utils

package
v0.0.0-...-bf46863 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPair

func NewPair(pair PairJSON) (dextypes.Pair, error)

TODO: ADD utils to convert Each type to dex/type (string to denom)

Types

type AddAssetMetadataProposalJSON

type AddAssetMetadataProposalJSON struct {
	Title       string        `json:"title" yaml:"title"`
	Description string        `json:"description" yaml:"description"`
	AssetList   AssetListJSON `json:"asset_list" yaml:"asset_list"`
	Deposit     string        `json:"deposit" yaml:"deposit"`
}

func ParseAddAssetMetadataProposalJSON

func ParseAddAssetMetadataProposalJSON(cdc *codec.LegacyAmino, proposalFile string) (AddAssetMetadataProposalJSON, error)

ParseAddAssetMetadataProposalJSON reads and parses an AddAssetMetadataProposalJSON from a file.

type AssetListJSON

type AssetListJSON []dextypes.AssetMetadata

type BatchContractPairJSON

type BatchContractPairJSON struct {
	ContractAddr string    `json:"contract_addr" yaml:"contract_addr"`
	Pairs        PairsJSON `json:"pairs" yaml:"pairs"`
}

ParamChangeJSON defines a parameter change used in JSON input. This allows values to be specified in raw JSON instead of being string encoded.

func (BatchContractPairJSON) ToBatchContractPair

func (bcp BatchContractPairJSON) ToBatchContractPair() (dextypes.BatchContractPair, error)

ToParamChange converts a ParamChangeJSON object to ParamChange.

type MultipleBatchContractPairJSON

type MultipleBatchContractPairJSON []BatchContractPairJSON

func (MultipleBatchContractPairJSON) ToMultipleBatchContractPair

func (mbcp MultipleBatchContractPairJSON) ToMultipleBatchContractPair() ([]dextypes.BatchContractPair, error)

ToParamChanges converts a slice of ParamChangeJSON objects to a slice of ParamChange.

type PairJSON

type PairJSON struct {
	PriceDenom       string `json:"price_denom" yaml:"price_denom"`
	AssetDenom       string `json:"asset_denom" yaml:"asset_denom"`
	PriceTickSize    string `json:"price_tick_size" yaml:"tick_size"`
	QuantityTickSize string `json:"quantity_tick_size" yaml:"tick_size"`
}

type PairsJSON

type PairsJSON []PairJSON

type RegisterPairsTxJSON

type RegisterPairsTxJSON struct {
	BatchContractPair MultipleBatchContractPairJSON `json:"batch_contract_pair" yaml:"batch_contract_pair"`
}

RegisterPairsTxJSON defines a RegisterPairsTx to parse register pair tx's from a JSON file.

func ParseRegisterPairsTxJSON

func ParseRegisterPairsTxJSON(cdc *codec.LegacyAmino, txFile string) (RegisterPairsTxJSON, error)

ParseRegisterPairsTxJSON reads and parses a RegisterPairsTxJSON from a file.

type TickSizeJSON

type TickSizeJSON struct {
	Pair         PairJSON `json:"pair" yaml:"pair"`
	TickSize     sdk.Dec  `json:"tick_size" yaml:"tick_size"`
	ContractAddr string   `json:"contract_addr" yaml:"contract_addr"`
}

func (TickSizeJSON) ToTickSize

func (ts TickSizeJSON) ToTickSize() (dextypes.TickSize, error)

type TickSizesJSON

type TickSizesJSON []TickSizeJSON

func (TickSizesJSON) ToTickSizes

func (tss TickSizesJSON) ToTickSizes() ([]dextypes.TickSize, error)

type UpdateTickSizeTxJSON

type UpdateTickSizeTxJSON struct {
	TickSizes TickSizesJSON `json:"tick_size_list" yaml:"tick_size_list"`
}

func ParseUpdateTickSizeTxJSON

func ParseUpdateTickSizeTxJSON(cdc *codec.LegacyAmino, txFile string) (UpdateTickSizeTxJSON, error)

ParseUpdateTickSizeTxJSON reads and parses a UpdateTickSizeTxJSON from a file.

Jump to

Keyboard shortcuts

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