common

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 3 Imported by: 2

README

x/common

The x/common directory holds helper and utility functions to be utilized by other x/ cosmos-sdk modules.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GovDenom    = "unibi"
	CollDenom   = "uust"
	StableDenom = "unusd"

	TreasuryPoolModuleAccount = "treasury_pool"

	PairSeparator = ":"

	WhitelistedColl = []string{CollDenom}

	GovStablePool  = AssetPair{Token0: GovDenom, Token1: StableDenom}
	CollStablePool = AssetPair{Token0: CollDenom, Token1: StableDenom}

	ErrInvalidTokenPair = fmt.Errorf("invalid token pair")
)

Functions

func DenomsFromPoolName

func DenomsFromPoolName(pool string) (denoms []string)

func PoolNameFromDenoms

func PoolNameFromDenoms(denoms []string) string

PoolNameFromDenoms returns a sorted string representing a pool of assets

func RawPoolNameFromDenoms

func RawPoolNameFromDenoms(denoms []string) string

RawPoolNameFromDenoms returns a string representing a pool of assets in the exact order the denoms were given as args

Types

type AssetPair

type AssetPair struct {
	Token0 string
	Token1 string
}

func (AssetPair) Inverse

func (pair AssetPair) Inverse() AssetPair

func (AssetPair) IsProperOrder

func (pair AssetPair) IsProperOrder() bool

func (AssetPair) Name

func (pair AssetPair) Name() string

name is the name of the pool that corresponds to the two assets on this pair.

func (AssetPair) PairID

func (pair AssetPair) PairID() string

func (AssetPair) Proper

func (pair AssetPair) Proper() AssetPair

func (AssetPair) String

func (pair AssetPair) String() string

type TokenPair added in v0.1.0

type TokenPair string

func NewTokenPairFromStr added in v0.1.0

func NewTokenPairFromStr(pair string) (TokenPair, error)

func (TokenPair) GetBaseTokenDenom added in v0.1.0

func (p TokenPair) GetBaseTokenDenom() string

func (TokenPair) GetQuoteTokenDenom added in v0.1.0

func (p TokenPair) GetQuoteTokenDenom() string

func (TokenPair) String added in v0.1.0

func (p TokenPair) String() string

Jump to

Keyboard shortcuts

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