Documentation
¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- 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) (types.BaseNFT, error)
- func (k Keeper) BurnNFT(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) 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(ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, ...) error
- func (k Keeper) GetCollection(ctx sdk.Context, denomID string) (types.Collection, error)
- func (k Keeper) GetCollections(ctx sdk.Context) (cs []types.Collection)
- func (k Keeper) GetDenom(ctx sdk.Context, id string) (denom types.Denom, err error)
- func (k Keeper) GetDenoms(ctx sdk.Context) (denoms []types.Denom)
- 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)
- func (k Keeper) GetOwner(ctx sdk.Context, address sdk.AccAddress, denom string) types.Owner
- func (k Keeper) GetOwners(ctx sdk.Context) (owners types.Owners)
- func (k Keeper) GetPaginateCollection(ctx sdk.Context, request *types.QueryCollectionRequest, denomID string) (types.Collection, *query.PageResponse, error)
- func (k Keeper) GetTotalSupply(ctx sdk.Context, denomID string) uint64
- func (k Keeper) GetTotalSupplyOfOwner(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64)
- func (k Keeper) HasDenomID(ctx sdk.Context, id string) bool
- func (k Keeper) HasDenomNm(ctx sdk.Context, name string) bool
- func (k Keeper) HasNFT(ctx sdk.Context, denomID, tokenID string) bool
- func (k Keeper) IssueDenom(ctx sdk.Context, id, name, schema string, creator sdk.AccAddress) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintNFT(ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, ...) error
- func (k Keeper) NFT(c context.Context, request *types.QueryNFTRequest) (*types.QueryNFTResponse, error)
- func (k Keeper) Owner(c context.Context, request *types.QueryOwnerRequest) (*types.QueryOwnerResponse, error)
- func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection) error
- func (k Keeper) SetDenom(ctx sdk.Context, denom types.Denom) error
- func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
- func (k Keeper) TransferOwner(ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the nfts module.
func NewMsgServerImpl ¶ added in v1.2.0
NewMsgServerImpl returns an implementation of the NFT MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
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) Authorize ¶
func (k Keeper) Authorize(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) (types.BaseNFT, error)
Authorize check if the sender is the issuer of nft, if it returns nft, if not, return an error
func (Keeper) Collection ¶
func (k Keeper) Collection(c context.Context, request *types.QueryCollectionRequest) (*types.QueryCollectionResponse, error)
func (Keeper) Denom ¶
func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error)
func (Keeper) Denoms ¶
func (k Keeper) Denoms(c context.Context, req *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
func (Keeper) EditNFT ¶
func (k Keeper) EditNFT( ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, owner sdk.AccAddress, ) error
EditNFT updates an already existing NFTs
func (Keeper) GetCollection ¶
GetCollection returns the collection by the specified denomID
func (Keeper) GetCollections ¶
func (k Keeper) GetCollections(ctx sdk.Context) (cs []types.Collection)
GetCollections returns all the collection
func (Keeper) GetPaginateCollection ¶ added in v1.2.0
func (k Keeper) GetPaginateCollection(ctx sdk.Context, request *types.QueryCollectionRequest, denomID string) (types.Collection, *query.PageResponse, error)
GetPaginateCollection returns the collection by the specified denomID
func (Keeper) GetTotalSupply ¶
GetTotalSupply returns the number of nft by the specified denomID
func (Keeper) GetTotalSupplyOfOwner ¶
func (k Keeper) GetTotalSupplyOfOwner(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64)
GetTotalSupplyOfOwner returns the amount of nft by the specified conditions
func (Keeper) HasDenomID ¶
HasDenomID returns whether the specified denomID exists
func (Keeper) HasDenomNm ¶
HasDenomNm returns whether the specified denomNm exists
func (Keeper) IssueDenom ¶
func (Keeper) MintNFT ¶
func (k Keeper) MintNFT( ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, owner sdk.AccAddress, ) error
MintNFT mints an NFT and manages that NFTs existence within Collections and Owners
func (Keeper) NFT ¶
func (k Keeper) NFT(c context.Context, request *types.QueryNFTRequest) (*types.QueryNFTResponse, error)
func (Keeper) Owner ¶
func (k Keeper) Owner(c context.Context, request *types.QueryOwnerRequest) (*types.QueryOwnerResponse, error)
func (Keeper) SetCollection ¶
SetCollection save all NFT and return error if existed
func (Keeper) Supply ¶
func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
func (Keeper) TransferOwner ¶
func (k Keeper) TransferOwner( ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenData string, srcOwner, dstOwner sdk.AccAddress, ) error
TransferOwner gets all the ID Collections owned by an address