types

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName   = "oracles"
	StoreKey     = ModuleName
	RouterKey    = ModuleName
	QuerierRoute = ModuleName
)

Variables

View Source
var ModuleCdc *codec.Codec

ModuleCdc is the codec for the module

View Source
var (
	OracleKey = []byte{0x00}
)

Functions

func GetOraclePrefixKey

func GetOraclePrefixKey(did did.Did) []byte

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type GenesisState

type GenesisState struct {
	Oracles Oracles `json:"oracles" yaml:"oracles"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func NewGenesisState

func NewGenesisState(oracles Oracles) GenesisState

type Oracle

type Oracle struct {
	OracleDid    did.Did         `json:"oracle_did" yaml:"oracle_did"`
	Capabilities OracleTokenCaps `json:"capabilities" yaml:"capabilities"`
}

func NewOracle

func NewOracle(oracleDid did.Did, caps OracleTokenCaps) Oracle

type OracleTokenCap

type OracleTokenCap struct {
	Denom        string    `json:"denom" yaml:"denom"`
	Capabilities TokenCaps `json:"capabilities" yaml:"capabilities"`
}

func NewOracleTokenCap

func NewOracleTokenCap(denom string, caps TokenCaps) OracleTokenCap

func ParseOracleTokenCap

func ParseOracleTokenCap(capStr string) (OracleTokenCap, error)

type OracleTokenCaps

type OracleTokenCaps []OracleTokenCap

func ParseOracleTokenCaps

func ParseOracleTokenCaps(capsStr string) (OracleTokenCaps, error)

func (OracleTokenCaps) Includes

func (otcs OracleTokenCaps) Includes(denom string) bool

func (OracleTokenCaps) MustGet

func (otcs OracleTokenCaps) MustGet(denom string) OracleTokenCap

type Oracles

type Oracles []Oracle

func (Oracles) Includes

func (os Oracles) Includes(oracle Oracle) bool

type TokenCap

type TokenCap string
const (
	MintCap     TokenCap = "mint"
	BurnCap     TokenCap = "burn"
	TransferCap TokenCap = "transfer"
)

func (TokenCap) IsValid

func (tc TokenCap) IsValid() bool

type TokenCaps

type TokenCaps []TokenCap

func ParseTokenCaps

func ParseTokenCaps(capsStr string) (TokenCaps, error)

func (TokenCaps) Includes

func (tcs TokenCaps) Includes(cap TokenCap) bool

Jump to

Keyboard shortcuts

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