balance

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package balance keeps track of the balance

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	Amount   *big.Int
	Decimals uint8
}

Balance represents a token balance.

func (*Balance) ToFloat64

func (b *Balance) ToFloat64() (float64, error)

ToFloat64 converts a balance to a float64.

type IBalanceManager

type IBalanceManager interface {
	IncrementBalance(tokenID string, amount *big.Int)
	DecrementBalance(tokenID string, amount *big.Int)
	GetAllOnChainBalances(ctx context.Context) error
	GetOnChainBalance(ctx context.Context, tokenID string) error
	GetBalance(tokenID string) *Balance
	GetNormalizedBalance(tokenID string) (float64, error)
}

IBalanceManager is the interface for a BalanceManager.

func NewBalanceManager

func NewBalanceManager(clients map[uint32]EVMClient.EVM, assets []config.AssetConfig, relayerAddress common.Address) (IBalanceManager, error)

NewBalanceManager creates a new balance manager.

Jump to

Keyboard shortcuts

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