Documentation ¶
Index ¶
- Constants
- Variables
- func CheckUnique(arr []int64) bool
- func CreateTestAddrs(numAddrs int) []sdk.AccAddress
- func ErrEmptyMetadata() *sdkerrors.Error
- func ErrForbiddenToTransferToYourself() *sdkerrors.Error
- func ErrInvalidCollection(denom string) *sdkerrors.Error
- func ErrInvalidDenom(denom string) *sdkerrors.Error
- func ErrInvalidNFT(id string) *sdkerrors.Error
- func ErrInvalidQuantity(quantity string) *sdkerrors.Error
- func ErrInvalidRecipientAddress(address string) *sdkerrors.Error
- func ErrInvalidReserve(reserve string) *sdkerrors.Error
- func ErrInvalidSenderAddress(address string) *sdkerrors.Error
- func ErrInvalidTokenID(name string) *sdkerrors.Error
- func ErrNFTAlreadyExists(id string) *sdkerrors.Error
- func ErrNotAllowedBurn() *sdkerrors.Error
- func ErrNotAllowedMint() *sdkerrors.Error
- func ErrNotAllowedUpdateReserve() *sdkerrors.Error
- func ErrNotEnoughFunds(reserve string) *sdkerrors.Error
- func ErrNotSetValueLowerNow() *sdkerrors.Error
- func ErrNotUniqueSubTokenIDs() *sdkerrors.Error
- func ErrNotUniqueTokenID() *sdkerrors.Error
- func ErrNotUniqueTokenURI() *sdkerrors.Error
- func ErrOwnerDoesNotOwnSubTokenID(owner string, subTokenID string) *sdkerrors.Error
- func ErrUnknownCollection(denom string) *sdkerrors.Error
- func ErrUnknownNFT(denom string, id string) *sdkerrors.Error
- func FindUtil(group Findable, el string) int
- func FindUtilInt64(group FindableInt64, el int64) int
- func GetCollectionKey(denom string) []byte
- func GetLastSubTokenIDKey(denom, id string) []byte
- func GetOwnerKey(address sdk.AccAddress, denom string) []byte
- func GetOwnersKey(address sdk.AccAddress) []byte
- func GetSubTokenKey(denom, id string, subTokenID int64) []byte
- func GetTokenIDKey(id string) []byte
- func GetTokenURIKey(tokenURI string) []byte
- func NewBaseNFT(id string, creator, owner sdk.AccAddress, tokenURI string, reserve sdk.Int, ...) exported.NFT
- func RegisterCodec(cdc *codec.Codec)
- func SplitOwnerKey(key []byte) (sdk.AccAddress, []byte)
- func TransferNFT(nft exported.NFT, sender, recipient sdk.AccAddress, subTokenIDs []int64) (exported.NFT, error)
- func ValidateGenesis(data GenesisState) error
- type AccountKeeper
- type BaseNFT
- func (bnft BaseNFT) EditMetadata(tokenURI string) exported.NFT
- func (bnft BaseNFT) GetAllowMint() bool
- func (bnft BaseNFT) GetCreator() sdk.AccAddress
- func (bnft BaseNFT) GetID() string
- func (bnft BaseNFT) GetOwners() exported.TokenOwners
- func (bnft BaseNFT) GetReserve() sdk.Int
- func (bnft BaseNFT) GetTokenURI() string
- func (bnft BaseNFT) MarshalJSON() ([]byte, error)
- func (bnft BaseNFT) SetOwners(owners exported.TokenOwners) exported.NFT
- func (bnft BaseNFT) String() string
- func (bnft *BaseNFT) UnmarshalJSON(b []byte) error
- type BaseNFTJSON
- type CodeType
- type Collection
- func (collection Collection) AddNFT(nft exported.NFT) (Collection, error)
- func (collection Collection) ContainsNFT(id string) bool
- func (collection Collection) DeleteNFT(nft exported.NFT) (Collection, error)
- func (collection Collection) GetNFT(id string) (nft exported.NFT, err error)
- func (collection Collection) String() string
- func (collection Collection) Supply() int
- func (collection Collection) UpdateNFT(nft exported.NFT) (Collection, error)
- type CollectionJSON
- type Collections
- func (collections Collections) Append(collectionsB ...Collection) Collections
- func (collections Collections) ElAtIndex(index int) string
- func (collections Collections) Empty() bool
- func (collections Collections) Find(denom string) (Collection, bool)
- func (collections Collections) Len() int
- func (collections Collections) Less(i, j int) bool
- func (collections Collections) MarshalJSON() ([]byte, error)
- func (collections Collections) Remove(denom string) (Collections, bool)
- func (collections Collections) Sort() Collections
- func (collections Collections) String() string
- func (collections Collections) Swap(i, j int)
- func (collections *Collections) UnmarshalJSON(b []byte) error
- type Findable
- type FindableInt64
- type GenesisState
- type IDCollection
- type IDCollections
- func (idCollections IDCollections) Append(idCollections2 ...IDCollection) IDCollections
- func (idCollections IDCollections) ElAtIndex(index int) string
- func (idCollections IDCollections) Len() int
- func (idCollections IDCollections) Less(i, j int) bool
- func (idCollections IDCollections) Sort() IDCollections
- func (idCollections IDCollections) String() string
- func (idCollections IDCollections) Swap(i, j int)
- type MsgBurnNFT
- type MsgEditNFTMetadata
- type MsgMintNFT
- type MsgTransferNFT
- type MsgUpdateReserveNFT
- type NFTJSON
- type NFTs
- func (nfts NFTs) Append(nftsB ...exported.NFT) NFTs
- func (nfts NFTs) ElAtIndex(index int) string
- func (nfts NFTs) Empty() bool
- func (nfts NFTs) Find(id string) (nft exported.NFT, found bool)
- func (nfts NFTs) Len() int
- func (nfts NFTs) Less(i, j int) bool
- func (nfts NFTs) MarshalJSON() ([]byte, error)
- func (nfts NFTs) Remove(id string) (NFTs, bool)
- func (nfts NFTs) Sort() NFTs
- func (nfts NFTs) String() string
- func (nfts NFTs) Swap(i, j int)
- func (nfts *NFTs) UnmarshalJSON(b []byte) error
- func (nfts NFTs) Update(id string, nft exported.NFT) (NFTs, bool)
- type Owner
- type QueryBalanceParams
- type QueryCollectionParams
- type QueryNFTParams
- type QuerySubTokensParams
- type ResponseSubToken
- type ResponseSubTokens
- type SortedIntArray
- func (sa SortedIntArray) ElAtIndex(index int) int64
- func (sa SortedIntArray) Find(el int64) (idx int)
- func (sa SortedIntArray) Len() int
- func (sa SortedIntArray) Less(i, j int) bool
- func (sa SortedIntArray) Sort() SortedIntArray
- func (sa SortedIntArray) String() string
- func (sa SortedIntArray) Swap(i, j int)
- type SortedStringArray
- type TokenOwner
- func (t TokenOwner) GetAddress() sdk.AccAddress
- func (t TokenOwner) GetSubTokenIDs() []int64
- func (t TokenOwner) RemoveSubTokenID(subTokenID int64) exported.TokenOwner
- func (t TokenOwner) SetSubTokenID(subTokenID int64) exported.TokenOwner
- func (t TokenOwner) SortSubTokensFix() exported.TokenOwner
- func (t TokenOwner) String() string
- type TokenOwners
- type TokenOwnersJSON
Constants ¶
const ( // Default coin codespace DefaultCodespace string = ModuleName CodeInvalidCollection CodeType = 101 CodeUnknownCollection CodeType = 102 CodeInvalidNFT CodeType = 103 CodeUnknownNFT CodeType = 104 CodeNFTAlreadyExists CodeType = 105 CodeEmptyMetadata CodeType = 106 CodeInvalidQuantity CodeType = 107 CodeInvalidReserve CodeType = 108 CodeNotAllowedBurn CodeType = 109 CodeNotAllowedMint CodeType = 110 CodeInvalidDenom CodeType = 111 CodeInvalidTokenID CodeType = 112 CodeNotUniqueSubTokenIDs CodeType = 113 CodeNotUniqueTokenURI CodeType = 114 CodeOwnerDoesNotOwnSubTokenID CodeType = 115 CodeInvalidSenderAddress CodeType = 116 CodeInvalidRecipientAddress CodeType = 117 CodeForbiddenToTransferToYourself CodeType = 118 CodeNotUniqueTokenID CodeType = 119 CodeNotAllowedUpdateNFTReserve CodeType = 120 CodeNotSetValueLowerNow CodeType = 121 CodeNotEnoughFunds CodeType = 122 )
const ( // ModuleName is the name of the module ModuleName = "nft" // StoreKey is the default store key for NFT StoreKey = coin.StoreKey // QuerierRoute is the querier route for the NFT store. QuerierRoute = ModuleName // RouterKey is the message route for the NFT module RouterKey = ModuleName )
const NFTPrefix = 0x60
const OwnerKeyHashLength = 54
const ReservedPool = "reserved_pool"
Variables ¶
var ( EventTypeTransfer = "transfer_nft" EventTypeEditNFTMetadata = "edit_nft_metadata" EventTypeMintNFT = "mint_nft" EventTypeBurnNFT = "burn_nft" EventTypeUpdateReserveNFT = "update_nft_reserve" AttributeValueCategory = ModuleName AttributeKeySender = "sender" AttributeKeyRecipient = "recipient" AttributeKeyOwner = "owner" AttributeKeyNFTID = "nft_id" AttributeKeyNFTTokenURI = "token_uri" AttributeKeyDenom = "denom" AttributeKeySubTokenIDStartRange = "sub_token_id_start_range" )
NFT module event types
var ( CollectionsKeyPrefix = []byte{NFTPrefix, 0x00} // key for NFT collections OwnersKeyPrefix = []byte{NFTPrefix, 0x01} // key for balance of NFTs held by an address SubTokenKeyPrefix = []byte{NFTPrefix, 0x02} LastSubTokenIDKeyPrefix = []byte{NFTPrefix, 0x03} TokenURIKeyPrefix = []byte{NFTPrefix, 0x04} TokenIDKeyPrefix = []byte{NFTPrefix, 0x05} )
var ( Addrs = CreateTestAddrs(100) Denom1 = "test_denom1" Denom2 = "test_denom2" Denom3 = "test_denom3" ID1 = "1" ID2 = "2" ID3 = "3" TokenURI1 = "https://google.com/token-1.json" TokenURI2 = "https://google.com/token-2.json" )
nolint: deadcode unused
var MinReserve = sdk.NewInt(100)
var ModuleCdc *codec.Codec
ModuleCdc generic sealed codec to be used throughout this module
var NewMinReserve = helpers.BipToPip(sdk.NewInt(100))
var NewMinReserve2 = helpers.BipToPip(sdk.NewInt(1))
Functions ¶
func CheckUnique ¶
---------------------------------------------------------------------------
func CreateTestAddrs ¶
func CreateTestAddrs(numAddrs int) []sdk.AccAddress
CreateTestAddrs creates test addresses
func ErrEmptyMetadata ¶
func ErrInvalidCollection ¶
func ErrInvalidDenom ¶
func ErrInvalidNFT ¶
func ErrInvalidQuantity ¶
func ErrInvalidReserve ¶
func ErrInvalidSenderAddress ¶
func ErrInvalidTokenID ¶
func ErrNFTAlreadyExists ¶
func ErrNotAllowedBurn ¶
func ErrNotAllowedMint ¶
func ErrNotAllowedUpdateReserve ¶ added in v1.2.6
func ErrNotEnoughFunds ¶ added in v1.2.6
func ErrNotSetValueLowerNow ¶ added in v1.2.6
func ErrNotUniqueSubTokenIDs ¶
func ErrNotUniqueTokenID ¶
func ErrNotUniqueTokenURI ¶
func ErrUnknownCollection ¶
func FindUtil ¶
FindUtil is a binary search funcion for types that support the Findable interface (elements must be sorted)
func FindUtilInt64 ¶
func FindUtilInt64(group FindableInt64, el int64) int
func GetCollectionKey ¶
GetCollectionKey gets the key of a collection
func GetLastSubTokenIDKey ¶
func GetOwnerKey ¶
func GetOwnerKey(address sdk.AccAddress, denom string) []byte
GetOwnerKey gets the key of a collection owned by an account address
func GetOwnersKey ¶
func GetOwnersKey(address sdk.AccAddress) []byte
GetOwnersKey gets the key prefix for all the collections owned by an account address
func GetSubTokenKey ¶
func GetTokenIDKey ¶
func GetTokenURIKey ¶
func NewBaseNFT ¶
func NewBaseNFT(id string, creator, owner sdk.AccAddress, tokenURI string, reserve sdk.Int, subTokenIDs []int64, allowMint bool) exported.NFT
NewBaseNFT creates a new NFT instance
func SplitOwnerKey ¶
func SplitOwnerKey(key []byte) (sdk.AccAddress, []byte)
SplitOwnerKey gets an address and denom from an owner key
func TransferNFT ¶
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis performs basic validation of nfts genesis data returning an error for any failed validation criteria.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface {
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
}
AccountKeeper defines the expected account keeper (noalias)
type BaseNFT ¶
type BaseNFT struct { ID string `json:"id,omitempty" yaml:"id"` // id of the token; not exported to clients Owners exported.TokenOwners `json:"owners" yaml:"owners"` // account addresses that owns the NFT Creator sdk.AccAddress `json:"creator" yaml:"creator"` TokenURI string `json:"token_uri" yaml:"token_uri"` // optional extra properties available for querying Reserve sdk.Int `json:"reserve" yaml:"reserve"` AllowMint bool `json:"allow_mint" yaml:"allow_mint"` }
BaseNFT non fungible token definition
func (BaseNFT) EditMetadata ¶
EditMetadata edits metadata of an nft
func (BaseNFT) GetAllowMint ¶
func (BaseNFT) GetCreator ¶
func (bnft BaseNFT) GetCreator() sdk.AccAddress
func (BaseNFT) GetOwners ¶
func (bnft BaseNFT) GetOwners() exported.TokenOwners
GetOwner returns the account address that owns the NFT
func (BaseNFT) GetReserve ¶
func (BaseNFT) GetTokenURI ¶
GetTokenURI returns the path to optional extra properties
func (BaseNFT) MarshalJSON ¶
func (*BaseNFT) UnmarshalJSON ¶
type BaseNFTJSON ¶
type BaseNFTJSON struct { ID string `json:"id,omitempty" yaml:"id"` // id of the token; not exported to clients Owners TokenOwners `json:"owners" yaml:"owners"` // account addresses that owns the NFT Creator sdk.AccAddress `json:"creator" yaml:"creator"` TokenURI string `json:"token_uri" yaml:"token_uri"` // optional extra properties available for querying Reserve sdk.Int `json:"reserve" yaml:"reserve"` AllowMint bool `json:"allow_mint" yaml:"allow_mint"` }
NFTJSON is the exported NFT format for clients
type Collection ¶
type Collection struct { Denom string `json:"denom,omitempty" yaml:"denom"` // name of the collection; not exported to clients NFTs NFTs `json:"nfts" yaml:"nfts"` // NFTs that belong to a collection }
Collection of non fungible tokens
func EmptyCollection ¶
func EmptyCollection() Collection
EmptyCollection returns an empty collection
func NewCollection ¶
func NewCollection(denom string, nfts NFTs) Collection
NewCollection creates a new NFT Collection
func (Collection) AddNFT ¶
func (collection Collection) AddNFT(nft exported.NFT) (Collection, error)
AddNFT adds an NFT to the collection
func (Collection) ContainsNFT ¶
func (collection Collection) ContainsNFT(id string) bool
ContainsNFT returns whether or not a Collection contains an NFT
func (Collection) DeleteNFT ¶
func (collection Collection) DeleteNFT(nft exported.NFT) (Collection, error)
DeleteNFT deletes an NFT from a collection
func (Collection) GetNFT ¶
func (collection Collection) GetNFT(id string) (nft exported.NFT, err error)
GetNFT gets a NFT from the collection
func (Collection) String ¶
func (collection Collection) String() string
String follows stringer interface
func (Collection) Supply ¶
func (collection Collection) Supply() int
Supply gets the total supply of NFTs of a collection
func (Collection) UpdateNFT ¶
func (collection Collection) UpdateNFT(nft exported.NFT) (Collection, error)
UpdateNFT updates an NFT from a collection
type CollectionJSON ¶
type CollectionJSON map[string]Collection
CollectionJSON is the exported Collection format for clients
type Collections ¶
type Collections []Collection
Collections define an array of Collection
func NewCollections ¶
func NewCollections(collections ...Collection) Collections
NewCollections creates a new set of NFTs
func (Collections) Append ¶
func (collections Collections) Append(collectionsB ...Collection) Collections
Append appends two sets of Collections
func (Collections) ElAtIndex ¶
func (collections Collections) ElAtIndex(index int) string
func (Collections) Empty ¶
func (collections Collections) Empty() bool
Empty returns true if there are no collections and false otherwise.
func (Collections) Find ¶
func (collections Collections) Find(denom string) (Collection, bool)
Find returns the searched collection from the set
func (Collections) Len ¶
func (collections Collections) Len() int
func (Collections) Less ¶
func (collections Collections) Less(i, j int) bool
func (Collections) MarshalJSON ¶
func (collections Collections) MarshalJSON() ([]byte, error)
MarshalJSON for Collections
func (Collections) Remove ¶
func (collections Collections) Remove(denom string) (Collections, bool)
Remove removes a collection from the set of collections
func (Collections) Sort ¶
func (collections Collections) Sort() Collections
Sort is a helper function to sort the set of coins inplace
func (Collections) String ¶
func (collections Collections) String() string
String follows stringer interface
func (Collections) Swap ¶
func (collections Collections) Swap(i, j int)
func (*Collections) UnmarshalJSON ¶
func (collections *Collections) UnmarshalJSON(b []byte) error
UnmarshalJSON for Collections
type Findable ¶
Findable is an interface for iterable types that allows the FindUtil function to work
type FindableInt64 ¶
type GenesisState ¶
type GenesisState struct { Owners []Owner `json:"owners"` Collections Collections `json:"collections"` }
GenesisState is the state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func NewGenesisState ¶
func NewGenesisState(owners []Owner, collections Collections) GenesisState
NewGenesisState creates a new genesis state.
type IDCollection ¶
type IDCollection struct { Denom string `json:"denom" yaml:"denom"` IDs SortedStringArray `json:"ids" yaml:"ids"` }
IDCollection defines a set of nft ids that belong to a specific collection
func NewIDCollection ¶
func NewIDCollection(denom string, ids []string) IDCollection
NewIDCollection creates a new IDCollection instance
func (IDCollection) AddID ¶
func (idCollection IDCollection) AddID(id string) IDCollection
AddID adds an ID to the idCollection
func (IDCollection) DeleteID ¶
func (idCollection IDCollection) DeleteID(id string) (IDCollection, error)
DeleteID deletes an ID from an ID Collection
func (IDCollection) Exists ¶
func (idCollection IDCollection) Exists(id string) (exists bool)
Exists determines whether an ID is in the IDCollection
func (IDCollection) String ¶
func (idCollection IDCollection) String() string
String follows stringer interface
func (IDCollection) Supply ¶
func (idCollection IDCollection) Supply() int
Supply gets the total supply of NFTIDs of a balance
type IDCollections ¶
type IDCollections []IDCollection
IDCollections is an array of ID Collections whose sole purpose is for find
func (IDCollections) Append ¶
func (idCollections IDCollections) Append(idCollections2 ...IDCollection) IDCollections
Append appends IDCollections to IDCollections
func (IDCollections) ElAtIndex ¶
func (idCollections IDCollections) ElAtIndex(index int) string
func (IDCollections) Len ¶
func (idCollections IDCollections) Len() int
func (IDCollections) Less ¶
func (idCollections IDCollections) Less(i, j int) bool
func (IDCollections) Sort ¶
func (idCollections IDCollections) Sort() IDCollections
Sort is a helper function to sort the set of strings in place
func (IDCollections) String ¶
func (idCollections IDCollections) String() string
String follows stringer interface
func (IDCollections) Swap ¶
func (idCollections IDCollections) Swap(i, j int)
type MsgBurnNFT ¶
type MsgBurnNFT struct { Sender sdk.AccAddress `json:"sender"` ID string `json:"id"` Denom string `json:"denom"` SubTokenIDs []int64 `json:"sub_token_ids"` }
func NewMsgBurnNFT ¶
func NewMsgBurnNFT(sender sdk.AccAddress, id string, denom string, subTokenIDs []int64) MsgBurnNFT
NewMsgBurnNFT is a constructor function for MsgBurnNFT
func (MsgBurnNFT) GetSignBytes ¶
func (msg MsgBurnNFT) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgBurnNFT) GetSigners ¶
func (msg MsgBurnNFT) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgBurnNFT) ValidateBasic ¶
func (msg MsgBurnNFT) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgEditNFTMetadata ¶
type MsgEditNFTMetadata struct { Sender sdk.AccAddress `json:"sender"` ID string `json:"id"` Denom string `json:"denom"` TokenURI string `json:"token_uri"` }
func NewMsgEditNFTMetadata ¶
func NewMsgEditNFTMetadata(sender sdk.AccAddress, id, denom, tokenURI string, ) MsgEditNFTMetadata
NewMsgEditNFTMetadata is a constructor function for MsgSetName
func (MsgEditNFTMetadata) GetSignBytes ¶
func (msg MsgEditNFTMetadata) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgEditNFTMetadata) GetSigners ¶
func (msg MsgEditNFTMetadata) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgEditNFTMetadata) ValidateBasic ¶
func (msg MsgEditNFTMetadata) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgMintNFT ¶
type MsgMintNFT struct { Sender sdk.AccAddress `json:"sender"` Recipient sdk.AccAddress `json:"recipient"` ID string `json:"id"` Denom string `json:"denom"` Quantity sdk.Int `json:"quantity"` TokenURI string `json:"token_uri"` Reserve sdk.Int `json:"reserve"` AllowMint bool `json:"allow_mint"` }
func NewMsgMintNFT ¶
func NewMsgMintNFT(sender, recipient sdk.AccAddress, id, denom, tokenURI string, quantity, reserve sdk.Int, allowMint bool) MsgMintNFT
NewMsgMintNFT is a constructor function for MsgMintNFT
func (MsgMintNFT) GetSignBytes ¶
func (msg MsgMintNFT) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgMintNFT) GetSigners ¶
func (msg MsgMintNFT) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgMintNFT) ValidateBasic ¶
func (msg MsgMintNFT) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgTransferNFT ¶
type MsgTransferNFT struct { Sender sdk.AccAddress `json:"sender"` Recipient sdk.AccAddress `json:"recipient"` ID string `json:"id"` Denom string `json:"denom"` SubTokenIDs []int64 `json:"sub_token_ids"` }
func NewMsgTransferNFT ¶
func NewMsgTransferNFT(sender, recipient sdk.AccAddress, denom, id string, subTokenIDs []int64) MsgTransferNFT
NewMsgTransferNFT is a constructor function for MsgSetName
func (MsgTransferNFT) GetSignBytes ¶
func (msg MsgTransferNFT) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgTransferNFT) GetSigners ¶
func (msg MsgTransferNFT) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgTransferNFT) ValidateBasic ¶
func (msg MsgTransferNFT) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgUpdateReserveNFT ¶ added in v1.2.6
type MsgUpdateReserveNFT struct { Sender sdk.AccAddress `json:"sender"` ID string `json:"id"` Denom string `json:"denom"` SubTokenIDs []int64 `json:"sub_token_ids"` NewReserveNFT sdk.Int `json:"reserve"` }
---------------------------------------------------------------------------
MsgUpdateReservNFT
---------------------------------------------------------------------------
func NewMsgUpdateReserveNFT ¶ added in v1.2.6
func NewMsgUpdateReserveNFT(sender sdk.AccAddress, id string, denom string, subTokenIDs []int64, newReserveNFT sdk.Int) MsgUpdateReserveNFT
NewUpdateReservNFT is a constructor function for MsgUpdateReservNFT
func (MsgUpdateReserveNFT) GetSignBytes ¶ added in v1.2.6
func (msg MsgUpdateReserveNFT) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgUpdateReserveNFT) GetSigners ¶ added in v1.2.6
func (msg MsgUpdateReserveNFT) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgUpdateReserveNFT) Route ¶ added in v1.2.6
func (msg MsgUpdateReserveNFT) Route() string
Route Implements Msg
func (MsgUpdateReserveNFT) Type ¶ added in v1.2.6
func (msg MsgUpdateReserveNFT) Type() string
Type Implements Msg
func (MsgUpdateReserveNFT) ValidateBasic ¶ added in v1.2.6
func (msg MsgUpdateReserveNFT) ValidateBasic() error
ValidateBasic Implements Msg.
type NFTs ¶
NFTs define a list of NFT
type Owner ¶
type Owner struct { Address sdk.AccAddress `json:"address" yaml:"address"` IDCollections IDCollections `json:"idCollections" yaml:"idCollections"` }
Owner of non fungible tokens
func NewOwner ¶
func NewOwner(owner sdk.AccAddress, idCollections ...IDCollection) Owner
NewOwner creates a new Owner
func (Owner) GetIDCollection ¶
func (owner Owner) GetIDCollection(denom string) (IDCollection, bool)
GetIDCollection gets the IDCollection from the owner
func (Owner) UpdateIDCollection ¶
func (owner Owner) UpdateIDCollection(idCollection IDCollection) (Owner, error)
UpdateIDCollection updates the ID Collection of an owner
type QueryBalanceParams ¶
type QueryBalanceParams struct { Owner sdk.AccAddress Denom string // optional }
QueryBalanceParams params for query 'custom/nfts/balance'
func NewQueryBalanceParams ¶
func NewQueryBalanceParams(owner sdk.AccAddress, denom ...string) QueryBalanceParams
NewQueryBalanceParams creates a new instance of QuerySupplyParams
type QueryCollectionParams ¶
type QueryCollectionParams struct {
Denom string `json:"denom"`
}
QueryCollectionParams defines the params for queries: - 'custom/nft/supply' - 'custom/nft/collection'
func NewQueryCollectionParams ¶
func NewQueryCollectionParams(denom string) QueryCollectionParams
NewQueryCollectionParams creates a new instance of QuerySupplyParams
func (QueryCollectionParams) Bytes ¶
func (q QueryCollectionParams) Bytes() []byte
Bytes exports the Denom as bytes
type QueryNFTParams ¶
QueryNFTParams params for query 'custom/nfts/nft'
func NewQueryNFTParams ¶
func NewQueryNFTParams(denom, id string) QueryNFTParams
NewQueryNFTParams creates a new instance of QueryNFTParams
type QuerySubTokensParams ¶
type QuerySubTokensParams struct { Denom string `json:"denom"` TokenID string `json:"token_id"` SubTokenIDs []int64 `json:"sub_token_ids"` }
QuerySubTokensParams params for query 'custom/nfts/sub_tokens'
func NewQuerySubTokensParams ¶
func NewQuerySubTokensParams(denom, id string, subTokenIDs []int64) QuerySubTokensParams
NewQuerySubTokensParams creates a new instance of QuerySubTokensParams
type ResponseSubToken ¶
type ResponseSubTokens ¶
type ResponseSubTokens []ResponseSubToken
type SortedIntArray ¶
type SortedIntArray []int64
func (SortedIntArray) ElAtIndex ¶
func (sa SortedIntArray) ElAtIndex(index int) int64
func (SortedIntArray) Find ¶
func (sa SortedIntArray) Find(el int64) (idx int)
func (SortedIntArray) Len ¶
func (sa SortedIntArray) Len() int
func (SortedIntArray) Less ¶
func (sa SortedIntArray) Less(i, j int) bool
func (SortedIntArray) Sort ¶
func (sa SortedIntArray) Sort() SortedIntArray
Sort is a helper function to sort the set of strings in place
func (SortedIntArray) String ¶
func (sa SortedIntArray) String() string
String is the string representation
func (SortedIntArray) Swap ¶
func (sa SortedIntArray) Swap(i, j int)
type SortedStringArray ¶
type SortedStringArray []string
SortedStringArray is an array of strings whose sole purpose is to help with find
func (SortedStringArray) ElAtIndex ¶
func (sa SortedStringArray) ElAtIndex(index int) string
func (SortedStringArray) Len ¶
func (sa SortedStringArray) Len() int
func (SortedStringArray) Less ¶
func (sa SortedStringArray) Less(i, j int) bool
func (SortedStringArray) Sort ¶
func (sa SortedStringArray) Sort() SortedStringArray
Sort is a helper function to sort the set of strings in place
func (SortedStringArray) String ¶
func (sa SortedStringArray) String() string
String is the string representation
func (SortedStringArray) Swap ¶
func (sa SortedStringArray) Swap(i, j int)
type TokenOwner ¶
type TokenOwner struct { Address sdk.AccAddress `json:"address"` SubTokenIDs SortedIntArray `json:"sub_token_ids"` }
func NewTokenOwner ¶
func NewTokenOwner(address sdk.AccAddress, subTokenIDs []int64) TokenOwner
func (TokenOwner) GetAddress ¶
func (t TokenOwner) GetAddress() sdk.AccAddress
func (TokenOwner) GetSubTokenIDs ¶
func (t TokenOwner) GetSubTokenIDs() []int64
func (TokenOwner) RemoveSubTokenID ¶
func (t TokenOwner) RemoveSubTokenID(subTokenID int64) exported.TokenOwner
func (TokenOwner) SetSubTokenID ¶
func (t TokenOwner) SetSubTokenID(subTokenID int64) exported.TokenOwner
func (TokenOwner) SortSubTokensFix ¶ added in v1.2.4
func (t TokenOwner) SortSubTokensFix() exported.TokenOwner
func (TokenOwner) String ¶
func (t TokenOwner) String() string
type TokenOwners ¶
type TokenOwners struct {
Owners []exported.TokenOwner `json:"owners"`
}
func (TokenOwners) GetOwner ¶
func (t TokenOwners) GetOwner(address sdk.AccAddress) exported.TokenOwner
func (TokenOwners) GetOwners ¶
func (t TokenOwners) GetOwners() []exported.TokenOwner
func (TokenOwners) SetOwner ¶
func (t TokenOwners) SetOwner(owner exported.TokenOwner) exported.TokenOwners
func (TokenOwners) String ¶
func (t TokenOwners) String() string
func (*TokenOwners) UnmarshalJSON ¶
func (t *TokenOwners) UnmarshalJSON(b []byte) error
type TokenOwnersJSON ¶
type TokenOwnersJSON struct {
Owners []TokenOwner `json:"owners"`
}