Documentation ¶
Index ¶
- Variables
- 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 ¶
var EthBlockByNumber = func(clientId Client, size uint32, bufPtr *byte, blockIdPtr *uint64) (error errno.Error) { return errno.ErrorNone }
var EthBlockNumberFromId = func(clientId Client, blockIdPtr *uint64, bufPtr *byte) (error errno.Error) { return errno.ErrorNone }
var EthBlockNumberFromIdSize = func(clientId Client, blockIdPtr *uint64, lenPtr *uint32) (error errno.Error) { return errno.ErrorNone }
var EthCallContract = func(clientId Client, contractId uint32, method string, outputPtr *byte) (error errno.Error) { return errno.ErrorNone }
var EthCallContractSize = func(clientId Client, contractId uint32, method string, inputsPtr *byte, inputsSize uint32, outputSizePtr *uint32) (error errno.Error) { return errno.ErrorNone }
var EthCloseClient = func(clientId Client) (error errno.Error) { return errno.ErrorNone }
var EthCurrentBlockNumber = func(clientId Client, blockNumberPtr *uint64) (error errno.Error) { return errno.ErrorNone }
var EthCurrentChainId = func(clientId Client, bufPtr *byte) (error errno.Error) { return errno.ErrorNone }
var EthCurrentChainIdSize = func(clientId Client, sizePtr *uint32) (error errno.Error) { return errno.ErrorNone }
var EthGetContractMethod = func(clientId Client, contractId uint32, method string, inputPtr *byte, outputPtr *byte) (error errno.Error) { return errno.ErrorNone }
var EthGetContractMethodSize = func(clientId Client, contractId uint32, method string, inputSizePtr *uint32, outputSizePtr *uint32) (error errno.Error) { return errno.ErrorNone }
var EthGetTransactionFromBlockByHash = func(clientId Client, blockIdPtr *uint64, idPtr *uint32, hashPtr *byte) (error errno.Error) { return errno.ErrorNone }
var EthGetTransactionMethodBytes = func(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32, method string, bufPtr *byte) (error errno.Error) { return errno.ErrorNone }
var EthGetTransactionMethodSize = func(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32, method string, sizePtr *uint32) (error errno.Error) { return errno.ErrorNone }
var EthGetTransactionMethodUint64 = func(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32, method string, numPtr *uint64) (error errno.Error) { return errno.ErrorNone }
var EthGetTransactionsFromBlock = func(clientId Client, blockIdPtr *uint64, bufPtr *byte) (error errno.Error) { return errno.ErrorNone }
var EthGetTransactionsFromBlockSize = func(clientId Client, blockIdPtr *uint64, sizePtr *uint32) (error errno.Error) { return errno.ErrorNone }
var EthNew = func(clientIdPtr *Client, url string) (error errno.Error) { return errno.ErrorNone }
var EthNewContract = func(clientId Client, contractId uint32, methodsPtr *byte) (error errno.Error) { return errno.ErrorNone }
var EthNewContractSize = func(clientId Client, abiPtr *byte, abiSize uint32, address string, methodsSizePtr *uint32, contractPtr *uint32) (error errno.Error) { return errno.ErrorNone }
var EthNonceFromPrivateKey = func(clientId Client, hexKey string, blockNumberLen uint32, blockNumberPtr *byte, noncePtr *uint64) (error errno.Error) { return errno.ErrorNone }
var EthSendTransaction = func(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32) (error errno.Error) { return errno.ErrorNone }
var EthTransactContract = func(clientId Client, contractId uint32, chainIdPtr *byte, chainIdSize uint32, method string, privKey string, inputPtr *byte, inputSize uint32, transactionIdPtr *uint32) (error errno.Error) { return errno.ErrorNone }
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.