multicall

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallOpts

type CallOpts struct {
	Block string
}

type Client

type Client struct {
	multicall.Multicall
}

func Init

func Init(rpc *ethclient.Client, contract string) (*Client, error)

Init initializes the mulicall client.

func (*Client) GetPairInfo

func (c *Client) GetPairInfo(contracts []string) (map[string]*Pair, error)

GetPairInfo returns a map of token addresses with their info as values.

func (*Client) GetPairToken

func (c *Client) GetPairToken(tokenPairs []TokenPair) (map[TokenPair]common.Address, error)

GetPairToken returns a slice of liquidity tokens zero addresses are not included.

func (*Client) GetTokenInfo

func (c *Client) GetTokenInfo(contracts []string) (map[string]Token, error)

GetTokenInfo returns a map of token addresses with their info as values.

type Pair

type Pair struct {
	Reserve0    *big.Int
	Reserve1    *big.Int
	TotalSupply *big.Int
	Token0      Token
	Token1      Token
}

type Token

type Token struct {
	Balance  *big.Int
	Contract string
	Symbol   string
	Decimals uint8
	Native   bool
}

func (Token) ToDatabaseToken

func (t Token) ToDatabaseToken() *database.Token

type TokenPair

type TokenPair struct {
	Factory string
	Token0  string
	Token1  string
}

func NewTokenPair

func NewTokenPair(token0, token1, factory string) *TokenPair

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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