ethutils

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllEvents                    = "*"
	DefaultInitialCallPastBlocks = 128
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ERC20Token

type ERC20Token struct {
	*IERC20.IERC20
	HexAddress string
}

func (*ERC20Token) BalanceOf

func (t *ERC20Token) BalanceOf(hexAddress string) (*big.Int, error)

type EthCall added in v0.11.0

type EthCall struct {
	// contains filtered or unexported fields
}

func NewEthCall added in v0.11.0

func NewEthCall(
	id string,
	abiDefinition string,
	address string,
	methodName string,
	args []interface{},
	outputIndex int,
	transformOutput string,
) (*EthCall, error)

func NewEthCallFromConfig added in v0.11.0

func NewEthCallFromConfig(cfg config.EthCall) (*EthCall, error)

func (*EthCall) Call added in v0.11.0

func (ec *EthCall) Call(ctx context.Context, client *ethclient.Client) (interface{}, error)

func (EthCall) ContractAddress added in v0.11.0

func (ec EthCall) ContractAddress() common.Address

func (EthCall) ID added in v0.11.0

func (ec EthCall) ID() string

func (EthCall) MethodName added in v0.11.0

func (ec EthCall) MethodName() string

type EthClient

type EthClient struct {
	// contains filtered or unexported fields
}

func NewEthClient

func NewEthClient(rpcAddress string, log *logging.Logger) (*EthClient, error)

func (*EthClient) BalanceAt added in v0.11.0

func (c *EthClient) BalanceAt(ctx context.Context, account common.Address) (*big.Int, error)

func (*EthClient) BalanceWithoutZerosAt added in v0.11.0

func (c *EthClient) BalanceWithoutZerosAt(ctx context.Context, account common.Address) (float64, error)

func (*EthClient) Call added in v0.11.0

func (c *EthClient) Call(ctx context.Context, call *EthCall) (interface{}, error)

func (*EthClient) GetAssetPoolBalanceForToken

func (c *EthClient) GetAssetPoolBalanceForToken(hexTokenAddress, assetPoolAddress string) (*big.Int, error)

func (*EthClient) GetERC20

func (c *EthClient) GetERC20(hexTokenAddress string) (*ERC20Token, error)

func (*EthClient) Height added in v0.12.0

func (c *EthClient) Height(ctx context.Context) (uint64, error)

func (*EthClient) Ready added in v0.14.0

func (c *EthClient) Ready(ctx context.Context) (bool, error)

type EventsCounter added in v0.12.0

type EventsCounter struct {
	// contains filtered or unexported fields
}

func NewEventsCounter added in v0.12.0

func NewEventsCounter(name string, address string, abiJSON string, initialCallPastBlocks uint64) (*EventsCounter, error)

func NewEventsCounterFromConfig added in v0.12.0

func NewEventsCounterFromConfig(cfg config.EthEvents) (*EventsCounter, error)

func (*EventsCounter) CallFilterLogs added in v0.12.0

func (e *EventsCounter) CallFilterLogs(ctx context.Context, client *EthClient) error

func (EventsCounter) ContractAddress added in v0.12.0

func (e EventsCounter) ContractAddress() string

func (EventsCounter) Count added in v0.12.0

func (e EventsCounter) Count() map[string]uint64

Count returns result

func (EventsCounter) Name added in v0.12.0

func (e EventsCounter) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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