multicall

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package multicall provides a wrapper client around the SimpleMultiCall contract

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Multicall

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

Multicall exposes utility functions around the multicall contract

func New

func New(ctx context.Context, addr string, backend bind.ContractBackend) (*Multicall, error)

New initializes the multicall contract wrapper package

func (*Multicall) Close

func (m *Multicall) Close()

Close terminates the context

func (*Multicall) GetBalances

func (m *Multicall) GetBalances(
	block uint64,
	pool string,
	tokens []string,
) ([]common.Address, []*big.Int, error)

GetBalances returns the balances of various tokens

func (*Multicall) GetDenormalizedWeights

func (m *Multicall) GetDenormalizedWeights(
	block uint64,
	pool string,
	tokens []string,
) ([]common.Address, []*big.Int, error)

GetDenormalizedWeights returns the denormalized weights of all given tokens

func (*Multicall) GetSpotPrices

func (m *Multicall) GetSpotPrices(
	block uint64,
	pool string,
	tokensIn []string,
	tokensOut []string,
) ([]common.Address, []common.Address, []*big.Int, error)

GetSpotPrices returns the spot prices of various in/out pairs

func (*Multicall) GetTotalSupplies

func (m *Multicall) GetTotalSupplies(
	block uint64,
	tokens []string,
) ([]common.Address, []*big.Int, error)

GetTotalSupplies returns the total supplies of various tokens

func (*Multicall) GetUsedBalances

func (m *Multicall) GetUsedBalances(
	block uint64,
	pool string,
	tokens []string,
) ([]common.Address, []*big.Int, error)

GetUsedBalances returns the used balances of various tokens

Jump to

Keyboard shortcuts

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