Documentation ¶
Index ¶
- Constants
- Variables
- func AllInvariants(k Keeper) sdk.Invariant
- func MakeTestCodec() *codec.Codec
- func NewQuerier(k Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SupplyInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) BurnTokens(ctx sdk.Context, amount sdk.Coins) error
- func (k Keeper) DeleteNFT(ctx sdk.Context, denom, id string, subTokenIDs []int64) error
- func (k Keeper) ExistTokenID(ctx sdk.Context, id string) bool
- func (k Keeper) ExistTokenURI(ctx sdk.Context, tokenURI string) bool
- 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) GetLastSubTokenID(ctx sdk.Context, denom, id string) int64
- func (k Keeper) GetNFT(ctx sdk.Context, denom, id string) (exported.NFT, 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) GetReservedPool(ctx sdk.Context) exported.ModuleAccountI
- func (k Keeper) GetSubToken(ctx sdk.Context, denom, id string, subTokenID int64) (sdk.Int, bool)
- 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, id string, reserve, quantity sdk.Int, ...) (int64, error)
- func (k Keeper) RemoveSubToken(ctx sdk.Context, denom, id string, subTokenID int64)
- func (k Keeper) ReserveTokens(ctx sdk.Context, amount sdk.Coins, address sdk.AccAddress) error
- func (k Keeper) SetBaseDenom()
- func (k Keeper) SetCollection(ctx sdk.Context, denom string, collection types.Collection)
- func (k Keeper) SetLastSubTokenID(ctx sdk.Context, denom, id string, lastSubTokenID int64)
- 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) SetSubToken(ctx sdk.Context, denom, id string, subTokenID int64, reserve sdk.Int)
- func (k Keeper) SetTokenIDIndex(ctx sdk.Context, id string)
- func (k Keeper) SetTokenURI(ctx sdk.Context, tokenURI string)
- 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)
- func (k Keeper) UpdateNFTReserve(ctx sdk.Context, denom, id string, subTokenIDs []int64, newReserve sdk.Int) 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
const (
DefaultBondDenom = "del"
)
Variables ¶
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 { 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 CreateTestInput ¶
Hogpodge of all sorts of input required for testing. `initPower` is converted to an amount of tokens. If `initPower` is 0, no addrs get created.
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, supplyKeeper supply.Keeper, baseDenom string) Keeper
NewKeeper creates new instances of the nft Keeper
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) GetLastSubTokenID ¶
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) GetReservedPool ¶
func (k Keeper) GetReservedPool(ctx sdk.Context) exported.ModuleAccountI
func (Keeper) GetSubToken ¶
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 ¶
func (k Keeper) MintNFT(ctx sdk.Context, denom, id string, reserve, quantity sdk.Int, creator, owner sdk.AccAddress, tokenURI string, allowMint bool) (int64, error)
MintNFT mints an NFT and manages that NFTs existence within Collections and Owners
func (Keeper) RemoveSubToken ¶
func (Keeper) ReserveTokens ¶
func (Keeper) SetBaseDenom ¶
func (k Keeper) SetBaseDenom()
func (Keeper) SetCollection ¶
SetCollection sets the entire collection of a single denom
func (Keeper) SetLastSubTokenID ¶
func (Keeper) SetOwnerByDenom ¶
SetOwnerByDenom sets a collection of NFT IDs owned by an address
func (Keeper) SetSubToken ¶
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