Documentation
¶
Index ¶
- func NewAbi(s string) *abi.ABI
- func NewCli(url string) *jsonrpc.Client
- type LoadWrapper
- type MyContract
- func (d *MyContract) Call(method string, param ...interface{}) (interface{}, error)
- func (d *MyContract) GetHistoryLogs(start, step int64, wrapper LoadWrapper, name ...interface{})
- func (d *MyContract) GetLogs(wrapper LoadWrapper, name ...interface{})
- func (d *MyContract) NewFilter(name ...interface{}) *web3.LogFilter
- func (d *MyContract) NowBlock() web3.BlockNumber
- func (d *MyContract) ParseLogWithWrapper(l *web3.Log, wrapper LoadWrapper, name ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoadWrapper ¶
type MyContract ¶
type MyContract struct { Addr string Contract *contract.Contract Cli *jsonrpc.Client TimeDuration int64 // after some time do it }
func NewContract ¶
func NewContract(addr, abiStr, rpc string) *MyContract
`NewContract` takes an address, an ABI string, and a data struct, and returns a `MyContract` struct
Args:
addr (string): The address of the contract abiStr (string): The ABI of the contract.
func (*MyContract) Call ¶
func (d *MyContract) Call(method string, param ...interface{}) (interface{}, error)
A function that is used to call the contract method.
func (*MyContract) GetHistoryLogs ¶
func (d *MyContract) GetHistoryLogs(start, step int64, wrapper LoadWrapper, name ...interface{})
The above code is a function that is used to get the history logs of a contract.
func (*MyContract) GetLogs ¶
func (d *MyContract) GetLogs(wrapper LoadWrapper, name ...interface{})
The above code is a Go function that is used to get the logs of a contract.
func (*MyContract) NewFilter ¶
func (d *MyContract) NewFilter(name ...interface{}) *web3.LogFilter
Creating a filter for the contract events.
func (*MyContract) NowBlock ¶
func (d *MyContract) NowBlock() web3.BlockNumber
It returns the current block number
func (*MyContract) ParseLogWithWrapper ¶
func (d *MyContract) ParseLogWithWrapper(l *web3.Log, wrapper LoadWrapper, name ...interface{})
A function that is used to parse the logs of a contract.
Click to show internal directories.
Click to hide internal directories.