token

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParseAddress    = tezos.ParseAddress
	NewTokenAddress = tezos.NewToken
)

Functions

This section is empty.

Types

type Address

type Address = tezos.Address

type Ledger

type Ledger struct {
	Id          uint64    `json:"id"`
	Contract    Address   `json:"contract"`
	Creator     Address   `json:"creator"`
	Category    string    `json:"category"`
	Kind        string    `json:"token_kind"`
	Type        string    `json:"token_type"`
	FirstBlock  int64     `json:"first_block"`
	FirstTime   time.Time `json:"first_time"`
	NumUsers    int       `json:"num_users"`
	NumHolders  int       `json:"num_holders"`
	NumTokens   int       `json:"num_tokens"`
	Tags        []string  `json:"tags"`
	CodeHash    string    `json:"code_hash"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Homepage    string    `json:"homepage"`
	Version     string    `json:"version"`
}

type OpHash

type OpHash = tezos.OpHash

type Query

type Query = client.Query

type Token

type Token struct {
	Id             uint64    `json:"id"`
	Contract       Address   `json:"contract"`
	TokenId        Z         `json:"token_id"`
	Kind           string    `json:"token_kind"`
	Type           string    `json:"token_type"`
	Category       string    `json:"category"`
	Name           string    `json:"name"`
	Symbol         string    `json:"symbol"`
	Decimals       int       `json:"decimals"`
	Tags           []string  `json:"tags"`
	Creator        string    `json:"creator"`
	FirstBlock     int64     `json:"first_block"`
	FirstTime      time.Time `json:"first_time"`
	Supply         Z         `json:"total_supply"`
	VolMint        Z         `json:"total_minted"`
	VolBurn        Z         `json:"total_burned"`
	LastChange     int64     `json:"last_supply_change_block"`
	LastChangeTime time.Time `json:"last_supply_change_time"`
	PriceUSD       float64   `json:"price_usd,string"`
	McapUSD        float64   `json:"mcap_usd,string"`
}

func (Token) Address

func (t Token) Address() TokenAddress

type TokenAPI

type TokenAPI interface {
	GetToken(context.Context, TokenAddress) (*Token, error)
	GetLedger(context.Context, Address) (*Ledger, error)

	GetTokenMetadata(context.Context, TokenAddress) (*TokenMetadata, error)
	GetLedgerMetadata(context.Context, Address) (*TokenMetadata, error)

	ListLedgerTokens(context.Context, Address, Query) ([]*Token, error)
	ListLedgerEvents(context.Context, Address, Query) ([]*TokenEvent, error)
	ListLedgerBalances(context.Context, Address, Query) ([]*TokenBalance, error)

	ListTokenEvents(context.Context, TokenAddress, Query) ([]*TokenEvent, error)
	ListTokenBalances(context.Context, TokenAddress, Query) ([]*TokenBalance, error)

	// firehose
	ListTokens(context.Context, Query) ([]*Token, error)
	ListEvents(context.Context, Query) ([]*TokenEvent, error)
	ListLedgers(context.Context, Query) ([]*Ledger, error)
	ListMetadata(context.Context, Query) ([]*TokenMetadata, error)
}

func NewTokenAPI

func NewTokenAPI(c *client.Client) TokenAPI

type TokenAddress

type TokenAddress = tezos.Token

type TokenBalance

type TokenBalance struct {
	Id         uint64  `json:"id"`
	Owner      Address `json:"owner"`
	Contract   Address `json:"contract"`
	TokenId    Z       `json:"token_id"`
	Kind       string  `json:"token_kind"`
	Type       string  `json:"token_type"`
	Name       string  `json:"name"`
	Symbol     string  `json:"symbol"`
	Decimals   int     `json:"decimals"`
	Balance    Z       `json:"balance"`
	FirstBlock int64   `json:"first_block"`
	LastBlock  int64   `json:"last_block"`
	NTransfers int     `json:"num_transfers"`
	NMints     int     `json:"num_mints"`
	NBurns     int     `json:"num_burns"`
	VolSent    Z       `json:"vol_sent"`
	VolRecv    Z       `json:"vol_recv"`
	VolMint    Z       `json:"vol_mint"`
	VolBurn    Z       `json:"vol_burn"`
}

type TokenEvent

type TokenEvent struct {
	Id        uint64    `json:"id"`
	Contract  Address   `json:"contract"`
	TokenId   Z         `json:"token_id"`
	TokenKind string    `json:"token_kind"`
	TokenType string    `json:"token_type"`
	EventType string    `json:"event_type"`
	Name      string    `json:"name"`
	Symbol    string    `json:"symbol"`
	Decimals  int       `json:"decimals"`
	Signer    Address   `json:"signer"`
	Sender    Address   `json:"sender"`
	Receiver  Address   `json:"receiver"`
	Amount    Z         `json:"amount"`
	TxHash    OpHash    `json:"tx_hash"`
	TxFee     int64     `json:"tx_fee,string"`
	Block     int64     `json:"block"`
	Time      time.Time `json:"time"`
}

type TokenMetadata

type TokenMetadata struct {
	Id          uint64          `json:"id"`
	Contract    Address         `json:"contract"`
	TokenId     Z               `json:"token_id"`
	Kind        string          `json:"kind"`
	Status      string          `json:"status"`
	Url         string          `json:"name"`
	RetriesLeft int             `json:"retries_left"`
	Block       int64           `json:"block"`
	Data        json.RawMessage `json:"data"`
}

type Z

type Z = tezos.Z

Jump to

Keyboard shortcuts

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