# 2. Phoenix

{% embed url="<https://www.youtube.com/watch?t=1s&v=csaEV_-uJAo>" %}

This package allows players to interact with smart contract by reading onchain values and by calling smart contract functions to convert a set of NFT tokens into other NFTs.

**Quick start:**

To initialize Phoenix AFP you need to take the prefab that is in **..>Additional Features Packages>Phoenix>Prafabs** called **metapro\_phoenix\_prefab** and instantiate it on the scene. Prefab is constructed in such a way that it will automatically show the initial screen and get **QuestData**. In our naming convention quest is a structure that has information about conversion, tokens that are taken, their amount, tokens that are given with their amount, available time and so on. To get more deep information about data structure please go to the Reference section of Phoenix AFP.

<figure><img src="https://lh3.googleusercontent.com/ZBkmW-dhGGevUnHhsM2ElBQ_1IzvLF8LHnSmlrwtneGyogB97fwhQoGI964fL48l8bdeDnOzhSgaaiRbHOLB_Xdi4qkw36QnsxP-FA2SnuwQNcpwY1ibqaz2MyKDff4M8qTGNrRg17bn-o7uZn5uhqs" alt=""><figcaption></figcaption></figure>

This is the initial screen that the player will see. In this stage the plugin obtains data from smart contract about set quest.

<figure><img src="https://lh5.googleusercontent.com/QdOmTGbk8fka1IxXgKY5_9DJGsdwG3EKcTsC0C2AO6avlvrSABPFLpATAQY0lpukfAaO1n1Vgrsp5wWWpqD9nBtcfKif6-mjtVhFaP4HSJLEEhs8nzjVX2LupGse5ZE78l5vtMUg5cROR-NsAMIhwis" alt=""><figcaption></figcaption></figure>

GetQuestData takes the id of the quest and saves information about that quest.

Players can click now on the Open **conversion** button to open the next window.

<figure><img src="https://lh5.googleusercontent.com/ZflJGoWxTtl_1YzD1X3StrO25CStkl8rjcDLsugaej_59w52hktiWfHWcqjLj2us7yvl99fij8Iqytw3shzGOsF3A7FSTYK4WTv5sC81FVK06G04p59unQskhPFVNv8l2AH7hTqlyCbWy6u-aBWvXEI" alt=""><figcaption></figcaption></figure>

This view shows which tokens are necessary for conversion and which token player will be given. When the player clicks on the Allow **conversion** button, the system sends a transaction to the user wallet that allows smart contract to take control of users' NFT in order to convert them. NFTs shown in this screenshot are just an example of how conversion would look like.

<figure><img src="https://lh4.googleusercontent.com/lBl-QQDmh3V1oKVcEC1L3a22lOVJgAbna6vxlYNCyiEa8PvEK24x7HUNBoK3wfA-_hweFNljW5jcew_335S2H2mXOegdZ-Wb_V0yK6BvYCa9uqnbRMu-4wuLEFNNQLSogbwq3QY5bjedg6KuBZY0vBA" alt=""><figcaption></figcaption></figure>

In players wallet transaction confirmation will popup and the player has to sign it in order to move forward.

<figure><img src="https://lh6.googleusercontent.com/VukuVfQkWdffgmfC3ofl7DTGexPJlcsFl_2K8EsYqZRkOuQvfnrE3UdiT_ZxMw9NMwuWMOF8vH-J9rdGsX4mWOtsYZWrd-IhNQBZ97lfWTP7D4Klm8vy9V7MfmcSuGX-3Q_Mdd9kMzdoZQ_nh4M0mok" alt=""><figcaption></figcaption></figure>

Second step is to actually call the conversion method in the smart contract. Player after clicking the **Convert** button will be again prompted in the wallet to sign a transaction. After transaction confirmation phoenix will display final screen that shows conversion.

<figure><img src="https://lh5.googleusercontent.com/vKtBKMJa7rdwDYY0yC4zSDylLHe4_sKiFO9SvPxcMUBeQ1YAJagUAbk7V9C0VSnS-zHkoEbPBRTjnNP8tLFEA7lt6yUliSfj_rNm9GrxUYvPdZrCrZhBUoZ0D9N_BbNnYULumaOUMn6-eT_f6rLysdY" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.metaproprotocol.com/metapro-protocol/unity-plugin/guides/afp-additional-features-packages/2.-phoenix.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
