Versions in this module Expand all Collapse all v1 v1.2.0 Jul 8, 2022 Changes in this version + const LightScryptN + const LightScryptP + const StandardScryptN + const StandardScryptP + func DecodeFromHex(s string) ([]byte, error) + func EncodeToHex(b []byte) string + func GoerliGenesis() string + func MainnetGenesis() string + func RinkebyGenesis() string + func RopstenGenesis() string + func SetVerbosity(level int) + type Account struct + func (a *Account) GetAddress() *Address + func (a *Account) GetURL() string + type Accounts struct + func (a *Accounts) Get(index int) (account *Account, _ error) + func (a *Accounts) Set(index int, account *Account) error + func (a *Accounts) Size() int + type Address struct + func NewAddressFromBytes(binary []byte) (address *Address, _ error) + func NewAddressFromHex(hex string) (address *Address, _ error) + func (a *Address) GetBytes() []byte + func (a *Address) GetHex() string + func (a *Address) SetBytes(address []byte) error + func (a *Address) SetHex(address string) error + func (a *Address) String() string + type Addresses struct + func NewAddresses(size int) *Addresses + func NewAddressesEmpty() *Addresses + func (a *Addresses) Append(address *Address) + func (a *Addresses) Get(index int) (address *Address, _ error) + func (a *Addresses) Set(index int, address *Address) error + func (a *Addresses) Size() int + type BigInt struct + func NewBigInt(x int64) *BigInt + func NewBigIntFromString(x string, base int) *BigInt + func (bi *BigInt) GetBytes() []byte + func (bi *BigInt) GetInt64() int64 + func (bi *BigInt) GetString(base int) string + func (bi *BigInt) SetBytes(buf []byte) + func (bi *BigInt) SetInt64(x int64) + func (bi *BigInt) SetString(x string, base int) + func (bi *BigInt) Sign() int + func (bi *BigInt) String() string + type BigInts struct + func NewBigInts(size int) *BigInts + func (bi *BigInts) Get(index int) (bigint *BigInt, _ error) + func (bi *BigInts) Set(index int, bigint *BigInt) error + func (bi *BigInts) Size() int + type Binaries struct + func (bs *Binaries) Get(index int) (binary []byte, _ error) + func (bs *Binaries) Set(index int, binary []byte) error + func (bs *Binaries) Size() int + func (bs *Binaries) String() string + type Block struct + func NewBlockFromJSON(data string) (*Block, error) + func NewBlockFromRLP(data []byte) (*Block, error) + func (b *Block) EncodeJSON() (string, error) + func (b *Block) EncodeRLP() ([]byte, error) + func (b *Block) GetBloom() *Bloom + func (b *Block) GetCoinbase() *Address + func (b *Block) GetDifficulty() *BigInt + func (b *Block) GetExtra() []byte + func (b *Block) GetGasLimit() int64 + func (b *Block) GetGasUsed() int64 + func (b *Block) GetHash() *Hash + func (b *Block) GetHeader() *Header + func (b *Block) GetMixDigest() *Hash + func (b *Block) GetNonce() int64 + func (b *Block) GetNumber() int64 + func (b *Block) GetParentHash() *Hash + func (b *Block) GetReceiptHash() *Hash + func (b *Block) GetRoot() *Hash + func (b *Block) GetTime() int64 + func (b *Block) GetTransaction(hash *Hash) *Transaction + func (b *Block) GetTransactions() *Transactions + func (b *Block) GetTxHash() *Hash + func (b *Block) GetUncleHash() *Hash + func (b *Block) GetUncles() *Headers + func (b *Block) String() string + type Bloom struct + func (b *Bloom) GetBytes() []byte + func (b *Bloom) GetHex() string + func (b *Bloom) String() string + type Bools struct + func (bs *Bools) Get(index int) (b bool, _ error) + func (bs *Bools) Set(index int, b bool) error + func (bs *Bools) Size() int + func (bs *Bools) String() string + type BoundContract struct + func BindContract(address *Address, abiJSON string, client *EthereumClient) (contract *BoundContract, _ error) + func DeployContract(opts *TransactOpts, abiJSON string, bytecode []byte, client *EthereumClient, ...) (contract *BoundContract, _ error) + func (c *BoundContract) Call(opts *CallOpts, out *Interfaces, method string, args *Interfaces) error + func (c *BoundContract) GetAddress() *Address + func (c *BoundContract) GetDeployer() *Transaction + func (c *BoundContract) RawTransact(opts *TransactOpts, calldata []byte) (tx *Transaction, _ error) + func (c *BoundContract) Transact(opts *TransactOpts, method string, args *Interfaces) (tx *Transaction, _ error) + func (c *BoundContract) Transfer(opts *TransactOpts) (tx *Transaction, _ error) + type CallMsg struct + func NewCallMsg() *CallMsg + func (msg *CallMsg) GetData() []byte + func (msg *CallMsg) GetFrom() *Address + func (msg *CallMsg) GetGas() int64 + func (msg *CallMsg) GetGasPrice() *BigInt + func (msg *CallMsg) GetTo() *Address + func (msg *CallMsg) GetValue() *BigInt + func (msg *CallMsg) SetData(data []byte) + func (msg *CallMsg) SetFrom(address *Address) + func (msg *CallMsg) SetGas(gas int64) + func (msg *CallMsg) SetGasPrice(price *BigInt) + func (msg *CallMsg) SetTo(address *Address) + func (msg *CallMsg) SetValue(value *BigInt) + type CallOpts struct + func NewCallOpts() *CallOpts + func (opts *CallOpts) GetGasLimit() int64 + func (opts *CallOpts) IsPending() bool + func (opts *CallOpts) SetContext(context *Context) + func (opts *CallOpts) SetFrom(addr *Address) + func (opts *CallOpts) SetGasLimit(limit int64) + func (opts *CallOpts) SetPending(pending bool) + type Context struct + func NewContext() *Context + func (c *Context) WithCancel() *Context + func (c *Context) WithDeadline(sec int64, nsec int64) *Context + func (c *Context) WithTimeout(nsec int64) *Context + type Enode struct + func NewEnode(rawurl string) (*Enode, error) + type Enodes struct + func FoundationBootnodes() *Enodes + func NewEnodes(size int) *Enodes + func NewEnodesEmpty() *Enodes + func (e *Enodes) Append(enode *Enode) + func (e *Enodes) Get(index int) (enode *Enode, _ error) + func (e *Enodes) Set(index int, enode *Enode) error + func (e *Enodes) Size() int + type EthereumClient struct + func NewEthereumClient(rawurl string) (client *EthereumClient, _ error) + func (ec *EthereumClient) CallContract(ctx *Context, msg *CallMsg, number int64) (output []byte, _ error) + func (ec *EthereumClient) EstimateGas(ctx *Context, msg *CallMsg) (gas int64, _ error) + func (ec *EthereumClient) FilterLogs(ctx *Context, query *FilterQuery) (logs *Logs, _ error) + func (ec *EthereumClient) GetBalanceAt(ctx *Context, account *Address, number int64) (balance *BigInt, _ error) + func (ec *EthereumClient) GetBlockByHash(ctx *Context, hash *Hash) (block *Block, _ error) + func (ec *EthereumClient) GetBlockByNumber(ctx *Context, number int64) (block *Block, _ error) + func (ec *EthereumClient) GetCodeAt(ctx *Context, account *Address, number int64) (code []byte, _ error) + func (ec *EthereumClient) GetHeaderByHash(ctx *Context, hash *Hash) (header *Header, _ error) + func (ec *EthereumClient) GetHeaderByNumber(ctx *Context, number int64) (header *Header, _ error) + func (ec *EthereumClient) GetNonceAt(ctx *Context, account *Address, number int64) (nonce int64, _ error) + func (ec *EthereumClient) GetPendingBalanceAt(ctx *Context, account *Address) (balance *BigInt, _ error) + func (ec *EthereumClient) GetPendingCodeAt(ctx *Context, account *Address) (code []byte, _ error) + func (ec *EthereumClient) GetPendingNonceAt(ctx *Context, account *Address) (nonce int64, _ error) + func (ec *EthereumClient) GetPendingStorageAt(ctx *Context, account *Address, key *Hash) (storage []byte, _ error) + func (ec *EthereumClient) GetPendingTransactionCount(ctx *Context) (count int, _ error) + func (ec *EthereumClient) GetStorageAt(ctx *Context, account *Address, key *Hash, number int64) (storage []byte, _ error) + func (ec *EthereumClient) GetTransactionByHash(ctx *Context, hash *Hash) (tx *Transaction, _ error) + func (ec *EthereumClient) GetTransactionCount(ctx *Context, hash *Hash) (count int, _ error) + func (ec *EthereumClient) GetTransactionInBlock(ctx *Context, hash *Hash, index int) (tx *Transaction, _ error) + func (ec *EthereumClient) GetTransactionReceipt(ctx *Context, hash *Hash) (receipt *Receipt, _ error) + func (ec *EthereumClient) GetTransactionSender(ctx *Context, tx *Transaction, blockhash *Hash, index int) (sender *Address, _ error) + func (ec *EthereumClient) PendingCallContract(ctx *Context, msg *CallMsg) (output []byte, _ error) + func (ec *EthereumClient) SendTransaction(ctx *Context, tx *Transaction) error + func (ec *EthereumClient) SubscribeFilterLogs(ctx *Context, query *FilterQuery, handler FilterLogsHandler, buffer int) (sub *Subscription, _ error) + func (ec *EthereumClient) SubscribeNewHead(ctx *Context, handler NewHeadHandler, buffer int) (sub *Subscription, _ error) + func (ec *EthereumClient) SuggestGasPrice(ctx *Context) (price *BigInt, _ error) + func (ec *EthereumClient) SyncProgress(ctx *Context) (progress *SyncProgress, _ error) + type FilterLogsHandler interface + OnError func(failure string) + OnFilterLogs func(log *Log) + type FilterQuery struct + func NewFilterQuery() *FilterQuery + func (fq *FilterQuery) GetAddresses() *Addresses + func (fq *FilterQuery) GetFromBlock() *BigInt + func (fq *FilterQuery) GetToBlock() *BigInt + func (fq *FilterQuery) GetTopics() *Topics + func (fq *FilterQuery) SetAddresses(addresses *Addresses) + func (fq *FilterQuery) SetFromBlock(fromBlock *BigInt) + func (fq *FilterQuery) SetToBlock(toBlock *BigInt) + func (fq *FilterQuery) SetTopics(topics *Topics) + type Hash struct + func NewHashFromBytes(binary []byte) (hash *Hash, _ error) + func NewHashFromHex(hex string) (hash *Hash, _ error) + func (h *Hash) GetBytes() []byte + func (h *Hash) GetHex() string + func (h *Hash) SetBytes(hash []byte) error + func (h *Hash) SetHex(hash string) error + func (h *Hash) String() string + type Hashes struct + func NewHashes(size int) *Hashes + func NewHashesEmpty() *Hashes + func (h *Hashes) Append(hash *Hash) + func (h *Hashes) Get(index int) (hash *Hash, _ error) + func (h *Hashes) Set(index int, hash *Hash) error + func (h *Hashes) Size() int + type Header struct + func NewHeaderFromJSON(data string) (*Header, error) + func NewHeaderFromRLP(data []byte) (*Header, error) + func (h *Header) EncodeJSON() (string, error) + func (h *Header) EncodeRLP() ([]byte, error) + func (h *Header) GetBloom() *Bloom + func (h *Header) GetCoinbase() *Address + func (h *Header) GetDifficulty() *BigInt + func (h *Header) GetExtra() []byte + func (h *Header) GetGasLimit() int64 + func (h *Header) GetGasUsed() int64 + func (h *Header) GetHash() *Hash + func (h *Header) GetMixDigest() *Hash + func (h *Header) GetNonce() *Nonce + func (h *Header) GetNumber() int64 + func (h *Header) GetParentHash() *Hash + func (h *Header) GetReceiptHash() *Hash + func (h *Header) GetRoot() *Hash + func (h *Header) GetTime() int64 + func (h *Header) GetTxHash() *Hash + func (h *Header) GetUncleHash() *Hash + func (h *Header) String() string + type Headers struct + func (h *Headers) Get(index int) (header *Header, _ error) + func (h *Headers) Size() int + type Interface struct + func NewInterface() *Interface + func (i *Interface) GetAddress() *Address + func (i *Interface) GetAddresses() *Addresses + func (i *Interface) GetBigInt() *BigInt + func (i *Interface) GetBigInts() *BigInts + func (i *Interface) GetBinaries() *Binaries + func (i *Interface) GetBinary() []byte + func (i *Interface) GetBool() bool + func (i *Interface) GetBools() *Bools + func (i *Interface) GetHash() *Hash + func (i *Interface) GetHashes() *Hashes + func (i *Interface) GetInt16() int16 + func (i *Interface) GetInt16s() *BigInts + func (i *Interface) GetInt32() int32 + func (i *Interface) GetInt32s() *BigInts + func (i *Interface) GetInt64() int64 + func (i *Interface) GetInt64s() *BigInts + func (i *Interface) GetInt8() int8 + func (i *Interface) GetInt8s() *BigInts + func (i *Interface) GetString() string + func (i *Interface) GetStrings() *Strings + func (i *Interface) GetUint16() *BigInt + func (i *Interface) GetUint16s() *BigInts + func (i *Interface) GetUint32() *BigInt + func (i *Interface) GetUint32s() *BigInts + func (i *Interface) GetUint64() *BigInt + func (i *Interface) GetUint64s() *BigInts + func (i *Interface) GetUint8() *BigInt + func (i *Interface) GetUint8s() *BigInts + func (i *Interface) SetAddress(address *Address) + func (i *Interface) SetAddresses(addrs *Addresses) + func (i *Interface) SetBigInt(bigint *BigInt) + func (i *Interface) SetBigInts(bigints *BigInts) + func (i *Interface) SetBinaries(binaries *Binaries) + func (i *Interface) SetBinary(binary []byte) + func (i *Interface) SetBool(b bool) + func (i *Interface) SetBools(bs *Bools) + func (i *Interface) SetDefaultAddress() + func (i *Interface) SetDefaultAddresses() + func (i *Interface) SetDefaultBigInt() + func (i *Interface) SetDefaultBigInts() + func (i *Interface) SetDefaultBinaries() + func (i *Interface) SetDefaultBinary() + func (i *Interface) SetDefaultBool() + func (i *Interface) SetDefaultBools() + func (i *Interface) SetDefaultHash() + func (i *Interface) SetDefaultHashes() + func (i *Interface) SetDefaultInt16() + func (i *Interface) SetDefaultInt16s() + func (i *Interface) SetDefaultInt32() + func (i *Interface) SetDefaultInt32s() + func (i *Interface) SetDefaultInt64() + func (i *Interface) SetDefaultInt64s() + func (i *Interface) SetDefaultInt8() + func (i *Interface) SetDefaultInt8s() + func (i *Interface) SetDefaultString() + func (i *Interface) SetDefaultStrings() + func (i *Interface) SetDefaultUint16() + func (i *Interface) SetDefaultUint16s() + func (i *Interface) SetDefaultUint32() + func (i *Interface) SetDefaultUint32s() + func (i *Interface) SetDefaultUint64() + func (i *Interface) SetDefaultUint64s() + func (i *Interface) SetDefaultUint8() + func (i *Interface) SetDefaultUint8s() + func (i *Interface) SetHash(hash *Hash) + func (i *Interface) SetHashes(hashes *Hashes) + func (i *Interface) SetInt16(n int16) + func (i *Interface) SetInt16s(bigints *BigInts) + func (i *Interface) SetInt32(n int32) + func (i *Interface) SetInt32s(bigints *BigInts) + func (i *Interface) SetInt64(n int64) + func (i *Interface) SetInt64s(bigints *BigInts) + func (i *Interface) SetInt8(n int8) + func (i *Interface) SetInt8s(bigints *BigInts) + func (i *Interface) SetString(str string) + func (i *Interface) SetStrings(strs *Strings) + func (i *Interface) SetUint16(bigint *BigInt) + func (i *Interface) SetUint16s(bigints *BigInts) + func (i *Interface) SetUint32(bigint *BigInt) + func (i *Interface) SetUint32s(bigints *BigInts) + func (i *Interface) SetUint64(bigint *BigInt) + func (i *Interface) SetUint64s(bigints *BigInts) + func (i *Interface) SetUint8(bigint *BigInt) + func (i *Interface) SetUint8s(bigints *BigInts) + type Interfaces struct + func NewInterfaces(size int) *Interfaces + func (i *Interfaces) Get(index int) (iface *Interface, _ error) + func (i *Interfaces) Set(index int, object *Interface) error + func (i *Interfaces) Size() int + type KeyStore struct + func NewKeyStore(keydir string, scryptN, scryptP int) *KeyStore + func (ks *KeyStore) DeleteAccount(account *Account, passphrase string) error + func (ks *KeyStore) ExportKey(account *Account, passphrase, newPassphrase string) (key []byte, _ error) + func (ks *KeyStore) GetAccounts() *Accounts + func (ks *KeyStore) HasAddress(address *Address) bool + func (ks *KeyStore) ImportECDSAKey(key []byte, passphrase string) (account *Account, _ error) + func (ks *KeyStore) ImportKey(keyJSON []byte, passphrase, newPassphrase string) (account *Account, _ error) + func (ks *KeyStore) ImportPreSaleKey(keyJSON []byte, passphrase string) (ccount *Account, _ error) + func (ks *KeyStore) Lock(address *Address) error + func (ks *KeyStore) NewAccount(passphrase string) (*Account, error) + func (ks *KeyStore) SignHash(address *Address, hash []byte) (signature []byte, _ error) + func (ks *KeyStore) SignHashPassphrase(account *Account, passphrase string, hash []byte) (signature []byte, _ error) + func (ks *KeyStore) SignTx(account *Account, tx *Transaction, chainID *BigInt) (*Transaction, error) + func (ks *KeyStore) SignTxPassphrase(account *Account, passphrase string, tx *Transaction, chainID *BigInt) (*Transaction, error) + func (ks *KeyStore) TimedUnlock(account *Account, passphrase string, timeout int64) error + func (ks *KeyStore) Unlock(account *Account, passphrase string) error + func (ks *KeyStore) UpdateAccount(account *Account, passphrase, newPassphrase string) error + type Log struct + func (l *Log) GetAddress() *Address + func (l *Log) GetBlockHash() *Hash + func (l *Log) GetBlockNumber() int64 + func (l *Log) GetData() []byte + func (l *Log) GetIndex() int + func (l *Log) GetTopics() *Hashes + func (l *Log) GetTxHash() *Hash + func (l *Log) GetTxIndex() int + type Logs struct + func (l *Logs) Get(index int) (log *Log, _ error) + func (l *Logs) Size() int + type MobileSigner struct + func (s *MobileSigner) Sign(addr *Address, unsignedTx *Transaction) (signedTx *Transaction, _ error) + type NewHeadHandler interface + OnError func(failure string) + OnNewHead func(header *Header) + type Node struct + func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) + func (n *Node) Close() error + func (n *Node) GetEthereumClient() (client *EthereumClient, _ error) + func (n *Node) GetNodeInfo() *NodeInfo + func (n *Node) GetPeersInfo() *PeerInfos + func (n *Node) Start() error + func (n *Node) Stop() error + type NodeConfig struct + BootstrapNodes *Enodes + EthereumDatabaseCache int + EthereumEnabled bool + EthereumGenesis string + EthereumNetStats string + EthereumNetworkID int64 + MaxPeers int + PprofAddress string + func NewNodeConfig() *NodeConfig + func (conf *NodeConfig) AddBootstrapNode(node *Enode) + func (conf *NodeConfig) EncodeJSON() (string, error) + func (conf *NodeConfig) String() string + type NodeInfo struct + func (ni *NodeInfo) GetDiscoveryPort() int + func (ni *NodeInfo) GetEnode() string + func (ni *NodeInfo) GetID() string + func (ni *NodeInfo) GetIP() string + func (ni *NodeInfo) GetListenerAddress() string + func (ni *NodeInfo) GetListenerPort() int + func (ni *NodeInfo) GetName() string + func (ni *NodeInfo) GetProtocols() *Strings + type Nonce struct + func (n *Nonce) GetBytes() []byte + func (n *Nonce) GetHex() string + func (n *Nonce) String() string + type PeerInfo struct + func (pi *PeerInfo) GetCaps() *Strings + func (pi *PeerInfo) GetID() string + func (pi *PeerInfo) GetLocalAddress() string + func (pi *PeerInfo) GetName() string + func (pi *PeerInfo) GetRemoteAddress() string + type PeerInfos struct + func (pi *PeerInfos) Get(index int) (info *PeerInfo, _ error) + func (pi *PeerInfos) Size() int + type Receipt struct + func NewReceiptFromJSON(data string) (*Receipt, error) + func NewReceiptFromRLP(data []byte) (*Receipt, error) + func (r *Receipt) EncodeJSON() (string, error) + func (r *Receipt) EncodeRLP() ([]byte, error) + func (r *Receipt) GetBloom() *Bloom + func (r *Receipt) GetContractAddress() *Address + func (r *Receipt) GetCumulativeGasUsed() int64 + func (r *Receipt) GetGasUsed() int64 + func (r *Receipt) GetLogs() *Logs + func (r *Receipt) GetPostState() []byte + func (r *Receipt) GetStatus() int + func (r *Receipt) GetTxHash() *Hash + func (r *Receipt) String() string + type Signer interface + Sign func(addr *Address, unsignedTx *Transaction) (tx *Transaction, _ error) + type Strings struct + func (s *Strings) Get(index int) (str string, _ error) + func (s *Strings) Set(index int, str string) error + func (s *Strings) Size() int + func (s *Strings) String() string + type Subscription struct + func (s *Subscription) Unsubscribe() + type SyncProgress struct + func (p *SyncProgress) GetCurrentBlock() int64 + func (p *SyncProgress) GetHighestBlock() int64 + func (p *SyncProgress) GetKnownStates() int64 + func (p *SyncProgress) GetPulledStates() int64 + func (p *SyncProgress) GetStartingBlock() int64 + type Topics struct + func NewTopics(size int) *Topics + func NewTopicsEmpty() *Topics + func (t *Topics) Append(topics *Hashes) + func (t *Topics) Get(index int) (hashes *Hashes, _ error) + func (t *Topics) Set(index int, topics *Hashes) error + func (t *Topics) Size() int + type TransactOpts struct + func NewKeyedTransactOpts(keyJson []byte, passphrase string, chainID *big.Int) (*TransactOpts, error) + func NewTransactOpts() *TransactOpts + func (opts *TransactOpts) GetFrom() *Address + func (opts *TransactOpts) GetGasLimit() int64 + func (opts *TransactOpts) GetGasPrice() *BigInt + func (opts *TransactOpts) GetNonce() int64 + func (opts *TransactOpts) GetValue() *BigInt + func (opts *TransactOpts) SetContext(context *Context) + func (opts *TransactOpts) SetFrom(from *Address) + func (opts *TransactOpts) SetGasLimit(limit int64) + func (opts *TransactOpts) SetGasPrice(price *BigInt) + func (opts *TransactOpts) SetNonce(nonce int64) + func (opts *TransactOpts) SetSigner(s Signer) + func (opts *TransactOpts) SetValue(value *BigInt) + type Transaction struct + func NewContractCreation(nonce int64, amount *BigInt, gasLimit int64, gasPrice *BigInt, data []byte) *Transaction + func NewTransaction(nonce int64, to *Address, amount *BigInt, gasLimit int64, gasPrice *BigInt, ...) *Transaction + func NewTransactionFromJSON(data string) (*Transaction, error) + func NewTransactionFromRLP(data []byte) (*Transaction, error) + func (tx *Transaction) EncodeJSON() (string, error) + func (tx *Transaction) EncodeRLP() ([]byte, error) + func (tx *Transaction) GetCost() *BigInt + func (tx *Transaction) GetData() []byte + func (tx *Transaction) GetFrom(chainID *BigInt) (address *Address, _ error) + func (tx *Transaction) GetGas() int64 + func (tx *Transaction) GetGasPrice() *BigInt + func (tx *Transaction) GetHash() *Hash + func (tx *Transaction) GetNonce() int64 + func (tx *Transaction) GetSigHash() *Hash + func (tx *Transaction) GetTo() *Address + func (tx *Transaction) GetValue() *BigInt + func (tx *Transaction) String() string + func (tx *Transaction) WithSignature(sig []byte, chainID *BigInt) (signedTx *Transaction, _ error) + type Transactions struct + func (txs *Transactions) Get(index int) (tx *Transaction, _ error) + func (txs *Transactions) Size() int