token

package
v0.0.0-...-f1964de Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPairSeparator = "/"

Variables

View Source
var TokenDenomRegex = regexp.MustCompile(tokenDenomRegexStr)

Functions

This section is empty.

Types

type Pair

type Pair struct {
	Base  string `json:"base"`
	Quote string `json:"quote"`
}

func PairFromString

func PairFromString(s string) (*Pair, error)

func PairFromStringWithSeparator

func PairFromStringWithSeparator(s string, separator string) (*Pair, error)

func (*Pair) Reversed

func (p *Pair) Reversed() *Pair

func (*Pair) String

func (p *Pair) String() string

func (*Pair) StringWithSeparator

func (p *Pair) StringWithSeparator(separator string) string

type Token

type Token struct {
	Amount decimal.Big `json:"amount"`
	Symbol string      `json:"symbol"`
}

func ParseToken

func ParseToken(s string) (*Token, error)

func ParseTokens

func ParseTokens(s string) ([]*Token, error)

func (*Token) Rebase

func (t *Token) Rebase(exponent int, symbol string) *Token

func (*Token) String

func (t *Token) String() string

Jump to

Keyboard shortcuts

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