contract

package
v0.0.0-...-18d23c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2021 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

func NewContract(addr web3.Address, abi *abi.ABI, provider *jsonrpc.Client) *Contract

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

func (c *Contract) EstimateGas(method string, args ...interface{}) (uint64, error)

EstimateGas estimates the gas for a contract call

func (*Contract) Event

func (c *Contract) Event(name string) (*Event, bool)

Event returns a specific event

func (*Contract) SetFrom

func (c *Contract) SetFrom(addr web3.Address)

SetFrom sets the origin of the calls

func (*Contract) Txn

func (c *Contract) Txn(method string, args ...interface{}) *Txn

Txn creates a new transaction object

type Event

type Event struct {
	// contains filtered or unexported fields
}

Event is a solidity event

func (*Event) Encode

func (e *Event) Encode() web3.Hash

Encode encodes an event

func (*Event) ParseLog

func (e *Event) ParseLog(log *web3.Log) (map[string]interface{}, error)

ParseLog parses a log

type NodeProvider

type NodeProvider interface {
}

NodeProvider handles the interactions with the Ethereum 1x node

type Txn

type Txn struct {
	// contains filtered or unexported fields
}

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) AddArgs

func (t *Txn) AddArgs(args ...interface{}) *Txn

AddArgs is used to set the arguments of the transaction

func (*Txn) Do

func (t *Txn) Do() error

Do sends the transaction to the network

func (*Txn) DoAndWait

func (t *Txn) DoAndWait() error

DoAndWait is a blocking query that combines both Do and Wait functions

func (*Txn) EstimateGas

func (t *Txn) EstimateGas() (uint64, error)

EstimateGas estimates the gas for the call

func (*Txn) Receipt

func (t *Txn) Receipt() *web3.Receipt

Receipt returns the receipt of the transaction after wait

func (*Txn) SetGasLimit

func (t *Txn) SetGasLimit(gasLimit uint64) *Txn

SetGasLimit sets the gas limit of the transaction

func (*Txn) SetGasPrice

func (t *Txn) SetGasPrice(gasPrice uint64) *Txn

SetGasPrice sets the gas price of the transaction

func (*Txn) SetValue

func (t *Txn) SetValue(v *big.Int) *Txn

SetValue sets the value for the txn

func (*Txn) Validate

func (t *Txn) Validate() error

Validate validates the arguments of the transaction

func (*Txn) Wait

func (t *Txn) Wait() error

Wait waits till the transaction is mined

Directories

Path Synopsis
builtin
ens

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL