eth

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshallSolcAbiJson

func UnmarshallSolcAbiJson(jsonReader io.Reader) (*abi.ABI, []byte, error)

Types

type Client

type Client interface {
	WaitReceipt(txid common.Hash) (*types.Receipt, error)
	SendTransaction(to *common.Address, value *big.Int, gasLimit uint64, calldata []byte) (*types.Transaction, error)
	Call(to *common.Address, value *big.Int, calldata []byte) ([]byte, error)
	Sign(data ...[]byte) ([3][32]byte, error)
	NetworkID() (*big.Int, error)
	CodeAt(addr common.Address) ([]byte, error)
	BalanceAt(addr common.Address) (*big.Int, error)
}

type Client2 added in v0.0.6

type Client2 struct {
	ReceiptTimeout time.Duration
	// contains filtered or unexported fields
}

func NewClient2 added in v0.0.6

func NewClient2(client *ethclient.Client, account *accounts.Account, ks *ethkeystore.KeyStore) *Client2

func (*Client2) Call added in v0.0.6

func (c *Client2) Call(fn func(*ethclient.Client) error) error

func (*Client2) CallAuth added in v0.0.6

func (*Client2) WaitReceipt added in v0.0.6

func (c *Client2) WaitReceipt(tx *types.Transaction) (*types.Receipt, error)

type Contract

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

func NewContract

func NewContract(client Client, abi *abi.ABI, byteCode []byte, address *common.Address) *Contract

NewContract initiates a contract ABI & bytecode from json file associated to a web3 client

func NewContractFromJson

func NewContractFromJson(client Client, solcjson io.Reader, address *common.Address) (*Contract, error)

NewContractFromJson initiates a contract ABI & bytecode from json file associated to a web3 client

func (*Contract) Abi

func (c *Contract) Abi() *abi.ABI

func (*Contract) Address

func (c *Contract) Address() *common.Address

func (*Contract) At

func (c *Contract) At(address *common.Address) *Contract

func (*Contract) ByteCode

func (c *Contract) ByteCode() []byte

func (*Contract) Call

func (c *Contract) Call(ret interface{}, funcname string, params ...interface{}) error

Call an constant method

func (*Contract) Client

func (c *Contract) Client() Client

func (*Contract) Conterfactual

func (c *Contract) Conterfactual(gasLimit uint64, gasPrice *big.Int, params ...interface{}) (creator, contract common.Address, rawtx []byte, err error)

func (*Contract) CreationBytes

func (c *Contract) CreationBytes(params ...interface{}) ([]byte, error)

func (*Contract) DeploySync

func (c *Contract) DeploySync(params ...interface{}) (*types.Transaction, *types.Receipt, error)

Deploy the contract

func (*Contract) SendTransaction

func (c *Contract) SendTransaction(value *big.Int, gasLimit uint64, funcname string, params ...interface{}) (*types.Transaction, error)

SendTransaction executes a contract method and wait it finalizes

func (*Contract) VerifyBytecode

func (c *Contract) VerifyBytecode() error

VerifyBytecode verifies is the bytecode is the same than the JSON

type Web3Client

type Web3Client struct {
	ReceiptTimeout time.Duration
	MaxGasPrice    uint64
	// contains filtered or unexported fields
}

Web3Client defines a connection to a client via websockets

func NewWeb3Client

func NewWeb3Client(rpcURL string, ks *keystore.KeyStore, account *accounts.Account) (*Web3Client, error)

NewWeb3Client creates a client, using a keystore and an account for transactions

func (*Web3Client) Account

func (c *Web3Client) Account() *accounts.Account

func (*Web3Client) BalanceAt

func (c *Web3Client) BalanceAt(addr common.Address) (*big.Int, error)

BalanceAt retieves information about the default account

func (*Web3Client) Call

func (c *Web3Client) Call(to *common.Address, value *big.Int, calldata []byte) ([]byte, error)

Call a constant method

func (*Web3Client) CodeAt

func (c *Web3Client) CodeAt(addr common.Address) ([]byte, error)

func (*Web3Client) KeyStore

func (c *Web3Client) KeyStore() *keystore.KeyStore

func (*Web3Client) NetworkID

func (c *Web3Client) NetworkID() (*big.Int, error)

func (*Web3Client) SendTransaction

func (c *Web3Client) SendTransaction(to *common.Address, value *big.Int, gasLimit uint64, calldata []byte) (*types.Transaction, error)

SendTransaction executes a contract method and wait it finalizes

func (*Web3Client) Sign

func (c *Web3Client) Sign(data ...[]byte) ([3][32]byte, error)

Sign does a web3 signature

func (*Web3Client) WaitReceipt

func (c *Web3Client) WaitReceipt(txid common.Hash) (*types.Receipt, error)

Jump to

Keyboard shortcuts

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