Documentation
¶
Index ¶
- func UnmarshallSolcAbiJson(jsonReader io.Reader) (*abi.ABI, []byte, error)
- type Client
- type Client2
- type Contract
- func (c *Contract) Abi() *abi.ABI
- func (c *Contract) Address() *common.Address
- func (c *Contract) At(address *common.Address) *Contract
- func (c *Contract) ByteCode() []byte
- func (c *Contract) Call(ret interface{}, funcname string, params ...interface{}) error
- func (c *Contract) Client() Client
- func (c *Contract) Conterfactual(gasLimit uint64, gasPrice *big.Int, params ...interface{}) (creator, contract common.Address, rawtx []byte, err error)
- func (c *Contract) CreationBytes(params ...interface{}) ([]byte, error)
- func (c *Contract) DeploySync(params ...interface{}) (*types.Transaction, *types.Receipt, error)
- func (c *Contract) SendTransaction(value *big.Int, gasLimit uint64, funcname string, params ...interface{}) (*types.Transaction, error)
- func (c *Contract) VerifyBytecode() error
- type Web3Client
- func (c *Web3Client) Account() *accounts.Account
- func (c *Web3Client) BalanceAt(addr common.Address) (*big.Int, error)
- func (c *Web3Client) Call(to *common.Address, value *big.Int, calldata []byte) ([]byte, error)
- func (c *Web3Client) CodeAt(addr common.Address) ([]byte, error)
- func (c *Web3Client) KeyStore() *keystore.KeyStore
- func (c *Web3Client) NetworkID() (*big.Int, error)
- func (c *Web3Client) SendTransaction(to *common.Address, value *big.Int, gasLimit uint64, calldata []byte) (*types.Transaction, error)
- func (c *Web3Client) Sign(data ...[]byte) ([3][32]byte, error)
- func (c *Web3Client) WaitReceipt(txid common.Hash) (*types.Receipt, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
func NewClient2 ¶ added in v0.0.6
func (*Client2) CallAuth ¶ added in v0.0.6
func (c *Client2) CallAuth(fn func(*ethclient.Client, *bind.TransactOpts) (*types.Transaction, error)) (*types.Transaction, error)
func (*Client2) WaitReceipt ¶ added in v0.0.6
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
func NewContract ¶
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) Conterfactual ¶
func (*Contract) CreationBytes ¶
func (*Contract) DeploySync ¶
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 ¶
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) KeyStore ¶
func (c *Web3Client) KeyStore() *keystore.KeyStore
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 ¶
Click to show internal directories.
Click to hide internal directories.