tokens

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Abstractions for keeping track of token names and their corresponding decimal precision exponents.

Index

Constants

This section is empty.

Variables

View Source
var (
	NATIVE_MAP = map[string]Native{
		"nibi": NewNativeToken("nibi", 18, "anibi", "anibi"),
	}
	// TODO Use IBC addresses from https://docs.osmosis.zone/developing/assets/asset-info.html
	IBC_MAP = map[string]IBCToken{
		"nusd": NewIBCToken("nusd", 6, "unusd", "unusd"),
		"osmo": NewIBCToken("osmo", 6, "uosmo", ibcPlaceholder),
		"ust":  NewIBCToken("ust", 6, "uust", ibcPlaceholder),
		"ion":  NewIBCToken("ion", 6, "uion", ibcPlaceholder),
		"atom": NewIBCToken(
			"atom",
			6,
			"uatom",
			"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"),
		"juno": NewIBCToken(
			"juno", 6, "ujuno",
			"ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED"),
		"luna": NewIBCToken(
			"luna", 6, "uluna",
			"ibc/0EF15DF2F02480ADE0BB6E85D9EBB5DAEA2836D3860E9F97F9AADE4F57A31AA0"),
	}
)

Functions

func RegisterDenoms

func RegisterDenoms()

Types

type IBCToken

type IBCToken struct {
	HumanDisplay     string // "atom"
	HumanExponent    int64  // 6
	Base             string // "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"
	BaseDisplay      string // "uatom"
	BaseExponent     int64  // 0
	DefaultBondDenom string
}

Metadata for non-native assets used in the chain.

func NewIBCToken

func NewIBCToken(humanDisplay string, humanExponent int64, baseDisplay string, base string) IBCToken

type Native

type Native struct {
	HumanDisplay        string // "nibi"
	HumanExponent       int64  // 18
	Base                string // "anibi"
	BaseDisplay         string // "anibi"
	BaseExponent        int64  // 0
	DefaultBondDenom    string
	Bech32PrefixAccAddr string
}

func NewNativeToken

func NewNativeToken(humanDisplay string, humanExponent int64, base string, baseDisplay string) Native

Jump to

Keyboard shortcuts

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