Documentation
¶
Index ¶
- Variables
- func CreateWalletAccount() (privateKeyHex, address string, err error)
- type ParsedLog
- type ParsedTx
- type TxParser
- type WalletClient
- func (wc *WalletClient) EstimateGasTransferERC20Token(ctx context.Context, tokenContract, to string, amount *big.Int) (gas uint64, err error)
- func (wc *WalletClient) EstimateGasTransferETH(ctx context.Context, to string, amount *big.Int) (gas uint64, err error)
- func (wc *WalletClient) GetERC20TokenBalance(ctx context.Context, tokenContract string) (balance *big.Int, err error)
- func (wc *WalletClient) GetERC20TokenBalanceByAddress(ctx context.Context, tokenContract, address string) (balance *big.Int, err error)
- func (wc *WalletClient) GetETHBalance(ctx context.Context) (balance *big.Int, err error)
- func (wc *WalletClient) GetETHBalanceByAddress(ctx context.Context, address string) (balance *big.Int, err error)
- func (wc *WalletClient) SuggestGasPrice(ctx context.Context) (gasPrice *big.Int, err error)
- func (wc *WalletClient) TransferERC20Token(ctx context.Context, tokenContract, to string, amount *big.Int, ...) (txHash string, err error)
- func (wc *WalletClient) TransferETH(ctx context.Context, to string, amount *big.Int, gasLimit uint64, ...) (txHash string, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GweiPerETH = big.NewInt(1000000000) // 1 ETH = 1,000,000,000 Gwei WeiPerETH = new(big.Int).Mul(GweiPerETH, big.NewInt(1000000000)) // 1 ETH = 1,000,000,000,000,000,000 Wei )
Functions ¶
func CreateWalletAccount ¶
Types ¶
type ParsedTx ¶
type ParsedTx struct { Block *big.Int // block height Timestamp int64 // block timestamp // milliseconds TxHash string // transaction hash From string // from address To string // to address // wallet or contract address Value *big.Int // transaction value Fee *big.Int // transaction fee // = gas price * gas used GasLimit uint64 // transaction gas limit GasUsed uint64 // transaction gas used GasPrice *big.Int // transaction gas price // static or dynamic // dynamic: min((base fee + max priority fee), max fee) BaseFee *big.Int // transaction base fee MaxPriorityFee *big.Int // transaction max priority fee MaxFee *big.Int // transaction max fee InputData string // transaction input data // hex string Logs []*ParsedLog // transaction logs Nonce uint64 TxType uint8 // transaction type // https://ethereum.org/developers/docs/transactions/#typed-transaction-envelope }
type TxParser ¶
type TxParser struct {
// contains filtered or unexported fields
}
func NewTxParser ¶
type WalletClient ¶
type WalletClient struct {
// contains filtered or unexported fields
}
func NewWalletClient ¶
func NewWalletClient(endpoint, privateKeyHex string) (*WalletClient, error)
func (*WalletClient) EstimateGasTransferERC20Token ¶
func (*WalletClient) EstimateGasTransferETH ¶
func (*WalletClient) GetERC20TokenBalance ¶
func (*WalletClient) GetERC20TokenBalanceByAddress ¶
func (*WalletClient) GetETHBalance ¶
func (*WalletClient) GetETHBalanceByAddress ¶
func (*WalletClient) SuggestGasPrice ¶
func (*WalletClient) TransferERC20Token ¶
Click to show internal directories.
Click to hide internal directories.