Documentation ¶
Index ¶
- func MakeTopics(query ...[]interface{}) ([][]web3.Hash, error)
- type Contract
- 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) FilterLogs(opts *web3.FilterOpts, name string, query ...[]interface{}) ([]*web3.Log, error)
- func (c *Contract) FilterLogsWithTopic(topics [][]web3.Hash, startBlock uint64, endBlock ...uint64) ([]*web3.Log, error)
- func (c *Contract) SetFrom(addr web3.Address)
- func (c *Contract) Txn(method string, args ...interface{}) *Txn
- type SignedTx
- type Signer
- func (self *Signer) ExecuteTxn(tx *web3.Transaction) (*web3.ExecutionResult, *web3.Receipt)
- func (e *Signer) GetNonce(blockNumber web3.BlockNumber) (uint64, error)
- func (self *Signer) SendTransaction(tx *web3.Transaction) *web3.Receipt
- func (self *Signer) SignTx(tx *web3.Transaction) *web3.Transaction
- func (self *Signer) TransferEther(to web3.Address, value *big.Int, msg string) *web3.Transaction
- func (self *Signer) WaitTx(hs web3.Hash) *web3.Receipt
- type Txn
- func (t *Txn) Do() error
- func (t *Txn) DoAndWait() (*web3.Receipt, error)
- func (t *Txn) EstimateGas() (uint64, error)
- func (t *Txn) MustToTransaction() *web3.Transaction
- func (t *Txn) SetGasLimit(gasLimit uint64) *Txn
- func (t *Txn) SetGasPrice(gasPrice uint64) *Txn
- func (t *Txn) SetNonce(nonce uint64) *Txn
- func (t *Txn) SetValue(v *big.Int) *Txn
- func (t *Txn) Sign(signer *Signer) *SignedTx
- func (t *Txn) ToTransaction() (*web3.Transaction, error)
- func (t *Txn) Wait() (receipt *web3.Receipt, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeTopics ¶
MakeTopics converts a filter query argument list into a filter topic set.
Types ¶
type Contract ¶
type Contract struct { Abi *abi.ABI Provider *jsonrpc.Client // contains filtered or unexported fields }
Contract is an Ethereum contract
func NewContract ¶
NewContract creates a new contract instance
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
func (*Contract) FilterLogs ¶
func (*Contract) FilterLogsWithTopic ¶ added in v0.1.2
type SignedTx ¶
type SignedTx struct {
*web3.Transaction
}
type Signer ¶
type Signer struct { *wallet.Key *jsonrpc.Client Executor *executor.Executor Submit bool Nonce uint64 // only used when in simulate mode // contains filtered or unexported fields }
func (*Signer) ExecuteTxn ¶
func (self *Signer) ExecuteTxn(tx *web3.Transaction) (*web3.ExecutionResult, *web3.Receipt)
func (*Signer) SendTransaction ¶
func (self *Signer) SendTransaction(tx *web3.Transaction) *web3.Receipt
func (*Signer) SignTx ¶
func (self *Signer) SignTx(tx *web3.Transaction) *web3.Transaction
func (*Signer) TransferEther ¶
type Txn ¶
type Txn struct { Data []byte // contains filtered or unexported fields }
Txn is a transaction object
func DeployContract ¶
func DeployContract(provider *jsonrpc.Client, from web3.Address, abiVal *abi.ABI, bin []byte, args ...interface{}) *Txn
DeployContract deploys a contract
func (*Txn) EstimateGas ¶
EstimateGas estimates the gas for the call
func (*Txn) MustToTransaction ¶
func (t *Txn) MustToTransaction() *web3.Transaction
func (*Txn) SetGasLimit ¶
SetGasLimit sets the gas limit of the transaction
func (*Txn) SetGasPrice ¶
SetGasPrice sets the gas price of the transaction
func (*Txn) ToTransaction ¶
func (t *Txn) ToTransaction() (*web3.Transaction, error)
Click to show internal directories.
Click to hide internal directories.