Documentation
¶
Index ¶
- Constants
- func AllInvariants(k Keeper) sdk.Invariant
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SupplyInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) BurnNFT(c context.Context, msg *types.MsgBurnNFT) (*types.MsgBurnNFTResponse, error)
- func (k Keeper) DeleteNFTSubTokens(ctx sdk.Context, denom, id string, subTokenIDsToDelete []uint64) error
- func (k Keeper) EditNFT(ctx sdk.Context, denom, id string, tokenURI string) error
- func (k Keeper) EditNFTMetadata(c context.Context, msg *types.MsgEditNFTMetadata) (*types.MsgEditNFTMetadataResponse, error)
- func (k Keeper) GenAndMintSubTokens(ctx sdk.Context, denom, id string, reserve, quantity sdk.Int, creator string) (types.SortedUintArray, error)
- func (k Keeper) GetCollection(ctx sdk.Context, denom string) (collection types.Collection, found bool)
- func (k Keeper) GetCollections(ctx sdk.Context) (collections []types.Collection)
- func (k Keeper) GetDenoms(ctx sdk.Context) (denoms []string)
- func (k Keeper) GetNFT(ctx sdk.Context, denom, id string) (types.BaseNFT, error)
- func (k Keeper) GetNFTs(ctx sdk.Context) (nfts []types.BaseNFT)
- func (k Keeper) GetOwnerCollectionByDenom(ctx sdk.Context, address sdk.AccAddress, denom string) (oc types.OwnerCollection, found bool)
- func (k Keeper) GetOwnerCollections(ctx sdk.Context, address sdk.AccAddress) []types.OwnerCollection
- func (k Keeper) GetSubToken(ctx sdk.Context, nftID string, subTokenID uint64) (types.SubToken, bool)
- func (k Keeper) GetSubTokens(ctx sdk.Context, nftID string) (subTokens []types.SubToken)
- func (k Keeper) HasTokenID(ctx sdk.Context, id string) bool
- func (k Keeper) HasTokenURI(ctx sdk.Context, tokenURI string) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Mint(ctx sdk.Context, denom, id string, reserve, quantity sdk.Int, ...) (uint64, error)
- func (k Keeper) MintNFT(c context.Context, msg *types.MsgMintNFT) (*types.MsgMintNFTResponse, error)
- func (k Keeper) MintNFTAndCollection(ctx sdk.Context, denom, id string, reserve sdk.Int, creator, owner string, ...) error
- func (k Keeper) MintSubTokens(ctx sdk.Context, id string, subTokens []types.SubToken)
- func (k Keeper) QueryCollection(c context.Context, req *types.QueryCollectionRequest) (*types.QueryCollectionResponse, error)
- func (k Keeper) QueryCollectionSupply(c context.Context, req *types.QueryCollectionSupplyRequest) (*types.QueryCollectionSupplyResponse, error)
- func (k Keeper) QueryDenoms(c context.Context, _ *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
- func (k Keeper) QueryNFT(c context.Context, req *types.QueryNFTRequest) (*types.QueryNFTResponse, error)
- func (k Keeper) QueryOwnerCollections(c context.Context, req *types.QueryOwnerCollectionsRequest) (*types.QueryOwnerCollectionsResponse, error)
- func (k Keeper) QuerySubTokens(c context.Context, req *types.QuerySubTokensRequest) (*types.QuerySubTokensResponse, error)
- func (k Keeper) RemoveSubToken(ctx sdk.Context, nftID string, subTokenID uint64)
- func (k Keeper) ReserveTokens(ctx sdk.Context, amount sdk.Coins, address sdk.AccAddress) error
- func (k Keeper) ReturnTokensTo(ctx sdk.Context, amount sdk.Coins, address sdk.AccAddress) error
- func (k Keeper) SetCollection(ctx sdk.Context, denom string, collection types.Collection)
- func (k Keeper) SetNFT(ctx sdk.Context, denom, id string, nft types.BaseNFT) error
- func (k Keeper) SetOwnerCollectionByDenom(ctx sdk.Context, owner sdk.AccAddress, denom string, ...)
- func (k Keeper) SetSubToken(ctx sdk.Context, nftID string, subToken types.SubToken)
- func (k Keeper) Transfer(ctx sdk.Context, denom, id string, sender, recipient string, ...) (types.BaseNFT, error)
- func (k Keeper) TransferNFT(c context.Context, msg *types.MsgTransferNFT) (*types.MsgTransferNFTResponse, error)
- func (k Keeper) UpdateNFTReserve(ctx sdk.Context, denom, id string, subTokenIDs []uint64, newReserve sdk.Int) error
- func (k Keeper) UpdateReserveNFT(c context.Context, msg *types.MsgUpdateReserveNFT) (*types.MsgUpdateReserveNFTResponse, error)
Constants ¶
const ( QuerySupply = "supply" QueryOwner = "owner" QueryOwnerByDenom = "ownerByDenom" QueryCollection = "collection" QueryDenoms = "denoms" QueryNFT = "nft" QuerySubTokens = "sub_tokens" )
query endpoints supported by the NFT Querier
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the nfts module.
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier is the module level router for state queries
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all supply invariants
func SupplyInvariant ¶
SupplyInvariant checks that the total amount of nfts on collections matches the total amount nfts in store
Types ¶
type Keeper ¶
type Keeper struct { BaseDenom *string // contains filtered or unexported fields }
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, storeKey sdk.StoreKey, bankKeeper keeper.Keeper, baseDenom string) *Keeper
NewKeeper creates new instances of the nft Keeper
func (Keeper) BurnNFT ¶
func (k Keeper) BurnNFT(c context.Context, msg *types.MsgBurnNFT) (*types.MsgBurnNFTResponse, error)
func (Keeper) DeleteNFTSubTokens ¶
func (k Keeper) DeleteNFTSubTokens(ctx sdk.Context, denom, id string, subTokenIDsToDelete []uint64) error
DeleteNFTSubTokens deletes an NFT sub tokens from store
func (Keeper) EditNFTMetadata ¶
func (k Keeper) EditNFTMetadata(c context.Context, msg *types.MsgEditNFTMetadata) (*types.MsgEditNFTMetadataResponse, error)
func (Keeper) GenAndMintSubTokens ¶
func (Keeper) GetCollection ¶
func (k Keeper) GetCollection(ctx sdk.Context, denom string) (collection types.Collection, found bool)
GetCollection returns a collection of NFTs
func (Keeper) GetCollections ¶
func (k Keeper) GetCollections(ctx sdk.Context) (collections []types.Collection)
GetCollections returns all the NFTs collections
func (Keeper) GetOwnerCollectionByDenom ¶
func (k Keeper) GetOwnerCollectionByDenom(ctx sdk.Context, address sdk.AccAddress, denom string) (oc types.OwnerCollection, found bool)
GetOwnerCollectionByDenom gets the ID Collection owned by an address of a specific denom
func (Keeper) GetOwnerCollections ¶
func (k Keeper) GetOwnerCollections(ctx sdk.Context, address sdk.AccAddress) []types.OwnerCollection
GetOwnerCollections gets all the ID Collections owned by an address
func (Keeper) GetSubToken ¶
func (Keeper) GetSubTokens ¶
func (Keeper) HasTokenID ¶
HasTokenID check if nft exists
func (Keeper) MintNFT ¶
func (k Keeper) MintNFT(c context.Context, msg *types.MsgMintNFT) (*types.MsgMintNFTResponse, error)
func (Keeper) MintNFTAndCollection ¶
func (k Keeper) MintNFTAndCollection( ctx sdk.Context, denom, id string, reserve sdk.Int, creator, owner string, tokenURI string, allowMint bool, subTokenIDs []uint64, ) error
MintNFTAndCollection mints an NFT and manages that NFTs existence within Collections and Owners
func (Keeper) MintSubTokens ¶
func (Keeper) QueryCollection ¶
func (k Keeper) QueryCollection(c context.Context, req *types.QueryCollectionRequest) (*types.QueryCollectionResponse, error)
func (Keeper) QueryCollectionSupply ¶
func (k Keeper) QueryCollectionSupply(c context.Context, req *types.QueryCollectionSupplyRequest) (*types.QueryCollectionSupplyResponse, error)
func (Keeper) QueryDenoms ¶
func (k Keeper) QueryDenoms(c context.Context, _ *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
func (Keeper) QueryNFT ¶
func (k Keeper) QueryNFT(c context.Context, req *types.QueryNFTRequest) (*types.QueryNFTResponse, error)
func (Keeper) QueryOwnerCollections ¶
func (k Keeper) QueryOwnerCollections(c context.Context, req *types.QueryOwnerCollectionsRequest) (*types.QueryOwnerCollectionsResponse, error)
func (Keeper) QuerySubTokens ¶
func (k Keeper) QuerySubTokens(c context.Context, req *types.QuerySubTokensRequest) (*types.QuerySubTokensResponse, error)
func (Keeper) RemoveSubToken ¶
func (Keeper) ReserveTokens ¶
func (Keeper) ReturnTokensTo ¶
func (Keeper) SetCollection ¶
SetCollection sets the entire collection of a single denom
func (Keeper) SetOwnerCollectionByDenom ¶
func (k Keeper) SetOwnerCollectionByDenom(ctx sdk.Context, owner sdk.AccAddress, denom string, ownerCollection types.OwnerCollection)
SetOwnerCollectionByDenom sets a collection of NFT IDs owned by an address
func (Keeper) SetSubToken ¶
func (Keeper) TransferNFT ¶
func (k Keeper) TransferNFT(c context.Context, msg *types.MsgTransferNFT) (*types.MsgTransferNFTResponse, error)
func (Keeper) UpdateNFTReserve ¶
func (k Keeper) UpdateNFTReserve(ctx sdk.Context, denom, id string, subTokenIDs []uint64, newReserve sdk.Int) error
UpdateNFTReserve increases the minimum reserve of the NFT token
func (Keeper) UpdateReserveNFT ¶
func (k Keeper) UpdateReserveNFT(c context.Context, msg *types.MsgUpdateReserveNFT) (*types.MsgUpdateReserveNFTResponse, error)