Documentation ¶
Index ¶
- type Block
- type Client
- type Contract
- type ContractMethod
- type Transaction
- func (t *Transaction) Chain() (*big.Int, error)
- func (t *Transaction) Data() ([]byte, error)
- func (t *Transaction) Gas() (uint64, error)
- func (t *Transaction) GasFeeCap() (*big.Int, error)
- func (t *Transaction) GasPrice() (*big.Int, error)
- func (t *Transaction) GasTipCap() (*big.Int, error)
- func (t *Transaction) Hash() ([]byte, error)
- func (t *Transaction) Nonce() (uint64, error)
- func (t *Transaction) RawSignatures() (rawSignatures, error)
- func (t *Transaction) Send() (err error)
- func (t *Transaction) ToAddress() ([]byte, error)
- func (t *Transaction) Value() (*big.Int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block defines wrappers for a block retrieved by the client.
func (*Block) NonceFromPrivateKey ¶
NonceFromPrivateKey returns the account nonce of the account given from the secp256k1 hexkey. The block number can be nil, in which case the nonce is taken from the latest known block.
func (*Block) Transaction ¶
func (b *Block) Transaction(hash []byte) (*Transaction, error)
Transaction returns transaction from block with the given transaction hash.
Transaction hash is 32 bytes, if inputted hash is longer than 32 bytes hash will be trimmed.
func (*Block) Transactions ¶
func (b *Block) Transactions() ([]*Transaction, error)
Transactions returns all transactions from the given block.
type Client ¶
type Client uint32
Client defines typed wrappers for the Ethereum RPC API.
func (Client) BlockByNumber ¶
BlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.
func (Client) CurrentBlockNumber ¶
CurrentBlockNumber returns the most recent block number.
func (Client) CurrentChainId ¶
CurrentChainID retrieves the current chain ID for transaction replay protection.
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
Contract defines typed wrappers for a contract with given abi.
func (*Contract) Method ¶
func (c *Contract) Method(name string) (*ContractMethod, error)
Method returns the contract method with the corresponding inputted name.
func (*Contract) Methods ¶
func (c *Contract) Methods() []*ContractMethod
Methods lists the available methods for within the given contract
type ContractMethod ¶
type ContractMethod struct {
// contains filtered or unexported fields
}
func (*ContractMethod) Call ¶
func (c *ContractMethod) Call(inputParameters ...interface{}) ([]interface{}, error)
Call invokes the (constant) contract method with params as input values
func (*ContractMethod) Name ¶
func (c *ContractMethod) Name() string
func (*ContractMethod) Transact ¶
func (c *ContractMethod) Transact(chainId *big.Int, privateKey string, inputParameters ...interface{}) (*Transaction, error)
Transact invokes the (paid) contract method with params as input values.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction defines wrappers for a transaction retrieved by the client.
func (*Transaction) Chain ¶
func (t *Transaction) Chain() (*big.Int, error)
Chain returns the EIP155 chain ID of the transaction. The return value will always be non-nil. For legacy transactions which are not replay-protected, the return value is zero.
func (*Transaction) Data ¶
func (t *Transaction) Data() ([]byte, error)
Data returns the input data of the transaction.
func (*Transaction) Gas ¶
func (t *Transaction) Gas() (uint64, error)
Gas returns the gas limit of the transaction.
func (*Transaction) GasFeeCap ¶
func (t *Transaction) GasFeeCap() (*big.Int, error)
GasFeeCap returns the fee cap per gas of the transaction.
func (*Transaction) GasPrice ¶
func (t *Transaction) GasPrice() (*big.Int, error)
GasPrice returns the gas price of the transaction
func (*Transaction) GasTipCap ¶
func (t *Transaction) GasTipCap() (*big.Int, error)
GasTipCap returns the gasTipCap per gas of the transaction.
func (*Transaction) Hash ¶
func (t *Transaction) Hash() ([]byte, error)
Hash returns the transaction hash.
func (*Transaction) Nonce ¶
func (t *Transaction) Nonce() (uint64, error)
Nonce returns the sender account nonce of the transaction.
func (*Transaction) RawSignatures ¶
func (t *Transaction) RawSignatures() (rawSignatures, error)
RawSignatureValues returns the V, R, S signature values of the transaction. The return values should not be modified by the caller.
func (*Transaction) Send ¶
func (t *Transaction) Send() (err error)
SendTransaction injects a signed transaction into the pending pool for execution.
func (*Transaction) ToAddress ¶
func (t *Transaction) ToAddress() ([]byte, error)
ToAddress returns the recipient address of the transaction.