Documentation ¶
Index ¶
- Constants
- Variables
- type Keeper
- func (k Keeper) Balance(goCtx context.Context, r *nft.QueryBalanceRequest) (*nft.QueryBalanceResponse, error)
- func (k Keeper) BatchBurn(ctx context.Context, classID string, nftIDs []string) error
- func (k Keeper) BatchMint(ctx context.Context, tokens []nft.NFT, receiver sdk.AccAddress) error
- func (k Keeper) BatchTransfer(ctx context.Context, classID string, nftIDs []string, receiver sdk.AccAddress) error
- func (k Keeper) BatchUpdate(ctx context.Context, tokens []nft.NFT) error
- func (k Keeper) Burn(ctx context.Context, classID, 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 context.Context, classID string, owner sdk.AccAddress) uint64
- func (k Keeper) GetClass(ctx context.Context, classID string) (nft.Class, bool)
- func (k Keeper) GetClasses(ctx context.Context) (classes []*nft.Class)
- func (k Keeper) GetNFT(ctx context.Context, classID, nftID string) (nft.NFT, bool)
- func (k Keeper) GetNFTsOfClass(ctx context.Context, classID string) (nfts []nft.NFT)
- func (k Keeper) GetNFTsOfClassByOwner(ctx context.Context, classID string, owner sdk.AccAddress) (nfts []nft.NFT)
- func (k Keeper) GetOwner(ctx context.Context, classID, nftID string) sdk.AccAddress
- func (k Keeper) GetTotalSupply(ctx context.Context, classID string) uint64
- func (k Keeper) HasClass(ctx context.Context, classID string) bool
- func (k Keeper) HasNFT(ctx context.Context, classID, id string) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, data *nft.GenesisState)
- func (k Keeper) Mint(ctx context.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 context.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 context.Context, classID string, nftID string, receiver sdk.AccAddress) error
- func (k Keeper) Update(ctx context.Context, token nft.NFT) error
- func (k Keeper) UpdateClass(ctx context.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(storeService store.KVStoreService, 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 ¶
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) BatchMint ¶
BatchMint defines a method for minting a batch of nfts
func (Keeper) BatchTransfer ¶
func (k Keeper) BatchTransfer(ctx context.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 ¶
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) GetNFT ¶
GetNFT returns the nft information of the specified classID and nftID
func (Keeper) GetNFTsOfClass ¶
GetNFTsOfClass returns all nft information under the specified classID
func (Keeper) GetNFTsOfClassByOwner ¶
func (k Keeper) GetNFTsOfClassByOwner(ctx context.Context, classID string, owner sdk.AccAddress) (nfts []nft.NFT)
GetNFTsOfClassByOwner returns all nft information of the specified classID under the specified owner
func (Keeper) GetOwner ¶
GetOwner returns the owner information of the specified nft
func (Keeper) GetTotalSupply ¶
GetTotalSupply returns the number of all nfts under the specified classID
func (Keeper) HasClass ¶
HasClass determines whether the specified classID exist
func (Keeper) HasNFT ¶
HasNFT determines whether the specified classID and nftID exist
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data *nft.GenesisState)
InitGenesis initializes the nft module's genesis state from a given genesis state.
func (Keeper) Mint ¶
Mint defines a method for minting a new nft
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) SaveClass ¶
SaveClass defines a method for creating a new nft class
func (Keeper) Send ¶
Send implements Send method of the types.MsgServer.
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 context.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
func (Keeper) Update ¶
Update defines a method for updating an exist nft Note: When the upper module uses this method, it needs to authenticate nft