Documentation ¶
Index ¶
- func EthBlockByNumber(clientId Client, size uint32, bufPtr *byte, blockIdPtr *uint64) (error errno.Error)
- func EthBlockNumberFromId(clientId Client, blockIdPtr *uint64, bufPtr *byte) (error errno.Error)
- func EthBlockNumberFromIdSize(clientId Client, blockIdPtr *uint64, lenPtr *uint32) (error errno.Error)
- func EthCallContract(clientId Client, contractId uint32, method string, outputPtr *byte) (error errno.Error)
- func EthCallContractSize(clientId Client, contractId uint32, method string, inputsPtr *byte, ...) (error errno.Error)
- func EthCloseClient(clientId Client) (error errno.Error)
- func EthCurrentBlockNumber(clientId Client, blockNumberPtr *uint64) (error errno.Error)
- func EthCurrentChainId(clientId Client, bufPtr *byte) (error errno.Error)
- func EthCurrentChainIdSize(clientId Client, sizePtr *uint32) (error errno.Error)
- func EthGetContractMethod(clientId Client, contractId uint32, method string, inputPtr *byte, ...) (error errno.Error)
- func EthGetContractMethodSize(clientId Client, contractId uint32, method string, inputSizePtr *uint32, ...) (error errno.Error)
- func EthGetTransactionFromBlockByHash(clientId Client, blockIdPtr *uint64, idPtr *uint32, hashPtr *byte) (error errno.Error)
- func EthGetTransactionMethodBytes(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32, ...) (error errno.Error)
- func EthGetTransactionMethodSize(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32, ...) (error errno.Error)
- func EthGetTransactionMethodUint64(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32, ...) (error errno.Error)
- func EthGetTransactionsFromBlock(clientId Client, blockIdPtr *uint64, bufPtr *byte) (error errno.Error)
- func EthGetTransactionsFromBlockSize(clientId Client, blockIdPtr *uint64, sizePtr *uint32) (error errno.Error)
- func EthNew(clientIdPtr *Client, url string) (error errno.Error)
- func EthNewContract(clientId Client, contractId uint32, methodsPtr *byte) (error errno.Error)
- func EthNewContractSize(clientId Client, abiPtr *byte, abiSize uint32, address string, ...) (error errno.Error)
- func EthNonceFromPrivateKey(clientId Client, hexKey string, blockNumberLen uint32, blockNumberPtr *byte, ...) (error errno.Error)
- func EthSendTransaction(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32) (error errno.Error)
- func EthTransactContract(clientId Client, contractId uint32, chainIdPtr *byte, chainIdSize uint32, ...) (error errno.Error)
- func EthTransactionRawSignatures(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32, ...) (error errno.Error)
- func EthTransactionRawSignaturesSize(clientId Client, blockIdPtr *uint64, contractId uint32, transactionId uint32, ...) (error errno.Error)
- 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 ¶
func EthBlockByNumber ¶
func EthBlockNumberFromId ¶
func EthCallContract ¶
func EthCallContractSize ¶
func EthCloseClient ¶ added in v0.1.22
func EthCurrentBlockNumber ¶
func EthCurrentChainIdSize ¶
func EthGetContractMethod ¶
func EthNewContract ¶
func EthNewContractSize ¶
func EthNonceFromPrivateKey ¶
func EthSendTransaction ¶
func EthTransactContract ¶
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.