Documentation
¶
Index ¶
Constants ¶
View Source
const AddressLength = common.AddressLength
AddressLength is the expected length of the address
View Source
const SignatureLength = 65
SignatureLength is the expected length of the Signature.
Variables ¶
View Source
var HexToAddress = common.HexToAddress
HexToAddress returns Address from hex representation.
View Source
var HexToBytes = common.FromHex
HexToBytes returns bytes from hex string.
View Source
var HexToHash = common.HexToHash
HexToHash returns Hash from hex string.
View Source
var IsHexAddress = common.IsHexAddress
IsHexAddress verifies if given string is a valid Ethereum address.
Functions ¶
func BlockNumberFromContext ¶ added in v0.5.0
BlockNumberFromContext returns the block number from the context.
Types ¶
type Address ¶
var EmptyAddress Address
EmptyAddress contains empty Ethereum address: 0x0000000000000000000000000000000000000000
type Client ¶
type Client interface {
// BlockNumber returns the current block number.
BlockNumber(ctx context.Context) (*big.Int, error)
// Call executes a message call transaction, which is directly
// executed in the VM of the node, but never mined into the blockchain.
Call(ctx context.Context, call Call) ([]byte, error)
// CallBlocks executes the same call on multiple blocks (counting back from the latest)
// and returns multiple results in a slice
CallBlocks(ctx context.Context, call Call, blocks []int64) ([][]byte, error)
// MultiCall works like the Call function but allows to execute multiple
// calls at once.
MultiCall(ctx context.Context, calls []Call) ([][]byte, error)
// Storage returns the value of key in the contract storage of the
// given account.
Storage(ctx context.Context, address Address, key Hash) ([]byte, error)
// SendTransaction injects a signed transaction into the pending pool
// for execution.
SendTransaction(ctx context.Context, transaction *Transaction) (*Hash, error)
}
type Signature ¶
type Signature [SignatureLength]byte
Signature represents the 65 byte signature.
func SignatureFromBytes ¶
type Signer ¶
type Signer interface {
// Address returns account's address used to sign data. May be empty if
// the signer is used only to verify signatures.
Address() Address
// SignTransaction signs transaction. Signed transaction will be set
// to the SignedTx field in the Transaction structure.
SignTransaction(transaction *Transaction) error
// Signature signs the hash of the given data and returns it.
Signature(data []byte) (Signature, error)
// Recover returns the wallet address that created the given signature.
Recover(signature Signature, data []byte) (*Address, error)
}
type Transaction ¶
type Transaction struct {
// Address is the contract's address.
Address Address
// Nonce is the transaction nonce. If zero, the nonce will be filled
// automatically.
Nonce uint64
// PriorityFee is the maximum tip value. If nil, the suggested gas tip value
// will be used.
PriorityFee *big.Int
// MaxFee is the maximum fee value. If nil, double value of a suggested
// gas fee will be used.
MaxFee *big.Int
// GasLimit is the maximum gas available to be used for this transaction.
GasLimit *big.Int
// Data is the raw transaction data.
Data []byte
// ChainID is the transaction chain ID. If nil, the chan ID will be filled
// automatically.
ChainID *big.Int
// SignedTx contains signed transaction. The data type stored here may
// be different for various implementations.
SignedTx interface{}
}
Click to show internal directories.
Click to hide internal directories.