nft

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

README

CLI

Queries

  1. approvals - Get the approved addresses for the NFT.
  2. collection - Get all the NFTs from a given collection.
  3. denom - Query the denom by the specified denom id.
  4. denom-by-name - Query the denom by the specified denom name.
  5. denom-by-symbol - Query the denom by the specified symbol.
  6. denoms - Query all denominations of all collections of NFTs.
  7. is-approved-for-all - Query if an address is an authorized operator for another address
  8. owner - Get the NFTs owned by an account address.
  9. supply - Query total supply of a collection or owner of NFTs.
  10. token - Query a single NFT from a collection by denom id and token id.

TXs

  1. approve - Adds an address to the approved list of a NFT.
  2. approve-all - Adds operator address to the globally approved list of sender.
  3. burn - Burn an NFT.
  4. edit - Edit the token data of an NFT.
  5. issue - Issue a new denom.
  6. mint - Mint a NFT and set the owner to the recipient. Only the denom creator can mint a new NFT.
  7. revoke - Revokes a previously granted permission to transfer the given an NFT.
  8. transfer - Transfer a NFT to a recipient.

REST

  1. /nft/denoms/{denomId} - GET - query a denom by denom id
  2. /nft/denoms/name/{denomName} - GET - query a denom by denom name
  3. /nft/denoms/symbol/{denomSymbol} - GET - query a denom by denom symbol
  4. /nft/denoms - POST - query all denoms
type queryDenomsRequest struct {
	Pagination query.PageRequest `json:"pagination"`
}
  1. /nft/collections - POST - Get all the NFTs from a given collection
type queryCollectionRequest struct {
	DenomId    string            `json:"denom_id"`
	Pagination query.PageRequest `json:"pagination"`
}
  1. /nft/collections/supply/{denomId} - GET - Get the total supply of a collection or owner
  2. /nft/owners - POST - Get the collections of NFTs owned by an address
type queryOwnerRequest struct {
	DenomId      string            `json:"denom_id"`
	OwnerAddress string            `json:"owner_address"`
	Pagination   query.PageRequest `json:"pagination"`
}
  1. /nft/nfts/{denomId}/{tokenId} - GET - Query a single NFT
  2. /nft/approvals/{denomId}/{tokenId} - GET - Query approvals for NFT
  3. /nft/is-approved-for-all - POST - Query if an address is an authorized operator for another address
type queryIsApprovedForAllRequest struct {
	Owner    string `json:"owner"`
	Operator string `json:"operator"`
}

MSGS

  1. Issue denom
typeUrl = "/cudosnode.cudosnode.nft.MsgIssueDenom"

message MsgIssueDenom {
    option (gogoproto.equal) = true;

    string id = 1;
    string name = 2;
    string schema = 3;
    string sender = 4;
    string contractAddressSigner = 5;
    string symbol = 6;
    string traits = 7;
}
  1. Transfer NFT to a receipeint
typeUrl = "/cudosnode.cudosnode.nft.MsgTransferNft"

message MsgTransferNft {
    option (gogoproto.equal) = true;

    string denom_id = 1 [ (gogoproto.moretags) = "yaml:\"denom_id\"" ];
    string token_id = 2;
    string from = 3;
    string to = 4;
    string sender = 5;
    string contractAddressSigner = 6;
}
  1. Grant approval for a denom to an operator
typeUrl = "/cudosnode.cudosnode.nft.MsgApproveNft"

message MsgApproveNft {
    option (gogoproto.equal) = true;

    string id = 1;
    string denom_id = 2 [ (gogoproto.moretags) = "yaml:\"denom_id\"" ];
    string sender = 3;
    string approvedAddress = 4;
    string contractAddressSigner = 5;
}
  1. Adds an adress to the globally approved list
typeUrl = "/cudosnode.cudosnode.nft.MsgApproveAllNft"

message MsgApproveAllNft {
    option (gogoproto.equal) = true;

    string  operator = 1;
    string  sender = 2;
    bool  approved = 3;
    string contractAddressSigner = 4;

}
  1. Revokes a previously granted permission to transfer the given an NFT.
typeUrl = "/cudosnode.cudosnode.nft.MsgRevokeNft"

message MsgRevokeNft {
    option (gogoproto.equal) = true;

    string addressToRevoke = 1;
    string denom_id = 2 [ (gogoproto.moretags) = "yaml:\"denom_id\"" ];
    string token_id = 3 [ (gogoproto.moretags) = "yaml:\"denom_id\"" ];
    string sender = 4;
    string contractAddressSigner = 5;
}
  1. Edits a denom
typeUrl = "/cudosnode.cudosnode.nft.MsgEditNFT"

message MsgEditNFT {
    option (gogoproto.equal) = true;

    string id = 1;
    string denom_id = 2 [ (gogoproto.moretags) = "yaml:\"denom_id\"" ];
    string name = 3;
    string uri = 4 [ (gogoproto.customname) = "URI" ];
    string data = 5;
    string sender = 6;
    string contractAddressSigner = 7;

}
  1. Mints a new NFT.
typeUrl = "/cudosnode.cudosnode.nft.MsgMintNFT"

message MsgMintNFT {
    option (gogoproto.equal) = true;

    string denom_id = 1 [ (gogoproto.moretags) = "yaml:\"denom_id\"" ];
    string name = 2;
    string uri = 3 [ (gogoproto.customname) = "URI" ];
    string data = 4;
    string sender = 5;
    string recipient = 6;
    string contractAddressSigner = 7;
}
  1. Burns a NFT.
typeUrl = "/cudosnode.cudosnode.nft.MsgBurnNFT"

message MsgBurnNFT {
    option (gogoproto.equal) = true;

    string id = 1;
    string denom_id = 2 [ (gogoproto.moretags) = "yaml:\"denom_id\"" ];
    string sender = 3;
    string contractAddressSigner = 4;
}

Documentation

Index

Constants

View Source
const ConsensusVersion = 2

Variables

This section is empty.

Functions

func DefaultGenesisState

func DefaultGenesisState() *types.GenesisState

DefaultGenesisState returns a default genesis state

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState

ExportGenesis returns the capability module's exported genesis.

func InitGenesis

func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState)

InitGenesis initializes the capability module's state from a provided genesis state.

func NewHandler

func NewHandler(k keeper.Keeper) sdk.Handler

NewHandler ...

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements the AppModule interface for the capability module.

func NewAppModule

func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

BeginBlock executes all ABCI BeginBlock logic respective to the capability module.

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

ConsensusVersion implements AppModule/ConsensusVersion.

func (AppModule) EndBlock

EndBlock executes all ABCI EndBlock logic respective to the capability module. It returns no validator updates.

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis returns the capability module's exported genesis state as raw JSON bytes.

func (AppModule) GenerateGenesisState

func (AppModule) GenerateGenesisState(simState *module.SimulationState)

GenerateGenesisState creates a randomized GenState of the NFT module.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate

InitGenesis performs the capability module's genesis initialization It returns no validator updates.

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

LegacyQuerierHandler returns the capability module's Querier.

func (AppModule) Name

func (am AppModule) Name() string

Name returns the capability module's name.

func (AppModule) ProposalContents

func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent

ProposalContents doesn't return any content functions for governance proposals.

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute returns the capability module's query routing key.

func (AppModule) RandomizedParams

func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange

RandomizedParams creates randomized NFT param changes for the simulator.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

RegisterInvariants registers the capability module's invariants.

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers a GRPC query service to respond to the module-specific GRPC queries.

func (AppModule) RegisterStoreDecoder

func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for NFT module's types

func (AppModule) Route

func (am AppModule) Route() sdk.Route

Route returns the capability module's message routing key.

func (AppModule) WeightedOperations

func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation

WeightedOperations returns the all the NFT module operations with their respective weights.

type AppModuleBasic

type AppModuleBasic struct {
	// contains filtered or unexported fields
}

AppModuleBasic implements the AppModuleBasic interface for the capability module.

func NewAppModuleBasic

func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns the capability module's default genesis state.

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd returns the capability module's root query command.

func (AppModuleBasic) GetTxCmd

func (a AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd returns the capability module's root tx command.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the capability module's name.

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino)

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.

func (AppModuleBasic) RegisterInterfaces

func (a AppModuleBasic) RegisterInterfaces(reg codectypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router)

RegisterRESTRoutes registers the capability module's REST service handlers.

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error

ValidateGenesis performs genesis state validation for the capability module.

Directories

Path Synopsis
client
cli
migrations
v1
v2
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL