erc

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 8 Imported by: 5

README

ERCs

ERC20

follow EIP20 token standard

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ERC20Info

type ERC20Info struct {
	Network  string
	Address  string
	Symbol   string
	Decimals int
	Contract *erc20.Erc20
}

Basic info of ERC20 token that are stable.

func (*ERC20Info) BalanceOf

func (t *ERC20Info) BalanceOf(address string) (float64, error)

Return the balance, already divided by decimals.

func (*ERC20Info) Init

func (t *ERC20Info) Init(address string, network string, client bind.ContractBackend) error

func (*ERC20Info) PriceUSD

func (t *ERC20Info) PriceUSD(gecko *coingecko.Gecko) (float64, error)

Return token's price.

func (*ERC20Info) TotalSupply

func (t *ERC20Info) TotalSupply() (float64, error)

Return token's total supply amount, already divided by decimals.

func (*ERC20Info) TotalSupplyUSD

func (t *ERC20Info) TotalSupplyUSD(gecko *coingecko.Gecko) (float64, error)

Return token's total supply in usd.

Jump to

Keyboard shortcuts

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