client

package
v0.0.0-...-ad1ab37 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api interface {
	SendTransaction(quantity *big.Int, fromPk *ecdsa.PrivateKey, to, token common.Address) (*types.Transaction, error)
	CheckBalance(address, token common.Address) (*BalanceResponse, error)
	CheckBalances(addresses []common.Address, token common.Address) (*BalancesResponse, error)
}

func NewApiImplementation

func NewApiImplementation(client *ethclient.Client) Api

func SafeNewApiImplementation

func SafeNewApiImplementation(client *ethclient.Client) (Api, error)

type BalanceResponse

type BalanceResponse struct {
	Balance *big.Int `json:"balance"`
	Error   error    `json:"error"`
}

type BalancesResponse

type BalancesResponse struct {
	Processed map[common.Address]*BalanceResponse `json:"processed"`
}

type MockApi

type MockApi struct {
	mock.Mock
}

func (*MockApi) CheckBalance

func (api *MockApi) CheckBalance(
	address, token common.Address,
) (
	resp *BalanceResponse,
	err error,
)

func (*MockApi) CheckBalances

func (api *MockApi) CheckBalances(
	address []common.Address, token common.Address,
) (
	resp *BalancesResponse,
	err error,
)

func (*MockApi) SendTransaction

func (api *MockApi) SendTransaction(
	quantity *big.Int,
	fromPk *ecdsa.PrivateKey,
	to,
	token common.Address,
) (
	resp *types.Transaction,
	err error,
)

type Resources

type Resources struct {
	API Api
}

type Service

type Service interface {
	SendTransaction(quantity *big.Int, fromPk *ecdsa.PrivateKey, to, token common.Address) (*types.Transaction, error)
	CheckBalance(address, token common.Address) (*BalanceResponse, error)
	CheckBalances(addresses []common.Address, token common.Address) (*BalancesResponse, error)
}

func NewService

func NewService(res *Resources) Service

Jump to

Keyboard shortcuts

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