Versions in this module Expand all Collapse all v1 v1.1.10 Oct 30, 2019 Changes in this version + const CurveType + const MasterKey + const QTUM_GET_TOKEN_BALANCE_METHOD + const QTUM_TRANSFER_EVENT_ID + const QTUM_TRANSFER_TOKEN_BALANCE_METHOD + const RPCServerCore + const RPCServerExplorer + const StakeConfirmations + const Symbol + var DEFAULT_GAS_LIMIT = "250000" + var DEFAULT_GAS_PRICE = decimal.New(4, -7) + func AddressTo32bytesArg(address string, isTestNet bool) ([]byte, error) + func AmountTo32bytesArg(amount int64) (string, error) + func HashAddressToBaseAddress(token string, isTestnet bool) string + func NewAddressDecoder(wm *WalletManager) *addressDecoder + type AccountBalance struct + AccountID string + Alias string + Amount uint64 + AssetAlias string + AssetID string + Password string + type BTCBlockScanner struct + CurrentBlockHeight uint64 + IsScanMemPool bool + RescanLastBlockCount uint64 + func NewBTCBlockScanner(wm *WalletManager) *BTCBlockScanner + func (bs *BTCBlockScanner) BatchExtractTransaction(blockHeight uint64, blockHash string, txs []string) error + func (bs *BTCBlockScanner) ExtractTransaction(blockHeight uint64, blockHash string, txid string, isCoinstake bool, ...) 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) GetScannedBlockHeader() (*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) 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) ScanTxMemPool() + func (bs *BTCBlockScanner) SetRescanBlockHeight(height uint64) error + 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 NewBlock(json *gjson.Result) *Block + func (b *Block) BlockHeader() *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 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 + Success bool + TxID string + type QRC20Unspent struct + Address string + GasUsed string + Key string + Output string + func NewQRC20Unspent(json *gjson.Result) *QRC20Unspent + type Response struct + Code int + Error interface{} + Id string + Message string + Result interface{} + type SaveResult struct + BlockHeight uint64 + Success bool + TxID string + type TokenReceipt struct + Amount string + BlockHash string + BlockHeight uint64 + ContractAddress string + Excepted string + From string + GasUsed uint64 + Sender string + To string + TxHash string + type Transaction struct + BlockHash string + BlockHeight uint64 + Blocktime int64 + Confirmations uint64 + Fees string + Hex string + IsCoinBase bool + Isqrc20Transfer bool + LockTime int64 + Size uint64 + TokenReceipts []*TokenReceipt + TxID string + Version uint64 + Vins []*Vin + Vouts []*Vout + type TransactionDecoder struct + func NewTransactionDecoder(wm *WalletManager) *TransactionDecoder + func (decoder *TransactionDecoder) CreateQRC20RawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) CreateQRC20SummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error) + func (decoder *TransactionDecoder) CreateRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) CreateSimpleRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) CreateSimpleSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, 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) SignRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *TransactionDecoder) SubmitRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) (*openwallet.Transaction, 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 + 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 + CoinDecimal decimal.Decimal + CoreWalletWatchOnly bool + CurveType uint32 + DataDir string + RPCServerType int + TokenTransferCost string + func NewConfig() *WalletConfig + type WalletManager struct + ContractDecoder openwallet.SmartContractDecoder + Decoder openwallet.AddressDecoder + ExplorerClient *Explorer + Log *log.OWLogger + TxDecoder openwallet.TransactionDecoder + func NewWalletManager() *WalletManager + func (this *WalletManager) GetSmartContractDecoder() openwallet.SmartContractDecoder + 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) GenQtumAddress() (string, error) + 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) GetAddressesFromLocalDB(walletID string, offset, limit int) ([]*openwallet.Address, error) + func (wm *WalletManager) GetAssetsLogger() *log.OWLogger + func (wm *WalletManager) GetBalance() string + 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) GetQRC20Balance(token openwallet.SmartContract, address string, isTestNet bool) (decimal.Decimal, error) + func (wm *WalletManager) GetQRC20UnspentByAddress(contractAddress, address string, tokenDecimal uint64, isTestNet bool) (decimal.Decimal, error) + 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, walletID string, ...) ([]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) 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) LockWallet() error + func (wm *WalletManager) QRC20Transfer(contractAddress string, from string, to string, gasPrice string, ...) (string, error) + 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) SendFrom(fromaccount, toaddress, amount string, password string) (string, error) + func (wm *WalletManager) SendRawTransaction(txHex string) (string, error) + func (wm *WalletManager) SendToAddress(address, amount, comment string, subtractfeefromamount bool, password string) (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) SignRawTransaction(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