Documentation ¶
Index ¶
- Constants
- func AllInvariants(k Keeper) sdk.Invariant
- func NewQuerier(k Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SupplyInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) DeleteNFT(ctx sdk.Context, denom, id string) (err 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) (nft exported.NFT, err error)
- func (k Keeper) GetOwner(ctx sdk.Context, address sdk.AccAddress) (owner types.Owner)
- func (k Keeper) GetOwnerByDenom(ctx sdk.Context, owner sdk.AccAddress, denom string) (idCollection types.IDCollection, found bool)
- func (k Keeper) GetOwners(ctx sdk.Context) (owners []types.Owner)
- func (k Keeper) IsNFT(ctx sdk.Context, denom, id string) (exists bool)
- func (k Keeper) IterateCollections(ctx sdk.Context, handler func(collection types.Collection) (stop bool))
- func (k Keeper) IterateIDCollections(ctx sdk.Context, prefix []byte, ...)
- func (k Keeper) IterateOwners(ctx sdk.Context, handler func(owner types.Owner) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintNFT(ctx sdk.Context, denom string, nft exported.NFT) (err error)
- func (k Keeper) SetCollection(ctx sdk.Context, denom string, collection types.Collection)
- func (k Keeper) SetOwner(ctx sdk.Context, owner types.Owner)
- func (k Keeper) SetOwnerByDenom(ctx sdk.Context, owner sdk.AccAddress, denom string, ids []string)
- func (k Keeper) SetOwners(ctx sdk.Context, owners []types.Owner)
- func (k Keeper) SwapOwners(ctx sdk.Context, denom string, id string, oldAddress sdk.AccAddress, ...) (err error)
- func (k Keeper) UpdateNFT(ctx sdk.Context, denom string, nft exported.NFT) (err error)
Constants ¶
const ( QuerySupply = "supply" QueryOwner = "owner" QueryOwnerByDenom = "ownerByDenom" QueryCollection = "collection" QueryDenoms = "denoms" QueryNFT = "nft" )
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 ¶
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 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 (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) GetOwnerByDenom ¶
func (k Keeper) GetOwnerByDenom(ctx sdk.Context, owner sdk.AccAddress, denom string) (idCollection types.IDCollection, found bool)
GetOwnerByDenom gets the ID Collection owned by an address of a specific denom
func (Keeper) IterateCollections ¶
func (k Keeper) IterateCollections(ctx sdk.Context, handler func(collection types.Collection) (stop bool))
IterateCollections iterates over collections and performs a function
func (Keeper) IterateIDCollections ¶
func (k Keeper) IterateIDCollections(ctx sdk.Context, prefix []byte, handler func(owner sdk.AccAddress, idCollection types.IDCollection) (stop bool))
IterateIDCollections iterates over the IDCollections by Owner and performs a function
func (Keeper) IterateOwners ¶
IterateOwners iterates over all Owners and performs a function
func (Keeper) MintNFT ¶
MintNFT mints an NFT and manages that NFTs existence within Collections and Owners
func (Keeper) SetCollection ¶
SetCollection sets the entire collection of a single denom
func (Keeper) SetOwnerByDenom ¶
SetOwnerByDenom sets a collection of NFT IDs owned by an address
func (Keeper) SwapOwners ¶
func (k Keeper) SwapOwners(ctx sdk.Context, denom string, id string, oldAddress sdk.AccAddress, newAddress sdk.AccAddress) (err error)
SwapOwners swaps the owners of a NFT ID