Documentation ¶
Index ¶
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SupplyInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) Authorize(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error
- func (k Keeper) BurnNFT(goCtx context.Context, msg *types.MsgBurnNFT) (*types.MsgBurnNFTResponse, error)
- func (k Keeper) Collection(c context.Context, request *types.QueryCollectionRequest) (*types.QueryCollectionResponse, error)
- func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error)
- func (k Keeper) Denoms(c context.Context, req *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
- func (k Keeper) EditNFT(goCtx context.Context, msg *types.MsgEditNFT) (*types.MsgEditNFTResponse, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetBalance(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64)
- func (k Keeper) GetCollections(ctx sdk.Context) (cs []types.Collection, err error)
- func (k Keeper) GetDenomInfo(ctx sdk.Context, denomID string) (*types.Denom, error)
- func (k Keeper) GetNFT(ctx sdk.Context, denomID, tokenID string) (nft exported.NFT, err error)
- func (k Keeper) GetNFTs(ctx sdk.Context, denom string) (nfts []exported.NFT, err error)
- func (k Keeper) GetTotalSupply(ctx sdk.Context, denomID string) uint64
- func (k Keeper) HasDenom(ctx sdk.Context, denomID string) bool
- func (k Keeper) HasNFT(ctx sdk.Context, denomID, tokenID string) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) IssueDenom(goCtx context.Context, msg *types.MsgIssueDenom) (*types.MsgIssueDenomResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintNFT(goCtx context.Context, msg *types.MsgMintNFT) (*types.MsgMintNFTResponse, error)
- func (k Keeper) NFT(c context.Context, request *types.QueryNFTRequest) (*types.QueryNFTResponse, error)
- func (k Keeper) NFTkeeper() nftkeeper.Keeper
- func (k Keeper) NFTsOfOwner(c context.Context, request *types.QueryNFTsOfOwnerRequest) (*types.QueryNFTsOfOwnerResponse, error)
- func (k Keeper) RemoveNFT(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error
- func (k Keeper) SaveCollection(ctx sdk.Context, collection types.Collection) error
- func (k Keeper) SaveDenom(ctx sdk.Context, id, name, schema, symbol string, creator sdk.AccAddress, ...) error
- func (k Keeper) SaveNFT(ctx sdk.Context, ...) error
- func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
- func (k Keeper) TransferDenom(goCtx context.Context, msg *types.MsgTransferDenom) (*types.MsgTransferDenomResponse, error)
- func (k Keeper) TransferDenomOwner(ctx sdk.Context, denomID string, srcOwner, dstOwner sdk.AccAddress) error
- func (k Keeper) TransferNFT(goCtx context.Context, msg *types.MsgTransferNFT) (*types.MsgTransferNFTResponse, error)
- func (k Keeper) TransferOwnership(ctx sdk.Context, ...) error
- func (k Keeper) UpdateNFT(ctx sdk.Context, ...) error
- type LegacyKeeper
- func (n LegacyKeeper) BurnNFT(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error
- func (n LegacyKeeper) GetDenom(ctx sdk.Context, id string) (denom types.Denom, found bool)
- func (n LegacyKeeper) GetNFT(ctx sdk.Context, denomID, tokenID string) (nft exported.NFT, err error)
- func (n LegacyKeeper) IssueDenom(ctx sdk.Context, id, name, schema, symbol string, creator sdk.AccAddress, ...) error
- func (n LegacyKeeper) MintNFT(ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, ...) error
- func (n LegacyKeeper) TransferOwner(ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, ...) error
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 owned by addresses
Types ¶
type Keeper ¶
type Keeper struct {
// 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.Codec, storeKey storetypes.StoreKey, ak nft.AccountKeeper, bk nft.BankKeeper, ) Keeper
NewKeeper creates a new instance of the NFT Keeper
func (Keeper) Authorize ¶
Authorize checks if the sender is the owner of the given NFT Return the NFT if true, an error otherwise
func (Keeper) BurnNFT ¶
func (k Keeper) BurnNFT(goCtx context.Context, msg *types.MsgBurnNFT) (*types.MsgBurnNFTResponse, error)
func (Keeper) Collection ¶
func (k Keeper) Collection(c context.Context, request *types.QueryCollectionRequest) (*types.QueryCollectionResponse, error)
Collection queries the NFTs of the specified denom
func (Keeper) Denom ¶
func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error)
Denom queries the definition of a given denom
func (Keeper) Denoms ¶
func (k Keeper) Denoms(c context.Context, req *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
Denoms queries all the denoms
func (Keeper) EditNFT ¶
func (k Keeper) EditNFT(goCtx context.Context, msg *types.MsgEditNFT) (*types.MsgEditNFTResponse, error)
func (Keeper) ExportGenesis ¶ added in v1.7.0
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func (Keeper) GetBalance ¶ added in v1.7.0
GetBalance returns the amount of NFTs by the specified conditions
func (Keeper) GetCollections ¶
GetCollections returns all the collections
func (Keeper) GetDenomInfo ¶ added in v1.7.0
GetDenomInfo return the denom information
func (Keeper) GetTotalSupply ¶
GetTotalSupply returns the number of NFTs by the specified denom ID
func (Keeper) InitGenesis ¶ added in v1.7.0
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis stores the NFT genesis.
func (Keeper) IssueDenom ¶
func (k Keeper) IssueDenom(goCtx context.Context, msg *types.MsgIssueDenom) (*types.MsgIssueDenomResponse, error)
IssueDenom issue a new denom.
func (Keeper) MintNFT ¶
func (k Keeper) MintNFT(goCtx context.Context, msg *types.MsgMintNFT) (*types.MsgMintNFTResponse, error)
func (Keeper) NFT ¶
func (k Keeper) NFT(c context.Context, request *types.QueryNFTRequest) (*types.QueryNFTResponse, error)
NFT queries the NFT for the given denom and token ID
func (Keeper) NFTsOfOwner ¶ added in v1.7.0
func (k Keeper) NFTsOfOwner(c context.Context, request *types.QueryNFTsOfOwnerRequest) (*types.QueryNFTsOfOwnerResponse, error)
NFTsOfOwner queries the NFTs of the specified owner
func (Keeper) SaveCollection ¶ added in v1.7.0
SaveCollection saves all NFTs and returns an error if there already exists
func (Keeper) SaveDenom ¶ added in v1.7.0
func (k Keeper) SaveDenom(ctx sdk.Context, id, name, schema, symbol string, creator sdk.AccAddress, mintRestricted, updateRestricted bool, description, uri, uriHash, data string, ) error
SaveDenom issues a denom according to the given params
func (Keeper) SaveNFT ¶ added in v1.7.0
func (k Keeper) SaveNFT(ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenUriHash, tokenData string, receiver sdk.AccAddress, ) error
SaveNFT mints an NFT and manages the NFT's existence within Collections and Owners
func (Keeper) Supply ¶
func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
Supply queries the total supply of a given denom or owner
func (Keeper) TransferDenom ¶ added in v1.7.0
func (k Keeper) TransferDenom(goCtx context.Context, msg *types.MsgTransferDenom) (*types.MsgTransferDenomResponse, error)
func (Keeper) TransferDenomOwner ¶ added in v1.5.0
func (k Keeper) TransferDenomOwner( ctx sdk.Context, denomID string, srcOwner, dstOwner sdk.AccAddress, ) error
TransferDenomOwner transfers the ownership of the given denom to the new owner
func (Keeper) TransferNFT ¶ added in v1.7.0
func (k Keeper) TransferNFT(goCtx context.Context, msg *types.MsgTransferNFT) (*types.MsgTransferNFTResponse, error)
func (Keeper) TransferOwnership ¶ added in v1.7.0
func (k Keeper) TransferOwnership(ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData string, srcOwner, dstOwner sdk.AccAddress, ) error
TransferOwnership transfers the ownership of the given NFT to the new owner
type LegacyKeeper ¶ added in v1.5.2
type LegacyKeeper struct {
// contains filtered or unexported fields
}
func NewLegacyKeeper ¶ added in v1.5.2
func NewLegacyKeeper(nk Keeper) LegacyKeeper
func (LegacyKeeper) BurnNFT ¶ added in v1.5.2
func (n LegacyKeeper) BurnNFT(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error
func (LegacyKeeper) IssueDenom ¶ added in v1.5.2
func (n LegacyKeeper) IssueDenom( ctx sdk.Context, id, name, schema, symbol string, creator sdk.AccAddress, mintRestricted, updateRestricted bool, ) error
func (LegacyKeeper) MintNFT ¶ added in v1.5.2
func (n LegacyKeeper) MintNFT( ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, owner sdk.AccAddress, ) error
func (LegacyKeeper) TransferOwner ¶ added in v1.5.2
func (n LegacyKeeper) TransferOwner( ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, srcOwner, dstOwner sdk.AccAddress, ) error
type Migrator ¶ added in v1.7.0
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶ added in v1.7.0
NewMigrator returns a new Migrator.