# 12. Demo of SDK Calling

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FYt9hSiFemBHmjppffsZx%2Fimage.png?alt=media&#x26;token=4c74ffa0-be1c-40c5-93f8-8a8d680f8652" alt=""><figcaption></figcaption></figure>

1. sdk.connectZecreyWallet: access to user account information via in-browser wallet extension

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2Fye3bJiWK8pQX45zLCDDp%2Fimage.png?alt=media&#x26;token=241e9a04-be3c-46b8-9be3-635cd1c9aae7" alt=""><figcaption></figcaption></figure>

2. sdk.getAccountByAccountName: find user accounts by username and get information such as user avatars.
3. sdk.getAccountNFTs: find NFTs by user accounts.
4. client.mintNft: create NFTs for users.
5. display NFT in the marketplace

### Game demo demonstrating NFT minting:

* Enter the [demo site](https://zecrey-legend-game-demo-95m2.vercel.app/)

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FV25IBcZwiVKAPr5jgOon%2Fimage.png?alt=media&#x26;token=1c0431d7-3444-4e64-9696-bf9f1c8693b7" alt=""><figcaption></figcaption></figure>

* Unconnected status

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2Fc16kcflAkEts7jO8CROG%2Fimage.png?alt=media&#x26;token=a42ac80c-fab3-4d28-ae2c-ae68164c95ea" alt=""><figcaption></figcaption></figure>

* Click "Connect Wallet" and select a wallet extension to connect.

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FZPzlfIZOr9cr2FkVC2M6%2Fimage.png?alt=media&#x26;token=46ba15e5-ef3a-4152-bcae-5a912116fefb" alt=""><figcaption></figcaption></figure>

* Legend is an L2 built on BNB Chain. Switch to Binance test network to proceed.

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2F3bTXruFG68ymqLnBoUou%2Fimage.png?alt=media&#x26;token=f2b616c2-1759-41a8-8d3e-04598b5ee5c6" alt=""><figcaption></figcaption></figure>

* Sign the request to connect to the wallet address.

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FPsVp14WKrdMzSwUw3cUY%2Fimage.png?alt=media&#x26;token=74ff5701-bd44-4ec8-afb8-7ce57c34015d" alt=""><figcaption></figcaption></figure>

* First-time users will be required to register a Legend L2 account associated with the L1 address. The Legend account name is in the form of a human-readable short name domain ending with ".zec".

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2F2dCrIdxS50dzoDn05yhB%2Fimage.png?alt=media&#x26;token=3ce5b02f-3497-4e73-ad11-903a18265be1" alt=""><figcaption></figcaption></figure>

* Confirm the registration to create a Legend account.

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FaNlJfYxOSZ54YILkGYSe%2Fimage.png?alt=media&#x26;token=cf6ec5b4-a536-4522-8375-80920e0e2ca5" alt=""><figcaption></figcaption></figure>

* After connecting to a Legend account, the status of the user's NFT assets will be retrieved and updated automatically.

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2F42f47NPXndr4wzMJmuXF%2Fimage.png?alt=media&#x26;token=67ed721a-0a21-4269-9fc6-2834d71e32be" alt=""><figcaption></figcaption></figure>

* In this demo, the user can walk around and open the treasure boxes. Every time a box is opened, an NFT will be minted as an in-game item.

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FJwLsicEdf7IIpLzEFdqS%2Fimage.png?alt=media&#x26;token=960dfb55-a19e-4418-85a9-9878377446ae" alt=""><figcaption></figcaption></figure>

* An NFT is successfully created and added to the user's assets. The user can check it in the Zecrey NFT marketplace.

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FQ6MEZsXnECvyOpXVPw6P%2Fimage.png?alt=media&#x26;token=ddce8e0b-2664-4e36-84ab-c115a933a73b" alt=""><figcaption></figcaption></figure>

* View the NFT in Zecrey web app marketplace.

<figure><img src="https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FJFJCrIj3XLhSKkIxi81p%2Fimage.png?alt=media&#x26;token=cba7eecf-34f4-4927-a0b8-481824ce528d" alt=""><figcaption></figcaption></figure>

* View the NFT in Zecrey mobile marketplace.

![](https://1457958107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5I1igl7xw1xqlPHEA%2Fuploads%2FgY3dEexhU2tkVFN6UWhE%2Fimage.png?alt=media\&token=d8de55b1-52d2-4f58-a41a-8549d3714686)
