Versions in this module Expand all Collapse all v1 v1.0.2 Oct 19, 2019 v1.0.1 Sep 21, 2019 Changes in this version + const TransferType + type Asset struct + Assetref string + Name string + Qty string + Rawqty string + Type string type TransactionDecoder + func (decoder *TransactionDecoder) CreateAssetRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) CreateAssetRawTransaction2(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) CreateAssetSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error) + func (decoder *TransactionDecoder) FilterUnspent(unSpents []*Unspent, isAsset bool, assetId string) []*Unspent + func (decoder *TransactionDecoder) VerifyAssetRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error type Unspent + Assets []*Asset + IsAsset bool type Vout + Asset *Asset + IsAsset bool type WalletManager + func (wm *WalletManager) GetAssetBalance(assetId string, address string) (decimal.Decimal, error) + func (wm *WalletManager) GetAssetIssuetxid(assetId string) (string, error) v1.0.0 Sep 16, 2019 Changes in this version + const CurveType + const Decimals + const MasterKey + const RPCServerCore + const RPCServerExplorer + const Symbol + var MainNetAddressPrefix = btcTransaction.BTCMainnetAddressPrefix + var TestNetAddressPrefix = btcTransaction.BTCTestnetAddressPrefix + func BasicAuth(username, password string) string + func DecodeScript(script string) ([]byte, error) + func NewAddressDecoder(wm *WalletManager) *addressDecoder + type AddressDecoder interface + ScriptPubKeyToBech32Address func(scriptPubKey []byte) (string, error) + type BTCBlockScanNotificationObject interface + BTCBlockScanNotify func(block *Block, txs []*Transaction) error + type BTCBlockScanner struct + BTCBlockObservers map[BTCBlockScanNotificationObject]bool + CurrentBlockHeight uint64 + IsScanMemPool bool + IsSkipFailedBlock bool + RescanLastBlockCount uint64 + func NewBTCBlockScanner(wm *WalletManager) *BTCBlockScanner + func (bs *BTCBlockScanner) AddBTCBlockObserver(obj BTCBlockScanNotificationObject) error + func (bs *BTCBlockScanner) BatchExtractTransaction(blockHeight uint64, blockHash string, txs []string) error + func (bs *BTCBlockScanner) BatchExtractTransactionOrigin(block *Block) error + func (bs *BTCBlockScanner) ExtractTransaction(blockHeight uint64, blockHash string, txid string, ...) ExtractResult + func (bs *BTCBlockScanner) ExtractTransactionData(txid string, scanTargetFunc openwallet.BlockScanTargetFunc) (map[string][]*openwallet.TxExtractData, error) + func (bs *BTCBlockScanner) GetBalanceByAddress(address ...string) ([]*openwallet.Balance, error) + func (bs *BTCBlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error) + func (bs *BTCBlockScanner) GetGlobalMaxBlockHeight() uint64 + func (bs *BTCBlockScanner) GetScannedBlockHeader() (*openwallet.BlockHeader, error) + func (bs *BTCBlockScanner) GetScannedBlockHeaderOrigin() (*openwallet.BlockHeader, error) + func (bs *BTCBlockScanner) GetScannedBlockHeight() uint64 + func (bs *BTCBlockScanner) GetTransactionsByAddress(offset, limit int, coin openwallet.Coin, address ...string) ([]*openwallet.TxExtractData, error) + func (bs *BTCBlockScanner) NewBTCBlockNotify(block *Block, isFork bool) + func (bs *BTCBlockScanner) RemoveBTCBlockObserver(obj BTCBlockScanNotificationObject) error + func (bs *BTCBlockScanner) RescanFailedRecord() + func (bs *BTCBlockScanner) Run() error + func (bs *BTCBlockScanner) SaveUnscanRecord(record *UnscanRecord) error + func (bs *BTCBlockScanner) ScanBlock(height uint64) error + func (bs *BTCBlockScanner) ScanBlockTask() + func (bs *BTCBlockScanner) ScanBlockTaskOrigin() + func (bs *BTCBlockScanner) ScanTxMemPool() + func (bs *BTCBlockScanner) ScanTxMemPoolOrigin() + func (bs *BTCBlockScanner) SetRescanBlockHeight(height uint64) error + func (bs *BTCBlockScanner) SetScanBlockTaskOrigin() + func (bs *BTCBlockScanner) Stop() error + type Block struct + Confirmations uint64 + Fork bool + Hash string + Height uint64 + Merkleroot string + Previousblockhash string + Time uint64 + Version uint64 + func (b *Block) BlockHeader(symbol string) *openwallet.BlockHeader + type BlockchainInfo struct + Bestblockhash string + Blocks uint64 + Chain string + Chainwork string + Difficulty string + Headers uint64 + Mediantime uint64 + Pruned bool + Verificationprogress string + func NewBlockchainInfo(json *gjson.Result) *BlockchainInfo + type Client struct + AccessToken string + BaseURL string + Debug bool + func NewClient(url, token string, debug bool) *Client + func (c *Client) Call(path string, request []interface{}) (*gjson.Result, error) + type ClientInterface interface + Call func(path string, request []interface{}) (*gjson.Result, error) + type ContractDecoder struct + func NewContractDecoder(wm *WalletManager) *ContractDecoder + func (decoder *ContractDecoder) GetTokenBalanceByAddress(contract openwallet.SmartContract, address ...string) ([]*openwallet.TokenBalance, error) + type Explorer struct + AccessToken string + BaseURL string + Debug bool + func NewExplorer(url string, debug bool) *Explorer + func (b *Explorer) Call(path string, request interface{}, method string) (*gjson.Result, error) + type ExtractResult struct + BlockHeight uint64 + IsOmniTransfer bool + Success bool + TxID string + type ExtractTxOriginResult struct + Success bool + Tx *Transaction + type OmniTransaction struct + Amount string + Block uint64 + BlockHash string + BlockTime int64 + Confirmations uint64 + Divisible bool + Fees string + IsMine string + PositionInBlock uint64 + PropertyId uint64 + ReferenceAddress string + SendingAddress string + TxID string + TypeInt uint64 + TypeStr string + Valid bool + Version uint64 + func NewOmniTx(json *gjson.Result) *OmniTransaction + type Response struct + Code int + Error interface{} + Id string + Message string + Result interface{} + type SaveResult struct + BlockHeight uint64 + Success bool + TxID string + type Transaction struct + BlockHash string + BlockHeight uint64 + Blocktime int64 + Confirmations uint64 + Decimals int32 + Fees string + Hex string + IsCoinBase bool + LockTime int64 + Size uint64 + TxID string + Version uint64 + Vins []*Vin + Vouts []*Vout + type TransactionDecoder struct + func NewTransactionDecoder(wm *WalletManager) *TransactionDecoder + func (decoder *TransactionDecoder) CreateBTCRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) CreateBTCSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error) + func (decoder *TransactionDecoder) CreateOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) CreateOmniSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error) + func (decoder *TransactionDecoder) CreateRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) CreateSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransaction, error) + func (decoder *TransactionDecoder) CreateSummaryRawTransactionWithError(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error) + func (decoder *TransactionDecoder) GetRawTransactionFeeRate() (feeRate string, unit string, err error) + func (decoder *TransactionDecoder) SignBTCRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) SignOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) SignRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) SubmitRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) (*openwallet.Transaction, error) + func (decoder *TransactionDecoder) VerifyBTCRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) VerifyOmniRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + type UnscanRecord struct + BlockHeight uint64 + ID string + Reason string + TxID string + func NewUnscanRecord(height uint64, txID, reason string) *UnscanRecord + type Unspent struct + AccountID string + Address string + Amount string + Confirmations uint64 + HDAddress openwallet.Address + Key string + ScriptPubKey string + Solvable bool + Spendable bool + TxID string + Vout uint64 + func NewUnspent(json *gjson.Result) *Unspent + type UnspentSort struct + Comparator func(a, b *Unspent) int + Values []*Unspent + func (s UnspentSort) Len() int + func (s UnspentSort) Less(i, j int) bool + func (s UnspentSort) Swap(i, j int) + type User struct + Age int + Email string + Group string + Name string + UserKey string + type Vin struct + Addr string + Coinbase string + N uint64 + TxID string + Value string + Vout uint64 + type Vout struct + Addr string + N uint64 + ScriptPubKey string + Type string + Value string + type WalletConfig struct + BlockchainFile string + CertFileName string + CertsDir string + CoreWalletWatchOnly bool + CurveType uint32 + CycleSeconds time.Duration + DBPath string + DataDir string + Decimals int32 + DefaultConfig string + IsTestNet bool + MainNetAddressPrefix btcTransaction.AddressPrefix + MasterKey string + MaxTxInputs int + MinFees decimal.Decimal + NodeInstallPath string + OmniCoreAPI string + OmniRPCPassword string + OmniRPCUser string + OmniSupport bool + OmniTransferCost string + RPCServerType int + RpcPassword string + RpcUser string + ServerAPI string + SumAddress string + SupportSegWit bool + Symbol string + TestNetAddressPrefix btcTransaction.AddressPrefix + Threshold decimal.Decimal + WalletDataPath string + WalletPassword string + func NewConfig(symbol string, curveType uint32, decimals int32) *WalletConfig + func (wc *WalletConfig) InitConfig() + func (wc *WalletConfig) PrintConfig() error + type WalletManager struct + Blockscanner *BTCBlockScanner + Config *WalletConfig + ContractDecoder *ContractDecoder + Decoder AddressDecoder + ExplorerClient *Explorer + Log *log.OWLogger + OnmiClient *Client + Storage *hdkeystore.HDKeystore + TxDecoder openwallet.TransactionDecoder + WalletClient *Client + WalletsInSum map[string]*openwallet.Wallet + func NewWalletManager() *WalletManager + func (wm *WalletManager) AddMultiSigAddress(required uint64, addresses []string) (string, string, error) + func (wm *WalletManager) AddWalletInSummary(wid string, wallet *openwallet.Wallet) + func (wm *WalletManager) BackupWallet(walletID string) (string, error) + func (wm *WalletManager) BackupWalletData(dest string) error + func (wm *WalletManager) BackupWalletFlow() error + func (wm *WalletManager) BuildTransaction(utxos []*Unspent, to []string, change string, amount []decimal.Decimal, ...) (string, decimal.Decimal, error) + func (wm *WalletManager) CreateAddressFlow() error + func (wm *WalletManager) CreateBatchAddress(name, password string, count uint64) (string, []*openwallet.Address, error) + func (wm *WalletManager) CreateChangeAddress(walletID string, key *hdkeystore.HDKey) (*openwallet.Address, error) + func (wm *WalletManager) CreateNewPrivateKey(accountID string, key *owkeychain.ExtendedKey, derivedPath string, ...) (string, *openwallet.Address, error) + func (wm *WalletManager) CreateNewWallet(name, password string) (*openwallet.Wallet, string, error) + func (wm *WalletManager) CreateReceiverAddress(account string) (string, error) + func (wm *WalletManager) CreateWalletFlow() error + func (wm *WalletManager) CurveType() uint32 + func (wm *WalletManager) Decimal() int32 + func (wm *WalletManager) DeleteUnscanRecord(height uint64) error + func (wm *WalletManager) DeleteUnscanRecordNotFindTX() error + func (wm *WalletManager) DumpWallet(filename string) error + func (wm *WalletManager) EncryptWallet(password string) error + func (wm *WalletManager) EstimateFee(inputs, outputs int64, feeRate decimal.Decimal) (decimal.Decimal, error) + func (wm *WalletManager) EstimateFeeRate() (decimal.Decimal, error) + func (wm *WalletManager) FullName() string + func (wm *WalletManager) GenerateSeed() []byte + func (wm *WalletManager) GetAddressBalance(walletID, address string) string + func (wm *WalletManager) GetAddressDecode() openwallet.AddressDecoder + func (wm *WalletManager) GetAddressWithBalance(address ...*openwallet.Address) error + func (wm *WalletManager) GetAddressesByAccount(walletID string) ([]string, error) + func (wm *WalletManager) GetAssetsLogger() *log.OWLogger + func (wm *WalletManager) GetBlock(hash string) (*Block, error) + func (wm *WalletManager) GetBlockChainInfo() (*BlockchainInfo, error) + func (wm *WalletManager) GetBlockHash(height uint64) (string, error) + func (wm *WalletManager) GetBlockHeight() (uint64, error) + func (wm *WalletManager) GetBlockScanner() openwallet.BlockScanner + func (wm *WalletManager) GetCoreWalletinfo() error + func (wm *WalletManager) GetLocalBlock(height uint64) (*Block, error) + func (wm *WalletManager) GetLocalNewBlock() (uint64, string) + func (wm *WalletManager) GetNetworkInfo() error + func (wm *WalletManager) GetOmniBalance(propertyId uint64, address string) (decimal.Decimal, error) + func (wm *WalletManager) GetOmniBestBlockHash() (string, error) + func (wm *WalletManager) GetOmniBlockHash(height uint64) (string, error) + func (wm *WalletManager) GetOmniBlockHeight() (uint64, error) + func (wm *WalletManager) GetOmniInfo() (*gjson.Result, error) + func (wm *WalletManager) GetOmniProperty(propertyId uint64) (*gjson.Result, error) + func (wm *WalletManager) GetOmniTransaction(txid string) (*OmniTransaction, error) + func (wm *WalletManager) GetSmartContractDecoder() openwallet.SmartContractDecoder + func (wm *WalletManager) GetTransaction(txid string) (*Transaction, error) + func (wm *WalletManager) GetTransactionDecoder() openwallet.TransactionDecoder + func (wm *WalletManager) GetTxIDsInMemPool() ([]string, error) + func (wm *WalletManager) GetTxOut(txid string, vout uint64) (*Vout, error) + func (wm *WalletManager) GetUnscanRecords() ([]*UnscanRecord, error) + func (wm *WalletManager) GetWalletBalance(accountID string) string + func (wm *WalletManager) GetWalletInfo(walletID string) (*openwallet.Wallet, error) + func (wm *WalletManager) GetWalletList() error + func (wm *WalletManager) GetWallets() ([]*openwallet.Wallet, error) + func (wm *WalletManager) ImportAddress(address, account string) error + func (wm *WalletManager) ImportMulti(addresses []*openwallet.Address, keys []string, watchOnly bool) ([]int, error) + func (wm *WalletManager) ImportPrivKey(wif, walletID string) error + func (wm *WalletManager) ImportWallet(filename string) error + func (wm *WalletManager) ImportWatchOnlyAddress(address ...*openwallet.Address) error + func (wm *WalletManager) InitAssetsConfig() (config.Configer, error) + func (wm *WalletManager) InitConfigFlow() error + func (wm *WalletManager) InitNodeConfigFlow() error + func (wm *WalletManager) InstallNodeFlow() error + func (wm *WalletManager) IsHaveOmniAssets(address string) bool + func (wm *WalletManager) KeyPoolRefill(keyPoolSize uint64) error + func (wm *WalletManager) ListUnspent(min uint64, addresses ...string) ([]*Unspent, error) + func (wm *WalletManager) ListUnspentFromLocalDB(walletID string) ([]*Unspent, error) + func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error + func (wm *WalletManager) LoadConfig() error + func (wm *WalletManager) LockWallet() error + func (wm *WalletManager) NewBlock(json *gjson.Result) *Block + func (wm *WalletManager) RebuildWalletUnspent(walletID string) error + func (wm *WalletManager) RestartNodeFlow() error + func (wm *WalletManager) RestoreWallet(keyFile, dbFile, datFile, password string) error + func (wm *WalletManager) RestoreWalletFlow() error + func (wm *WalletManager) SaveLocalBlock(block *Block) + func (wm *WalletManager) SaveLocalNewBlock(blockHeight uint64, blockHash string) + func (wm *WalletManager) SendBatchTransaction(walletID string, to []string, amounts []decimal.Decimal, password string) (string, error) + func (wm *WalletManager) SendRawTransaction(txHex string) (string, error) + func (wm *WalletManager) SendToAddress(address string, amount uint64) (string, error) + func (wm *WalletManager) SendTransaction(walletID, to string, amount decimal.Decimal, password string, ...) ([]string, error) + func (wm *WalletManager) SetConfigFlow(subCmd string) error + func (wm *WalletManager) ShowConfig() error + func (wm *WalletManager) ShowConfigInfo(subCmd string) error + func (wm *WalletManager) ShowNodeInfo() error + func (wm *WalletManager) SignRawTransactionInCoreWallet(txHex, walletID string, key *hdkeystore.HDKey, utxos []*Unspent) (string, error) + func (wm *WalletManager) StartNodeFlow() error + func (wm *WalletManager) StopNodeFlow() error + func (wm *WalletManager) SummaryFollow() error + func (wm *WalletManager) SummaryWallets() + func (wm *WalletManager) Symbol() string + func (wm *WalletManager) TransferFlow() error + func (wm *WalletManager) UnlockWallet(passphrase string, seconds int) error