internft

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 11 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountKeeper

type AccountKeeper interface {
	NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
	// Set an account in the store.
	SetAccount(context.Context, sdk.AccountI)
	GetModuleAddress(name string) sdk.AccAddress
}

AccountKeeper defines the contract required for account APIs.

type InterClass

type InterClass struct {
	ID   string
	URI  string
	Data string
}

func (InterClass) GetData

func (d InterClass) GetData() string

func (InterClass) GetID

func (d InterClass) GetID() string

func (InterClass) GetURI

func (d InterClass) GetURI() string

type InterNftKeeper

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

InterNftKeeper defines the ICS721 Keeper

func NewInterNftKeeper

func NewInterNftKeeper(cdc codec.Codec,
	k nftkeeper.Keeper,
	ak AccountKeeper,
) InterNftKeeper

NewInterNftKeeper creates a new ics721 Keeper instance

func (InterNftKeeper) Burn

func (ik InterNftKeeper) Burn(ctx sdk.Context, classID string, tokenID string) error

Burn implement the method of ICS721Keeper.Burn

Fault-tolerant on missing NFTs (matches x/erc721 and x/cw721 RefundPacketToken): if the NFT is already gone, skipping keeps the IBC refund path alive instead of rolling back the whole cache context.

A bound NFT is refused. nft-transfer reaches this method through the ICS721Keeper interface, so it does not pass through x/collection.RemoveNFT, which is where the conversion guard normally lives; without this check the ICS-721 path would destroy the native half of a converted NFT and leave the escrowed contract half with no on-chain record of its existence -- "undiscoverable and unrecoverable", in x/erc721's own words. The checker is injected by app/keepers (see SetConvertedNFTChecker).

This does NOT restrict ordinary ICS-721 traffic. Only the destroy branch calls Burn: nft-transfer picks escrow or destroy from IsAwayFromOrigin (nft-transfer keeper/relay.go:238-248), and the class a conversion produces is always "uptick-<contract>" (x/erc721 and x/cw721 both pin it in Register*), which never carries a "<port>/<channel>/" prefix -- so the outbound transfer of a converted NFT always escrows. A genuine voucher being returned to its origin chain also arrives here with no pair recorded, so it is released by the same check. (R1-C: ibc voucher classes are barred from pair registration, and legacy ibc-class pairs are settled at the v0.5.0 upgrade height; the earlier claim that "pairs are only ever written for uptick-<contract> classes" was false and is what let a convert-memo voucher pair lock its NFT out of the origin chain.)

The absence check is a plain HasNFT read on purpose. An earlier version wrapped it in a blanket recover(), which swallowed every panic — including the SDK gas meter's OutOfGas and store/runtime panics — and then reported the burn as successful with reason "nft_already_gone". That silently turned a failed transaction into a successful ICS-721 burn, so the recover() was removed: only a genuine HasNFT == false may skip, everything else must propagate.

func (InterNftKeeper) CreateOrUpdateClass

func (ik InterNftKeeper) CreateOrUpdateClass(ctx sdk.Context,
	classID,
	classURI,
	classData string,
) error

CreateOrUpdateClass implement the method of ICS721Keeper.CreateOrUpdateClass

func (InterNftKeeper) GetClass

func (ik InterNftKeeper) GetClass(ctx sdk.Context, classID string) (nfttransfer.Class, bool)

GetClass implement the method of ICS721Keeper.GetClass

func (InterNftKeeper) GetNFT

func (ik InterNftKeeper) GetNFT(ctx sdk.Context, classID, tokenID string) (nfttransfer.NFT, bool)

GetNFT implement the method of ICS721Keeper.GetNFT

func (InterNftKeeper) GetOwner

func (ik InterNftKeeper) GetOwner(ctx sdk.Context, classID string, tokenID string) sdk.AccAddress

GetOwner implement the method of ICS721Keeper.GetOwner

func (InterNftKeeper) HasClass

func (ik InterNftKeeper) HasClass(ctx sdk.Context, classID string) bool

HasClass implement the method of ICS721Keeper.HasClass

func (InterNftKeeper) IsConvertedNFT added in v0.5.0

func (ik InterNftKeeper) IsConvertedNFT(ctx sdk.Context, classID, nftID string) bool

IsConvertedNFT reports whether the native NFT has a contract-side counterpart, i.e. whether destroying it would strand the escrowed contract half.

It delegates to the collection keeper's guard, which the application wires once x/erc721 and x/cw721 exist (collectionkeeper.SetConvertedNFTChecker). The copy of the collection keeper held here shares the guard's slot, so that later wiring reaches this adapter too -- see the field comment in interface.go and Keeper.convertedNFTs.

func (InterNftKeeper) Logger

func (ik InterNftKeeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (InterNftKeeper) Mint

func (ik InterNftKeeper) Mint(ctx sdk.Context,
	classID,
	tokenID,
	tokenURI,
	tokenData string,
	receiver sdk.AccAddress,
) error

Mint implement the method of ICS721Keeper.Mint

func (InterNftKeeper) Transfer

func (ik InterNftKeeper) Transfer(
	ctx sdk.Context,
	classID,
	tokenID,
	tokenData string,
	receiver sdk.AccAddress,
) error

Transfer implement the method of ICS721Keeper.Transfer

type InterToken

type InterToken struct {
	ClassID string
	ID      string
	URI     string
	Data    string
}

func (InterToken) GetClassID

func (t InterToken) GetClassID() string

func (InterToken) GetData

func (t InterToken) GetData() string

func (InterToken) GetID

func (t InterToken) GetID() string

func (InterToken) GetURI

func (t InterToken) GetURI() string

Jump to

Keyboard shortcuts

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