utils

package
v0.0.0-...-94803f6 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: GPL-3.0-or-later, LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ConvertFromDecimals

func ConvertFromDecimals(amount *big.Float, decimals int) *big.Int

func ConvertToDecimals

func ConvertToDecimals(amount *big.Int, decimals int) *big.Float

func IsValidChain

func IsValidChain(c *Chain) bool

func MustParseABI

func MustParseABI(strABI string) abi.ABI

func PairParseSwap

func PairParseSwap(txLog types.Log) (*contract.PairSwap, error)

func PairParseSync

func PairParseSync(txLog types.Log) (*contract.PairSync, error)

func TokenParseApproval

func TokenParseApproval(txLog types.Log) (*contract.TokenApproval, error)

func TokenParseTransfer

func TokenParseTransfer(txLog types.Log) (*contract.TokenTransfer, error)

Types

type Chain

type Chain string
const (
	ChainEthereum           Chain = "ethereum"
	ChainOptimisticEthereum Chain = "optimisticethereum"
	ChainBinanceSmartChain  Chain = "bsc"
	ChainOptimisticKovan    Chain = "optimistickovan"
	ChainPolygon            Chain = "polygon"
)

func (Chain) Currency

func (c Chain) Currency() string

func (Chain) GetBlockTime

func (c Chain) GetBlockTime() int

func (Chain) GetClient

func (c Chain) GetClient(ctx context.Context) (client *ethclient.Client, err error)

func (Chain) GetWSClient

func (c Chain) GetWSClient(ctx context.Context) (client *ethclient.Client, err error)

func (Chain) ID

func (c Chain) ID() int

func (Chain) Name

func (c Chain) Name() string

type ChainData

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

Jump to

Keyboard shortcuts

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