Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SupplyInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) AddApproval(ctx sdk.Context, denomID, tokenID string, sender sdk.AccAddress, ...) error
- func (k Keeper) AddApprovalForAll(ctx sdk.Context, sender sdk.AccAddress, ...) error
- func (k Keeper) ApproveNFT(ctx sdk.Context, nft types.BaseNFT, approvedAddress sdk.AccAddress, ...)
- 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) DenomByName(c context.Context, request *types.QueryDenomByNameRequest) (*types.QueryDenomByNameResponse, error)
- func (k Keeper) DenomBySymbol(c context.Context, request *types.QueryDenomBySymbolRequest) (*types.QueryDenomBySymbolResponse, 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) GetApprovalsNFT(c context.Context, request *types.QueryApprovalsNFTRequest) (*types.QueryApprovalsNFTResponse, error)
- func (k Keeper) GetApprovedAddresses(ctx sdk.Context, sender sdk.AccAddress) (*types.ApprovedAddressesData, error)
- func (k Keeper) GetBaseNFT(ctx sdk.Context, denomID, tokenID string) (nft types.BaseNFT, err 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) GetDenomByName(ctx sdk.Context, name string) (denom types.Denom, err error)
- func (k Keeper) GetDenomBySymbol(ctx sdk.Context, symbol 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) GetNFTApprovedAddresses(ctx sdk.Context, denomID, tokenID string) (approvedAddresses []string, err error)
- func (k Keeper) GetNFTs(ctx sdk.Context, denom string) (nfts []exported.NFT)
- func (k Keeper) GetNftTotalCountForCollection(ctx sdk.Context, denomID string) uint64
- func (k Keeper) GetOwner(ctx sdk.Context, address sdk.AccAddress, denom string) (types.Owner, error)
- func (k Keeper) GetOwners(ctx sdk.Context) (owners types.Owners, err error)
- 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) HasDenomSymbol(ctx sdk.Context, name string) bool
- func (k Keeper) HasNFT(ctx sdk.Context, denomID, tokenID string) bool
- func (k Keeper) IncrementTotalCounterForCollection(ctx sdk.Context, denomID string)
- func (k Keeper) IsApprovedAddress(nft *types.BaseNFT, sender string) bool
- func (k Keeper) IsApprovedOperator(ctx sdk.Context, owner, operator sdk.AccAddress) bool
- func (k Keeper) IsDenomCreator(ctx sdk.Context, denomID string, address sdk.AccAddress) (types.Denom, error)
- func (k Keeper) IsOwner(nft types.BaseNFT, owner sdk.AccAddress) bool
- func (k Keeper) IssueDenom(ctx sdk.Context, id, name, schema, symbol string, creator sdk.AccAddress) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintNFT(ctx sdk.Context, denomID string, tokenNm, tokenURI, tokenData string, ...) (string, error)
- func (k Keeper) MintNFTUnverified(ctx sdk.Context, denomID string, tokenNm, tokenURI, tokenData string, ...) (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) QueryApprovalsIsApprovedForAll(c context.Context, request *types.QueryApprovalsIsApprovedForAllRequest) (*types.QueryApprovalsIsApprovedForAllResponse, error)
- func (k Keeper) RevokeApproval(ctx sdk.Context, denomID, tokenID string, ...) error
- func (k Keeper) RevokeApprovalNFT(ctx sdk.Context, nft types.BaseNFT, addressToRevoke sdk.AccAddress, ...) error
- func (k Keeper) SetApprovedAddress(ctx sdk.Context, sender, operator sdk.AccAddress, approved bool)
- func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection, sender sdk.AccAddress) error
- func (k Keeper) SetDenom(ctx sdk.Context, denom types.Denom) error
- func (k Keeper) SetGenesisCollection(ctx sdk.Context, collection types.Collection) error
- func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
- func (k Keeper) TransferOwner(ctx sdk.Context, denomID, tokenID string, from, to, sender sdk.AccAddress) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the NFT module.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
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) AddApproval ¶
func (k Keeper) AddApproval(ctx sdk.Context, denomID, tokenID string, sender sdk.AccAddress, approvedAddress sdk.AccAddress) error
func (Keeper) AddApprovalForAll ¶
func (k Keeper) AddApprovalForAll(ctx sdk.Context, sender sdk.AccAddress, operatorAddressToBeAdded sdk.AccAddress, approved bool) error
func (Keeper) ApproveNFT ¶
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) DenomByName ¶
func (k Keeper) DenomByName(c context.Context, request *types.QueryDenomByNameRequest) (*types.QueryDenomByNameResponse, error)
func (Keeper) DenomBySymbol ¶
func (k Keeper) DenomBySymbol(c context.Context, request *types.QueryDenomBySymbolRequest) (*types.QueryDenomBySymbolResponse, 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, sender sdk.AccAddress, ) error
EditNFT updates an already existing NFT
func (Keeper) GetApprovalsNFT ¶
func (k Keeper) GetApprovalsNFT(c context.Context, request *types.QueryApprovalsNFTRequest) (*types.QueryApprovalsNFTResponse, error)
func (Keeper) GetApprovedAddresses ¶
func (k Keeper) GetApprovedAddresses(ctx sdk.Context, sender sdk.AccAddress) (*types.ApprovedAddressesData, error)
func (Keeper) GetBaseNFT ¶
GetNFT set a specific NFT in the store from its index
func (Keeper) GetCollection ¶
GetCollection returns the collection by the specified denom ID
func (Keeper) GetCollections ¶
func (k Keeper) GetCollections(ctx sdk.Context) (cs []types.Collection)
GetCollections returns all the collections
func (Keeper) GetDenomByName ¶
GetDenom returns the denom by name
func (Keeper) GetDenomBySymbol ¶
GetDenomBySymbol returns the denom by symbol
func (Keeper) GetNFTApprovedAddresses ¶
func (k Keeper) GetNFTApprovedAddresses(ctx sdk.Context, denomID, tokenID string) (approvedAddresses []string, err error)
GetNFTApprovedAddresses returns the approved addresses for the nft
func (Keeper) GetNftTotalCountForCollection ¶
GetNftTotalCountForCollection returns the count of all minted nfts ( including burned )
func (Keeper) GetOwner ¶
func (k Keeper) GetOwner(ctx sdk.Context, address sdk.AccAddress, denom string) (types.Owner, error)
GetOwner gets all the ID collections owned by an address and denom ID
func (Keeper) GetPaginateCollection ¶
func (k Keeper) GetPaginateCollection(ctx sdk.Context, request *types.QueryCollectionRequest, denomID string) (types.Collection, *query.PageResponse, error)
GetPaginateCollection returns the collection by the specified denom ID
func (Keeper) GetTotalSupply ¶
GetTotalSupply returns the number of NFTs by the specified denom ID
func (Keeper) GetTotalSupplyOfOwner ¶
func (k Keeper) GetTotalSupplyOfOwner(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64)
GetTotalSupplyOfOwner returns the amount of NFTs by the specified conditions
func (Keeper) HasDenomID ¶
HasDenomID returns whether the specified denom ID exists
func (Keeper) HasDenomNm ¶
HasDenomNm returns whether the specified denom name exists
func (Keeper) HasDenomSymbol ¶
HasDenomSymbol returns whether the specified denom symbol exists
func (Keeper) IncrementTotalCounterForCollection ¶
IncrementTotalCounterForCollection increments the count of all minted nfts for a collection
func (Keeper) IsApprovedAddress ¶ added in v0.5.0
func (Keeper) IsApprovedOperator ¶
func (Keeper) IsDenomCreator ¶
func (k Keeper) IsDenomCreator(ctx sdk.Context, denomID string, address sdk.AccAddress) (types.Denom, error)
IsDenomCreator checks if address is the creator of Denom Return the Denom if true, an error otherwise
func (Keeper) IsOwner ¶
IsOwner checks if the sender is the owner of the given NFT Return the NFT if true, an error otherwise
func (Keeper) IssueDenom ¶
func (k Keeper) IssueDenom(ctx sdk.Context, id, name, schema, symbol string, creator sdk.AccAddress) error
IssueDenom issues a denom according to the given params
func (Keeper) MintNFT ¶
func (k Keeper) MintNFT( ctx sdk.Context, denomID string, tokenNm, tokenURI, tokenData string, sender, owner sdk.AccAddress, ) (string, error)
MintNFT mints an NFT and manages the NFT's existence within Collections and Owners
func (Keeper) MintNFTUnverified ¶
func (k Keeper) MintNFTUnverified( ctx sdk.Context, denomID string, tokenNm, tokenURI, tokenData string, owner sdk.AccAddress) (string, error)
MintNFTUnverified mints an NFT without verifying if the owner is the creator of denom Needed during genesis initialization
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) QueryApprovalsIsApprovedForAll ¶
func (k Keeper) QueryApprovalsIsApprovedForAll(c context.Context, request *types.QueryApprovalsIsApprovedForAllRequest) (*types.QueryApprovalsIsApprovedForAllResponse, error)
func (Keeper) RevokeApproval ¶
func (Keeper) RevokeApprovalNFT ¶
func (Keeper) SetApprovedAddress ¶
func (Keeper) SetCollection ¶
func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection, sender sdk.AccAddress) error
SetCollection saves all NFTs and returns an error if there already exists or any one of the owner's bech32 account address is invalid or any NFT's owner is not the creator of denomination
func (Keeper) SetGenesisCollection ¶
SetGenesisCollection saves all NFTs and returns an error if there already exists or any one of the owner's bech32 account address is invalid
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 string, from, to, sender sdk.AccAddress) error
TransferOwner transfers the ownership of the given NFT to the new owner