client

package
v0.0.0-...-40c4472 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	IP:             "localhost",
	HttpPort:       "22000",
	WsPort:         "32000",
	AddressPath:    "",
	PrivateKeyPath: "",
}

Functions

This section is empty.

Types

type Api

type Api interface {
	Deposit(amount *big.Int) error
	Withdraw(amount *big.Int) error
	Transfer(receiver string, amount *big.Int) error
	GetBalance(accountAddress *string) (*big.Int, error)
}

type Client

type Client struct {
	Api
	// contains filtered or unexported fields
}

func NewClient

func NewClient(db repository.Repo, ctx context.Context) *Client

func (*Client) Deposit

func (c *Client) Deposit(amount *big.Int) error

func (*Client) GetBalance

func (c *Client) GetBalance(accountAddress *string) (*big.Int, error)

func (*Client) NewTxOpts

func (c *Client) NewTxOpts() (*bind.TransactOpts, error)

func (*Client) Prepare

func (c *Client) Prepare(cfg *Config) (err error)

func (*Client) Transfer

func (c *Client) Transfer(receiver string, amount *big.Int) error

func (*Client) Withdraw

func (c *Client) Withdraw(amount *big.Int) error

type Config

type Config struct {
	IP             string `yaml:"ip"`
	HttpPort       string `yaml:"http_port"`
	WsPort         string `yaml:"ws_port"`
	AddressPath    string `yaml:"address_path"`
	PrivateKeyPath string `yaml:"private_key_path"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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