Versions in this module Expand all Collapse all v1 v1.7.2 Jan 14, 2023 v1.7.0 Jan 12, 2023 Changes in this version + const CurveType + const ERC1155_ABI_JSON + const ERC20_ABI_JSON + const ERC721_ABI_JSON + const MAX_EXTRACTING_SIZE + const Symbol + var ERC1155_ABI = abi.JSON(strings.NewReader(ERC1155_ABI_JSON)) + var ERC20_ABI = abi.JSON(strings.NewReader(ERC20_ABI_JSON)) + var ERC721_ABI = abi.JSON(strings.NewReader(ERC721_ABI_JSON)) + func AppendOxToAddress(addr string) string + func CustomAddressDecode(address string) string + func CustomAddressEncode(address string) string + type AddrBalance struct + Address string + Balance *big.Int + Index int + TokenBalance *big.Int + func (this *AddrBalance) GetAddress() string + func (this *AddrBalance) SetTokenBalance(b *big.Int) + func (this *AddrBalance) ValidTokenBalance() bool + type AddrBalanceInf interface + GetAddress func() string + SetTokenBalance func(b *big.Int) + ValidTokenBalance func() bool + type Address struct + Account string + Address string + CreatedAt time.Time + HDPath string + Index int + PublicKey string + TxCount uint64 + func (this *Address) CalcHexPrivKey(masterKey *hdkeystore.HDKey) (string, error) + func (this *Address) CalcPrivKey(masterKey *hdkeystore.HDKey) ([]byte, error) + type AddressDecoder struct + func (decoder *AddressDecoder) PrivateKeyToWIF(priv []byte, isTestnet bool) (string, error) + func (decoder *AddressDecoder) PublicKeyToAddress(pub []byte, isTestnet bool) (string, error) + func (decoder *AddressDecoder) RedeemScriptToAddress(pubs [][]byte, required uint64, isTestnet bool) (string, error) + func (decoder *AddressDecoder) WIFToPrivateKey(wif string, isTestnet bool) ([]byte, error) + type BlockHeader struct + BlockHash string + BlockHeight uint64 + BlockNumber string + Difficulty string + GasLimit string + GasUsed string + Miner string + PreviousHash string + TotalDifficulty string + type BlockScanner struct + CurrentBlockHeight uint64 + IsScanMemPool bool + RescanLastBlockCount uint64 + func NewBlockScanner(wm *WalletManager) *BlockScanner + func (bs *BlockScanner) BatchExtractTransaction(height uint64, txs []*BlockTransaction) error + func (bs *BlockScanner) DeleteUnscanRecord(height uint64) error + func (bs *BlockScanner) DeleteUnscanRecordByID(id string) error + func (bs *BlockScanner) ExtractTransaction(tx *BlockTransaction) ExtractResult + func (bs *BlockScanner) ExtractTransactionAndReceiptData(txid string, scanTargetFunc openwallet.BlockScanTargetFuncV2) (map[string][]*openwallet.TxExtractData, ...) + func (bs *BlockScanner) ExtractTransactionData(txid string, scanTargetFunc openwallet.BlockScanTargetFunc) (map[string][]*openwallet.TxExtractData, error) + func (bs *BlockScanner) GetBalanceByAddress(address ...string) ([]*openwallet.Balance, error) + func (bs *BlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error) + func (bs *BlockScanner) GetGlobalMaxBlockHeight() uint64 + func (bs *BlockScanner) GetLocalBlock(height uint64) (*EthBlock, error) + func (bs *BlockScanner) GetLocalBlockHead() (uint64, string, error) + func (bs *BlockScanner) GetScannedBlockHeader() (*openwallet.BlockHeader, error) + func (bs *BlockScanner) GetUnscanRecords() ([]*openwallet.UnscanRecord, error) + func (bs *BlockScanner) RescanFailedRecord() + func (bs *BlockScanner) SaveLocalBlock(blockHeader *EthBlock) error + func (bs *BlockScanner) SaveLocalBlockHead(blockHeight uint64, blockHash string) error + func (bs *BlockScanner) SaveUnscanRecord(record *openwallet.UnscanRecord) error + func (bs *BlockScanner) SaveUnscannedTransaction(blockHeight uint64, reason string) error + func (bs *BlockScanner) ScanBlock(height uint64) error + func (bs *BlockScanner) ScanBlockTask() + func (bs *BlockScanner) SetRescanBlockHeight(height uint64) error + func (bs *BlockScanner) SupportBlockchainDAI() bool + func (bs *BlockScanner) UpdateTxByReceipt(tx *BlockTransaction) error + type BlockTransaction struct + BlockHash string + BlockHeight uint64 + BlockNumber string + Data string + Decimal int32 + FilterFunc openwallet.BlockScanTargetFuncV2 + From string + Gas string + GasPrice string + Hash string + Receipt *TransactionReceipt + Status uint64 + Timestamp string + To string + TransactionIndex string + Value string + func (this *BlockTransaction) GetAmountEthString() string + func (this *BlockTransaction) GetTxFeeEthString() string + type CallMsg struct + Data []byte + From ethcom.Address + Gas uint64 + GasLimit uint64 + GasPrice *big.Int + Nonce uint64 + To ethcom.Address + Value *big.Int + func (msg *CallMsg) MarshalJSON() ([]byte, error) + func (msg *CallMsg) UnmarshalJSON(data []byte) error + type CallResult map[string]interface + func (r CallResult) MarshalJSON() ([]byte, error) + type ERC20Token struct + Address string + Decimals int + Name string + Symbol string + type EthBlock struct + Transactions []*BlockTransaction + func (block *EthBlock) CreateOpenWalletBlockHeader() *openwallet.BlockHeader + type EthContractDecoder struct + func (decoder *EthContractDecoder) CallSmartContractABI(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) (*openwallet.SmartContractCallResult, *openwallet.Error) + func (decoder *EthContractDecoder) CreateSmartContractRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) *openwallet.Error + func (decoder *EthContractDecoder) EncodeRawTransactionCallMsg(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) (*CallMsg, *abi.ABI, *openwallet.Error) + func (decoder *EthContractDecoder) GetAssetsAccountDefAddress(wrapper openwallet.WalletDAI, accountID string) (*openwallet.Address, *openwallet.Error) + func (decoder *EthContractDecoder) GetTokenBalanceByAddress(contract openwallet.SmartContract, address ...string) ([]*openwallet.TokenBalance, error) + func (decoder *EthContractDecoder) SubmitSmartContractRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) (*openwallet.SmartContractReceipt, *openwallet.Error) + func (decoder *EthContractDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) error + type EthEvent struct + Address string + Data string + LogIndex string + Removed bool + Topics []string + type EthTransactionDecoder struct + func NewTransactionDecoder(wm *WalletManager) *EthTransactionDecoder + func (decoder *EthTransactionDecoder) CreateErc20TokenRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *EthTransactionDecoder) CreateErc20TokenSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error) + func (decoder *EthTransactionDecoder) CreateRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *EthTransactionDecoder) CreateSimpleRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction, ...) error + func (decoder *EthTransactionDecoder) CreateSimpleSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error) + func (decoder *EthTransactionDecoder) CreateSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransaction, error) + func (decoder *EthTransactionDecoder) CreateSummaryRawTransactionWithError(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error) + func (decoder *EthTransactionDecoder) GetRawTransactionFeeRate() (feeRate string, unit string, err error) + func (decoder *EthTransactionDecoder) SignRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + func (decoder *EthTransactionDecoder) SubmitRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) (*openwallet.Transaction, error) + func (decoder *EthTransactionDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error + type ExtractResult struct + BlockHeight uint64 + Success bool + TxID string + type NFTContractDecoder struct + func (decoder *NFTContractDecoder) GetMetaDataOfNFT(nft *openwallet.NFT) (*openwallet.NFTMetaData, *openwallet.Error) + func (decoder *NFTContractDecoder) GetNFTBalanceByAddress(nft *openwallet.NFT, owner string) (*openwallet.NFTBalance, *openwallet.Error) + func (decoder *NFTContractDecoder) GetNFTBalanceByAddressBatch(nft []*openwallet.NFT, owner []string) ([]*openwallet.NFTBalance, *openwallet.Error) + func (decoder *NFTContractDecoder) GetNFTOwnerByTokenID(nft *openwallet.NFT) (*openwallet.NFTOwner, *openwallet.Error) + func (decoder *NFTContractDecoder) GetNFTTransfer(event *openwallet.SmartContractEvent) (*openwallet.NFTTransfer, *openwallet.Error) + type SaveResult struct + BlockHeight uint64 + Success bool + TxID string + type TransactionReceipt struct + ETHReceipt *types.Receipt + Raw string + func (receipt *TransactionReceipt) ParseTransferEvent() map[string][]*TransferEvent + type TransferEvent struct + ContractAddress string + From ethcom.Address + To ethcom.Address + TokenDecimals uint8 + TokenFrom string + TokenName string + TokenSymbol string + TokenTo string + Value *big.Int + type WalletConfig struct + BroadcastAPI string + ChainID uint64 + CurveType uint32 + DBPath string + DataDir string + FixGasLimit *big.Int + FixGasPrice *big.Int + NonceComputeMode int64 + OffsetsGasPrice *big.Int + ScanContractList []string + ScanMainCoin bool + ServerAPI string + Symbol string + func NewConfig(symbol string) *WalletConfig + type WalletManager struct + Blockscanner openwallet.BlockScanner + BroadcastClient *quorum_rpc.Client + Config *WalletConfig + ContractDecoder openwallet.SmartContractDecoder + CustomAddressDecodeFunc func(address string) string + CustomAddressEncodeFunc func(address string) string + Decoder openwallet.AddressDecoderV2 + Log *log.OWLogger + NFTContractDecoder openwallet.NFTContractDecoder + RawClient *ethclient.Client + TxDecoder openwallet.TransactionDecoder + WalletClient *quorum_rpc.Client + func NewWalletManager() *WalletManager + func NewWalletManagerWithSymbol(symbol string) *WalletManager + func (wm *WalletManager) BalanceModelType() openwallet.BalanceModelType + func (wm *WalletManager) CallABI(contractAddr string, abiInstance abi.ABI, abiParam ...string) (map[string]interface{}, *openwallet.Error) + func (wm *WalletManager) CurveType() uint32 + func (wm *WalletManager) Decimal() int32 + func (wm *WalletManager) DecodeABIResult(abiInstance abi.ABI, method string, dataHex string) (map[string]interface{}, string, error) + func (wm *WalletManager) DecodeReceiptLogResult(abiInstance abi.ABI, log types.Log) (map[string]interface{}, string, string, error) + func (wm *WalletManager) ERC20GetAddressBalance(address string, contractAddr string) (*big.Int, error) + func (wm *WalletManager) EncodeABIParam(abiInstance abi.ABI, abiParam ...string) ([]byte, error) + func (wm *WalletManager) EthCall(callMsg CallMsg, sign string) (string, error) + func (wm *WalletManager) FullName() string + func (wm *WalletManager) GetAddrBalance(address string, sign string) (*big.Int, error) + func (wm *WalletManager) GetAddressDecoderV2() openwallet.AddressDecoderV2 + func (wm *WalletManager) GetAddressNonce(wrapper openwallet.WalletDAI, address string) uint64 + func (wm *WalletManager) GetAssetsLogger() *log.OWLogger + func (wm *WalletManager) GetBlockByNum(blockNum uint64, showTransactionSpec bool) (*EthBlock, error) + func (wm *WalletManager) GetBlockNumber() (uint64, error) + func (wm *WalletManager) GetBlockScanner() openwallet.BlockScanner + func (wm *WalletManager) GetGasEstimated(from string, to string, value *big.Int, data []byte) (*big.Int, error) + func (wm *WalletManager) GetGasPrice() (*big.Int, error) + func (wm *WalletManager) GetNFTContractDecoder() openwallet.NFTContractDecoder + func (wm *WalletManager) GetSmartContractDecoder() openwallet.SmartContractDecoder + func (wm *WalletManager) GetTransactionByHash(txid string) (*BlockTransaction, error) + func (wm *WalletManager) GetTransactionCount(addr string) (uint64, error) + func (wm *WalletManager) GetTransactionDecoder() openwallet.TransactionDecoder + func (wm *WalletManager) GetTransactionFeeEstimated(from string, to string, value *big.Int, data []byte) (*txFeeInfo, error) + func (wm *WalletManager) GetTransactionReceipt(transactionId string) (*TransactionReceipt, error) + func (wm *WalletManager) InitAssetsConfig() (config.Configer, error) + func (wm *WalletManager) IsContract(address string) (bool, error) + func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error + func (wm *WalletManager) LoadContractInfo(addr string) *openwallet.SmartContract + func (wm *WalletManager) RecoverUnscannedTransactions(unscannedTxs []*openwallet.UnscanRecord) ([]*BlockTransaction, error) + func (wm *WalletManager) SendRawTransaction(signedTx string) (string, error) + func (wm *WalletManager) SetNetworkChainID() (uint64, error) + func (wm *WalletManager) SupportsInterface(contractAddr string) string + func (wm *WalletManager) Symbol() string + func (wm *WalletManager) UpdateAddressNonce(wrapper openwallet.WalletDAI, address string, nonce uint64)