Documentation ¶
Index ¶
- Constants
- Variables
- func AddrsToStrings(addrs ...sdk.AccAddress) []string
- func StringsToAddrs(strs ...string) []sdk.AccAddress
- type AssetPair
- func (pair AssetPair) BaseDenom() string
- func (*AssetPair) Descriptor() ([]byte, []int)
- func (this *AssetPair) Equal(that interface{}) bool
- func (m AssetPair) FromKeyBytes(b []byte) (int, keys.Key)
- func (pair AssetPair) Inverse() AssetPair
- func (m AssetPair) KeyBytes() []byte
- func (m *AssetPair) Marshal() (dAtA []byte, err error)
- func (m *AssetPair) MarshalTo(dAtA []byte) (int, error)
- func (m *AssetPair) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AssetPair) ProtoMessage()
- func (pair AssetPair) QuoteDenom() string
- func (m *AssetPair) Reset()
- func (m *AssetPair) Size() (n int)
- func (pair AssetPair) String() string
- func (m *AssetPair) Unmarshal(dAtA []byte) error
- func (pair AssetPair) Validate() error
- func (this *AssetPair) VerboseEqual(that interface{}) error
- func (m *AssetPair) XXX_DiscardUnknown()
- func (m *AssetPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AssetPair) XXX_Merge(src proto.Message)
- func (m *AssetPair) XXX_Size() int
- func (m *AssetPair) XXX_Unmarshal(b []byte) error
- type AssetPairs
Constants ¶
const ( DenomNIBI = "unibi" DenomUSDC = "uusdc" DenomNUSD = "unusd" DenomBTC = "ubtc" DenomETH = "ueth" ModuleName = "common" TreasuryPoolModuleAccount = "treasury_pool" PairSeparator = ":" )
Variables ¶
var ( Pair_NIBI_NUSD = AssetPair{Token0: DenomNIBI, Token1: DenomNUSD} Pair_USDC_NUSD = AssetPair{Token0: DenomUSDC, Token1: DenomNUSD} Pair_BTC_NUSD = AssetPair{Token0: DenomBTC, Token1: DenomNUSD} Pair_ETH_NUSD = AssetPair{Token0: DenomETH, Token1: DenomNUSD} ErrInvalidTokenPair = sdkerrors.Register(ModuleName, 1, "invalid token pair") )
Functions ¶
func AddrsToStrings ¶ added in v0.5.2
func AddrsToStrings(addrs ...sdk.AccAddress) []string
func StringsToAddrs ¶ added in v0.5.2
func StringsToAddrs(strs ...string) []sdk.AccAddress
Types ¶
type AssetPair ¶
type AssetPair struct { Token0 string `protobuf:"bytes,1,opt,name=token0,proto3" json:"token0,omitempty"` Token1 string `protobuf:"bytes,2,opt,name=token1,proto3" json:"token1,omitempty"` }
func MustNewAssetPair ¶ added in v0.5.2
MustNewAssetPair returns a new asset pair. It will panic if 'pair' is invalid. The form, "token0:token1", is expected for 'pair'.
func NewAssetPair ¶ added in v0.5.2
NewAssetPair 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 (*AssetPair) Descriptor ¶ added in v0.5.2
func (*AssetPair) MarshalToSizedBuffer ¶ added in v0.5.2
func (*AssetPair) ProtoMessage ¶ added in v0.5.2
func (*AssetPair) ProtoMessage()
func (AssetPair) QuoteDenom ¶ added in v0.11.0
func (AssetPair) String ¶
String returns the string representation of the asset pair.
Note that this differs from the output of the proto-generated 'String' method.
func (AssetPair) Validate ¶ added in v0.5.2
Validate performs a basic validation of the market params
func (*AssetPair) VerboseEqual ¶ added in v0.5.2
func (*AssetPair) XXX_DiscardUnknown ¶ added in v0.5.2
func (m *AssetPair) XXX_DiscardUnknown()
func (*AssetPair) XXX_Marshal ¶ added in v0.5.2
func (*AssetPair) XXX_Unmarshal ¶ added in v0.5.2
type AssetPairs ¶ added in v0.5.2
type AssetPairs []AssetPair
AssetPairs is a set of AssetPair, one per pair.
func NewAssetPairs ¶ added in v0.5.2
func NewAssetPairs(pairStrings ...string) (pairs AssetPairs)
NewAssetPairs constructs a new asset pair set. A panic will occur if one of the provided pair names is invalid.
func (AssetPairs) Contains ¶ added in v0.5.2
func (haystack AssetPairs) Contains(needle AssetPair) bool
Contains checks if a token pair is contained within 'Pairs'
func (AssetPairs) MarshalJSON ¶ added in v0.5.2
func (pairs AssetPairs) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the AssetPairs type to allow nil AssetPairs to be encoded as empty
func (AssetPairs) Strings ¶ added in v0.5.2
func (pairs AssetPairs) Strings() []string
func (AssetPairs) Validate ¶ added in v0.5.2
func (pairs AssetPairs) Validate() error