connection

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransactor

func NewTransactor(keyFile string, password string) (*bind.TransactOpts, error)

NewTransactor returns a new transactor for the given keyFile.

func SetNextNonce

func SetNextNonce(client *ethclient.Client, opts *bind.TransactOpts) error

SetNextNonce sets the next nonce of the transactor address.

Types

type Connection

type Connection struct {
	*ethclient.Client

	Opts     *bind.TransactOpts
	KeyStore *keystore.KeyStore
	// contains filtered or unexported fields
}

Connection wraps 'etherclient.Client' to hold transactor options and a key-store.

func New

func New(url string) (*Connection, error)

New creates a new connection

func NewForKey

func NewForKey(url, keyFile, password string) (*Connection, error)

NewForKey creates a new connection using the given key-store file and password.

func NewForKeyStore

func NewForKeyStore(url, keystorePath string, a common.Address, password string) (*Connection, error)

NewForKeyStore creates a new connection using the given key-store and password.

func (*Connection) RawCall added in v0.0.3

func (c *Connection) RawCall(result interface{}, method string, args ...interface{}) error

RawCall performs a JSON-RPC call against the underlying RPC connection

func (*Connection) RawCallContext added in v0.0.3

func (c *Connection) RawCallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error

RawCall performs a JSON-RPC call against the underlying RPC connection, using the given context

func (*Connection) SetGasPrice

func (c *Connection) SetGasPrice(wei *big.Int)

SetGasPrice

func (*Connection) SetKeyStore

func (c *Connection) SetKeyStore(keystorePath string) error

SetKeyStore sets the connections keystore to the path provided.

func (*Connection) SetNextNonce

func (c *Connection) SetNextNonce() error

SetNextNonce sets nonce to the next available for the transactor's address.

func (*Connection) SetNonce

func (c *Connection) SetNonce(nonce uint64)

SetNonce sets the nonce to the provided value. This can be used to replay a stuck transaction.

func (*Connection) SetSuggestedGasPrice

func (c *Connection) SetSuggestedGasPrice() error

SetSuggestedGasPrice sets the suggested gas price of the connection.

func (*Connection) SetTransactor

func (c *Connection) SetTransactor(keyPath, password string) error

SetTransactor sets the connections transactor to that of the given keyFile.

func (*Connection) SetTransactorFromKeyStore

func (c *Connection) SetTransactorFromKeyStore(a common.Address, password string) error

SetTransactorFromKeyStore sets the connections transactor to the address within the key-tore.

Jump to

Keyboard shortcuts

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