Documentation ¶
Index ¶
- Constants
- type Contract
- func (c *Contract) Address() common.Address
- func (c *Contract) AllMethods() []string
- func (c *Contract) Call(methodName string, args ...interface{}) (interface{}, error)
- func (c *Contract) CallAtWithMultiReturns(blockNumber *big.Int, methodName string, args ...interface{}) ([]interface{}, error)
- func (c *Contract) CallWithFromAndValue(methodName string, from common.Address, value *big.Int, args ...interface{}) ([]interface{}, error)
- func (c *Contract) CallWithMultiReturns(methodName string, args ...interface{}) ([]interface{}, error)
- func (c *Contract) EncodeABI(methodName string, args ...interface{}) ([]byte, error)
- func (c *Contract) Methods(methodName string) abi.Method
- type EstimateFee
- type Eth
- func (e *Eth) Accounts() ([]common.Address, error)
- func (e *Eth) Address() common.Address
- func (e *Eth) Call(msg *types.CallMsg, block *big.Int) (string, error)
- func (e *Eth) ChainID() (*big.Int, error)
- func (e *Eth) DecodeParameters(parameters []string, data []byte) ([]interface{}, error)
- func (e *Eth) EncodeParameters(parameters []string, data []interface{}) ([]byte, error)
- func (e *Eth) EstimateFee() (*EstimateFee, error)
- func (e *Eth) EstimateGas(msg *types.CallMsg) (uint64, error)
- func (e *Eth) EstimateGasContract(bin []byte) (uint64, error)
- func (e *Eth) EstimatePriorityFee(historicalBlocks int, blockNumber *big.Int, feeHistoryPercentile []float64) (*big.Int, error)
- func (e *Eth) FeeHistory(historicalBlocks int, blockNumber *big.Int, feeHistoryPercentile []float64) (*types.FeeHistory, error)
- func (e *Eth) GasPrice() (uint64, error)
- func (e *Eth) GetBalance(addr common.Address, blockNumber *big.Int) (*big.Int, error)
- func (e *Eth) GetBlocByNumber(number *big.Int, full bool) (*eTypes.Block, error)
- func (e *Eth) GetBlockByHash(hash common.Hash, full bool) (*eTypes.Block, error)
- func (e *Eth) GetBlockHeaderByNumber(number *big.Int, full bool) (*eTypes.Header, error)
- func (e *Eth) GetBlockNumber() (uint64, error)
- func (e *Eth) GetChainId() *big.Int
- func (e *Eth) GetLogs(fliter *types.Fliter) ([]*types.Event, error)
- func (e *Eth) GetNonce(addr common.Address, blockNumber *big.Int) (uint64, error)
- func (e *Eth) GetPrivateKey() *ecdsa.PrivateKey
- func (e *Eth) GetTransactionByHash(hash common.Hash) (*eTypes.Transaction, error)
- func (e *Eth) GetTransactionReceipt(hash common.Hash) (*eTypes.Receipt, error)
- func (e *Eth) NewContract(abiString string, contractAddr ...string) (*Contract, error)
- func (e *Eth) NewEIP1559Tx(to common.Address, amount *big.Int, gasLimit uint64, gasTipCap *big.Int, ...) (*eTypes.Transaction, error)
- func (e *Eth) SendRawEIP1559Transaction(to common.Address, amount *big.Int, nonce uint64, gasLimit uint64, ...) (common.Hash, error)
- func (e *Eth) SendRawTransaction(to common.Address, amount *big.Int, nonce uint64, gasLimit uint64, ...) (common.Hash, error)
- func (e *Eth) SendTransaction(txn *eTypes.Transaction) (common.Hash, error)
- func (e *Eth) SetAccount(privateKey string) error
- func (e *Eth) SetChainId(chainId int64)
- func (e *Eth) SetTxPollTimeout(timeout int)
- func (e *Eth) SignText(data []byte) ([]byte, error)
- func (e *Eth) SignTypedData(data apitypes.TypedData) ([]byte, error)
- func (e *Eth) SuggestGasTipCap() (*big.Int, error)
- func (e *Eth) SyncSendEIP1559RawTransaction(to common.Address, amount *big.Int, nonce uint64, gasLimit uint64, ...) (*eTypes.Receipt, error)
- func (e *Eth) SyncSendRawTransaction(to common.Address, amount *big.Int, nonce uint64, gasLimit uint64, ...) (*eTypes.Receipt, error)
Constants ¶
const (
PRIORITY_FEE_INCREASE_BOUNDARY = 200
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
func (*Contract) AllMethods ¶
func (*Contract) CallAtWithMultiReturns ¶
func (*Contract) CallWithFromAndValue ¶
func (*Contract) CallWithMultiReturns ¶
type EstimateFee ¶
type Eth ¶
type Eth struct {
// contains filtered or unexported fields
}
Eth is the eth namespace
func (*Eth) DecodeParameters ¶
func (*Eth) EncodeParameters ¶
func (*Eth) EstimateFee ¶
func (e *Eth) EstimateFee() (*EstimateFee, error)
func (*Eth) EstimateGas ¶
Estimate gas for excuting transaction
func (*Eth) EstimateGasContract ¶
Estimate gas for deploying contract
func (*Eth) EstimatePriorityFee ¶
func (e *Eth) EstimatePriorityFee(historicalBlocks int, blockNumber *big.Int, feeHistoryPercentile []float64) (*big.Int, error)
Estimate priority gas fee
func (*Eth) FeeHistory ¶
func (e *Eth) FeeHistory(historicalBlocks int, blockNumber *big.Int, feeHistoryPercentile []float64) (*types.FeeHistory, error)
Get fee history for EIP1559 blocks
func (*Eth) GetBalance ¶
Get ether balance of account
func (*Eth) GetBlocByNumber ¶
Get block header by block number
func (*Eth) GetBlockByHash ¶
Get block by block hash
func (*Eth) GetBlockHeaderByNumber ¶
Get block header by block number
func (*Eth) GetBlockNumber ¶
Get current block height
func (*Eth) GetChainId ¶
func (*Eth) GetPrivateKey ¶
func (e *Eth) GetPrivateKey() *ecdsa.PrivateKey
func (*Eth) GetTransactionByHash ¶
Get transaction by transaction hash
func (*Eth) GetTransactionReceipt ¶
Get transaction receipt by transaction hash
func (*Eth) NewContract ¶
func (*Eth) NewEIP1559Tx ¶
func (*Eth) SendRawEIP1559Transaction ¶
func (*Eth) SendRawTransaction ¶
func (*Eth) SendTransaction ¶
Send transaction
func (*Eth) SetAccount ¶
Setup default ethereum account with privateKey (hex format)
func (*Eth) SetTxPollTimeout ¶
Setup timeout for polling confirmation from txs (unit second)
func (*Eth) SignText ¶
SignText signs raw text message keccak256("\x19Ethereum Signed Message:\n"${message length}${message}).
func (*Eth) SignTypedData ¶
SignTypedData signs EIP-712 conformant typed data hash = keccak256("\x19${byteVersion}${domainSeparator}${hashStruct(message)}") It returns - the signature, - and/or any error