Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) CallEVM(ctx sdk.Context, abi abi.ABI, from, contract common.Address, commit bool, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallEVMWithData(ctx sdk.Context, from common.Address, contract *common.Address, data []byte, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) ConvertERC721(goCtx context.Context, msg *types.MsgConvertERC721) (*types.MsgConvertERC721, error)
- func (k Keeper) ConvertNFT(goCtx context.Context, msg *types.MsgConvertNFT) (*types.MsgConvertNFTResponse, error)
- func (k Keeper) CreateNFTClass(ctx sdk.Context, msg *types.MsgConvertERC721) error
- func (k Keeper) DeleteERC721Map(ctx sdk.Context, erc721 common.Address)
- func (k Keeper) DeleteEvmAddressByContractTokenId(ctx sdk.Context, evmContractAddress string, evmTokenId string)
- func (k Keeper) DeleteNFTPairByNFTID(ctx sdk.Context, classID string, nftID string)
- func (k Keeper) DeleteNFTPairByTokenID(ctx sdk.Context, contractAddress string, tokenID string)
- func (k Keeper) DeleteNFTUIDPairByNFTUID(ctx sdk.Context, nftUID string)
- func (k Keeper) DeleteNFTUIDPairByTokenUID(ctx sdk.Context, tokenUID string)
- func (k Keeper) DeleteTokenPair(ctx sdk.Context, tokenPair types.TokenPair)
- func (k Keeper) DeployERC721Contract(ctx sdk.Context, msg *types.MsgConvertNFT) (common.Address, error)
- func (k Keeper) EvmContract(c context.Context, req *types.QueryEvmAddressRequest) (*types.QueryTokenPairResponse, error)
- func (k Keeper) GetClassIDAndNFTID(ctx sdk.Context, msg *types.MsgConvertERC721) (string, []string, error)
- func (k Keeper) GetClassMap(ctx sdk.Context, classID string) []byte
- func (k Keeper) GetContractAddressAndTokenIds(ctx sdk.Context, msg *types.MsgConvertNFT) (string, []string, error)
- func (k Keeper) GetERC721Map(ctx sdk.Context, erc721 common.Address) []byte
- func (k Keeper) GetEvmAddressByContractTokenId(ctx sdk.Context, evmContractAddress string, evmTokenId string) []byte
- func (k Keeper) GetNFTPairByClassNFTID(ctx sdk.Context, classID string, nftID string) []byte
- func (k Keeper) GetNFTPairByContractTokenID(ctx sdk.Context, contractAddress string, tokenID string) []byte
- func (k Keeper) GetNFTUIDPairByTokenUID(ctx sdk.Context, tokenUID string) []byte
- func (k Keeper) GetPair(ctx sdk.Context, token string) (types.TokenPair, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetTokenPair(ctx sdk.Context, id []byte) (types.TokenPair, bool)
- func (k Keeper) GetTokenPairID(ctx sdk.Context, token string) []byte
- func (k Keeper) GetTokenPairs(ctx sdk.Context) []types.TokenPair
- func (k Keeper) GetTokenUIDPairByNFTUID(ctx sdk.Context, nftUID string) []byte
- func (k *Keeper) GetVoucherClassID(port string, channel string, classId string) string
- func (k Keeper) IsClassRegistered(ctx sdk.Context, classID string) bool
- func (k Keeper) IsERC721Registered(ctx sdk.Context, erc721 common.Address) bool
- func (k Keeper) IsTokenPairRegistered(ctx sdk.Context, id []byte) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) QueryClassEnhance(ctx sdk.Context, contract common.Address) (types.ClassEnhance, error)
- func (k Keeper) QueryERC721(ctx sdk.Context, contract common.Address) (types.ERC721Data, error)
- func (k Keeper) QueryERC721DataByTokenID(queryFuncName string, ctx sdk.Context, contract common.Address, ...) ([]interface{}, error)
- func (k Keeper) QueryERC721Token(ctx sdk.Context, contract common.Address) (types.ERC721TokenData, error)
- func (k Keeper) QueryERC721TokenOwner(ctx sdk.Context, contract common.Address, tokenID *big.Int) (common.Address, error)
- func (k Keeper) QueryNFTEnhance(ctx sdk.Context, contract common.Address, tokenID *big.Int) (types.NFTEnhance, error)
- func (k Keeper) RefundPacketToken(ctx sdk.Context, data ibcnfttransfertypes.NonFungibleTokenPacketData) error
- func (k Keeper) RegisterERC721(ctx sdk.Context, msg *types.MsgConvertERC721) (*types.TokenPair, error)
- func (k Keeper) RegisterNFT(ctx sdk.Context, msg *types.MsgConvertNFT) (*types.TokenPair, error)
- func (k Keeper) SetClassMap(ctx sdk.Context, classID string, id []byte)
- func (k Keeper) SetERC721Map(ctx sdk.Context, erc721 common.Address, id []byte)
- func (k Keeper) SetEvmAddressByContractTokenId(ctx sdk.Context, evmContractAddress string, evmTokenId string, ...)
- func (k *Keeper) SetICS4Wrapper(ics4Wrapper porttypes.ICS4Wrapper)
- func (k Keeper) SetNFTPairByClassNFTID(ctx sdk.Context, classID string, nftID string, contractAddress string, ...)
- func (k Keeper) SetNFTPairByContractTokenID(ctx sdk.Context, contractAddress string, tokenID string, classID string, ...)
- func (k Keeper) SetNFTPairs(ctx sdk.Context, contractAddress string, tokenID string, classID string, ...)
- func (k Keeper) SetNFTUIDPairByNFTUID(ctx sdk.Context, nftUID string, tokenUID string)
- func (k Keeper) SetNFTUIDPairByTokenUID(ctx sdk.Context, tokenUID string, nftUID string)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTokenPair(ctx sdk.Context, tokenPair types.TokenPair)
- func (k Keeper) ToggleConversion(ctx sdk.Context, token string) (types.TokenPair, error)
- func (k Keeper) TokenPair(c context.Context, req *types.QueryTokenPairRequest) (*types.QueryTokenPairResponse, error)
- func (k Keeper) TokenPairs(c context.Context, req *types.QueryTokenPairsRequest) (*types.QueryTokenPairsResponse, error)
- func (k Keeper) TransferERC721(goCtx context.Context, msg *types.MsgTransferERC721) (*types.MsgTransferERC721Response, error)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of this module maintains collections of erc721.
func NewKeeper ¶ added in v1.0.1
func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ps paramtypes.Subspace, ak types.AccountKeeper, nk nftkeeper.Keeper, ek types.EVMKeeper, ik ibcnfttransferkeeper.Keeper, ) Keeper
NewKeeper creates new instances of the erc721 Keeper
func (Keeper) CallEVM ¶
func (k Keeper) CallEVM( ctx sdk.Context, abi abi.ABI, from, contract common.Address, commit bool, method string, args ...interface{}, ) (*evmtypes.MsgEthereumTxResponse, error)
CallEVM performs a smart contract method call using given args
func (Keeper) CallEVMWithData ¶
func (k Keeper) CallEVMWithData( ctx sdk.Context, from common.Address, contract *common.Address, data []byte, commit bool, ) (*evmtypes.MsgEthereumTxResponse, error)
CallEVMWithData performs a smart contract method call using contract data
func (Keeper) ConvertERC721 ¶
func (k Keeper) ConvertERC721( goCtx context.Context, msg *types.MsgConvertERC721, ) ( *types.MsgConvertERC721, error, )
ConvertERC721 converts ERC721 tokens into native Cosmos nft for both Cosmos-native and ERC721 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 ERC721 tokens for both Cosmos-native and ERC721 TokenPair Owners
func (Keeper) CreateNFTClass ¶
CreateNFTClass generates the metadata to represent the ERC721 token .
func (Keeper) DeleteERC721Map ¶
DeleteERC721Map deletes the token pair id for the given address
func (Keeper) DeleteEvmAddressByContractTokenId ¶
func (Keeper) DeleteNFTPairByNFTID ¶
func (Keeper) DeleteNFTPairByTokenID ¶
func (Keeper) DeleteNFTUIDPairByNFTUID ¶
func (Keeper) DeleteNFTUIDPairByTokenUID ¶
func (Keeper) DeleteTokenPair ¶
DeleteTokenPair removes a token pair.
func (Keeper) DeployERC721Contract ¶
func (k Keeper) DeployERC721Contract( ctx sdk.Context, msg *types.MsgConvertNFT, ) (common.Address, error)
DeployERC721Contract creates and deploys an ERC721 contract on the EVM with the erc20 module account as owner.
func (Keeper) EvmContract ¶ added in v1.0.1
func (k Keeper) EvmContract(c context.Context, req *types.QueryEvmAddressRequest) (*types.QueryTokenPairResponse, error)
EvmContract returns a given registered token pair
func (Keeper) GetClassIDAndNFTID ¶
func (k Keeper) GetClassIDAndNFTID(ctx sdk.Context, msg *types.MsgConvertERC721) (string, []string, error)
GetClassIDAndNFTID sets the erc20 parameters to the param space.
func (Keeper) GetClassMap ¶
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 sets the erc721 parameters to the param space.
func (Keeper) GetERC721Map ¶
GetERC721Map returns the token pair id for the given address
func (Keeper) GetEvmAddressByContractTokenId ¶
func (Keeper) GetNFTPairByClassNFTID ¶
func (Keeper) GetNFTPairByContractTokenID ¶
func (Keeper) GetNFTUIDPairByTokenUID ¶
func (Keeper) GetPair ¶
GetPair checks that:
- the global parameter for erc721 conversion is enabled
- minting is enabled for the given (erc721,nft) token pair
func (Keeper) GetTokenPair ¶
GetTokenPair - get registered token pair from the identifier
func (Keeper) GetTokenPairID ¶
GetTokenPairID returns the pair id from either of the registered tokens.
func (Keeper) GetTokenPairs ¶
GetTokenPairs - get all registered token tokenPairs
func (Keeper) GetTokenUIDPairByNFTUID ¶
func (*Keeper) GetVoucherClassID ¶ added in v1.0.1
func (Keeper) IsClassRegistered ¶
IsClassRegistered check if registered nft class is registered
func (Keeper) IsERC721Registered ¶
IsERC721Registered check if registered ERC721 token is registered
func (Keeper) IsTokenPairRegistered ¶
IsTokenPairRegistered - check if registered token tokenPair is registered
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns the params of the erc20 module
func (Keeper) QueryClassEnhance ¶
func (k Keeper) QueryClassEnhance( ctx sdk.Context, contract common.Address, ) (types.ClassEnhance, error)
QueryClassEnhance returns the data of a deployed ERC721 contract
func (Keeper) QueryERC721 ¶
QueryERC721 returns the data of a deployed ERC721 contract
func (Keeper) QueryERC721DataByTokenID ¶
func (Keeper) QueryERC721Token ¶
func (k Keeper) QueryERC721Token( ctx sdk.Context, contract common.Address, ) (types.ERC721TokenData, error)
QueryERC721Token returns the data of a ERC721 token
func (Keeper) QueryERC721TokenOwner ¶
func (k Keeper) QueryERC721TokenOwner( ctx sdk.Context, contract common.Address, tokenID *big.Int, ) (common.Address, error)
QueryERC721TokenOwner returns the owner of given tokenID
func (Keeper) QueryNFTEnhance ¶
func (k Keeper) QueryNFTEnhance( ctx sdk.Context, contract common.Address, tokenID *big.Int, ) (types.NFTEnhance, error)
QueryNFTEnhance returns the data of a deployed ERC721 contract
func (Keeper) RefundPacketToken ¶ added in v1.0.1
func (k Keeper) RefundPacketToken( ctx sdk.Context, data ibcnfttransfertypes.NonFungibleTokenPacketData, ) error
RefundPacketToken handles the erc721 conversion for a native erc721 token pair:
- escrow tokens on module account
- mint nft to the receiver: nftId: tokenAddress|tokenID
func (Keeper) RegisterERC721 ¶
func (k Keeper) RegisterERC721(ctx sdk.Context, msg *types.MsgConvertERC721) (*types.TokenPair, error)
RegisterERC721 creates a Cosmos coin and registers the token pair between the nft and the ERC721
func (Keeper) RegisterNFT ¶
RegisterNFT deploys an erc721 contract and creates the token pair for the existing cosmos coin
func (Keeper) SetClassMap ¶
SetClassMap sets the token pair id for the classID
func (Keeper) SetERC721Map ¶
SetERC721Map sets the token pair id for the given address
func (Keeper) SetEvmAddressByContractTokenId ¶
func (k Keeper) SetEvmAddressByContractTokenId(ctx sdk.Context, evmContractAddress string, evmTokenId string, evmAddress string)
SetEvmAddressByContractTokenId
func (*Keeper) SetICS4Wrapper ¶
func (k *Keeper) SetICS4Wrapper(ics4Wrapper porttypes.ICS4Wrapper)
SetICS4Wrapper sets the ICS4 wrapper to the keeper. It panics if already set
func (Keeper) SetNFTPairByClassNFTID ¶
func (Keeper) SetNFTPairByContractTokenID ¶
func (Keeper) SetNFTPairs ¶
func (Keeper) SetNFTUIDPairByNFTUID ¶
func (Keeper) SetNFTUIDPairByTokenUID ¶
func (Keeper) SetTokenPair ¶
SetTokenPair stores a token pair
func (Keeper) ToggleConversion ¶
ToggleConversion toggles conversion for a given token pair
func (Keeper) TokenPair ¶
func (k Keeper) TokenPair(c context.Context, req *types.QueryTokenPairRequest) (*types.QueryTokenPairResponse, error)
TokenPair returns a given registered token pair
func (Keeper) TokenPairs ¶
func (k Keeper) TokenPairs(c context.Context, req *types.QueryTokenPairsRequest) (*types.QueryTokenPairsResponse, error)
TokenPairs returns all registered pairs
func (Keeper) TransferERC721 ¶ added in v1.0.1
func (k Keeper) TransferERC721( goCtx context.Context, msg *types.MsgTransferERC721, ) ( *types.MsgTransferERC721Response, error, )
TransferERC721 converts ERC721 tokens into native Cosmos nft for both Cosmos-native and ERC721 TokenPair Owners and transfer through IBC