Documentation ¶
Index ¶
- Constants
- Variables
- type Keeper
- func (k Keeper) Balance(goCtx context.Context, r *nft.QueryBalanceRequest) (*nft.QueryBalanceResponse, error)
- func (k Keeper) BatchBurn(ctx sdk.Context, classID string, nftIDs []string) error
- func (k Keeper) BatchMint(ctx sdk.Context, tokens []nft.NFT, receiver sdk.AccAddress) error
- func (k Keeper) BatchTransfer(ctx sdk.Context, classID string, nftIDs []string, receiver sdk.AccAddress) error
- func (k Keeper) BatchUpdate(ctx sdk.Context, tokens []nft.NFT) error
- func (k Keeper) Burn(ctx sdk.Context, classID string, nftID string) error
- func (k Keeper) Class(goCtx context.Context, r *nft.QueryClassRequest) (*nft.QueryClassResponse, error)
- func (k Keeper) Classes(goCtx context.Context, r *nft.QueryClassesRequest) (*nft.QueryClassesResponse, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *nft.GenesisState
- func (k Keeper) GetBalance(ctx sdk.Context, classID string, owner sdk.AccAddress) uint64
- func (k Keeper) GetClass(ctx sdk.Context, classID string) (nft.Class, bool)
- func (k Keeper) GetClasses(ctx sdk.Context) (classes []*nft.Class)
- func (k Keeper) GetNFT(ctx sdk.Context, classID, nftID string) (nft.NFT, bool)
- func (k Keeper) GetNFTsOfClass(ctx sdk.Context, classID string) (nfts []nft.NFT)
- func (k Keeper) GetNFTsOfClassByOwner(ctx sdk.Context, classID string, owner sdk.AccAddress) (nfts []nft.NFT)
- func (k Keeper) GetOwner(ctx sdk.Context, classID string, nftID string) sdk.AccAddress
- func (k Keeper) GetTotalSupply(ctx sdk.Context, classID string) uint64
- func (k Keeper) HasClass(ctx sdk.Context, classID string) bool
- func (k Keeper) HasNFT(ctx sdk.Context, classID, id string) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, data *nft.GenesisState)
- func (k Keeper) Mint(ctx sdk.Context, token nft.NFT, receiver sdk.AccAddress) error
- func (k Keeper) NFT(goCtx context.Context, r *nft.QueryNFTRequest) (*nft.QueryNFTResponse, error)
- func (k Keeper) NFTs(goCtx context.Context, r *nft.QueryNFTsRequest) (*nft.QueryNFTsResponse, error)
- func (k Keeper) Owner(goCtx context.Context, r *nft.QueryOwnerRequest) (*nft.QueryOwnerResponse, error)
- func (k Keeper) SaveClass(ctx sdk.Context, class nft.Class) error
- func (k Keeper) Send(goCtx context.Context, msg *nft.MsgSend) (*nft.MsgSendResponse, error)
- func (k Keeper) Supply(goCtx context.Context, r *nft.QuerySupplyRequest) (*nft.QuerySupplyResponse, error)
- func (k Keeper) Transfer(ctx sdk.Context, classID string, nftID string, receiver sdk.AccAddress) error
- func (k Keeper) Update(ctx sdk.Context, token nft.NFT) error
- func (k Keeper) UpdateClass(ctx sdk.Context, class nft.Class) error
Constants ¶
const StoreKey = nft.ModuleName
StoreKey is the store key string for nft
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the nft store
func NewKeeper ¶
func NewKeeper(key storetypes.StoreKey, cdc codec.BinaryCodec, ak nft.AccountKeeper, bk nft.BankKeeper, ) Keeper
NewKeeper creates a new nft Keeper instance
func (Keeper) Balance ¶
func (k Keeper) Balance(goCtx context.Context, r *nft.QueryBalanceRequest) (*nft.QueryBalanceResponse, error)
Balance return the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721
func (Keeper) BatchBurn ¶ added in v0.47.0
BatchBurn defines a method for burning a batch of nfts from a specific classID. Note: When the upper module uses this method, it needs to authenticate nft
func (Keeper) BatchTransfer ¶ added in v0.47.0
func (k Keeper) BatchTransfer(ctx sdk.Context, classID string, nftIDs []string, receiver sdk.AccAddress, ) error
BatchTransfer defines a method for sending a batch of nfts from one account to another account from a specific classID. Note: When the upper module uses this method, it needs to authenticate nft
func (Keeper) BatchUpdate ¶ added in v0.47.0
BatchUpdate defines a method for updating a batch of exist nfts Note: When the upper module uses this method, it needs to authenticate nft
func (Keeper) Burn ¶
Burn defines a method for burning a nft from a specific account. Note: When the upper module uses this method, it needs to authenticate nft
func (Keeper) Class ¶
func (k Keeper) Class(goCtx context.Context, r *nft.QueryClassRequest) (*nft.QueryClassResponse, error)
Class return an NFT class based on its id
func (Keeper) Classes ¶
func (k Keeper) Classes(goCtx context.Context, r *nft.QueryClassesRequest) (*nft.QueryClassesResponse, error)
Classes return all NFT classes
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *nft.GenesisState
ExportGenesis returns a GenesisState for a given context.
func (Keeper) GetBalance ¶
GetBalance returns the specified account, the number of all nfts under the specified classID
func (Keeper) GetClass ¶
GetClass defines a method for returning the class information of the specified id
func (Keeper) GetClasses ¶
GetClasses defines a method for returning all classes information
func (Keeper) GetNFTsOfClass ¶
GetNFTsOfClass returns all nft information under the specified classID
func (Keeper) GetNFTsOfClassByOwner ¶
func (k Keeper) GetNFTsOfClassByOwner(ctx sdk.Context, classID string, owner sdk.AccAddress) (nfts []nft.NFT)
GetNFTsOfClassByOwner returns all nft information of the specified classID under the specified owner
func (Keeper) GetTotalSupply ¶
GetTotalSupply returns the number of all nfts under the specified classID
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data *nft.GenesisState)
InitGenesis new nft genesis
func (Keeper) NFT ¶
func (k Keeper) NFT(goCtx context.Context, r *nft.QueryNFTRequest) (*nft.QueryNFTResponse, error)
NFT return an NFT based on its class and id.
func (Keeper) NFTs ¶
func (k Keeper) NFTs(goCtx context.Context, r *nft.QueryNFTsRequest) (*nft.QueryNFTsResponse, error)
NFTs queries all NFTs of a given class or owner (at least one must be provided), similar to tokenByIndex in ERC721Enumerable
func (Keeper) Owner ¶
func (k Keeper) Owner(goCtx context.Context, r *nft.QueryOwnerRequest) (*nft.QueryOwnerResponse, error)
Owner return the owner of the NFT based on its class and id, same as ownerOf in ERC721
func (Keeper) Supply ¶
func (k Keeper) Supply(goCtx context.Context, r *nft.QuerySupplyRequest) (*nft.QuerySupplyResponse, error)
Supply return the number of NFTs from the given class, same as totalSupply of ERC721.
func (Keeper) Transfer ¶
func (k Keeper) Transfer(ctx sdk.Context, classID string, nftID string, receiver sdk.AccAddress, ) error
Transfer defines a method for sending a nft from one account to another account. Note: When the upper module uses this method, it needs to authenticate nft