types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

copied from https://github.com/cosmos/cosmos-sdk/blob/v0.38.1/types/coin.go

Index

Constants

View Source
const (
	RCreateCollection = MsgRoute("create")
	RIssueNFT         = MsgRoute("issue_nft")
	RIssueFT          = MsgRoute("issue_ft")
	RMintFT           = MsgRoute("mint_ft")
	RMintNFT          = MsgRoute("mint_nft")
	RBurnNFT          = MsgRoute("burn_nft")
	RBurnFT           = MsgRoute("burn_ft")
	RBurnFTFrom       = MsgRoute("burn_ft_from")
	RBurnNFTFrom      = MsgRoute("burn_nft_from")
	RTransferFT       = MsgRoute("transfer_ft")
	RTransferNFT      = MsgRoute("transfer_nft")
	RTransferFTFrom   = MsgRoute("transfer_ft_from")
	RTransferNFTFrom  = MsgRoute("transfer_nft_from")
	RModify           = MsgRoute("modify")
	RApprove          = MsgRoute("approve")
	RDisapprove       = MsgRoute("disapprove")
	RGrantPerm        = MsgRoute("grant_perm")
	RRevokePerm       = MsgRoute("revoke_perm")
	RAttach           = MsgRoute("attach")
	RDetach           = MsgRoute("detach")
	RAttachFrom       = MsgRoute("attach_from")
	RDetachFrom       = MsgRoute("detach_from")
)
View Source
const (
	ModuleName = "collection"

	StoreKey  = ModuleName
	RouterKey = ModuleName
)
View Source
const (
	DefaultParamspace = ModuleName

	DefaultMaxComposableDepth uint64 = 20
	DefaultMaxComposableWidth uint64 = 20
)
View Source
const (
	MintAction   = "mint"
	BurnAction   = "burn"
	IssueAction  = "issue"
	ModifyAction = "modify"
)
View Source
const (
	QuerierRoute             = ModuleName
	QueryBalances            = "balances"
	QueryBalance             = "balance"
	QueryTokens              = "tokens"
	QueryTokensWithTokenType = "tokensWithTokenType"
	QueryTokenTypes          = "tokentypes"
	QueryPerms               = "perms"
	QueryCollections         = "collections"
	QuerySupply              = "supply"
	QueryMint                = "mint"
	QueryBurn                = "burn"
	QueryNFTCount            = "nftcount"
	QueryNFTMint             = "nftmint"
	QueryNFTBurn             = "nftburn"
	QueryParent              = "parent"
	QueryRoot                = "root"
	QueryChildren            = "children"
	QueryIsApproved          = "approved"
	QueryApprovers           = "approver"
)
View Source
const (
	TokenTypeLength    = 8
	SmallestAlphanum   = "0"
	FungibleFlag       = SmallestAlphanum
	ReservedEmpty      = "00000000"
	SmallestFTType     = "00000001"
	ReservedEmptyNFT   = "10000000"
	SmallestNFTType    = "10000001"
	SmallestTokenIndex = "00000001"
)
View Source
const (
	MaxBaseImgURILength  = 1000
	MaxTokenNameLength   = 20
	MaxChangeFieldsCount = 100
	MaxTokenMetaLength   = 1000
)
View Source
const (
	EncodeRouterKey = "collectionencode"
)

Variables

View Source
var (
	OneCoin  = func(denom string) Coin { return NewCoin(denom, sdk.NewInt(1)) }
	OneCoins = func(denom string) Coins { return NewCoins(OneCoin(denom)) }
)
View Source
var (
	ErrTokenExist                    = sdkerrors.Register(ModuleName, 1, "token symbol, token-id already exists")
	ErrTokenNotExist                 = sdkerrors.Register(ModuleName, 2, "token symbol, token-id does not exist")
	ErrTokenNotMintable              = sdkerrors.Register(ModuleName, 3, "token symbol, token-id is not mintable")
	ErrInvalidTokenName              = sdkerrors.Register(ModuleName, 4, "token name should not be empty")
	ErrInvalidTokenID                = sdkerrors.Register(ModuleName, 5, "invalid token id")
	ErrInvalidTokenDecimals          = sdkerrors.Register(ModuleName, 6, "token decimals should be within the range in 0 ~ 18")
	ErrInvalidIssueFT                = sdkerrors.Register(ModuleName, 7, "Issuing token with amount[1], decimals[0], mintable[false] prohibited. Issue nft token instead.")
	ErrInvalidAmount                 = sdkerrors.Register(ModuleName, 8, "invalid token amount")
	ErrInvalidBaseImgURILength       = sdkerrors.Register(ModuleName, 9, "invalid base_img_uri length")
	ErrInvalidNameLength             = sdkerrors.Register(ModuleName, 10, "invalid name length")
	ErrInvalidTokenType              = sdkerrors.Register(ModuleName, 11, "invalid token type pattern found")
	ErrInvalidTokenIndex             = sdkerrors.Register(ModuleName, 12, "invalid token index pattern found")
	ErrCollectionExist               = sdkerrors.Register(ModuleName, 13, "collection already exists")
	ErrCollectionNotExist            = sdkerrors.Register(ModuleName, 14, "collection does not exists")
	ErrTokenTypeExist                = sdkerrors.Register(ModuleName, 15, "token type for contract_id, token-type already exists")
	ErrTokenTypeNotExist             = sdkerrors.Register(ModuleName, 16, "token type for contract_id, token-type does not exist")
	ErrTokenTypeFull                 = sdkerrors.Register(ModuleName, 17, "all token type for contract_id are occupied")
	ErrTokenIndexFull                = sdkerrors.Register(ModuleName, 18, "all non-fungible token index for contract_id, token-type are occupied")
	ErrTokenIDFull                   = sdkerrors.Register(ModuleName, 19, "all fungible token-id for contract_id are occupied")
	ErrTokenNoPermission             = sdkerrors.Register(ModuleName, 20, "account does not have the permission")
	ErrTokenAlreadyAChild            = sdkerrors.Register(ModuleName, 21, "token is already a child of some other")
	ErrTokenNotAChild                = sdkerrors.Register(ModuleName, 22, "token is not a child of some other")
	ErrTokenNotOwnedBy               = sdkerrors.Register(ModuleName, 23, "token is being not owned by")
	ErrTokenCannotTransferChildToken = sdkerrors.Register(ModuleName, 24, "cannot transfer a child token")
	ErrTokenNotNFT                   = sdkerrors.Register(ModuleName, 25, "token is not a NFT")
	ErrCannotAttachToItself          = sdkerrors.Register(ModuleName, 26, "cannot attach token to itself")
	ErrCannotAttachToADescendant     = sdkerrors.Register(ModuleName, 27, "cannot attach token to a descendant")
	ErrApproverProxySame             = sdkerrors.Register(ModuleName, 28, "approver is same with proxy")
	ErrCollectionNotApproved         = sdkerrors.Register(ModuleName, 29, "proxy is not approved on the collection")
	ErrCollectionAlreadyApproved     = sdkerrors.Register(ModuleName, 30, "proxy is already approved on the collection")
	ErrAccountExist                  = sdkerrors.Register(ModuleName, 31, "account already exists")
	ErrAccountNotExist               = sdkerrors.Register(ModuleName, 32, "account does not exists")
	ErrInsufficientSupply            = sdkerrors.Register(ModuleName, 33, "insufficient supply")
	ErrInvalidCoin                   = sdkerrors.Register(ModuleName, 34, "invalid coin")
	ErrInvalidChangesFieldCount      = sdkerrors.Register(ModuleName, 35, "invalid count of field changes")
	ErrEmptyChanges                  = sdkerrors.Register(ModuleName, 36, "changes is empty")
	ErrInvalidChangesField           = sdkerrors.Register(ModuleName, 37, "invalid field of changes")
	ErrTokenIndexWithoutType         = sdkerrors.Register(ModuleName, 38, "There is a token index but no token type")
	ErrTokenTypeFTWithoutIndex       = sdkerrors.Register(ModuleName, 39, "There is a token type of ft but no token index")
	ErrInsufficientToken             = sdkerrors.Register(ModuleName, 40, "insufficient token")
	ErrDuplicateChangesField         = sdkerrors.Register(ModuleName, 41, "duplicate field of changes")
	ErrInvalidMetaLength             = sdkerrors.Register(ModuleName, 42, "invalid meta length")
	ErrSupplyOverflow                = sdkerrors.Register(ModuleName, 43, "supply for collection reached maximum")
	ErrEmptyField                    = sdkerrors.Register(ModuleName, 44, "required field cannot be empty")
	ErrCompositionTooDeep            = sdkerrors.Register(ModuleName, 45, "cannot attach token (composition too deep)")
	ErrCompositionTooWide            = sdkerrors.Register(ModuleName, 46, "cannot attach token (composition too wide)")
	ErrBurnNonRootNFT                = sdkerrors.Register(ModuleName, 47, "cannot burn non-root NFTs")
)
View Source
var (
	EventTypeIssueFT              = "issue_ft"
	EventTypeIssueNFT             = "issue_nft"
	EventTypeMintFT               = "mint_ft"
	EventTypeBurnFT               = "burn_ft"
	EventTypeMintNFT              = "mint_nft"
	EventTypeModifyCollection     = "modify_collection"
	EventTypeModifyTokenType      = "modify_token_type" /* #nosec */
	EventTypeModifyToken          = "modify_token"
	EventTypeGrantPermToken       = "grant_perm"
	EventTypeRevokePermToken      = "revoke_perm"
	EventTypeCreateCollection     = "create_collection"
	EventTypeAttachToken          = "attach" /* #nosec */
	EventTypeDetachToken          = "detach" /* #nosec */
	EventTypeAttachFrom           = "attach_from"
	EventTypeDetachFrom           = "detach_from"
	EventTypeTransfer             = "transfer"
	EventTypeTransferFT           = "transfer_ft"
	EventTypeTransferNFT          = "transfer_nft"
	EventTypeTransferFTFrom       = "transfer_ft_from"
	EventTypeTransferNFTFrom      = "transfer_nft_from"
	EventTypeOperationTransferNFT = "operation_transfer_nft"
	EventTypeApproveCollection    = "approve_collection"
	EventTypeDisapproveCollection = "disapprove_collection"
	EventTypeBurnNFT              = "burn_nft"
	EventTypeBurnFTFrom           = "burn_ft_from"
	EventTypeBurnNFTFrom          = "burn_nft_from"
	EventTypeOperationBurnNFT     = "operation_burn_nft"
	EventTypeOperationRootChanged = "operation_root_changed"

	AttributeKeyName        = "name"
	AttributeKeyMeta        = "meta"
	AttributeKeyContractID  = "contract_id"
	AttributeKeyTokenID     = "token_id"
	AttributeKeyOwner       = "owner"
	AttributeKeyAmount      = "amount"
	AttributeKeyDecimals    = "decimals"
	AttributeKeyBaseImgURI  = "base_img_uri"
	AttributeKeyMintable    = "mintable"
	AttributeKeyTokenType   = "token_type"
	AttributeKeyFrom        = "from"
	AttributeKeyTo          = "to"
	AttributeKeyPerm        = "perm"
	AttributeKeyToTokenID   = "to_token_id"
	AttributeKeyFromTokenID = "from_token_id"
	AttributeKeyApprover    = "approver"
	AttributeKeyProxy       = "proxy"
	AttributeKeyOldRoot     = "old_root_token_id"
	AttributeKeyNewRoot     = "new_root_token_id"

	AttributeValueCategory = ModuleName
)
View Source
var (
	AccountKeyPrefix            = []byte{0x00}
	CollectionKeyPrefix         = []byte{0x01}
	SupplyKeyPrefix             = []byte{0x02}
	TokenKeyPrefix              = []byte{0x03}
	TokenTypeKeyPrefix          = []byte{0x04}
	TokenChildToParentKeyPrefix = []byte{0x05}
	TokenParentToChildKeyPrefix = []byte{0x06}
	CollectionApprovedKeyPrefix = []byte{0x07}
	NextTokenTypeFTKeyPrefix    = []byte{0x08}
	NextTokenTypeNFTKeyPrefix   = []byte{0x09}
	NextTokenIDNFTKeyPrefix     = []byte{0x0a}
	PermKeyPrefix               = []byte{0x0b}
	AccountOwnNFTKeyPrefix      = []byte{0x0c}
	TokenTypeMintCountPrefix    = []byte{0x0d}
	TokenTypeBurnCountPrefix    = []byte{0x0e}
)
View Source
var (
	KeyMaxComposableDepth = []byte("MaxComposableDepth")
	KeyMaxComposableWidth = []byte("MaxComposableWidth")
)
View Source
var (
	CollectionModifiableFields = ModifiableFields{
		AttributeKeyName:       true,
		AttributeKeyBaseImgURI: true,
		AttributeKeyMeta:       true,
	}
	TokenTypeModifiableFields = ModifiableFields{
		AttributeKeyName: true,
		AttributeKeyMeta: true,
	}
	TokenModifiableFields = ModifiableFields{
		AttributeKeyName: true,
		AttributeKeyMeta: true,
	}
)
View Source
var ModuleCdc *codec.Codec

Functions

func AccountKey

func AccountKey(contractID string, acc sdk.AccAddress) []byte

func AccountOwnNFTKey

func AccountOwnNFTKey(contractID string, owner sdk.AccAddress, tokenID string) []byte

func CollectionApprovedKey

func CollectionApprovedKey(contractID string, proxy sdk.AccAddress, approver sdk.AccAddress) []byte

func CollectionApproversKey

func CollectionApproversKey(contractID string, proxy sdk.AccAddress) []byte

func CollectionKey

func CollectionKey(contractID string) []byte

func NextTokenIDNFTKey

func NextTokenIDNFTKey(contractID, tokenType string) []byte

func NextTokenTypeFTKey

func NextTokenTypeFTKey(contractID string) []byte

func NextTokenTypeNFTKey

func NextTokenTypeNFTKey(contractID string) []byte

func ParamKeyTable

func ParamKeyTable() subspace.KeyTable

func PermKey

func PermKey(contractID string, addr sdk.AccAddress) []byte

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

func SupplyKey

func SupplyKey(contractID string) []byte

func TokenChildToParentKey

func TokenChildToParentKey(contractID, tokenID string) []byte

func TokenKey

func TokenKey(contractID, tokenID string) []byte

func TokenParentToChildKey

func TokenParentToChildKey(contractID, parent, child string) []byte

func TokenParentToChildSubKey

func TokenParentToChildSubKey(contractID, parent string) []byte

func TokenTypeBurnCount

func TokenTypeBurnCount(contractID, tokenType string) []byte

func TokenTypeKey

func TokenTypeKey(contractID, tokenType string) []byte

func TokenTypeMintCount

func TokenTypeMintCount(contractID, tokenType string) []byte

func ValidateBaseImgURI

func ValidateBaseImgURI(baseImgURI string) bool

func ValidateDenom

func ValidateDenom(denom string) error

ValidateDenom validates a denomination string returning an error if it is invalid.

func ValidateMeta

func ValidateMeta(meta string) bool

func ValidateName

func ValidateName(name string) bool

func ValidateReg

func ValidateReg(symbol string, reg *regexp.Regexp) error

func ValidateTokenID

func ValidateTokenID(tokenID string) error

func ValidateTokenIndex

func ValidateTokenIndex(index string) error

func ValidateTokenType

func ValidateTokenType(tokenType string) error

func ValidateTokenTypeFT

func ValidateTokenTypeFT(tokenType string) error

func ValidateTokenTypeNFT

func ValidateTokenTypeNFT(tokenType string) error

func WrapIfOverflowPanic

func WrapIfOverflowPanic(r interface{}) error

Types

type Account

type Account interface {
	GetAddress() sdk.AccAddress
	GetContractID() string
	GetCoins() Coins
	SetCoins(Coins) Account
	String() string
}

type AccountKeeper

type AccountKeeper interface {
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) auth.Account
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.Account
	SetAccount(ctx sdk.Context, acc auth.Account)
}

type AccountPermission

type AccountPermission struct {
	Address     sdk.AccAddress
	Permissions Permissions
}

func (*AccountPermission) AddPermission

func (ap *AccountPermission) AddPermission(p Permission)

func (*AccountPermission) GetAddress

func (ap *AccountPermission) GetAddress() sdk.AccAddress

func (*AccountPermission) GetPermissions

func (ap *AccountPermission) GetPermissions() Permissions

func (*AccountPermission) HasPermission

func (ap *AccountPermission) HasPermission(p Permission) bool

func (*AccountPermission) RemovePermission

func (ap *AccountPermission) RemovePermission(p Permission)

func (*AccountPermission) String

func (ap *AccountPermission) String() string

type AccountPermissionI

type AccountPermissionI interface {
	GetAddress() sdk.AccAddress
	HasPermission(Permission) bool
	AddPermission(Permission)
	RemovePermission(Permission)
	String() string
	GetPermissions() Permissions
}

func NewAccountPermission

func NewAccountPermission(addr sdk.AccAddress) AccountPermissionI

type Accounts

type Accounts []Account

type ApproversParam

type ApproversParam struct {
	ContractID string         `json:"contract_id"`
	Proxy      sdk.AccAddress `json:"proxy"`
}

type BalanceParam

type BalanceParam struct {
	ContractID string         `json:"contract_id"`
	TokenID    string         `json:"token_id"`
	Addr       sdk.AccAddress `json:"addr"`
}

type BaseAccount

type BaseAccount struct {
	Address    sdk.AccAddress `json:"address"`
	ContractID string         `json:"contract_id"`
	Coins      Coins          `json:"tokens"`
}

func NewBaseAccountWithAddress

func NewBaseAccountWithAddress(contractID string, addr sdk.AccAddress) *BaseAccount

func (BaseAccount) GetAddress

func (acc BaseAccount) GetAddress() sdk.AccAddress

func (BaseAccount) GetCoins

func (acc BaseAccount) GetCoins() Coins

func (BaseAccount) GetContractID

func (acc BaseAccount) GetContractID() string

func (BaseAccount) SetCoins

func (acc BaseAccount) SetCoins(coins Coins) Account

func (BaseAccount) String

func (acc BaseAccount) String() string

type BaseCollection

type BaseCollection struct {
	ContractID string `json:"contract_id"`
	Name       string `json:"name"`
	Meta       string `json:"meta"`
	BaseImgURI string `json:"base_img_uri"`
}

func (BaseCollection) GetBaseImgURI

func (c BaseCollection) GetBaseImgURI() string

func (BaseCollection) GetContractID

func (c BaseCollection) GetContractID() string

func (BaseCollection) GetMeta

func (c BaseCollection) GetMeta() string

func (BaseCollection) GetName

func (c BaseCollection) GetName() string

func (*BaseCollection) SetBaseImgURI

func (c *BaseCollection) SetBaseImgURI(baseImgURI string)

func (*BaseCollection) SetMeta

func (c *BaseCollection) SetMeta(meta string)

func (*BaseCollection) SetName

func (c *BaseCollection) SetName(name string)

func (BaseCollection) String

func (c BaseCollection) String() string

type BaseFT

type BaseFT struct {
	ContractID string  `json:"contract_id"`
	TokenID    string  `json:"token_id"`
	Decimals   sdk.Int `json:"decimals"`
	Mintable   bool    `json:"mintable"`
	Name       string  `json:"name"`
	Meta       string  `json:"meta"`
}

func (BaseFT) GetContractID

func (t BaseFT) GetContractID() string

func (BaseFT) GetDecimals

func (t BaseFT) GetDecimals() sdk.Int

func (BaseFT) GetMeta

func (t BaseFT) GetMeta() string

func (BaseFT) GetMintable

func (t BaseFT) GetMintable() bool

func (BaseFT) GetName

func (t BaseFT) GetName() string

func (BaseFT) GetTokenID

func (t BaseFT) GetTokenID() string

func (BaseFT) GetTokenIndex

func (t BaseFT) GetTokenIndex() string

func (BaseFT) GetTokenType

func (t BaseFT) GetTokenType() string

func (*BaseFT) SetMeta

func (t *BaseFT) SetMeta(meta string)

func (*BaseFT) SetName

func (t *BaseFT) SetName(name string)

func (BaseFT) String

func (t BaseFT) String() string

type BaseNFT

type BaseNFT struct {
	ContractID string         `json:"contract_id"`
	TokenID    string         `json:"token_id"`
	Owner      sdk.AccAddress `json:"owner"`
	Name       string         `json:"name"`
	Meta       string         `json:"meta"`
}

func (BaseNFT) GetContractID

func (t BaseNFT) GetContractID() string

func (BaseNFT) GetMeta

func (t BaseNFT) GetMeta() string

func (BaseNFT) GetName

func (t BaseNFT) GetName() string

func (BaseNFT) GetOwner

func (t BaseNFT) GetOwner() sdk.AccAddress

func (BaseNFT) GetTokenID

func (t BaseNFT) GetTokenID() string

func (BaseNFT) GetTokenIndex

func (t BaseNFT) GetTokenIndex() string

func (BaseNFT) GetTokenType

func (t BaseNFT) GetTokenType() string

func (*BaseNFT) SetMeta

func (t *BaseNFT) SetMeta(meta string)

func (*BaseNFT) SetName

func (t *BaseNFT) SetName(name string)

func (*BaseNFT) SetOwner

func (t *BaseNFT) SetOwner(owner sdk.AccAddress)

func (BaseNFT) String

func (t BaseNFT) String() string

type BaseSupply

type BaseSupply struct {
	ContractID  string `json:"contract_id"`
	TotalSupply Coins  `json:"total_supply"`
	TotalMint   Coins  `json:"total_mint"`
	TotalBurn   Coins  `json:"total_burn"`
}

func (BaseSupply) Deflate

func (supply BaseSupply) Deflate(amount Coins) Supply

func (BaseSupply) GetContractID

func (supply BaseSupply) GetContractID() string

func (BaseSupply) GetTotalBurn

func (supply BaseSupply) GetTotalBurn() Coins

func (BaseSupply) GetTotalMint

func (supply BaseSupply) GetTotalMint() Coins

func (BaseSupply) GetTotalSupply

func (supply BaseSupply) GetTotalSupply() Coins

func (BaseSupply) Inflate

func (supply BaseSupply) Inflate(amount Coins) Supply

func (BaseSupply) SetTotalSupply

func (supply BaseSupply) SetTotalSupply(total Coins) Supply

func (BaseSupply) String

func (supply BaseSupply) String() string

func (BaseSupply) ValidateBasic

func (supply BaseSupply) ValidateBasic() error

type BaseTokenType

type BaseTokenType struct {
	ContractID string `json:"contract_id"`
	TokenType  string `json:"token_type"`
	Name       string `json:"name"`
	Meta       string `json:"meta"`
}

func (BaseTokenType) GetContractID

func (t BaseTokenType) GetContractID() string

func (BaseTokenType) GetMeta

func (t BaseTokenType) GetMeta() string

func (BaseTokenType) GetName

func (t BaseTokenType) GetName() string

func (BaseTokenType) GetTokenType

func (t BaseTokenType) GetTokenType() string

func (*BaseTokenType) SetMeta

func (t *BaseTokenType) SetMeta(meta string)

func (*BaseTokenType) SetName

func (t *BaseTokenType) SetName(name string)

func (BaseTokenType) String

func (t BaseTokenType) String() string

type Change

type Change struct {
	Field string `json:"field"`
	Value string `json:"value"`
}

func NewChange

func NewChange(field string, value string) Change

type Changes

type Changes []Change

func NewChanges

func NewChanges(changes ...Change) Changes

func NewChangesWithMap

func NewChangesWithMap(changesMap map[string]string) Changes

type ChangesValidator

type ChangesValidator struct {
	// contains filtered or unexported fields
}

func NewChangesValidator

func NewChangesValidator() *ChangesValidator

func (*ChangesValidator) SetMode

func (c *ChangesValidator) SetMode(tokenType, tokenIndex string) error

func (*ChangesValidator) Validate

func (c *ChangesValidator) Validate(changes Changes) error

type Coin

type Coin struct {
	Denom string `json:"token_id"`

	// To allow the use of unsigned integers (see: #1273) a larger refactor will
	// need to be made. So we use signed integers for now with safety measures in
	// place preventing negative values being used.
	Amount sdk.Int `json:"amount"`
}

Coin hold some amount of one currency.

CONTRACT: A coin will never hold a negative amount of any denomination.

func NewCoin

func NewCoin(denom string, amount sdk.Int) Coin

NewCoin returns a new coin with a denomination and amount. It will panic if the amount is negative.

func NewInt64Coin

func NewInt64Coin(denom string, amount int64) Coin

NewInt64Coin returns a new coin with a denomination and amount. It will panic if the amount is negative.

func ParseCoin

func ParseCoin(coinStr string) (coin Coin, err error)

ParseCoin parses a cli input for one coin type, returning errors if invalid. This returns an error on an empty string as well.

func (Coin) Add

func (coin Coin) Add(coinB Coin) Coin

Adds amounts of two coins with same denom. If the coins differ in denom then it panics.

func (Coin) IsEqual

func (coin Coin) IsEqual(other Coin) bool

IsEqual returns true if the two sets of Coins have the same value

func (Coin) IsGTE

func (coin Coin) IsGTE(other Coin) bool

IsGTE returns true if they are the same type and the receiver is an equal or greater value

func (Coin) IsLT

func (coin Coin) IsLT(other Coin) bool

IsLT returns true if they are the same type and the receiver is a smaller value

func (Coin) IsNegative

func (coin Coin) IsNegative() bool

IsNegative returns true if the coin amount is negative and false otherwise.

func (Coin) IsPositive

func (coin Coin) IsPositive() bool

IsPositive returns true if coin amount is positive.

func (Coin) IsValid

func (coin Coin) IsValid() bool

IsValid returns true if the Coin has a non-negative amount and the denom is vaild.

func (Coin) IsZero

func (coin Coin) IsZero() bool

IsZero returns if this represents no money

func (Coin) String

func (coin Coin) String() string

String provides a human-readable representation of a coin

func (Coin) Sub

func (coin Coin) Sub(coinB Coin) Coin

Subtracts amounts of two coins with same denom. If the coins differ in denom then it panics.

type Coins

type Coins []Coin

Coins is a set of Coin, one per currency

func NewCoins

func NewCoins(coins ...Coin) Coins

NewCoins constructs a new coin set.

func ParseCoins

func ParseCoins(coinsStr string) (Coins, error)

ParseCoins will parse out a list of coins separated by commas. If nothing is provided, it returns nil Coins. Returned coins are sorted.

func (Coins) Add

func (coins Coins) Add(coinsB ...Coin) Coins

Add adds two sets of coins.

e.g. {2A} + {A, 2B} = {3A, 2B} {2A} + {0B} = {2A}

NOTE: Add operates under the invariant that coins are sorted by denominations.

CONTRACT: Add will never return Coins where one Coin has a non-positive amount. In otherwords, IsValid will always return true.

func (Coins) AmountOf

func (coins Coins) AmountOf(denom string) sdk.Int

Returns the amount of a denom from coins

func (Coins) DenomsSubsetOf

func (coins Coins) DenomsSubsetOf(coinsB Coins) bool

DenomsSubsetOf returns true if receiver's denom set is subset of coinsB's denoms.

func (Coins) Empty

func (coins Coins) Empty() bool

Empty returns true if there are no coins and false otherwise.

func (Coins) GetDenomByIndex

func (coins Coins) GetDenomByIndex(i int) string

GetDenomByIndex returns the Denom of the certain coin to make the findDup generic

func (Coins) IsAllGT

func (coins Coins) IsAllGT(coinsB Coins) bool

IsAllGT returns true if for every denom in coinsB, the denom is present at a greater amount in coins.

func (Coins) IsAllGTE

func (coins Coins) IsAllGTE(coinsB Coins) bool

IsAllGTE returns false if for any denom in coinsB, the denom is present at a smaller amount in coins; else returns true.

func (Coins) IsAllLT

func (coins Coins) IsAllLT(coinsB Coins) bool

IsAllLT returns True iff for every denom in coins, the denom is present at a smaller amount in coinsB.

func (Coins) IsAllLTE

func (coins Coins) IsAllLTE(coinsB Coins) bool

IsAllLTE returns true iff for every denom in coins, the denom is present at a smaller or equal amount in coinsB.

func (Coins) IsAllPositive

func (coins Coins) IsAllPositive() bool

IsAllPositive returns true if there is at least one coin and all currencies have a positive value.

func (Coins) IsAnyGT

func (coins Coins) IsAnyGT(coinsB Coins) bool

IsAnyGT returns true iff for any denom in coins, the denom is present at a greater amount in coinsB.

e.g. {2A, 3B}.IsAnyGT{A} = true {2A, 3B}.IsAnyGT{5C} = false {}.IsAnyGT{5C} = false {2A, 3B}.IsAnyGT{} = false

func (Coins) IsAnyGTE

func (coins Coins) IsAnyGTE(coinsB Coins) bool

IsAnyGTE returns true iff coins contains at least one denom that is present at a greater or equal amount in coinsB; it returns false otherwise.

NOTE: IsAnyGTE operates under the invariant that both coin sets are sorted by denominations and there exists no zero coins.

func (Coins) IsAnyNegative

func (coins Coins) IsAnyNegative() bool

IsAnyNegative returns true if there is at least one coin whose amount is negative; returns false otherwise. It returns false if the coin set is empty too.

func (Coins) IsEqual

func (coins Coins) IsEqual(coinsB Coins) bool

IsEqual returns true if the two sets of Coins have the same value

func (Coins) IsValid

func (coins Coins) IsValid() bool

IsValid asserts the Coins are sorted, have positive amount, and Denom does not contain upper case characters.

func (Coins) IsZero

func (coins Coins) IsZero() bool

IsZero returns true if there are no coins or all coins are zero.

func (Coins) Len

func (coins Coins) Len() int

nolint

func (Coins) Less

func (coins Coins) Less(i, j int) bool

func (Coins) MarshalJSON

func (coins Coins) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom JSON marshaller for the Coins type to allow nil Coins to be encoded as an empty array.

func (Coins) SafeSub

func (coins Coins) SafeSub(coinsB Coins) (Coins, bool)

SafeSub performs the same arithmetic as Sub but returns a boolean if any negative coin amount was returned.

func (Coins) Sort

func (coins Coins) Sort() Coins

Sort is a helper function to sort the set of coins inplace

func (Coins) String

func (coins Coins) String() string

func (Coins) Sub

func (coins Coins) Sub(coinsB Coins) Coins

Sub subtracts a set of coins from another.

e.g. {2A, 3B} - {A} = {A, 3B} {2A} - {0B} = {2A} {A, B} - {A} = {B}

CONTRACT: Sub will never return Coins where one Coin has a non-positive amount. In otherwords, IsValid will always return true.

func (Coins) Swap

func (coins Coins) Swap(i, j int)

type Collection

type Collection interface {
	GetContractID() string
	GetName() string
	SetName(name string)
	GetBaseImgURI() string
	SetBaseImgURI(baseImgURI string)
	GetMeta() string
	SetMeta(meta string)
	String() string
}

func NewCollection

func NewCollection(contractID, name, meta, baseImgURI string) Collection

type CollectionParam

type CollectionParam struct {
	ContractID string `json:"contract_id"`
}

type Collections

type Collections []Collection

func (Collections) String

func (collections Collections) String() string

type FT

type FT interface {
	Token
	GetMintable() bool
	GetDecimals() sdk.Int
}

func NewFT

func NewFT(contractID, tokenID, name, meta string, decimals sdk.Int, mintable bool) FT

type Findable

type Findable interface {
	IDAtIndex(index int) string
	Len() int
}

type IsApprovedParam

type IsApprovedParam struct {
	ContractID string         `json:"contract_id"`
	Proxy      sdk.AccAddress `json:"proxy"`
	Approver   sdk.AccAddress `json:"approver"`
}

type MintNFTParam

type MintNFTParam struct {
	Name      string `json:"name"`
	Meta      string `json:"meta"`
	TokenType string `json:"token_type"`
}

func NewMintNFTParam

func NewMintNFTParam(name, meta, tokenType string) MintNFTParam

type ModifiableFields

type ModifiableFields map[string]bool

type MsgApprove

type MsgApprove struct {
	Approver   sdk.AccAddress `json:"approver"`
	ContractID string         `json:"contract_id"`
	Proxy      sdk.AccAddress `json:"proxy"`
}

func NewMsgApprove

func NewMsgApprove(approver sdk.AccAddress, contractID string, proxy sdk.AccAddress) MsgApprove

func (MsgApprove) GetContractID

func (msg MsgApprove) GetContractID() string

func (MsgApprove) GetSignBytes

func (msg MsgApprove) GetSignBytes() []byte

func (MsgApprove) GetSigners

func (msg MsgApprove) GetSigners() []sdk.AccAddress

func (MsgApprove) Route

func (MsgApprove) Route() string

func (MsgApprove) Type

func (MsgApprove) Type() string

func (MsgApprove) ValidateBasic

func (msg MsgApprove) ValidateBasic() error

type MsgAttach

type MsgAttach struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	ToTokenID  string         `json:"to_token_id"`
	TokenID    string         `json:"token_id"`
}

func NewMsgAttach

func NewMsgAttach(from sdk.AccAddress, contractID string, toTokenID string, tokenID string) MsgAttach

func (MsgAttach) GetContractID

func (msg MsgAttach) GetContractID() string

func (MsgAttach) GetSignBytes

func (msg MsgAttach) GetSignBytes() []byte

func (MsgAttach) GetSigners

func (msg MsgAttach) GetSigners() []sdk.AccAddress

func (MsgAttach) MarshalJSON

func (msg MsgAttach) MarshalJSON() ([]byte, error)

func (MsgAttach) Route

func (MsgAttach) Route() string

func (MsgAttach) Type

func (MsgAttach) Type() string

func (*MsgAttach) UnmarshalJSON

func (msg *MsgAttach) UnmarshalJSON(data []byte) error

func (MsgAttach) ValidateBasic

func (msg MsgAttach) ValidateBasic() error

type MsgAttachFrom

type MsgAttachFrom struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	From       sdk.AccAddress `json:"from"`
	ToTokenID  string         `json:"to_token_id"`
	TokenID    string         `json:"token_id"`
}

func NewMsgAttachFrom

func NewMsgAttachFrom(proxy sdk.AccAddress, contractID string, from sdk.AccAddress, toTokenID string, tokenID string) MsgAttachFrom

func (MsgAttachFrom) GetContractID

func (msg MsgAttachFrom) GetContractID() string

func (MsgAttachFrom) GetSignBytes

func (msg MsgAttachFrom) GetSignBytes() []byte

func (MsgAttachFrom) GetSigners

func (msg MsgAttachFrom) GetSigners() []sdk.AccAddress

func (MsgAttachFrom) MarshalJSON

func (msg MsgAttachFrom) MarshalJSON() ([]byte, error)

func (MsgAttachFrom) Route

func (MsgAttachFrom) Route() string

func (MsgAttachFrom) Type

func (MsgAttachFrom) Type() string

func (*MsgAttachFrom) UnmarshalJSON

func (msg *MsgAttachFrom) UnmarshalJSON(data []byte) error

func (MsgAttachFrom) ValidateBasic

func (msg MsgAttachFrom) ValidateBasic() error

type MsgBurnFT

type MsgBurnFT struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	Amount     Coins          `json:"amount"`
}

func NewMsgBurnFT

func NewMsgBurnFT(from sdk.AccAddress, contractID string, amount ...Coin) MsgBurnFT

func (MsgBurnFT) GetContractID

func (msg MsgBurnFT) GetContractID() string

func (MsgBurnFT) GetSignBytes

func (msg MsgBurnFT) GetSignBytes() []byte

func (MsgBurnFT) GetSigners

func (msg MsgBurnFT) GetSigners() []sdk.AccAddress

func (MsgBurnFT) Route

func (MsgBurnFT) Route() string

func (MsgBurnFT) Type

func (MsgBurnFT) Type() string

func (MsgBurnFT) ValidateBasic

func (msg MsgBurnFT) ValidateBasic() error

type MsgBurnFTFrom

type MsgBurnFTFrom struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	From       sdk.AccAddress `json:"from"`
	Amount     Coins          `json:"amount"`
}

func NewMsgBurnFTFrom

func NewMsgBurnFTFrom(proxy sdk.AccAddress, contractID string, from sdk.AccAddress, amount ...Coin) MsgBurnFTFrom

func (MsgBurnFTFrom) GetContractID

func (msg MsgBurnFTFrom) GetContractID() string

func (MsgBurnFTFrom) GetSignBytes

func (msg MsgBurnFTFrom) GetSignBytes() []byte

func (MsgBurnFTFrom) GetSigners

func (msg MsgBurnFTFrom) GetSigners() []sdk.AccAddress

func (MsgBurnFTFrom) Route

func (MsgBurnFTFrom) Route() string

func (MsgBurnFTFrom) Type

func (MsgBurnFTFrom) Type() string

func (MsgBurnFTFrom) ValidateBasic

func (msg MsgBurnFTFrom) ValidateBasic() error

type MsgBurnNFT

type MsgBurnNFT struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	TokenIDs   []string       `json:"token_ids"`
}

func NewMsgBurnNFT

func NewMsgBurnNFT(from sdk.AccAddress, contractID string, tokenIDs ...string) MsgBurnNFT

func (MsgBurnNFT) GetContractID

func (msg MsgBurnNFT) GetContractID() string

func (MsgBurnNFT) GetSignBytes

func (msg MsgBurnNFT) GetSignBytes() []byte

func (MsgBurnNFT) GetSigners

func (msg MsgBurnNFT) GetSigners() []sdk.AccAddress

func (MsgBurnNFT) Route

func (msg MsgBurnNFT) Route() string

func (MsgBurnNFT) Type

func (msg MsgBurnNFT) Type() string

func (MsgBurnNFT) ValidateBasic

func (msg MsgBurnNFT) ValidateBasic() error

type MsgBurnNFTFrom

type MsgBurnNFTFrom struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	From       sdk.AccAddress `json:"from"`
	TokenIDs   []string       `json:"token_ids"`
}

func NewMsgBurnNFTFrom

func NewMsgBurnNFTFrom(proxy sdk.AccAddress, contractID string, from sdk.AccAddress, tokenIDs ...string) MsgBurnNFTFrom

func (MsgBurnNFTFrom) GetContractID

func (msg MsgBurnNFTFrom) GetContractID() string

func (MsgBurnNFTFrom) GetSignBytes

func (msg MsgBurnNFTFrom) GetSignBytes() []byte

func (MsgBurnNFTFrom) GetSigners

func (msg MsgBurnNFTFrom) GetSigners() []sdk.AccAddress

func (MsgBurnNFTFrom) Route

func (msg MsgBurnNFTFrom) Route() string

func (MsgBurnNFTFrom) Type

func (msg MsgBurnNFTFrom) Type() string

func (MsgBurnNFTFrom) ValidateBasic

func (msg MsgBurnNFTFrom) ValidateBasic() error

type MsgCreateCollection

type MsgCreateCollection struct {
	Owner      sdk.AccAddress `json:"owner"`
	Name       string         `json:"name"`
	Meta       string         `json:"meta"`
	BaseImgURI string         `json:"base_img_uri"`
}

func NewMsgCreateCollection

func NewMsgCreateCollection(owner sdk.AccAddress, name, meta, baseImgURI string) MsgCreateCollection

func (MsgCreateCollection) GetSignBytes

func (msg MsgCreateCollection) GetSignBytes() []byte

func (MsgCreateCollection) GetSigners

func (msg MsgCreateCollection) GetSigners() []sdk.AccAddress

func (MsgCreateCollection) Route

func (MsgCreateCollection) Route() string

func (MsgCreateCollection) Type

func (MsgCreateCollection) Type() string

func (MsgCreateCollection) ValidateBasic

func (msg MsgCreateCollection) ValidateBasic() error

type MsgDetach

type MsgDetach struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	TokenID    string         `json:"token_id"`
}

func NewMsgDetach

func NewMsgDetach(from sdk.AccAddress, contractID string, tokenID string) MsgDetach

func (MsgDetach) GetContractID

func (msg MsgDetach) GetContractID() string

func (MsgDetach) GetSignBytes

func (msg MsgDetach) GetSignBytes() []byte

func (MsgDetach) GetSigners

func (msg MsgDetach) GetSigners() []sdk.AccAddress

func (MsgDetach) MarshalJSON

func (msg MsgDetach) MarshalJSON() ([]byte, error)

func (MsgDetach) Route

func (MsgDetach) Route() string

func (MsgDetach) Type

func (MsgDetach) Type() string

func (*MsgDetach) UnmarshalJSON

func (msg *MsgDetach) UnmarshalJSON(data []byte) error

func (MsgDetach) ValidateBasic

func (msg MsgDetach) ValidateBasic() error

type MsgDetachFrom

type MsgDetachFrom struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	From       sdk.AccAddress `json:"from"`
	TokenID    string         `json:"token_id"`
}

func NewMsgDetachFrom

func NewMsgDetachFrom(proxy sdk.AccAddress, contractID string, from sdk.AccAddress, tokenID string) MsgDetachFrom

func (MsgDetachFrom) GetContractID

func (msg MsgDetachFrom) GetContractID() string

func (MsgDetachFrom) GetSignBytes

func (msg MsgDetachFrom) GetSignBytes() []byte

func (MsgDetachFrom) GetSigners

func (msg MsgDetachFrom) GetSigners() []sdk.AccAddress

func (MsgDetachFrom) MarshalJSON

func (msg MsgDetachFrom) MarshalJSON() ([]byte, error)

func (MsgDetachFrom) Route

func (MsgDetachFrom) Route() string

func (MsgDetachFrom) Type

func (MsgDetachFrom) Type() string

func (*MsgDetachFrom) UnmarshalJSON

func (msg *MsgDetachFrom) UnmarshalJSON(data []byte) error

func (MsgDetachFrom) ValidateBasic

func (msg MsgDetachFrom) ValidateBasic() error

type MsgDisapprove

type MsgDisapprove struct {
	Approver   sdk.AccAddress `json:"approver"`
	ContractID string         `json:"contract_id"`
	Proxy      sdk.AccAddress `json:"proxy"`
}

func NewMsgDisapprove

func NewMsgDisapprove(approver sdk.AccAddress, contractID string, proxy sdk.AccAddress) MsgDisapprove

func (MsgDisapprove) GetContractID

func (msg MsgDisapprove) GetContractID() string

func (MsgDisapprove) GetSignBytes

func (msg MsgDisapprove) GetSignBytes() []byte

func (MsgDisapprove) GetSigners

func (msg MsgDisapprove) GetSigners() []sdk.AccAddress

func (MsgDisapprove) Route

func (MsgDisapprove) Route() string

func (MsgDisapprove) Type

func (MsgDisapprove) Type() string

func (MsgDisapprove) ValidateBasic

func (msg MsgDisapprove) ValidateBasic() error

type MsgGrantPermission

type MsgGrantPermission struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	To         sdk.AccAddress `json:"to"`
	Permission Permission     `json:"permission"`
}

func NewMsgGrantPermission

func NewMsgGrantPermission(from sdk.AccAddress, contractID string, to sdk.AccAddress, perm Permission) MsgGrantPermission

func (MsgGrantPermission) GetContractID

func (msg MsgGrantPermission) GetContractID() string

func (MsgGrantPermission) GetSignBytes

func (msg MsgGrantPermission) GetSignBytes() []byte

func (MsgGrantPermission) GetSigners

func (msg MsgGrantPermission) GetSigners() []sdk.AccAddress

func (MsgGrantPermission) Route

func (MsgGrantPermission) Route() string

func (MsgGrantPermission) Type

func (MsgGrantPermission) Type() string

func (MsgGrantPermission) ValidateBasic

func (msg MsgGrantPermission) ValidateBasic() error

type MsgIssueFT

type MsgIssueFT struct {
	Owner      sdk.AccAddress `json:"owner"`
	ContractID string         `json:"contract_id"`
	To         sdk.AccAddress `json:"to"`
	Name       string         `json:"name"`
	Meta       string         `json:"meta"`
	Amount     sdk.Int        `json:"amount"`
	Mintable   bool           `json:"mintable"`
	Decimals   sdk.Int        `json:"decimals"`
}

func NewMsgIssueFT

func NewMsgIssueFT(owner, to sdk.AccAddress, contractID string, name, meta string, amount sdk.Int, decimal sdk.Int, mintable bool) MsgIssueFT

func (MsgIssueFT) GetContractID

func (msg MsgIssueFT) GetContractID() string

func (MsgIssueFT) GetSignBytes

func (msg MsgIssueFT) GetSignBytes() []byte

func (MsgIssueFT) GetSigners

func (msg MsgIssueFT) GetSigners() []sdk.AccAddress

func (MsgIssueFT) Route

func (msg MsgIssueFT) Route() string

func (MsgIssueFT) Type

func (msg MsgIssueFT) Type() string

func (MsgIssueFT) ValidateBasic

func (msg MsgIssueFT) ValidateBasic() error

type MsgIssueNFT

type MsgIssueNFT struct {
	Owner      sdk.AccAddress `json:"owner"`
	ContractID string         `json:"contract_id"`
	Name       string         `json:"name"`
	Meta       string         `json:"meta"`
}

func NewMsgIssueNFT

func NewMsgIssueNFT(owner sdk.AccAddress, contractID, name, meta string) MsgIssueNFT

func (MsgIssueNFT) GetContractID

func (msg MsgIssueNFT) GetContractID() string

func (MsgIssueNFT) GetSignBytes

func (msg MsgIssueNFT) GetSignBytes() []byte

func (MsgIssueNFT) GetSigners

func (msg MsgIssueNFT) GetSigners() []sdk.AccAddress

func (MsgIssueNFT) Route

func (MsgIssueNFT) Route() string

func (MsgIssueNFT) Type

func (MsgIssueNFT) Type() string

func (MsgIssueNFT) ValidateBasic

func (msg MsgIssueNFT) ValidateBasic() error

type MsgMintFT

type MsgMintFT struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	To         sdk.AccAddress `json:"to"`
	Amount     Coins          `json:"amount"`
}

func NewMsgMintFT

func NewMsgMintFT(from sdk.AccAddress, contractID string, to sdk.AccAddress, amount ...Coin) MsgMintFT

func (MsgMintFT) GetContractID

func (msg MsgMintFT) GetContractID() string

func (MsgMintFT) GetSignBytes

func (msg MsgMintFT) GetSignBytes() []byte

func (MsgMintFT) GetSigners

func (msg MsgMintFT) GetSigners() []sdk.AccAddress

func (MsgMintFT) Route

func (MsgMintFT) Route() string

func (MsgMintFT) Type

func (MsgMintFT) Type() string

func (MsgMintFT) ValidateBasic

func (msg MsgMintFT) ValidateBasic() error

type MsgMintNFT

type MsgMintNFT struct {
	From          sdk.AccAddress `json:"from"`
	ContractID    string         `json:"contract_id"`
	To            sdk.AccAddress `json:"to"`
	MintNFTParams []MintNFTParam `json:"params"`
}

func NewMsgMintNFT

func NewMsgMintNFT(from sdk.AccAddress, contractID string, to sdk.AccAddress, mintNFTParams ...MintNFTParam) MsgMintNFT

func (MsgMintNFT) GetContractID

func (msg MsgMintNFT) GetContractID() string

func (MsgMintNFT) GetSignBytes

func (msg MsgMintNFT) GetSignBytes() []byte

func (MsgMintNFT) GetSigners

func (msg MsgMintNFT) GetSigners() []sdk.AccAddress

func (MsgMintNFT) Route

func (msg MsgMintNFT) Route() string

func (MsgMintNFT) Type

func (msg MsgMintNFT) Type() string

func (MsgMintNFT) ValidateBasic

func (msg MsgMintNFT) ValidateBasic() error

type MsgModify

type MsgModify struct {
	Owner      sdk.AccAddress `json:"owner"`
	ContractID string         `json:"contract_id"`
	TokenType  string         `json:"token_type"`
	TokenIndex string         `json:"token_index"`
	Changes    Changes        `json:"changes"`
}

func NewMsgModify

func NewMsgModify(owner sdk.AccAddress, contractID, tokenType, tokenIndex string, changes Changes) MsgModify

func (MsgModify) GetContractID

func (msg MsgModify) GetContractID() string

func (MsgModify) GetSignBytes

func (msg MsgModify) GetSignBytes() []byte

func (MsgModify) GetSigners

func (msg MsgModify) GetSigners() []sdk.AccAddress

func (MsgModify) Route

func (msg MsgModify) Route() string

func (MsgModify) Type

func (msg MsgModify) Type() string

func (MsgModify) ValidateBasic

func (msg MsgModify) ValidateBasic() error

type MsgRevokePermission

type MsgRevokePermission struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	Permission Permission     `json:"permission"`
}

func NewMsgRevokePermission

func NewMsgRevokePermission(from sdk.AccAddress, contractID string, perm Permission) MsgRevokePermission

func (MsgRevokePermission) GetContractID

func (msg MsgRevokePermission) GetContractID() string

func (MsgRevokePermission) GetSignBytes

func (msg MsgRevokePermission) GetSignBytes() []byte

func (MsgRevokePermission) GetSigners

func (msg MsgRevokePermission) GetSigners() []sdk.AccAddress

func (MsgRevokePermission) Route

func (MsgRevokePermission) Route() string

func (MsgRevokePermission) Type

func (MsgRevokePermission) Type() string

func (MsgRevokePermission) ValidateBasic

func (msg MsgRevokePermission) ValidateBasic() error

type MsgRoute

type MsgRoute string

type MsgTransferFT

type MsgTransferFT struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	To         sdk.AccAddress `json:"to"`
	Amount     Coins          `json:"amount"`
}

func NewMsgTransferFT

func NewMsgTransferFT(from sdk.AccAddress, contractID string, to sdk.AccAddress, amount ...Coin) MsgTransferFT

func (MsgTransferFT) GetContractID

func (msg MsgTransferFT) GetContractID() string

func (MsgTransferFT) GetSignBytes

func (msg MsgTransferFT) GetSignBytes() []byte

func (MsgTransferFT) GetSigners

func (msg MsgTransferFT) GetSigners() []sdk.AccAddress

func (MsgTransferFT) MarshalJSON

func (msg MsgTransferFT) MarshalJSON() ([]byte, error)

func (MsgTransferFT) Route

func (MsgTransferFT) Route() string

func (MsgTransferFT) Type

func (MsgTransferFT) Type() string

func (*MsgTransferFT) UnmarshalJSON

func (msg *MsgTransferFT) UnmarshalJSON(data []byte) error

func (MsgTransferFT) ValidateBasic

func (msg MsgTransferFT) ValidateBasic() error

type MsgTransferFTFrom

type MsgTransferFTFrom struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	From       sdk.AccAddress `json:"from"`
	To         sdk.AccAddress `json:"to"`
	Amount     Coins          `json:"amount"`
}

func NewMsgTransferFTFrom

func NewMsgTransferFTFrom(proxy sdk.AccAddress, contractID string, from sdk.AccAddress, to sdk.AccAddress, amount ...Coin) MsgTransferFTFrom

func (MsgTransferFTFrom) GetContractID

func (msg MsgTransferFTFrom) GetContractID() string

func (MsgTransferFTFrom) GetSignBytes

func (msg MsgTransferFTFrom) GetSignBytes() []byte

func (MsgTransferFTFrom) GetSigners

func (msg MsgTransferFTFrom) GetSigners() []sdk.AccAddress

func (MsgTransferFTFrom) MarshalJSON

func (msg MsgTransferFTFrom) MarshalJSON() ([]byte, error)

func (MsgTransferFTFrom) Route

func (MsgTransferFTFrom) Route() string

func (MsgTransferFTFrom) Type

func (MsgTransferFTFrom) Type() string

func (*MsgTransferFTFrom) UnmarshalJSON

func (msg *MsgTransferFTFrom) UnmarshalJSON(data []byte) error

func (MsgTransferFTFrom) ValidateBasic

func (msg MsgTransferFTFrom) ValidateBasic() error

type MsgTransferNFT

type MsgTransferNFT struct {
	From       sdk.AccAddress `json:"from"`
	ContractID string         `json:"contract_id"`
	To         sdk.AccAddress `json:"to"`
	TokenIDs   []string       `json:"token_ids"`
}

func NewMsgTransferNFT

func NewMsgTransferNFT(from sdk.AccAddress, contractID string, to sdk.AccAddress, tokenIDs ...string) MsgTransferNFT

func (MsgTransferNFT) GetContractID

func (msg MsgTransferNFT) GetContractID() string

func (MsgTransferNFT) GetSignBytes

func (msg MsgTransferNFT) GetSignBytes() []byte

func (MsgTransferNFT) GetSigners

func (msg MsgTransferNFT) GetSigners() []sdk.AccAddress

func (MsgTransferNFT) MarshalJSON

func (msg MsgTransferNFT) MarshalJSON() ([]byte, error)

func (MsgTransferNFT) Route

func (MsgTransferNFT) Route() string

func (MsgTransferNFT) Type

func (MsgTransferNFT) Type() string

func (*MsgTransferNFT) UnmarshalJSON

func (msg *MsgTransferNFT) UnmarshalJSON(data []byte) error

func (MsgTransferNFT) ValidateBasic

func (msg MsgTransferNFT) ValidateBasic() error

type MsgTransferNFTFrom

type MsgTransferNFTFrom struct {
	Proxy      sdk.AccAddress `json:"proxy"`
	ContractID string         `json:"contract_id"`
	From       sdk.AccAddress `json:"from"`
	To         sdk.AccAddress `json:"to"`
	TokenIDs   []string       `json:"token_ids"`
}

func NewMsgTransferNFTFrom

func NewMsgTransferNFTFrom(proxy sdk.AccAddress, contractID string, from sdk.AccAddress, to sdk.AccAddress, tokenIDs ...string) MsgTransferNFTFrom

func (MsgTransferNFTFrom) GetContractID

func (msg MsgTransferNFTFrom) GetContractID() string

func (MsgTransferNFTFrom) GetSignBytes

func (msg MsgTransferNFTFrom) GetSignBytes() []byte

func (MsgTransferNFTFrom) GetSigners

func (msg MsgTransferNFTFrom) GetSigners() []sdk.AccAddress

func (MsgTransferNFTFrom) MarshalJSON

func (msg MsgTransferNFTFrom) MarshalJSON() ([]byte, error)

func (MsgTransferNFTFrom) Route

func (MsgTransferNFTFrom) Route() string

func (MsgTransferNFTFrom) Type

func (MsgTransferNFTFrom) Type() string

func (*MsgTransferNFTFrom) UnmarshalJSON

func (msg *MsgTransferNFTFrom) UnmarshalJSON(data []byte) error

func (MsgTransferNFTFrom) ValidateBasic

func (msg MsgTransferNFTFrom) ValidateBasic() error

type NFT

type NFT interface {
	Token
	GetOwner() sdk.AccAddress
	SetOwner(sdk.AccAddress)
}

func NewNFT

func NewNFT(contractID, tokenID, name, meta string, owner sdk.AccAddress) NFT

type NodeQuerier

type NodeQuerier interface {
	QueryWithData(path string, data []byte) ([]byte, int64, error)
	WithHeight(height int64) context.CLIContext
}

type Params

type Params struct {
	MaxComposableDepth uint64 `json:"max_composable_depth" yaml:"max_composable_depth"`
	MaxComposableWidth uint64 `json:"max_composable_width" yaml:"max_composable_width"`
}

func DefaultParams

func DefaultParams() Params

func NewParams

func NewParams(maxComposableDepth, maxComposableWidth uint64) Params

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() subspace.ParamSetPairs

func (Params) Validate

func (p Params) Validate() error

type PermParam

type PermParam struct {
	ContractID string         `json:"contract_id"`
	Address    sdk.AccAddress `json:"address"`
}

type Permission

type Permission string

func NewBurnPermission

func NewBurnPermission() Permission

func NewIssuePermission

func NewIssuePermission() Permission

func NewMintPermission

func NewMintPermission() Permission

func NewModifyPermission

func NewModifyPermission() Permission

func (Permission) Equal

func (p Permission) Equal(p2 Permission) bool

func (Permission) String

func (p Permission) String() string

func (Permission) Validate

func (p Permission) Validate() bool

type Permissions

type Permissions []Permission

func NewPermissions

func NewPermissions(perms ...Permission) Permissions

func (*Permissions) AddPermission

func (pms *Permissions) AddPermission(p Permission)

func (*Permissions) GetPermissions

func (pms *Permissions) GetPermissions() []Permission

func (Permissions) HasPermission

func (pms Permissions) HasPermission(p Permission) bool

func (*Permissions) RemoveElement

func (pms *Permissions) RemoveElement(idx int)

func (*Permissions) RemovePermission

func (pms *Permissions) RemovePermission(p Permission)

func (Permissions) String

func (pms Permissions) String() string

type QueryAccAddressParams

type QueryAccAddressParams struct {
	Addr sdk.AccAddress `json:"addr"`
}

func NewQueryAccAddressParams

func NewQueryAccAddressParams(addr sdk.AccAddress) QueryAccAddressParams

type QueryApprovedWrapper

type QueryApprovedWrapper struct {
	IsApprovedParam IsApprovedParam `json:"is_approved_param"`
}

type QueryApproversWrapper

type QueryApproversWrapper struct {
	ApproversParam ApproversParam `json:"approvers_param"`
}

type QueryBalanceWrapper

type QueryBalanceWrapper struct {
	BalanceParam BalanceParam `json:"balance_param"`
}

type QueryCollectionWrapper

type QueryCollectionWrapper struct {
	CollectionParam CollectionParam `json:"collection_param"`
}

type QueryIsApprovedParams

type QueryIsApprovedParams struct {
	Proxy    sdk.AccAddress `json:"proxy"`
	Approver sdk.AccAddress `json:"approver"`
}

func NewQueryIsApprovedParams

func NewQueryIsApprovedParams(proxy sdk.AccAddress, approver sdk.AccAddress) QueryIsApprovedParams

type QueryNFTCountWrapper

type QueryNFTCountWrapper struct {
	TokensParam TokensParam `json:"tokens_param"`
}

type QueryPermsWrapper

type QueryPermsWrapper struct {
	PermParam PermParam `json:"perm_param"`
}

type QueryProxyParams

type QueryProxyParams struct {
	Proxy sdk.AccAddress `json:"proxy"`
}

func NewQueryApproverParams

func NewQueryApproverParams(proxy sdk.AccAddress) QueryProxyParams

type QueryTokenIDAccAddressParams

type QueryTokenIDAccAddressParams struct {
	TokenID string         `json:"token_id"`
	Addr    sdk.AccAddress `json:"addr"`
}

func NewQueryTokenIDAccAddressParams

func NewQueryTokenIDAccAddressParams(tokenID string, addr sdk.AccAddress) QueryTokenIDAccAddressParams

type QueryTokenIDParams

type QueryTokenIDParams struct {
	TokenID string `json:"token_id"`
}

func NewQueryTokenIDParams

func NewQueryTokenIDParams(tokenID string) QueryTokenIDParams

type QueryTokenTypeParams

type QueryTokenTypeParams struct {
	TokenType string `json:"token_type"`
}

func NewQueryTokenTypeParams

func NewQueryTokenTypeParams(tokenType string) QueryTokenTypeParams

type QueryTokenTypeWrapper

type QueryTokenTypeWrapper struct {
	TokenTypeParam TokenTypeParam `json:"token_type_param"`
}

type QueryTokenTypesWrapper

type QueryTokenTypesWrapper struct {
	TokenTypesParam TokenTypesParam `json:"tokentypes_param"`
}

type QueryTokensWrapper

type QueryTokensWrapper struct {
	TokensParam TokensParam `json:"tokens_param"`
}

type QueryTotalWrapper

type QueryTotalWrapper struct {
	TotalParam TotalParam `json:"total_param"`
}

type Supply

type Supply interface {
	GetContractID() string
	GetTotalSupply() Coins
	SetTotalSupply(total Coins) Supply
	GetTotalMint() Coins
	GetTotalBurn() Coins

	Inflate(amount Coins) Supply
	Deflate(amount Coins) Supply

	String() string
	ValidateBasic() error
}

func DefaultSupply

func DefaultSupply(contractID string) Supply

func NewSupply

func NewSupply(contractID string, total Coins) Supply

type Token

type Token interface {
	GetName() string
	SetName(name string)
	GetContractID() string
	GetTokenID() string
	GetTokenType() string
	GetTokenIndex() string
	String() string
	GetMeta() string
	SetMeta(meta string)
}

type TokenType

type TokenType interface {
	GetName() string
	SetName(string)
	GetMeta() string
	SetMeta(string)
	GetContractID() string
	GetTokenType() string
	String() string
}

func NewBaseTokenType

func NewBaseTokenType(contractID, tokenType, name, meta string) TokenType

type TokenTypeParam

type TokenTypeParam struct {
	ContractID string `json:"contract_id"`
	TokenType  string `json:"token_type"`
}

type TokenTypes

type TokenTypes []TokenType

func (TokenTypes) String

func (ts TokenTypes) String() string

type TokenTypesParam

type TokenTypesParam struct {
	ContractID string `json:"contract_id"`
	TokenID    string `json:"token_id"`
}

type Tokens

type Tokens []Token

func (Tokens) String

func (ts Tokens) String() string

type TokensParam

type TokensParam struct {
	ContractID string `json:"contract_id"`
	TokenID    string `json:"token_id"`
}

type TotalParam

type TotalParam struct {
	ContractID string `json:"contract_id"`
	TokenID    string `json:"token_id"`
}

type WasmCustomMsg

type WasmCustomMsg struct {
	Route string          `json:"route"`
	Data  json.RawMessage `json:"data"`
}

type WasmCustomQuerier

type WasmCustomQuerier struct {
	Route string          `json:"route"`
	Data  json.RawMessage `json:"data"`
}

Jump to

Keyboard shortcuts

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