Documentation
¶
Index ¶
- func GenerateERC721TokenID(classId string, nftId string) *big.Int
- func GenerateNativeTokenID(erc721 common.Address, tokenId *big.Int) string
- type Keeper
- func (k Keeper) Burn(ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, ...) error
- func (k Keeper) CallEVM(ctx sdk.Context, contractABI abi.ABI, from, to common.Address, commit bool, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallEVMWithData(ctx sdk.Context, from common.Address, contractAddress *common.Address, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) ClassData(ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address) (string, error)
- func (k Keeper) ClassPair(c context.Context, req *types.QueryClassPairRequest) (*types.QueryClassPairResponse, error)
- func (k Keeper) ClassPairs(c context.Context, req *types.QueryClassPairsRequest) (*types.QueryClassPairsResponse, error)
- func (k Keeper) ClassURI(ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address) (string, error)
- func (k Keeper) ConvertERC721(goCtx context.Context, msg *types.MsgConvertERC721) (*types.MsgConvertERC721Response, error)
- func (k Keeper) ConvertERC721Burn(ctx sdk.Context, pair types.ClassPair, msg *types.MsgConvertERC721, ...) (string, error)
- func (k Keeper) ConvertERC721Mint(ctx sdk.Context, pair types.ClassPair, msg *types.MsgConvertERC721, ...) (string, error)
- func (k Keeper) ConvertNFT(goCtx context.Context, msg *types.MsgConvertNFT) (*types.MsgConvertNFTResponse, error)
- func (k Keeper) ConvertNFTBurn(ctx sdk.Context, pair types.ClassPair, msg *types.MsgConvertNFT, ...) (*big.Int, error)
- func (k Keeper) ConvertNFTMint(ctx sdk.Context, pair types.ClassPair, msg *types.MsgConvertNFT, ...) (*big.Int, error)
- func (k Keeper) ConvertValidator(ctx sdk.Context, sender, receiver sdk.AccAddress, token string) (types.ClassPair, error)
- func (k Keeper) DeleteClassPair(ctx sdk.Context, ClassPair types.ClassPair)
- func (k Keeper) DeleteERC721TokenIdMap(ctx sdk.Context, erc721 common.Address, tokenId *big.Int)
- func (k Keeper) DeleteNativeNftIdMap(ctx sdk.Context, classId, nftId string)
- func (k Keeper) DeployERC721Contract(ctx sdk.Context, deployer common.Address, ...) (common.Address, error)
- func (k Keeper) ERC721Keeper() erc721Keeper
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetClassCollections(ctx sdk.Context) []types.ClassCollection
- func (k Keeper) GetClassMap(ctx sdk.Context, denom string) []byte
- func (k Keeper) GetClassPair(ctx sdk.Context, id []byte) (types.ClassPair, bool)
- func (k Keeper) GetClassPairID(ctx sdk.Context, class string) []byte
- func (k Keeper) GetERC721Map(ctx sdk.Context, erc721 common.Address) []byte
- func (k Keeper) GetERC721TokenIdMap(ctx sdk.Context, classId, nftId string) *big.Int
- func (k Keeper) GetNativeNftIdMap(ctx sdk.Context, erc721 common.Address, tokenId *big.Int) string
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) IsClassPairRegistered(ctx sdk.Context, id []byte) bool
- func (k Keeper) IsClassRegistered(ctx sdk.Context, classId string) bool
- func (k Keeper) IsERC721Registered(ctx sdk.Context, erc721 common.Address) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Mint(ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, ...) error
- func (k Keeper) OwnerOf(ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, ...) (common.Address, error)
- func (k Keeper) QueryERC721(ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, ...) (types.ERC721Data, error)
- func (k Keeper) QueryERC721Token(ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, ...) (types.ERC721TokenData, error)
- func (k Keeper) SaveRegisteredClass(ctx sdk.Context, sender sdk.AccAddress, classId string) (common.Address, error)
- func (k Keeper) SaveRegisteredERC721(ctx sdk.Context, contract common.Address) (string, error)
- func (k Keeper) SetClass(ctx sdk.Context, contract common.Address, uri string, data string) error
- func (k Keeper) SetClassMap(ctx sdk.Context, classId string, id []byte)
- func (k Keeper) SetClassPair(ctx sdk.Context, ClassPair types.ClassPair)
- func (k Keeper) SetERC721Map(ctx sdk.Context, erc721 common.Address, id []byte)
- func (k Keeper) SetERC721TokenIdMap(ctx sdk.Context, erc721 common.Address, tokenId *big.Int, nftId string)
- func (k Keeper) SetNativeNftIdMap(ctx sdk.Context, classId, nftId string, tokenId *big.Int)
- func (k Keeper) SupportsInterface(ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, ...) (bool, error)
- func (k Keeper) TokenData(ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, ...) (string, error)
- func (k Keeper) TokenTrace(c context.Context, req *types.QueryTokenTraceRequest) (*types.QueryTokenTraceResponse, error)
- func (k Keeper) TokenURI(ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, ...) (string, error)
- func (k Keeper) TransferFrom(ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateERC721TokenID ¶
GenerateERC721TokenID generates an ERC721 token ID
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of this module maintains collections of erc721.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, ak types.AccountKeeper, evmKeeper types.EVMKeeper, nftKeeper types.NFTKeeper, ) Keeper
func (Keeper) Burn ¶
func (k Keeper) Burn(ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, sender common.Address, tokenId *big.Int, ) error
Burn burns an NFT
func (Keeper) CallEVM ¶
func (k Keeper) CallEVM( ctx sdk.Context, contractABI abi.ABI, from, to 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, contractAddress *common.Address, data []byte, commit bool, ) (*evmtypes.MsgEthereumTxResponse, error)
CallEVMWithData performs a smart contract method call using contract data
func (Keeper) ClassData ¶
func (k Keeper) ClassData( ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, ) (string, error)
ClassData queries an account's class data for a given ERC721 contract
func (Keeper) ClassPair ¶
func (k Keeper) ClassPair( c context.Context, req *types.QueryClassPairRequest, ) (*types.QueryClassPairResponse, error)
ClassPair returns a given registered token pair
func (Keeper) ClassPairs ¶
func (k Keeper) ClassPairs( c context.Context, req *types.QueryClassPairsRequest, ) (*types.QueryClassPairsResponse, error)
ClassPairs returns all registered pairs
func (Keeper) ClassURI ¶
func (k Keeper) ClassURI( ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, ) (string, error)
ClassURI queries an account's class URI for a given ERC721 contract
func (Keeper) ConvertERC721 ¶
func (k Keeper) ConvertERC721(goCtx context.Context, msg *types.MsgConvertERC721) (*types.MsgConvertERC721Response, error)
ConvertERC721 converts an ERC721 token to an native Cosmos token
func (Keeper) ConvertERC721Burn ¶
func (k Keeper) ConvertERC721Burn(ctx sdk.Context, pair types.ClassPair, msg *types.MsgConvertERC721, receiver sdk.AccAddress, sender common.Address, ) (string, error)
ConvertERC721Burn converts a native Cosmos token to an erc721 token
func (Keeper) ConvertERC721Mint ¶
func (k Keeper) ConvertERC721Mint(ctx sdk.Context, pair types.ClassPair, msg *types.MsgConvertERC721, receiver sdk.AccAddress, sender common.Address, ) (string, error)
ConvertERC721Mint converts a erc721 token to an native Cosmos token
func (Keeper) ConvertNFT ¶
func (k Keeper) ConvertNFT(goCtx context.Context, msg *types.MsgConvertNFT) (*types.MsgConvertNFTResponse, error)
ConvertNFT converts a native Cosmos token to an ERC721 token
func (Keeper) ConvertNFTBurn ¶
func (k Keeper) ConvertNFTBurn(ctx sdk.Context, pair types.ClassPair, msg *types.MsgConvertNFT, receiver common.Address, sender sdk.AccAddress) (*big.Int, error)
ConvertNFTBurn converts a erc721 token to an native Cosmos token
func (Keeper) ConvertNFTMint ¶
func (k Keeper) ConvertNFTMint( ctx sdk.Context, pair types.ClassPair, msg *types.MsgConvertNFT, receiver common.Address, sender sdk.AccAddress, ) (*big.Int, error)
ConvertNFTMint converts a native Cosmos token to an ERC721 token
func (Keeper) ConvertValidator ¶
func (k Keeper) ConvertValidator( ctx sdk.Context, sender, receiver sdk.AccAddress, token string, ) (types.ClassPair, error)
ConvertValidator is the validator for Convert
func (Keeper) DeleteClassPair ¶
DeleteClassPair removes a token pair.
func (Keeper) DeleteERC721TokenIdMap ¶
DeleteERC721TokenIdMap deletes a token id pair erc721/tokenId = sha256.sum(classId/nftId)
func (Keeper) DeleteNativeNftIdMap ¶
DeleteNativeNftIdMap deletes a token id pair classId/nftId = tokenId
func (Keeper) DeployERC721Contract ¶
func (Keeper) ERC721Keeper ¶
func (k Keeper) ERC721Keeper() erc721Keeper
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
func (Keeper) GetClassCollections ¶
func (k Keeper) GetClassCollections(ctx sdk.Context) []types.ClassCollection
GetClassCollections - get all the registered class pairs and their tokens Genesis state only
func (Keeper) GetClassMap ¶
GetClassMap returns the token pair id for the given class
func (Keeper) GetClassPair ¶
GetClassPair gets a registered token pair from the identifier.
func (Keeper) GetClassPairID ¶
GetClassPairID returns the pair id from either of the registered tokens. Hex address or ClassId can be used as token argument.
func (Keeper) GetERC721Map ¶
GetERC721Map returns the token pair id for the given address
func (Keeper) GetERC721TokenIdMap ¶
GetERC721TokenIdMap classId/nftId = tokenId
func (Keeper) GetNativeNftIdMap ¶
GetNativeNftIdMap erc721/tokenId = sha256.sum(classId/nftId)
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
func (Keeper) IsClassPairRegistered ¶
IsClassPairRegistered - check if registered token ClassPair is registered
func (Keeper) IsClassRegistered ¶
IsClassRegistered check if registered cosmos x/nft Class
func (Keeper) IsERC721Registered ¶
IsERC721Registered check if registered ERC20 token is registered
func (Keeper) Mint ¶
func (k Keeper) Mint(ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, to common.Address, tokenId *big.Int, tokenURI string, tokenData string, ) error
Mint mints an NFT
func (Keeper) OwnerOf ¶
func (k Keeper) OwnerOf( ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, tokenID *big.Int, ) (common.Address, error)
OwnerOf queries an account's owner for a given ERC721 contract
func (Keeper) QueryERC721 ¶
func (k Keeper) QueryERC721( ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, isSystem bool, ) (types.ERC721Data, error)
QueryERC721 queries an ERC721 contract
func (Keeper) QueryERC721Token ¶
func (k Keeper) QueryERC721Token( ctx sdk.Context, contractAddress common.Address, contractABI abi.ABI, tokenId *big.Int, isSystem bool, ) (types.ERC721TokenData, error)
QueryERC721Token queries an ERC721 token
func (Keeper) SaveRegisteredClass ¶
func (k Keeper) SaveRegisteredClass(ctx sdk.Context, sender sdk.AccAddress, classId string) (common.Address, error)
SaveRegisteredClass saves the registered denom to the store
func (Keeper) SaveRegisteredERC721 ¶
SaveRegisteredERC721 saves the registered ERC721 to the store
func (Keeper) SetClassMap ¶
SetClassMap sets the token pair id for the given class
func (Keeper) SetClassPair ¶
SetClassPair stores a token pair
func (Keeper) SetERC721Map ¶
SetERC721Map sets the token pair id for the given address
func (Keeper) SetERC721TokenIdMap ¶
func (k Keeper) SetERC721TokenIdMap(ctx sdk.Context, erc721 common.Address, tokenId *big.Int, nftId string)
SetERC721TokenIdMap stores a token id pair erc721/tokenId = sha256.sum(classId/nftId)
func (Keeper) SetNativeNftIdMap ¶
SetNativeNftIdMap stores a token id pair classId/nftId = tokenId
func (Keeper) SupportsInterface ¶
func (k Keeper) SupportsInterface(ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, interfaceId [4]byte, ) (bool, error)
SupportsInterface checks if the contract supports an interface
func (Keeper) TokenData ¶
func (k Keeper) TokenData( ctx sdk.Context, contractABI abi.ABI, contractAddress common.Address, tokenID *big.Int, ) (string, error)
TokenData queries an account's token data for a given ERC721 contract
func (Keeper) TokenTrace ¶
func (k Keeper) TokenTrace( c context.Context, req *types.QueryTokenTraceRequest, ) (*types.QueryTokenTraceResponse, error)
TokenTrace returns a cross-chain token trace