> For the complete documentation index, see [llms.txt](https://docs.metaproprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metaproprotocol.com/metapro-protocol/unity-plugin/guides/afp-additional-features-packages/1.-safe-token-transfer.md).

# 1. Safe token transfer

{% embed url="<https://www.youtube.com/watch?v=-oTdNGEn9CM>" %}

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.&#x20;

**Quick start:**

In SafeTrasnferFrom folder you’ll find folder **Prefabs** that contains desktop and mobile implementations of token transferring scripts.&#x20;

**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.

<figure><img src="https://lh5.googleusercontent.com/3ILy6snEaeGJojvR0Ss2A0AvRX4PP4qksGO-R0J1wAYLefwQ7gmBxN51bguSBZR2XUTSajidzlqcMJA1HjojuHahQ60ylL3jTg5y_VczEmQddF-qi01i2CeyOjU4gtwG9JxYaRQxHrI458v12NB_DZk" alt=""><figcaption></figcaption></figure>

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:

<figure><img src="https://lh4.googleusercontent.com/AXMqiie36vCpWy956yOt2u4qFioWiDgFioQY-TVJ0-bEDOsB6OBuiNTUQJAk0iqg8Tn7E_n6F7e5CGDbJ2p8rDwICGGkQc5EbgFcP_7zZaA2Z0QFbj4MhbNaOj7tX-nN94WVAjLOfsL9NjU3XSzuVsc" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh3.googleusercontent.com/9dk9aC5VgDxcE6_U9vAFy04IGroYLXqzjVEi6SIFDn_SlFdhm333PrGNdVSOOw6YU0HUc1InDJHDQ-NLxoOq8Hj8GkXyPweObl6dN6BeErLca5BFdSKlbDY0yf8O0gHH7aAoVEEHcK08PBqL2Aquk5w" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="https://lh4.googleusercontent.com/KEevk8P5Gq5Epm0lp_rV0aicoPp3eb81h3uOIi1-sXkb9qxcN_QKS4f-tnu8nBCKRoOzo8xmh_P3m2MHztcquvZ12DX05NgjZ7FzcBodQaVHMsi69DkHLF0RV9KqR-ZV0Vmg7YVBUA3nW1FrAY4uhWo" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="https://lh6.googleusercontent.com/3Ihsv6WJla8xk69B42L5IUqq0wU2paEMoym2Uk0ygV-iBbj1WqkgLtnVYZIwlOUOdulYp6U1EGFkh84U1hzAIFISghHKUZ0uM9Y1ivYPb_Lzo2PFi-iOihkecrkuHQdBZHBZx1cUnesiV7ZpETCb6R4" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="https://lh4.googleusercontent.com/aMZn7clBUV1-sYIF8QZ1UDbw361uHsuGxPCJsFm9Wvk1kCzW3rwrJJsvLjnJMcSRHHJPuCMCiGzoRz1haq6stbb2gnCl1GTz9wjZ6FJE8qlqqJytaHSazEJo89waldxncNF2PhGkbIPsGYdxn5lERoo" alt=""><figcaption></figcaption></figure>

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.metaproprotocol.com/metapro-protocol/unity-plugin/guides/afp-additional-features-packages/1.-safe-token-transfer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
