v0.8.2 Latest Latest

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0



package client provides API for communication with an Ethereum blockchain.



This section is empty.


This section is empty.


This section is empty.


type Client

type Client struct {
	// contains filtered or unexported fields

Client defines necessary attributes for establishing communication with an Ethereum blockchain and for performing functions required by the Nym system.

func New

func New(cfg Config) (*Client, error)

func (*Client) GetTransactionStatus

func (c *Client) GetTransactionStatus(ctx context.Context, txHash []byte)

used to get status of transaction, pending, accepted, rejected, etc

func (*Client) QueryERC20Balance

func (c *Client) QueryERC20Balance(ctx context.Context, address common.Address, pending bool) (*big.Int, error)

pending is used to decide whether to query pending balance

func (*Client) TransferERC20Tokens

func (c *Client) TransferERC20Tokens(ctx context.Context,
	amount int64,
	targetAddress common.Address,
) error

TODO: rewrite to use token instance similarly to Balance query? TransferERC20Tokens sends specified amount of ERC20 tokens to given account.

type Config

type Config struct {
	// contains filtered or unexported fields

Config defines configuration for Ethereum Client. TODO: if expands too much, move it to a toml file? Or just include it in new section of existing Client toml.

func NewConfig

func NewConfig(pk *ecdsa.PrivateKey, node string, erc20, pipeAccount common.Address, logger *logger.Logger) Config

NewConfig creates new instance of Config struct.

Jump to

Keyboard shortcuts

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