tokens

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceRequest

type BalanceRequest struct {
	ContractAddress common.Address
	Address         common.Address
}

BalanceRequest contains the request parameters for GetAccountBalance.

type HistoricalBalanceRequest

type HistoricalBalanceRequest struct {
	ContractAddress common.Address
	Address         common.Address
	BlockNo         int64
}

HistoricalBalanceRequest contains the request parameters for GetHistoricalBalance.

type HistoricalSupplyRequest

type HistoricalSupplyRequest struct {
	ContractAddress common.Address
	BlockNo         int64
}

HistoricalSupplyRequest contains the request parameters for GetHistoricalSupply.

type TokenInfo

type TokenInfo struct {
	ContractAddress common.Address `etherscan:"contractAddress"`
	TokenName       string         `etherscan:"tokenName"`
	Symbol          string
	Divisor         uint
	TokenType       string   `etherscan:"tokenType"`
	TotalSupply     *big.Int `etherscan:"totalSupply"`
	BlueCheckmark   bool     `etherscan:"blueCheckmark,str"`
	Description     string
	Website         string
	Email           string
	Blog            string
	Reddit          string
	Slack           string
	Facebook        string
	Twitter         string
	BitcoinTalk     string
	Github          string
	Telegram        string
	WeChat          string
	LinkedIn        string
	Discord         string
	Whitepaper      string
	TokenPriceUSD   decimal.Decimal `etherscan:"tokenPriceUSD"`
}

TokenInfo describes an ERC20/ERC721 token.

type TokensClient

type TokensClient struct {
	API *httpapi.APIClient
}

TokensClient is the client for tokens actions.

func (*TokensClient) GetAccountBalance

func (c *TokensClient) GetAccountBalance(
	ctx context.Context, req *BalanceRequest,
) (*big.Int, error)

GetAccountBalance returns the current balance of an ERC-20 token of an address.

func (*TokensClient) GetHistoricalBalance

func (c *TokensClient) GetHistoricalBalance(
	ctx context.Context, req *HistoricalBalanceRequest,
) (*big.Int, error)

GetHistoricalBalance returns the balance of an ERC-20 token of an address at a certain block height.

func (*TokensClient) GetHistoricalSupply

func (c *TokensClient) GetHistoricalSupply(
	ctx context.Context, req *HistoricalSupplyRequest,
) (*big.Int, error)

GetHistoricalSupply returns the amount of an ERC-20 token in circulation at a certain block height.

func (*TokensClient) GetTokenInfo

func (c *TokensClient) GetTokenInfo(
	ctx context.Context, contractAddr common.Address,
) (result []TokenInfo, err error)

GetTokenInfo returns project information and social media links of an ERC-20/ERC-721 token.

func (*TokensClient) GetTotalSupply

func (c *TokensClient) GetTotalSupply(
	ctx context.Context, contractAddr common.Address,
) (*big.Int, error)

GetTotalSupply returns the current amount of an ERC-20 token in circulation.

Jump to

Keyboard shortcuts

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