Transfer ERC721 Tokens
As a game developer, you may need to transfer ERC721 tokens (also known as NFTs) between players or from a player's wallet to a game wallet. The Leap Wallet SDK provides the necessary methods for this.

To transfer an ERC721 token, use the following code:
const txApi = new Tx(wallet, provider);
// Native Transactions
const nativeTx = await txApi.createNativeTx(wallet.address, receiver_wallet_address, amount);
const txHash = await txApi.signAndBroadcastTx(nativeTx);
// ERC721 Transactions
const nativeTx = await txApi.createERC20Tx(
wallet.address,
receiver_wallet_address,
amount,
erc721_token_contract_address,
);
const txHash = await txApi.signAndBroadcastTx(nativeTx);
Last updated