asset

package
v1.0.2-post.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTokenPair = sdkerrors.Register("asset", 1, "invalid token pair")

paired against USD

View Source
var PairKeyEncoder collections.KeyEncoder[Pair] = pairKeyEncoder{}
View Source
var Registry registry

Functions

func PairsToStrings added in v0.21.9

func PairsToStrings(pairs []Pair) []string

Types

type Pair

type Pair string

func MustNewPair

func MustNewPair(pair string) Pair

MustNewPair returns a new asset pair. It will panic if 'pair' is invalid. The form, "token0:token1", is expected for 'pair'.

func MustNewPairs added in v0.21.9

func MustNewPairs(pairStrings ...string) (pairs []Pair)

MustNewPairs constructs a new asset pair set. A panic will occur if one of the provided pair names is invalid.

func NewPair

func NewPair(base string, quote string) Pair

func TryNewPair

func TryNewPair(pair string) (Pair, error)

TryNewPair New returns a new asset pair instance if the pair is valid. The form, "token0:token1", is expected for 'pair'. Use this function to return an error instead of panicking.

func (Pair) BaseDenom

func (pair Pair) BaseDenom() string

func (Pair) Equal

func (pair Pair) Equal(other Pair) bool

func (Pair) Inverse

func (pair Pair) Inverse() Pair

func (Pair) Marshal

func (pair Pair) Marshal() ([]byte, error)

func (Pair) MarshalJSON

func (pair Pair) MarshalJSON() ([]byte, error)

func (Pair) MarshalTo

func (pair Pair) MarshalTo(data []byte) (n int, err error)

func (Pair) QuoteDenom

func (pair Pair) QuoteDenom() string

func (Pair) Size

func (pair Pair) Size() int

func (Pair) String

func (pair Pair) String() string

String returns the string representation of the asset pair.

Note that this differs from the output of the proto-generated 'String' method.

func (*Pair) Unmarshal

func (pair *Pair) Unmarshal(data []byte) error

func (*Pair) UnmarshalJSON

func (pair *Pair) UnmarshalJSON(data []byte) error

func (Pair) Validate

func (pair Pair) Validate() error

Validate performs a basic validation of the market params

Jump to

Keyboard shortcuts

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