Documentation
¶
Index ¶
- type Contract
- func (c *Contract) ABI() *abi.ABI
- func (c *Contract) Addr() web3.Address
- func (c *Contract) Call(method string, block web3.BlockNumber, args ...interface{}) (map[string]interface{}, error)
- func (c *Contract) EstimateGas(method string, args ...interface{}) (uint64, error)
- func (c *Contract) Event(name string) (*Event, bool)
- func (c *Contract) SetFrom(addr web3.Address)
- func (c *Contract) Txn(method string, args ...interface{}) *Txn
- type Event
- type NodeProvider
- type Txn
- func (t *Txn) AddArgs(args ...interface{}) *Txn
- func (t *Txn) ConvertToWeb3Transaction() (*web3.Transaction, error)
- func (t *Txn) EstimateGas() (uint64, error)
- func (t *Txn) GetReceipt() *web3.Receipt
- func (t *Txn) SetGasLimit(gasLimit uint64) *Txn
- func (t *Txn) SetGasPrice(gasPrice uint64) *Txn
- func (t *Txn) SetValue(v *big.Int) *Txn
- func (t *Txn) SignAndSend(key *wallet.Key, chainID uint64) error
- func (t *Txn) SignSendAndWait(key *wallet.Key, chainID uint64) error
- func (t *Txn) Validate() error
- func (t *Txn) Wait() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
Contract is an Ethereum contract
func NewContract ¶
NewContract creates a new contract instance
func (*Contract) Addr ¶
func (c *Contract) Addr() web3.Address
Addr returns the address of the contract
func (*Contract) Call ¶
func (c *Contract) Call(method string, block web3.BlockNumber, args ...interface{}) (map[string]interface{}, error)
Call calls a method in the contract
func (*Contract) EstimateGas ¶
EstimateGas estimates the gas for a contract call
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is a solidity event
type NodeProvider ¶
type NodeProvider interface { }
NodeProvider handles the interactions with the Ethereum 1x node
type Txn ¶
type Txn struct { From web3.Address Addr *web3.Address Provider *jsonrpc.Client Method *abi.Method Args []interface{} Data []byte Bin []byte GasLimit uint64 GasPrice uint64 Value *big.Int Hash web3.Hash Receipt *web3.Receipt }
Txn is a transaction object
func DeployContract ¶
func DeployContract(provider *jsonrpc.Client, from web3.Address, abi *abi.ABI, bin []byte, args ...interface{}) *Txn
DeployContract deploys a contract
func (*Txn) ConvertToWeb3Transaction ¶
func (*Txn) EstimateGas ¶
EstimateGas estimates the gas for the call
func (*Txn) GetReceipt ¶
func (t *Txn) GetReceipt() *web3.Receipt
Receipt returns the receipt of the transaction after wait
func (*Txn) SetGasLimit ¶
SetGasLimit sets the gas limit of the transaction
func (*Txn) SetGasPrice ¶
SetGasPrice sets the gas price of the transaction
func (*Txn) SignAndSend ¶
Signs and sends the transaction to the network
func (*Txn) SignSendAndWait ¶
SignSendAndWait is a blocking query that combines both SignAndSend and Wait functions