Versions in this module Expand all Collapse all v0 v0.0.1 Nov 16, 2024 Changes in this version + const ChainName + func BuildErc20Data(toAddress common.Address, amount *big.Int) []byte + func BuildErc721Data(fromAddress, toAddress common.Address, tokenId *big.Int) []byte + func CreateEip1559SignedTx(txData *types.DynamicFeeTx, signature []byte, chainId *big.Int) (string, string, error) + func CreateEip1559UnSignTx(txData *types.DynamicFeeTx, chainId *big.Int) (string, error) + func CreateLegacySignedTx(txData *types.LegacyTx, signature []byte, chainId *big.Int) (string, string, error) + func CreateLegacyUnSignTx(txData *types.LegacyTx, chainId *big.Int) string + func NewChainAdaptor(conf *config.Config) (chain.IChainAdaptor, error) + type ChainAdaptor struct + func (c *ChainAdaptor) BuildSignedTransaction(req *account.SignedTransactionRequest) (*account.SignedTransactionResponse, error) + func (c *ChainAdaptor) ConvertAddress(req *account.ConvertAddressRequest) (*account.ConvertAddressResponse, error) + func (c *ChainAdaptor) CreateUnSignTransaction(req *account.UnSignTransactionRequest) (*account.UnSignTransactionResponse, error) + func (c *ChainAdaptor) DecodeTransaction(req *account.DecodeTransactionRequest) (*account.DecodeTransactionResponse, error) + func (c *ChainAdaptor) GetAccount(req *account.AccountRequest) (*account.AccountResponse, error) + func (c *ChainAdaptor) GetBlockByHash(req *account.BlockHashRequest) (*account.BlockResponse, error) + func (c *ChainAdaptor) GetBlockByNumber(req *account.BlockNumberRequest) (*account.BlockResponse, error) + func (c *ChainAdaptor) GetBlockByRange(req *account.BlockByRangeRequest) (*account.BlockByRangeResponse, error) + func (c *ChainAdaptor) GetBlockHeaderByHash(req *account.BlockHeaderHashRequest) (*account.BlockHeaderResponse, error) + func (c *ChainAdaptor) GetBlockHeaderByNumber(req *account.BlockHeaderNumberRequest) (*account.BlockHeaderResponse, error) + func (c *ChainAdaptor) GetExtraData(req *account.ExtraDataRequest) (*account.ExtraDataResponse, error) + func (c *ChainAdaptor) GetFee(req *account.FeeRequest) (*account.FeeResponse, error) + func (c *ChainAdaptor) GetSupportChains(req *account.SupportChainsRequest) (*account.SupportChainsResponse, error) + func (c *ChainAdaptor) GetTxByAddress(req *account.TxAddressRequest) (*account.TxAddressResponse, error) + func (c *ChainAdaptor) GetTxByHash(req *account.TxHashRequest) (*account.TxHashResponse, error) + func (c *ChainAdaptor) SendTx(req *account.SendTxRequest) (*account.SendTxResponse, error) + func (c *ChainAdaptor) ValidAddress(req *account.ValidAddressRequest) (*account.ValidAddressResponse, error) + func (c *ChainAdaptor) VerifySignedTransaction(req *account.VerifyTransactionRequest) (*account.VerifyTransactionResponse, error) + type EthClient interface + BlockByHash func(common.Hash) (*RpcBlock, error) + BlockByNumber func(*big.Int) (*RpcBlock, error) + BlockHeaderByHash func(common.Hash) (*types.Header, error) + BlockHeaderByNumber func(*big.Int) (*types.Header, error) + BlockHeadersByRange func(*big.Int, *big.Int, uint) ([]types.Header, error) + Close func() + FilterLogs func(filterQuery ethereum.FilterQuery, chainId uint) (Logs, error) + LatestFinalizedBlockHeader func() (*types.Header, error) + LatestSafeBlockHeader func() (*types.Header, error) + SendRawTransaction func(rawTx string) error + StorageHash func(common.Address, *big.Int) (common.Hash, error) + SuggestGasPrice func() (*big.Int, error) + SuggestGasTipCap func() (*big.Int, error) + TxByHash func(common.Hash) (*types.Transaction, error) + TxCountByAddress func(common.Address) (hexutil.Uint64, error) + TxReceiptByHash func(common.Hash) (*types.Receipt, error) + func DialEthClient(ctx context.Context, rpcUrl string) (EthClient, error) + type EthData struct + EthDataCli *etherscan.ChainExplorerAdaptor + func NewEthDataClient(baseUrl, apiKey string, timeout time.Duration) (*EthData, error) + func (ed *EthData) GetBalanceByAddress(contractAddr, address string) (*account.AccountBalanceResponse, error) + func (ed *EthData) GetTxByAddress(page, pagesize uint64, address string, action account.ActionType) (*account.TransactionResponse[account.AccountTxResponse], error) + type Logs struct + Logs []types.Log + ToBlockHeader *types.Header + type RPC interface + BatchCallContext func(ctx context.Context, b []rpc.BatchElem) error + CallContext func(ctx context.Context, result any, method string, args ...any) error + Close func() + func NewRPC(client *rpc.Client) RPC + type RpcBlock struct + BaseFee string + Hash common.Hash + Height uint64 + Transactions []TransactionList + type TransactionList struct + From string + Hash string + To string + Value string + type TxStructure struct + ChainId string + ContractAddress string + FromAddress string + Gas uint64 + GasFeeCap string + GasPrice string + GasTipCap string + Nonce uint64 + ToAddress string + TokenId string + Value string