quorum

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2023 License: GPL-3.0 Imports: 32 Imported by: 1

Documentation

Overview

  • Copyright 2018 The openwallet Authors

  • This file is part of the openwallet library. *

  • The openwallet library is free software: you can redistribute it and/or modify

  • it under the terms of the GNU Lesser General Public License as published by

  • the Free Software Foundation, either version 3 of the License, or

  • (at your option) any later version. *

  • The openwallet library is distributed in the hope that it will be useful,

  • but WITHOUT ANY WARRANTY; without even the implied warranty of

  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

  • GNU Lesser General Public License for more details.

  • Copyright 2018 The openwallet Authors

  • This file is part of the openwallet library. *

  • The openwallet library is free software: you can redistribute it and/or modify

  • it under the terms of the GNU Lesser General Public License as published by

  • the Free Software Foundation, either version 3 of the License, or

  • (at your option) any later version. *

  • The openwallet library is distributed in the hope that it will be useful,

  • but WITHOUT ANY WARRANTY; without even the implied warranty of

  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

  • GNU Lesser General Public License for more details.

  • Copyright 2018 The openwallet Authors

  • This file is part of the openwallet library. *

  • The openwallet library is free software: you can redistribute it and/or modify

  • it under the terms of the GNU Lesser General Public License as published by

  • the Free Software Foundation, either version 3 of the License, or

  • (at your option) any later version. *

  • The openwallet library is distributed in the hope that it will be useful,

  • but WITHOUT ANY WARRANTY; without even the implied warranty of

  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

  • GNU Lesser General Public License for more details.

* Copyright 2018 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.

Index

Constants

View Source
const (
	Symbol    = "QUORUM"
	CurveType = owcrypt.ECC_CURVE_SECP256K1
)
View Source
const (
	ERC20_ABI_JSON   = `` /* 3885-byte string literal not displayed */
	ERC721_ABI_JSON  = `` /* 4364-byte string literal not displayed */
	ERC1155_ABI_JSON = `` /* 3856-byte string literal not displayed */
)
View Source
const (
	//BLOCK_CHAIN_BUCKET = "blockchain" //区块链数据集合
	//periodOfTask      = 5 * time.Second //定时任务执行隔间
	MAX_EXTRACTING_SIZE = 15 //并发的扫描线程数

)

Variables

Functions

func AppendOxToAddress

func AppendOxToAddress(addr string) string

func CustomAddressDecode

func CustomAddressDecode(address string) string

func CustomAddressEncode

func CustomAddressEncode(address string) string

Types

type AddrBalance

type AddrBalance struct {
	Address      string
	Balance      *big.Int
	TokenBalance *big.Int
	Index        int
}

func (*AddrBalance) GetAddress

func (this *AddrBalance) GetAddress() string

func (*AddrBalance) SetTokenBalance

func (this *AddrBalance) SetTokenBalance(b *big.Int)

func (*AddrBalance) ValidTokenBalance

func (this *AddrBalance) ValidTokenBalance() bool

type AddrBalanceInf

type AddrBalanceInf interface {
	SetTokenBalance(b *big.Int)
	GetAddress() string
	ValidTokenBalance() bool
}

type Address

type Address struct {
	Address   string `json:"address" storm:"id"`
	Account   string `json:"account" storm:"index"`
	HDPath    string `json:"hdpath"`
	Index     int
	PublicKey string

	TxCount   uint64
	CreatedAt time.Time
	// contains filtered or unexported fields
}

func (*Address) CalcHexPrivKey

func (this *Address) CalcHexPrivKey(masterKey *hdkeystore.HDKey) (string, error)

func (*Address) CalcPrivKey

func (this *Address) CalcPrivKey(masterKey *hdkeystore.HDKey) ([]byte, error)

type AddressDecoder

type AddressDecoder struct{}

AddressDecoder 地址解析器

func (*AddressDecoder) PrivateKeyToWIF

func (decoder *AddressDecoder) PrivateKeyToWIF(priv []byte, isTestnet bool) (string, error)

PrivateKeyToWIF 私钥转WIF

func (*AddressDecoder) PublicKeyToAddress

func (decoder *AddressDecoder) PublicKeyToAddress(pub []byte, isTestnet bool) (string, error)

PublicKeyToAddress 公钥转地址

func (*AddressDecoder) RedeemScriptToAddress

func (decoder *AddressDecoder) RedeemScriptToAddress(pubs [][]byte, required uint64, isTestnet bool) (string, error)

RedeemScriptToAddress 多重签名赎回脚本转地址

func (*AddressDecoder) WIFToPrivateKey

func (decoder *AddressDecoder) WIFToPrivateKey(wif string, isTestnet bool) ([]byte, error)

WIFToPrivateKey WIF转私钥

type BlockHeader

type BlockHeader struct {
	BlockNumber     string `json:"number" storm:"id"`
	BlockHash       string `json:"hash"`
	GasLimit        string `json:"gasLimit"`
	GasUsed         string `json:"gasUsed"`
	Miner           string `json:"miner"`
	Difficulty      string `json:"difficulty"`
	TotalDifficulty string `json:"totalDifficulty"`
	PreviousHash    string `json:"parentHash"`
	BlockHeight     uint64 //RecoverBlockHeader的时候进行初始化
}

type BlockScanner

type BlockScanner struct {
	*openwallet.BlockScannerBase
	CurrentBlockHeight uint64 //当前区块高度

	IsScanMemPool        bool   //是否扫描交易池
	RescanLastBlockCount uint64 //重扫上N个区块数量
	// contains filtered or unexported fields
}

func NewBlockScanner

func NewBlockScanner(wm *WalletManager) *BlockScanner

NewBTCBlockScanner 创建区块链扫描器

func (*BlockScanner) BatchExtractTransaction

func (bs *BlockScanner) BatchExtractTransaction(height uint64, txs []*BlockTransaction) error

BatchExtractTransaction 批量提取交易单

func (*BlockScanner) DeleteUnscanRecord

func (bs *BlockScanner) DeleteUnscanRecord(height uint64) error

DeleteUnscanRecord 删除指定高度的未扫记录

func (*BlockScanner) DeleteUnscanRecordByID

func (bs *BlockScanner) DeleteUnscanRecordByID(id string) error

DeleteUnscanRecordByID 删除指定的未扫记录

func (*BlockScanner) ExtractTransaction

func (bs *BlockScanner) ExtractTransaction(tx *BlockTransaction) ExtractResult

ExtractTransaction 提取交易单

func (*BlockScanner) ExtractTransactionAndReceiptData

func (bs *BlockScanner) ExtractTransactionAndReceiptData(txid string, scanTargetFunc openwallet.BlockScanTargetFuncV2) (map[string][]*openwallet.TxExtractData, map[string]*openwallet.SmartContractReceipt, error)

ExtractTransactionAndReceiptData 提取交易单及交易回执数据 @required

func (*BlockScanner) ExtractTransactionData

func (bs *BlockScanner) ExtractTransactionData(txid string, scanTargetFunc openwallet.BlockScanTargetFunc) (map[string][]*openwallet.TxExtractData, error)

ExtractTransactionData 扫描一笔交易

func (*BlockScanner) GetBalanceByAddress

func (bs *BlockScanner) GetBalanceByAddress(address ...string) ([]*openwallet.Balance, error)

GetBalanceByAddress 获取地址余额

func (*BlockScanner) GetCurrentBlockHeader

func (bs *BlockScanner) GetCurrentBlockHeader() (*openwallet.BlockHeader, error)

GetCurrentBlockHeader 获取当前区块高度

func (*BlockScanner) GetGlobalMaxBlockHeight

func (bs *BlockScanner) GetGlobalMaxBlockHeight() uint64

func (*BlockScanner) GetLocalBlock

func (bs *BlockScanner) GetLocalBlock(height uint64) (*EthBlock, error)

GetLocalBlock 获取本地区块数据

func (*BlockScanner) GetLocalBlockHead

func (bs *BlockScanner) GetLocalBlockHead() (uint64, string, error)

GetLocalBlockHead 获取本地记录的区块高度和hash

func (*BlockScanner) GetScannedBlockHeader

func (bs *BlockScanner) GetScannedBlockHeader() (*openwallet.BlockHeader, error)

GetScannedBlockHeader 获取当前已扫区块高度

func (*BlockScanner) GetUnscanRecords

func (bs *BlockScanner) GetUnscanRecords() ([]*openwallet.UnscanRecord, error)

func (*BlockScanner) RescanFailedRecord

func (bs *BlockScanner) RescanFailedRecord()

rescanFailedRecord 重扫失败记录

func (*BlockScanner) SaveLocalBlock

func (bs *BlockScanner) SaveLocalBlock(blockHeader *EthBlock) error

SaveLocalBlock 记录本地新区块

func (*BlockScanner) SaveLocalBlockHead

func (bs *BlockScanner) SaveLocalBlockHead(blockHeight uint64, blockHash string) error

SaveLocalBlockHead 记录区块高度和hash到本地

func (*BlockScanner) SaveUnscanRecord

func (bs *BlockScanner) SaveUnscanRecord(record *openwallet.UnscanRecord) error

SaveUnscanRecord 保存交易记录到钱包数据库

func (*BlockScanner) SaveUnscannedTransaction

func (bs *BlockScanner) SaveUnscannedTransaction(blockHeight uint64, reason string) error

func (*BlockScanner) ScanBlock

func (bs *BlockScanner) ScanBlock(height uint64) error

func (*BlockScanner) ScanBlockTask

func (bs *BlockScanner) ScanBlockTask()

func (*BlockScanner) SetRescanBlockHeight

func (bs *BlockScanner) SetRescanBlockHeight(height uint64) error

SetRescanBlockHeight 重置区块链扫描高度

func (*BlockScanner) SupportBlockchainDAI

func (bs *BlockScanner) SupportBlockchainDAI() bool

SupportBlockchainDAI 支持外部设置区块链数据访问接口 @optional

func (*BlockScanner) UpdateTxByReceipt

func (bs *BlockScanner) UpdateTxByReceipt(tx *BlockTransaction) error

UpdateTxByReceipt

type BlockTransaction

type BlockTransaction struct {
	Hash             string `json:"hash" storm:"id"`
	BlockNumber      string `json:"blockNumber" storm:"index"`
	BlockHash        string `json:"blockHash" storm:"index"`
	From             string `json:"from"`
	To               string `json:"to"`
	Gas              string `json:"gas"`
	GasPrice         string `json:"gasPrice"`
	Value            string `json:"value"`
	Data             string `json:"input"`
	TransactionIndex string `json:"transactionIndex"`
	Timestamp        string `json:"timestamp"`
	BlockHeight      uint64 //transaction scanning 的时候对其进行赋值
	FilterFunc       openwallet.BlockScanTargetFuncV2
	Status           uint64 `json:"-"`
	Receipt          *TransactionReceipt
	Decimal          int32
}

func (*BlockTransaction) GetAmountEthString

func (this *BlockTransaction) GetAmountEthString() string

func (*BlockTransaction) GetTxFeeEthString

func (this *BlockTransaction) GetTxFeeEthString() string

type CallMsg

type CallMsg struct {
	To       ethcom.Address `json:"to"`
	From     ethcom.Address `json:"from"`
	Nonce    uint64         `json:"nonce"`
	Value    *big.Int       `json:"value"`
	GasLimit uint64         `json:"gasLimit"`
	Gas      uint64         `json:"gas"`
	GasPrice *big.Int       `json:"gasPrice"`
	Data     []byte         `json:"data"`
}

func (*CallMsg) MarshalJSON

func (msg *CallMsg) MarshalJSON() ([]byte, error)

func (*CallMsg) UnmarshalJSON

func (msg *CallMsg) UnmarshalJSON(data []byte) error

type CallResult

type CallResult map[string]interface{}

func (CallResult) MarshalJSON

func (r CallResult) MarshalJSON() ([]byte, error)

type ERC20Token

type ERC20Token struct {
	Address  string `json:"address" storm:"id"`
	Symbol   string `json:"symbol" storm:"index"`
	Name     string `json:"name"`
	Decimals int    `json:"decimals"`
	// contains filtered or unexported fields
}

type EthBlock

type EthBlock struct {
	BlockHeader
	Transactions []*BlockTransaction `json:"transactions"`
}

func (*EthBlock) CreateOpenWalletBlockHeader

func (block *EthBlock) CreateOpenWalletBlockHeader() *openwallet.BlockHeader

type EthContractDecoder

type EthContractDecoder struct {
	*openwallet.SmartContractDecoderBase
	// contains filtered or unexported fields
}

func (*EthContractDecoder) CallSmartContractABI

调用合约ABI方法

func (*EthContractDecoder) CreateSmartContractRawTransaction

func (decoder *EthContractDecoder) CreateSmartContractRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) *openwallet.Error

创建原始交易单

func (*EthContractDecoder) EncodeRawTransactionCallMsg

func (decoder *EthContractDecoder) EncodeRawTransactionCallMsg(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) (*CallMsg, *abi.ABI, *openwallet.Error)

func (*EthContractDecoder) GetAssetsAccountDefAddress

func (decoder *EthContractDecoder) GetAssetsAccountDefAddress(wrapper openwallet.WalletDAI, accountID string) (*openwallet.Address, *openwallet.Error)

func (*EthContractDecoder) GetTokenBalanceByAddress

func (decoder *EthContractDecoder) GetTokenBalanceByAddress(contract openwallet.SmartContract, address ...string) ([]*openwallet.TokenBalance, error)

func (*EthContractDecoder) SubmitSmartContractRawTransaction

func (decoder *EthContractDecoder) SubmitSmartContractRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) (*openwallet.SmartContractReceipt, *openwallet.Error)

SubmitRawTransaction 广播交易单

func (*EthContractDecoder) VerifyRawTransaction

func (decoder *EthContractDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.SmartContractRawTransaction) error

VerifyRawTransaction 验证交易单,验证交易单并返回加入签名后的交易单

type EthEvent

type EthEvent struct {
	Address string   `json:"address"`
	Topics  []string `json:"topics"`
	Data    string   `josn:"data"`
	//BlockNumber string
	LogIndex string `json:"logIndex"`
	Removed  bool   `json:"removed"`
}

type EthTransactionDecoder

type EthTransactionDecoder struct {
	openwallet.TransactionDecoderBase
	// contains filtered or unexported fields
}

func NewTransactionDecoder

func NewTransactionDecoder(wm *WalletManager) *EthTransactionDecoder

NewTransactionDecoder 交易单解析器

func (*EthTransactionDecoder) CreateErc20TokenRawTransaction

func (decoder *EthTransactionDecoder) CreateErc20TokenRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error

func (*EthTransactionDecoder) CreateErc20TokenSummaryRawTransaction

func (decoder *EthTransactionDecoder) CreateErc20TokenSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)

CreateErc20TokenSummaryRawTransaction 创建ERC20Token汇总交易

func (*EthTransactionDecoder) CreateRawTransaction

func (decoder *EthTransactionDecoder) CreateRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error

CreateRawTransaction 创建交易单

func (*EthTransactionDecoder) CreateSimpleRawTransaction

func (decoder *EthTransactionDecoder) CreateSimpleRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction, tmpNonce *uint64) error

func (*EthTransactionDecoder) CreateSimpleSummaryRawTransaction

func (decoder *EthTransactionDecoder) CreateSimpleSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)

CreateSimpleSummaryRawTransaction 创建QUORUM汇总交易

func (*EthTransactionDecoder) CreateSummaryRawTransaction

func (decoder *EthTransactionDecoder) CreateSummaryRawTransaction(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransaction, error)

CreateSummaryRawTransaction 创建汇总交易,返回原始交易单数组

func (*EthTransactionDecoder) CreateSummaryRawTransactionWithError

func (decoder *EthTransactionDecoder) CreateSummaryRawTransactionWithError(wrapper openwallet.WalletDAI, sumRawTx *openwallet.SummaryRawTransaction) ([]*openwallet.RawTransactionWithError, error)

CreateSummaryRawTransactionWithError 创建汇总交易,返回能原始交易单数组(包含带错误的原始交易单)

func (*EthTransactionDecoder) GetRawTransactionFeeRate

func (decoder *EthTransactionDecoder) GetRawTransactionFeeRate() (feeRate string, unit string, err error)

func (*EthTransactionDecoder) SignRawTransaction

func (decoder *EthTransactionDecoder) SignRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error

SignRawTransaction 签名交易单

func (*EthTransactionDecoder) SubmitRawTransaction

func (decoder *EthTransactionDecoder) SubmitRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) (*openwallet.Transaction, error)

SubmitRawTransaction 广播交易单

func (*EthTransactionDecoder) VerifyRawTransaction

func (decoder *EthTransactionDecoder) VerifyRawTransaction(wrapper openwallet.WalletDAI, rawTx *openwallet.RawTransaction) error

VerifyRawTransaction 验证交易单,验证交易单并返回加入签名后的交易单

type ExtractResult

type ExtractResult struct {
	TxID        string
	BlockHeight uint64
	Success     bool
	// contains filtered or unexported fields
}

ExtractResult 扫描完成的提取结果

type NFTContractDecoder

type NFTContractDecoder struct {
	*openwallet.NFTContractDecoderBase
	// contains filtered or unexported fields
}

func (*NFTContractDecoder) GetMetaDataOfNFT

func (decoder *NFTContractDecoder) GetMetaDataOfNFT(nft *openwallet.NFT) (*openwallet.NFTMetaData, *openwallet.Error)

GetMetaDataOfNFT 查询NFT的MetaData

func (*NFTContractDecoder) GetNFTBalanceByAddress

func (decoder *NFTContractDecoder) GetNFTBalanceByAddress(nft *openwallet.NFT, owner string) (*openwallet.NFTBalance, *openwallet.Error)

GetNFTBalanceByAddress 查询地址NFT余额列表 NFT.TokenID为空则查询合约下拥有者所NFT数量。

func (*NFTContractDecoder) GetNFTBalanceByAddressBatch

func (decoder *NFTContractDecoder) GetNFTBalanceByAddressBatch(nft []*openwallet.NFT, owner []string) ([]*openwallet.NFTBalance, *openwallet.Error)

GetNFTBalanceByAddressBatch 查询地址NFT余额列表

func (*NFTContractDecoder) GetNFTOwnerByTokenID

func (decoder *NFTContractDecoder) GetNFTOwnerByTokenID(nft *openwallet.NFT) (*openwallet.NFTOwner, *openwallet.Error)

GetNFTOwnerByTokenID 查询地址token的拥有者

func (*NFTContractDecoder) GetNFTTransfer

GetNFTTransfer 从event解析NFT转账信息

type SaveResult

type SaveResult struct {
	TxID        string
	BlockHeight uint64
	Success     bool
}

SaveResult 保存结果

type TransactionReceipt

type TransactionReceipt struct {
	ETHReceipt *types.Receipt
	Raw        string
}

func (*TransactionReceipt) ParseTransferEvent

func (receipt *TransactionReceipt) ParseTransferEvent() map[string][]*TransferEvent

type TransferEvent

type TransferEvent struct {
	ContractAddress string
	TokenName       string
	TokenSymbol     string
	TokenDecimals   uint8
	TokenFrom       string
	TokenTo         string
	From            ethcom.Address
	To              ethcom.Address
	Value           *big.Int
}

type WalletConfig

type WalletConfig struct {

	//币种
	Symbol string
	//本地数据库文件路径
	DBPath string
	//钱包服务API
	ServerAPI string
	//曲线类型
	CurveType uint32
	//网络ID
	ChainID uint64
	//数据目录
	DataDir string
	//固定gasLimit值
	FixGasLimit *big.Int
	//固定gasPrice值
	FixGasPrice *big.Int
	//补偿gasPrice值
	OffsetsGasPrice *big.Int
	//nonce计算方式, 0: auto-increment nonce, 1: latest nonce
	NonceComputeMode int64
	//Broadcast node RPC API
	BroadcastAPI string

	//是否扫描主币
	ScanMainCoin bool

	//扫描合约列表
	ScanContractList []string
}

func NewConfig

func NewConfig(symbol string) *WalletConfig

type WalletManager

type WalletManager struct {
	openwallet.AssetsAdapterBase

	RawClient               *ethclient.Client               //原生ETH客户端
	WalletClient            *quorum_rpc.Client              // 节点客户端
	BroadcastClient         *quorum_rpc.Client              // 节点客户端
	Config                  *WalletConfig                   //钱包管理配置
	Blockscanner            openwallet.BlockScanner         //区块扫描器
	Decoder                 openwallet.AddressDecoderV2     //地址编码器
	TxDecoder               openwallet.TransactionDecoder   //交易单编码器
	ContractDecoder         openwallet.SmartContractDecoder //智能合约解释器
	NFTContractDecoder      openwallet.NFTContractDecoder   //NFT智能合约解释器
	Log                     *log.OWLogger                   //日志工具
	CustomAddressEncodeFunc func(address string) string     //自定义地址转换算法
	CustomAddressDecodeFunc func(address string) string     //自定义地址转换算法
}

func NewWalletManager

func NewWalletManager() *WalletManager

func NewWalletManagerWithSymbol

func NewWalletManagerWithSymbol(symbol string) *WalletManager

func (*WalletManager) BalanceModelType

func (wm *WalletManager) BalanceModelType() openwallet.BalanceModelType

func (*WalletManager) CallABI

func (wm *WalletManager) CallABI(contractAddr string, abiInstance abi.ABI, abiParam ...string) (map[string]interface{}, *openwallet.Error)

func (*WalletManager) CurveType

func (wm *WalletManager) CurveType() uint32

CurveType 曲线类型

func (*WalletManager) Decimal

func (wm *WalletManager) Decimal() int32

小数位精度

func (*WalletManager) DecodeABIResult

func (wm *WalletManager) DecodeABIResult(abiInstance abi.ABI, method string, dataHex string) (map[string]interface{}, string, error)

DecodeABIResult 解码ABI结果

func (*WalletManager) DecodeReceiptLogResult

func (wm *WalletManager) DecodeReceiptLogResult(abiInstance abi.ABI, log types.Log) (map[string]interface{}, string, string, error)

DecodeReceiptLogResult 解码回执日志结果

func (*WalletManager) ERC20GetAddressBalance

func (wm *WalletManager) ERC20GetAddressBalance(address string, contractAddr string) (*big.Int, error)

ERC20GetAddressBalance

func (*WalletManager) EncodeABIParam

func (wm *WalletManager) EncodeABIParam(abiInstance abi.ABI, abiParam ...string) ([]byte, error)

EncodeABIParam 编码API调用参数

func (*WalletManager) EthCall

func (wm *WalletManager) EthCall(callMsg CallMsg, sign string) (string, error)

func (*WalletManager) FullName

func (wm *WalletManager) FullName() string

FullName 币种全名

func (*WalletManager) GetAddrBalance

func (wm *WalletManager) GetAddrBalance(address string, sign string) (*big.Int, error)

GetAddrBalance

func (*WalletManager) GetAddressDecoderV2

func (wm *WalletManager) GetAddressDecoderV2() openwallet.AddressDecoderV2

AddressDecode 地址解析器

func (*WalletManager) GetAddressNonce

func (wm *WalletManager) GetAddressNonce(wrapper openwallet.WalletDAI, address string) uint64

GetAddressNonce

func (*WalletManager) GetAssetsLogger

func (wm *WalletManager) GetAssetsLogger() *log.OWLogger

GetAssetsLogger 获取资产账户日志工具

func (*WalletManager) GetBlockByNum

func (wm *WalletManager) GetBlockByNum(blockNum uint64, showTransactionSpec bool) (*EthBlock, error)

func (*WalletManager) GetBlockNumber

func (wm *WalletManager) GetBlockNumber() (uint64, error)

GetBlockNumber

func (*WalletManager) GetBlockScanner

func (wm *WalletManager) GetBlockScanner() openwallet.BlockScanner

GetBlockScanner 获取区块链

func (*WalletManager) GetGasEstimated

func (wm *WalletManager) GetGasEstimated(from string, to string, value *big.Int, data []byte) (*big.Int, error)

GetGasEstimated

func (*WalletManager) GetGasPrice

func (wm *WalletManager) GetGasPrice() (*big.Int, error)

func (*WalletManager) GetNFTContractDecoder

func (wm *WalletManager) GetNFTContractDecoder() openwallet.NFTContractDecoder

GetNFTContractDecoder 获取NFT智能合约解析器 @optional

func (*WalletManager) GetSmartContractDecoder

func (wm *WalletManager) GetSmartContractDecoder() openwallet.SmartContractDecoder

GetSmartContractDecoder 获取智能合约解析器

func (*WalletManager) GetTransactionByHash

func (wm *WalletManager) GetTransactionByHash(txid string) (*BlockTransaction, error)

func (*WalletManager) GetTransactionCount

func (wm *WalletManager) GetTransactionCount(addr string) (uint64, error)

func (*WalletManager) GetTransactionDecoder

func (wm *WalletManager) GetTransactionDecoder() openwallet.TransactionDecoder

TransactionDecoder 交易单解析器

func (*WalletManager) GetTransactionFeeEstimated

func (wm *WalletManager) GetTransactionFeeEstimated(from string, to string, value *big.Int, data []byte) (*txFeeInfo, error)

func (*WalletManager) GetTransactionReceipt

func (wm *WalletManager) GetTransactionReceipt(transactionId string) (*TransactionReceipt, error)

func (*WalletManager) InitAssetsConfig

func (wm *WalletManager) InitAssetsConfig() (config.Configer, error)

InitAssetsConfig 初始化默认配置

func (*WalletManager) IsContract

func (wm *WalletManager) IsContract(address string) (bool, error)

IsContract 是否合约

func (*WalletManager) LoadAssetsConfig

func (wm *WalletManager) LoadAssetsConfig(c config.Configer) error

LoadAssetsConfig 加载外部配置

func (*WalletManager) LoadContractInfo

func (wm *WalletManager) LoadContractInfo(addr string) *openwallet.SmartContract

LoadContractInfo 通过地址加载合约信息

func (*WalletManager) RecoverUnscannedTransactions

func (wm *WalletManager) RecoverUnscannedTransactions(unscannedTxs []*openwallet.UnscanRecord) ([]*BlockTransaction, error)

func (*WalletManager) SendRawTransaction

func (wm *WalletManager) SendRawTransaction(signedTx string) (string, error)

SendRawTransaction

func (*WalletManager) SetNetworkChainID

func (wm *WalletManager) SetNetworkChainID() (uint64, error)

func (*WalletManager) SupportsInterface

func (wm *WalletManager) SupportsInterface(contractAddr string) string

func (*WalletManager) Symbol

func (wm *WalletManager) Symbol() string

Symbol 币种标识

func (*WalletManager) UpdateAddressNonce

func (wm *WalletManager) UpdateAddressNonce(wrapper openwallet.WalletDAI, address string, nonce uint64)

UpdateAddressNonce

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL