1. Safe token transfer
Last updated
Last updated
This package allows the developer to interact with our smart contract that let player send his NFT token to another address. We’ve provided UI implementation and functionality.
Quick start:
In SafeTrasnferFrom folder you’ll find folder Prefabs that contains desktop and mobile implementations of token transferring scripts.
WARNING: Before you start using this AFP you should have created a bscscan account that provides you an API key to use in checking transaction status calls. You will find it in API-KEYs section in your BscSscan account.
To use this AFP dev should instantiate game object from the provided prefab. Then call function SetupTransfer with NftTokenData object to set desired NFT to transfer.
Example:
After instantiation of a prefab popup will show which contains NFT data and 2 input fields that user has to fill: recipient address and amount of tokens.
If fields are filled correctly then the player can click on the Send button and move forward. If not the error message will show up.
Recipient address must be the correct BSC address.
Amount should be at least 1 token.
When player continues to send a token new window will show up and in that moment player has to confirm the transaction in his wallet.
If an error occurs in that stage (player cancels transaction, wallet doesn’t have sufficient funds to cover transaction fee etc.) error message will pop up. When that happens the player is able to either close the popup window or retry the transaction that will open the initial state of AFP.
After a successful transaction, the confirmation window shows and the player is able to click on the BSC Scan button to view the transaction in his web browser.