keeper

package
v0.4.1-fix Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxReportedExportIssues = 20

MaxReportedExportIssues caps how many individual records are spelled out in the error message. Every issue is still counted.

Variables

This section is empty.

Functions

func NewMsgServerImpl added in v0.4.0

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func NormalizeCW721Address added in v0.5.0

func NormalizeCW721Address(addr string) (string, error)

NormalizeCW721Address returns the canonical bech32 form of a CW721 contract address. Bech32 decodes identically from its all-lowercase and all-uppercase spellings, so the same contract can be presented under multiple alias strings. Every KV key derived from a CW721 address (token pair maps, token UIDs, refund receivers) MUST use the canonical re-encoded form, otherwise:

  • the same contract can be registered twice under case aliases;
  • lookups with a differently-cased address miss the stored pair;
  • exported genesis fails validation, because genesis duplicate detection is case-insensitive (strings.ToLower) while runtime keys are not.

func WrapWasmKeeper added in v0.4.0

func WrapWasmKeeper(k *wasmkeeper.Keeper) types.WasmKeeper

WrapWasmKeeper adapts wasmd's keeper to the cw721 WasmKeeper interface.

Types

type AllNftAccess

type AllNftAccess struct {
	Owner string `json:"owner"`
}

type AllNftData

type AllNftData struct {
	TokenUri  string      `json:"token_uri"`
	Extension interface{} `json:"extension"`
}

type AllNftInfo

type AllNftInfo struct {
	Access AllNftAccess `json:"access"`
	Info   AllNftData   `json:"info"`
}

type ContractInfo

type ContractInfo struct {
	Data ContractInfoData `json:"data"`
}

ContractInfo {"data":{"name":"uptick test collection","symbol":"uptick-test-01"}}

type ContractInfoData

type ContractInfoData struct {
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
}

type GenesisExportError added in v0.5.0

type GenesisExportError struct {
	Module string
	Issues []GenesisExportIssue
}

GenesisExportError reports state that a genesis file cannot represent. The error-returning accessors (ExportNFTUIDPairs, ExportRefundReceivers) return it through issuesToError when the live store is damaged.

The Cosmos SDK module interface (AppModule.ExportGenesis(ctx, cdc) json.RawMessage) has no error channel, so the module-level ExportGenesis cannot surface it and degrades-and-reports instead; Error() is what spells out the actionable list of damaged keys, capped at MaxReportedExportIssues.

func (*GenesisExportError) Error added in v0.5.0

func (e *GenesisExportError) Error() string

type GenesisExportIssue added in v0.5.0

type GenesisExportIssue struct {
	Kind   GenesisExportIssueKind
	Key    string
	Detail string
}

GenesisExportIssue is one state record that cannot be exported faithfully. Key carries the store key so an operator can point at the exact record.

func MergeExportIssues added in v0.5.0

func MergeExportIssues(groups ...[]GenesisExportIssue) []GenesisExportIssue

MergeExportIssues flattens the per-store issue lists into one list so every caller reports them in the same order instead of re-implementing the append.

func (GenesisExportIssue) String added in v0.5.0

func (i GenesisExportIssue) String() string

type GenesisExportIssueKind added in v0.5.0

type GenesisExportIssueKind string

GenesisExportIssueKind classifies one reason why a genesis export could not represent the live store faithfully.

const (
	// GenesisExportIssueTokenPairCorrupt means a registered TokenPair record
	// could not be decoded.
	GenesisExportIssueTokenPairCorrupt GenesisExportIssueKind = "token_pair_corrupt" //nolint:gosec // G101 false positive: the identifier name contains "Token"; the value is a non-secret issue-kind code.
	// GenesisExportIssueUIDIndexBackward means a reverse (nftUID -> tokenUID)
	// index entry has no matching forward entry.
	GenesisExportIssueUIDIndexBackward GenesisExportIssueKind = "nft_uid_index_reverse_without_forward"
	// GenesisExportIssueUIDIndexForward means a forward (tokenUID -> nftUID)
	// index entry has no matching reverse entry.
	GenesisExportIssueUIDIndexForward GenesisExportIssueKind = "nft_uid_index_forward_without_reverse"
	// GenesisExportIssueRefundKeyOrphan means a refund receiver record does not
	// belong to any registered contract.
	GenesisExportIssueRefundKeyOrphan GenesisExportIssueKind = "refund_key_orphaned"
	// GenesisExportIssueUIDIndexUnregisteredPair means a bidirectional
	// conversion binding is internally consistent but its contract/class no
	// longer resolve to a registered token pair, so the import side would
	// reject it (ValidateGenesisPairs) and InitGenesis would panic. The export
	// drops and reports it instead.
	GenesisExportIssueUIDIndexUnregisteredPair GenesisExportIssueKind = "nft_uid_index_unregistered_pair"
)

type InstantiateInfo

type InstantiateInfo struct {
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
	Minter string `json:"minter"`
}

type Keeper

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

Keeper is the x/cw721 keeper

func NewKeeper

func NewKeeper(
	storeKey storetypes.StoreKey,
	cdc codec.BinaryCodec,
	accountKeeper types.AccountKeeper,
	nftKeeper collectionkeeper.Keeper,
	wasmKeeper types.WasmKeeper,
	ibcTransferKeeper types.IBCNFTTransferKeeper,
) Keeper

NewKeeper creates a new Keeper

func (Keeper) ConvertCW721

func (k Keeper) ConvertCW721(
	goCtx context.Context,
	msg *types.MsgConvertCW721,
) (
	*types.MsgConvertCW721Response, error,
)

ConvertCW721 converts CW721 tokens into native Cosmos nft for both Cosmos-native and CW721 TokenPair Owners

func (Keeper) ConvertNFT

func (k Keeper) ConvertNFT(
	goCtx context.Context,
	msg *types.MsgConvertNFT,
) (
	*types.MsgConvertNFTResponse, error,
)

ConvertNFT ConvertCoin converts native Cosmos nft into CW721 tokens for both Cosmos-native and CW721 TokenPair Owners

func (Keeper) CreateNFTClass

func (k Keeper) CreateNFTClass(ctx sdk.Context, msg *types.MsgConvertCW721) error

CreateNFTClass generates the metadata to represent the CW721 token .

func (Keeper) DeleteCW721Map

func (k Keeper) DeleteCW721Map(ctx sdk.Context, cw721 string)

DeleteCW721Map deletes the token pair id for the given address

func (Keeper) DeleteCwAddressByContractTokenId

func (k Keeper) DeleteCwAddressByContractTokenId(ctx sdk.Context, cwContractAddress string, cwTokenId string)

func (Keeper) DeleteNFTPairByNFTID

func (k Keeper) DeleteNFTPairByNFTID(ctx sdk.Context, classID string, nftID string)

func (Keeper) DeleteNFTPairByTokenID

func (k Keeper) DeleteNFTPairByTokenID(ctx sdk.Context, contractAddress string, tokenID string)

func (Keeper) DeleteNFTUIDPairByNFTUID

func (k Keeper) DeleteNFTUIDPairByNFTUID(ctx sdk.Context, nftUID string)

func (Keeper) DeleteNFTUIDPairByTokenUID

func (k Keeper) DeleteNFTUIDPairByTokenUID(ctx sdk.Context, tokenUID string)

func (Keeper) DeletePairPerTokenState added in v0.5.0

func (k Keeper) DeletePairPerTokenState(ctx sdk.Context, pair types.TokenPair)

DeletePairPerTokenState removes the bidirectional NFT UID index entries and IBC refund receivers that belong to pair, so a removed token pair cannot leave orphans that make ExportGenesis fail (mirrors the erc721 keeper).

Symmetry note: unlike erc721 there is currently no production path that removes a cw721 token pair (CW721 contracts cannot self-destruct and no message deletes a pair), so today this helper has no live caller. It exists so any future pair-removal path (or governance purge message) cleans the per-token state in exactly the same way as erc721 instead of leaving orphaned UID/refund records behind.

Commit semantics: Cosmos SDK state is per-transaction — a write made on a handler path that returns an error is rolled back by baseapp. Callers must therefore only invoke this on paths that end in success.

func (Keeper) DeleteTokenPair

func (k Keeper) DeleteTokenPair(ctx sdk.Context, tokenPair types.TokenPair)

DeleteTokenPair removes a token pair.

func (Keeper) DeployCW721Contract added in v0.4.0

func (k Keeper) DeployCW721Contract(
	ctx sdk.Context,
	msg *types.MsgConvertNFT,
) (string, error)

DeployCW721Contract instantiates a CW721 contract with the cw721 module account as admin and minter, using a previously stored wasm code ID.

func (Keeper) ExecWasmMsg

ExecWasmMsg exec the contract and get the result

func (Keeper) ExportIssues added in v0.5.0

func (k Keeper) ExportIssues(ctx sdk.Context) []GenesisExportIssue

ExportIssues aggregates every degradation the genesis export can report, without requiring the caller to build the genesis state first. The app-level diagnostics report uses it to describe a degraded export without a second full export pass.

func (Keeper) ExportNFTUIDPairs added in v0.5.0

func (k Keeper) ExportNFTUIDPairs(ctx sdk.Context) ([]types.NFTUIDPair, error)

ExportNFTUIDPairs returns every per-token conversion binding and verifies the bidirectional index is internally consistent (forward[x]=y must imply reverse[y]=x). A mismatch means the live store is corrupt; failing the export loudly is preferable to baking the corruption into a genesis file.

func (Keeper) ExportNFTUIDPairsWithReport added in v0.5.0

func (k Keeper) ExportNFTUIDPairsWithReport(ctx sdk.Context) ([]types.NFTUIDPair, []GenesisExportIssue)

ExportNFTUIDPairsWithReport collects every damaged index entry instead of aborting on the first one, so the fail-closed export can report the complete repair list in one pass.

A binding is exported only if the import side would accept it: types.ValidateGenesisPairs requires the token UID and the NFT UID to resolve to the same registered token pair, and InitGenesis panics on the same condition. A consistent binding can still outlive its pair -- a pair record that no longer decodes is dropped from the exported TokenPairs, and a removed pair's index entries are swept best-effort -- so emitting them verbatim produced a genesis that failed its own validation: an unusable backup exactly when it is needed. Such bindings are dropped AND reported: dropping is the only importable option (nothing this validation rejects can survive an InitGenesis), and the dropped record stays visible in <home>/export-issues.json so it can be repaired out of band. The live chain is untouched either way -- this is purely about producing a genesis that can be read back.

func (Keeper) ExportRefundReceivers added in v0.5.0

func (k Keeper) ExportRefundReceivers(ctx sdk.Context) ([]types.RefundReceiver, error)

ExportRefundReceivers returns every recorded IBC refund receiver. Refund store keys are "<contractAddress><tokenID>" concatenations; the contract part is recovered by matching against the registered pair contracts, which is lossless for any address format. CW721 contracts are bech32: matching is case-insensitive (all-lowercase and all-uppercase encodings are the same address), and the exact stored prefix bytes are returned so re-import reproduces the original key. Orphaned records fail the export instead of being dropped.

func (Keeper) ExportRefundReceiversWithReport added in v0.5.0

func (k Keeper) ExportRefundReceiversWithReport(ctx sdk.Context) ([]types.RefundReceiver, []GenesisExportIssue)

ExportRefundReceiversWithReport exports every refund receiver and reports (rather than aborts on) the orphaned keys, so the fail-closed caller can print the full repair list at once.

func (Keeper) GetAccountKeeper added in v0.4.0

func (k Keeper) GetAccountKeeper() types.AccountKeeper

GetAccountKeeper returns the account keeper

func (Keeper) GetCW721Map

func (k Keeper) GetCW721Map(ctx sdk.Context, cw721 string) []byte

GetCW721Map returns the token pair id for the given address

func (Keeper) GetClassIDAndNFTID

func (k Keeper) GetClassIDAndNFTID(ctx sdk.Context, msg *types.MsgConvertCW721) (string, []string, error)

GetClassIDAndNFTID resolves class ID and NFT IDs from a MsgConvertCW721, using saved mappings or generating new IDs as needed.

func (Keeper) GetClassMap

func (k Keeper) GetClassMap(ctx sdk.Context, classID string) []byte

GetClassMap returns the token pair id for the given class

func (Keeper) GetContractAddressAndTokenIds

func (k Keeper) GetContractAddressAndTokenIds(ctx sdk.Context, msg *types.MsgConvertNFT) (string, []string, error)

GetContractAddressAndTokenIds resolves the contract address and token IDs from a MsgConvertNFT, using saved mappings or generating new IDs as needed.

func (Keeper) GetCwAddressByContractTokenId

func (k Keeper) GetCwAddressByContractTokenId(ctx sdk.Context, cwContractAddress string, cwTokenId string) []byte

func (Keeper) GetEnableCw721 added in v0.4.0

func (k Keeper) GetEnableCw721(ctx sdk.Context) bool

GetEnableCw721 returns the EnableCw721 param

func (Keeper) GetEnableEVMHook added in v0.4.0

func (k Keeper) GetEnableEVMHook(ctx sdk.Context) bool

GetEnableEVMHook returns the EnableEVMHook param

func (Keeper) GetNFTKeeper added in v0.4.0

func (k Keeper) GetNFTKeeper() collectionkeeper.Keeper

GetNFTKeeper returns the nft keeper

func (Keeper) GetNFTPairByClassNFTID

func (k Keeper) GetNFTPairByClassNFTID(ctx sdk.Context, classID string, nftID string) []byte

func (Keeper) GetNFTPairByContractTokenID

func (k Keeper) GetNFTPairByContractTokenID(ctx sdk.Context, contractAddress string, tokenID string) []byte

func (Keeper) GetNFTUIDPairByTokenUID

func (k Keeper) GetNFTUIDPairByTokenUID(ctx sdk.Context, tokenUID string) []byte

func (Keeper) GetPair

func (k Keeper) GetPair(
	ctx sdk.Context,
	token string,
) (types.TokenPair, error)

GetPair looks up a token pair by class id first, then by CW721 contract. Class ids and contract addresses are distinct namespaces: a class-path caller (ConvertNFT) must use GetPairByClass so a denom whose id equals a contract address cannot resolve to that contract's pair.

func (Keeper) GetPairByCW721 added in v0.5.0

func (k Keeper) GetPairByCW721(ctx sdk.Context, contract string) (types.TokenPair, error)

GetPairByCW721 resolves a pair exclusively from the CW721 contract map.

func (Keeper) GetPairByClass added in v0.5.0

func (k Keeper) GetPairByClass(ctx sdk.Context, classID string) (types.TokenPair, error)

GetPairByClass resolves a pair exclusively from the class-id map.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of cw721 parameters.

func (Keeper) GetTokenPair

func (k Keeper) GetTokenPair(ctx sdk.Context, id []byte) (types.TokenPair, bool)

GetTokenPair - get registered token pair from the identifier

func (Keeper) GetTokenPairID

func (k Keeper) GetTokenPairID(ctx sdk.Context, token string) []byte

GetTokenPairID returns the pair id from a class id or a CW721 contract. The maps are distinct namespaces: class is tried first so a denom whose id equals a contract address cannot steal that contract's pair on the class path.

func (Keeper) GetTokenPairs

func (k Keeper) GetTokenPairs(ctx sdk.Context) []types.TokenPair

GetTokenPairs - get all registered token tokenPairs

Corrupt records are skipped here and reported through GetTokenPairsWithReport: this accessor is reachable from the gRPC query path, where a panic would take the node's query handler down, and it is no longer the genesis-export entry point (ExportGenesis fails closed on the report).

func (Keeper) GetTokenPairsWithReport added in v0.5.0

func (k Keeper) GetTokenPairsWithReport(ctx sdk.Context) ([]types.TokenPair, []GenesisExportIssue)

GetTokenPairsWithReport returns every decodable token pair plus the list of records that could not be decoded. Damaged records are never dropped silently: the caller decides whether to abort (genesis export does) or to continue with the healthy subset.

func (Keeper) GetTokenUIDPairByNFTUID

func (k Keeper) GetTokenUIDPairByNFTUID(ctx sdk.Context, nftUID string) []byte

func (Keeper) GetWasmCode

func (k Keeper) GetWasmCode(ctx sdk.Context, account string) []byte

GetWasmCode stores a WasmCode

func (Keeper) GetWasmCodeID added in v0.4.0

func (k Keeper) GetWasmCodeID(ctx sdk.Context) (uint64, error)

GetWasmCodeID returns the stored CW721 wasm code ID used for auto-instantiate. It looks up the module account first, then the module name as a fallback key.

func (Keeper) GetWasmKeeper added in v0.4.0

func (k Keeper) GetWasmKeeper() types.WasmKeeper

GetWasmKeeper returns the CosmWasm surface used by this module.

func (Keeper) InstantiateWasmContract

func (k Keeper) InstantiateWasmContract(
	ctx sdk.Context,
	senderAddr string,
	codeId uint64,
	label string,
	name string,
	symbol string,
	minter string,
) (string, error)

InstantiateWasmContract creates and deploys an CW721 contract on the EVM with the cw721 module account as owner.

func (Keeper) IsCW721Registered

func (k Keeper) IsCW721Registered(ctx sdk.Context, cw721 string) bool

IsCW721Registered check if registered CW721 token is registered

func (Keeper) IsClassRegistered

func (k Keeper) IsClassRegistered(ctx sdk.Context, classID string) bool

IsClassRegistered check if registered nft class is registered

func (Keeper) IsTokenPairRegistered

func (k Keeper) IsTokenPairRegistered(ctx sdk.Context, id []byte) bool

IsTokenPairRegistered - check if registered token tokenPair is registered

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MintCw721

func (k Keeper) MintCw721(
	ctx sdk.Context,
	contractAddress string,
	tokenId string,
	owner string,
	tokenUri string,
) (*wasmtypes.MsgExecuteContractResponse, error)

MintCw721 mints a CW721 token. The execute sender is the module minter; owner is the recipient of the newly minted token.

func (Keeper) Params

Params returns the cw721 module params.

func (Keeper) QueryCW721

func (k Keeper) QueryCW721(
	ctx sdk.Context,
	contractAddress string,
) (types.CW721Data, error)

QueryCW721 returns the data of a deployed CW721 contract

func (Keeper) QueryCW721AllNftInfo

func (k Keeper) QueryCW721AllNftInfo(
	ctx sdk.Context,
	contractAddress string,
	tokenId string,
) (AllNftInfo, error)

QueryCW721AllNftInfo returns the owner of given tokenID QueryCW721TokenOwner -> QueryCW721TokenOwner

func (Keeper) QueryCW721TokenOwner added in v0.5.0

func (k Keeper) QueryCW721TokenOwner(
	ctx sdk.Context,
	contractAddress string,
	tokenId string,
) (string, error)

QueryCW721TokenOwner returns the current owner of a CW721 token.

It is used by the IBC refund path to decide whether the module account still escrows the token: a token that is no longer owned by the module must be skipped instead of refunded, otherwise the refund aborts the IBC callback and the packet can never be finalized.

func (Keeper) QueryWasmState

QueryWasmState for query (rsp *types.QuerySmartContractStateResponse, err error) func (q grpcQuerier) SmartContractState(c context.Context, req *types.QuerySmartContractStateRequest) (rsp *types.QuerySmartContractStateResponse, err error) {

func (Keeper) RefundPacketToken

func (k Keeper) RefundPacketToken(
	ctx sdk.Context,
	data ibcnfttransfertypes.NonFungibleTokenPacketData,
) error

RefundPacketToken handles the IBC packet timeout/failure for CW721 transfers. It reverses the conversion: returns the CW721 to its original owner, cleans up token pair mappings, and burns the native NFT returned to the module account.

The refund is gated on the module account still owning the CW721 token; a token that was already refunded, never escrowed, or moved elsewhere is skipped with an event instead of an error (an error would abort the IBC callback and strand the packet forever). Mirrors x/erc721.

func (Keeper) RegisterCW721

func (k Keeper) RegisterCW721(ctx sdk.Context, msg *types.MsgConvertCW721) (*types.TokenPair, error)

RegisterCW721 creates a Cosmos coin and registers the token pair between the nft and the CW721

func (Keeper) RegisterNFT

func (k Keeper) RegisterNFT(ctx sdk.Context, msg *types.MsgConvertNFT) (*types.TokenPair, error)

RegisterNFT deploys an cw721 contract and creates the token pair for the existing cosmos coin

func (Keeper) SetCW721Map

func (k Keeper) SetCW721Map(ctx sdk.Context, cw721 string, id []byte)

SetCW721Map sets the token pair id for the given address

func (Keeper) SetClassMap

func (k Keeper) SetClassMap(ctx sdk.Context, classID string, id []byte)

SetClassMap sets the token pair id for the classID

func (Keeper) SetCwAddressByContractTokenId

func (k Keeper) SetCwAddressByContractTokenId(ctx sdk.Context, cwContractAddress string, cwTokenId string, cwReceiver string)

SetCwAddressByContractTokenId

func (Keeper) SetGenesisNFTUIDPair added in v0.5.0

func (k Keeper) SetGenesisNFTUIDPair(ctx sdk.Context, pair types.NFTUIDPair)

SetGenesisNFTUIDPair restores one bidirectional conversion binding during InitGenesis, writing both directions of the runtime index.

func (Keeper) SetGenesisRefundReceiver added in v0.5.0

func (k Keeper) SetGenesisRefundReceiver(ctx sdk.Context, receiver types.RefundReceiver)

SetGenesisRefundReceiver restores one IBC refund receiver during InitGenesis under the exact store key it was exported from.

func (Keeper) SetNFTPairByClassNFTID

func (k Keeper) SetNFTPairByClassNFTID(ctx sdk.Context, classID string, nftID string, contractAddress string, tokenID string)

func (Keeper) SetNFTPairByContractTokenID

func (k Keeper) SetNFTPairByContractTokenID(ctx sdk.Context, contractAddress string, tokenID string, classID string, nftID string)

func (Keeper) SetNFTPairs

func (k Keeper) SetNFTPairs(ctx sdk.Context, contractAddress string, tokenID string, classID string, nftID string) error

SetNFTPairs atomically binds a CW721 (contract, tokenID) to a Cosmos NFT (classID, nftID) in both directions, enforcing a strict one-to-one invariant forward[x]=y ⟺ reverse[y]=x. If either side already points to a different partner the call fails, mirroring x/erc721.

func (Keeper) SetNFTUIDPairByNFTUID

func (k Keeper) SetNFTUIDPairByNFTUID(ctx sdk.Context, nftUID string, tokenUID string)

func (Keeper) SetNFTUIDPairByTokenUID

func (k Keeper) SetNFTUIDPairByTokenUID(ctx sdk.Context, tokenUID string, nftUID string)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error

SetParams sets the cw721 parameters to the store.

func (Keeper) SetTokenPair

func (k Keeper) SetTokenPair(ctx sdk.Context, tokenPair types.TokenPair) error

SetTokenPair stores a token pair SetTokenPair stores a token pair. A protobuf marshal failure is surfaced to the caller instead of being swallowed: silently dropping the write would leave the token pair unregistered while later lookups assume it exists.

func (Keeper) SetWasmCode

func (k Keeper) SetWasmCode(ctx sdk.Context, account string, codeId uint64)

SetWasmCode stores a WasmCode

func (Keeper) TokenPair

TokenPair returns a given registered token pair.

func (Keeper) TokenPairs

TokenPairs returns all registered token pairs.

func (Keeper) TransferCW721

func (k Keeper) TransferCW721(
	goCtx context.Context,
	msg *types.MsgTransferCW721,
) (
	*types.MsgTransferCW721Response, error,
)

TransferCW721 converts CW721 tokens into native Cosmos nft for both Cosmos-native and CW721 TokenPair Owners and transfer through IBC

func (Keeper) TransferCw721

func (k Keeper) TransferCw721(
	ctx sdk.Context,
	contractAddress string,
	tokenId string,
	recipient string,
	sender string,
) (*wasmtypes.MsgExecuteContractResponse, error)

TransferCw721 the contract and get the result

func (Keeper) UpdateParams added in v0.4.0

UpdateParams updates cw721 params. Authority must be the gov module account.

func (Keeper) WasmContract

WasmContract returns the registered token pair (and therefore the CW721 contract) for the given class id. Port and channel are accepted for API / IBC-voucher compatibility, but the pair registry is keyed by class id, so the lookup resolves on ClassId alone. A missing pair is reported as NotFound — it must never return an empty "success" response, which used to silently hide the contract address from clients.

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) GetParams added in v0.4.0

func (m Migrator) GetParams(ctx sdk.Context) types.Params

GetParams returns the cw721 module params - used for migration

func (Migrator) Migrate1to2 added in v0.4.0

func (m Migrator) Migrate1to2(_ sdk.Context) error

Migrate1to2 migrates the store from version 1 to 2.

The 1→2 migration is intentionally a no-op: the cw721 module store layout did not change between its version-1 and version-2 states — only the module ConsensusVersion was bumped (alongside the params handling moving to authority-based management, which the v0.4.0 upgrade handler performs). The registration exists so a chain whose on-chain module version map still records cw721 v1 can advance through RunMigrations without failing. Keep it registered; never delete it while any chain can still hold module version 1.

func (Migrator) SetParams added in v0.4.0

func (m Migrator) SetParams(ctx sdk.Context, params types.Params) error

SetParams sets the cw721 module params - used for migration

type MintInfo

type MintInfo struct {
	Mint MintInfoData `json:"mint"`
}

MintInfo {"mint":{"token_id":"abc126","owner":"uptick100s3yp8l3atuuvx98jmftttxzy4ee5mg2n79fx","token_uri":"http://test.com"}}

type MintInfoData

type MintInfoData struct {
	TokenId  string `json:"token_id"`
	Owner    string `json:"owner"`
	TokenUri string `json:"token_uri"`
}

type TransferNftData

type TransferNftData struct {
	Recipient string `json:"recipient"`
	TokenId   string `json:"token_id"`
}

type TransferNftInfo

type TransferNftInfo struct {
	TransferNft TransferNftData `json:"transfer_nft"`
}

TransferNftInfo {"transfer_nft":{"recipient":"uptick1n3t0zuwq4u47ke48qm3pfhj96f4ujhs70f52sg","token_id":"abc123"}}

Jump to

Keyboard shortcuts

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