Documentation ¶
Index ¶
- Constants
- 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
- 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
- type EthData
- type Logs
- type RPC
- type RpcBlock
- type TransactionList
- type TxStructure
Constants ¶
View Source
const ChainName = "Ethereum"
Variables ¶
This section is empty.
Functions ¶
func BuildErc721Data ¶
func CreateEip1559SignedTx ¶
func CreateEip1559UnSignTx ¶
func CreateLegacySignedTx ¶
func CreateLegacyUnSignTx ¶
func NewChainAdaptor ¶
func NewChainAdaptor(conf *config.Config) (chain.IChainAdaptor, error)
Types ¶
type ChainAdaptor ¶
type ChainAdaptor struct {
// contains filtered or unexported fields
}
func (*ChainAdaptor) BuildSignedTransaction ¶
func (c *ChainAdaptor) BuildSignedTransaction(req *account.SignedTransactionRequest) (*account.SignedTransactionResponse, error)
func (*ChainAdaptor) ConvertAddress ¶
func (c *ChainAdaptor) ConvertAddress(req *account.ConvertAddressRequest) (*account.ConvertAddressResponse, error)
func (*ChainAdaptor) CreateUnSignTransaction ¶
func (c *ChainAdaptor) CreateUnSignTransaction(req *account.UnSignTransactionRequest) (*account.UnSignTransactionResponse, error)
func (*ChainAdaptor) DecodeTransaction ¶
func (c *ChainAdaptor) DecodeTransaction(req *account.DecodeTransactionRequest) (*account.DecodeTransactionResponse, error)
func (*ChainAdaptor) GetAccount ¶
func (c *ChainAdaptor) GetAccount(req *account.AccountRequest) (*account.AccountResponse, error)
func (*ChainAdaptor) GetBlockByHash ¶
func (c *ChainAdaptor) GetBlockByHash(req *account.BlockHashRequest) (*account.BlockResponse, error)
func (*ChainAdaptor) GetBlockByNumber ¶
func (c *ChainAdaptor) GetBlockByNumber(req *account.BlockNumberRequest) (*account.BlockResponse, error)
func (*ChainAdaptor) GetBlockByRange ¶
func (c *ChainAdaptor) GetBlockByRange(req *account.BlockByRangeRequest) (*account.BlockByRangeResponse, error)
func (*ChainAdaptor) GetBlockHeaderByHash ¶
func (c *ChainAdaptor) GetBlockHeaderByHash(req *account.BlockHeaderHashRequest) (*account.BlockHeaderResponse, error)
func (*ChainAdaptor) GetBlockHeaderByNumber ¶
func (c *ChainAdaptor) GetBlockHeaderByNumber(req *account.BlockHeaderNumberRequest) (*account.BlockHeaderResponse, error)
func (*ChainAdaptor) GetExtraData ¶
func (c *ChainAdaptor) GetExtraData(req *account.ExtraDataRequest) (*account.ExtraDataResponse, error)
func (*ChainAdaptor) GetFee ¶
func (c *ChainAdaptor) GetFee(req *account.FeeRequest) (*account.FeeResponse, error)
func (*ChainAdaptor) GetSupportChains ¶
func (c *ChainAdaptor) GetSupportChains(req *account.SupportChainsRequest) (*account.SupportChainsResponse, error)
func (*ChainAdaptor) GetTxByAddress ¶
func (c *ChainAdaptor) GetTxByAddress(req *account.TxAddressRequest) (*account.TxAddressResponse, error)
func (*ChainAdaptor) GetTxByHash ¶
func (c *ChainAdaptor) GetTxByHash(req *account.TxHashRequest) (*account.TxHashResponse, error)
func (*ChainAdaptor) SendTx ¶
func (c *ChainAdaptor) SendTx(req *account.SendTxRequest) (*account.SendTxResponse, error)
func (*ChainAdaptor) ValidAddress ¶
func (c *ChainAdaptor) ValidAddress(req *account.ValidAddressRequest) (*account.ValidAddressResponse, error)
func (*ChainAdaptor) VerifySignedTransaction ¶
func (c *ChainAdaptor) VerifySignedTransaction(req *account.VerifyTransactionRequest) (*account.VerifyTransactionResponse, error)
type EthClient ¶
type EthClient interface { BlockHeaderByNumber(*big.Int) (*types.Header, error) BlockByNumber(*big.Int) (*RpcBlock, error) BlockByHash(common.Hash) (*RpcBlock, error) LatestSafeBlockHeader() (*types.Header, error) LatestFinalizedBlockHeader() (*types.Header, error) BlockHeaderByHash(common.Hash) (*types.Header, error) BlockHeadersByRange(*big.Int, *big.Int, uint) ([]types.Header, error) TxByHash(common.Hash) (*types.Transaction, error) TxReceiptByHash(common.Hash) (*types.Receipt, error) StorageHash(common.Address, *big.Int) (common.Hash, error) FilterLogs(filterQuery ethereum.FilterQuery, chainId uint) (Logs, error) TxCountByAddress(common.Address) (hexutil.Uint64, error) SendRawTransaction(rawTx string) error SuggestGasPrice() (*big.Int, error) SuggestGasTipCap() (*big.Int, error) Close() }
type EthData ¶
type EthData struct {
EthDataCli *etherscan.ChainExplorerAdaptor
}
func NewEthDataClient ¶
func (*EthData) GetBalanceByAddress ¶
func (ed *EthData) GetBalanceByAddress(contractAddr, address string) (*account.AccountBalanceResponse, error)
func (*EthData) GetTxByAddress ¶
func (ed *EthData) GetTxByAddress(page, pagesize uint64, address string, action account.ActionType) (*account.TransactionResponse[account.AccountTxResponse], error)
type RPC ¶
type RpcBlock ¶
type RpcBlock struct { Hash common.Hash `json:"hash"` Height uint64 `json:"height"` Transactions []TransactionList `json:"transactions"` BaseFee string `json:"baseFeePerGas"` }
type TransactionList ¶
type TxStructure ¶
type TxStructure struct { ChainId string `json:"chain_id"` Nonce uint64 `json:"nonce"` GasPrice string `json:"gas_price"` GasTipCap string `json:"gas_tip_cap"` GasFeeCap string `json:"gas_fee_cap"` Gas uint64 `json:"gas"` ContractAddress string `json:"contract_address"` FromAddress string `json:"from_address"` ToAddress string `json:"to_address"` TokenId string `json:"token_id"` Value string `json:"value"` }
Click to show internal directories.
Click to hide internal directories.