# Introduction

Zecrey aims to lower the entry barriers of blockchain by making it available for business and consumer use, while increasing privacy and security.

> **DEPRECATED.**
>
> No longer in development, Zecrey Protocol has been rebranded as [Zecrey Labs](https://twitter.com/ZecreyLabs). For more information, visit: <https://zecrey.medium.com/introducing-zecrey-labs-latest-innovations-kontos-protocol-and-zklegend-23a8c64dbe7c>

## What is Zecrey Protocol?

Zecrey is a zk-Rollup based Layer 2 protocol featuring privacy and scalability. From the perspective of products, Zecrey provides a user-friendly wallet containing L1s and Zecrey native L2s. There are two different types of  Layer 2 systems embedded into our wallet, namely, **Zecrey Zero** and **Zecrey Legend**. The first mainly focuses on privacy features and the second mainly focuses on NFT issuance and NFT marketplace.

## Features

### **Asset-Oriented Solution**

Zecrey Protocol is a zkrollup-based solution for vertical use cases, oriented towards asset and ownership. It focuses on a fundamental need for trading that is associated with two types of assets: fungible assets like ERC20 and non-fungible assets like ERC721/ERC1155. The basic demand we will meet includes multiple scenarios derived from fungible and non-fungible assets such as:

1. The transfer of tokens
2. The swap of tokens and
3. The issuance and trading of NFT and so forth.&#x20;

As part of our core functionality, we have ensured that Zecrey enables privacy features for fungible asset transactions, security level same as the underlying mainchain and faster transactions than any other platform. Apart from that, our solution based on zkRollup technology benefits users with:

1. Complete ownership of their assets.
2. Ultra-fast transaction confirmation speed, and
3. Ultra-low transaction fees.

### **Primitives to Applications**

From the perspective of protocol layering and at the core of the architecture, Zecrey offers all the basic primitives required on the asset layer. These primitives will be used as the encapsulation provided by the bottom layer to the upper layer.

The basic primitives built with zkRollup technology will help us provide users with the ability to transfer, swap, and perform basic functions such as NFT minting, buying, and selling.

Based on the above, we will provide feature-rich and easy-to-call SDKs to the public. Speaking of SDKs, I’d like to mention that our SDKs will be unique. It will include private payment, private versions of DEX similar to Uniswap V2, and a platform for NFT issuance and transactions. For example, the SDK of NFT Issuance is based on the primitives of minting NFTs, and Zecrey L2 DEX is based on the primitives of swap.

### **Customized Bottom-up Architecture**

Zecrey provides complete customized architecture from the bottom up. The bottom layer of this Architecture will be the infrastructure layer based on zkRollup. And the upper layer will have SDK/API to provide relevant development components. The top layer will consist of various applications including payment and NFT market products. And the outermost layer will provide products for C-end users and a multi-chain wallet with a plugin and mobile version. The customization we have implemented in this architecture gives us the capacity to design more complex interactions and customized transaction support for both fungible and non-fungible assets.

## Products

From the perspective of products, Zecrey provides a user-friendly wallet supporting L1s and Zecrey native L2s. There are two different types of  Layer 2 systems embedded into our wallet, namely, Zecrey Zero and Zecrey Legend. The first mainly focuses on privacy features and the second mainly focuses on NFT issuance and NFT marketplace.

For Layer 1 functions, it mainly serves as an entry to manage assets. Now we have released the main network wallet for Layer 1s. We initially support 7 chains, mostly EVM compatible chains as well as a non-EVM chain, Near native chain.&#x20;

#### Zecrey Zero

`Zecrey Zero` is a lightweight, **privacy-driven**, and portable **payment solution**, and it provides users with a simple and intuitive interface that allows users to be able to conduct private transfers and swap transactions with ease of access.

For `Zecrey Zero`, we enable privacy features where users can conduct private transfer and private swap transactions. The privacy feature here we mention is mainly related to transaction amount, which means the transaction amount will be concealed by protocol, and no one but yourself knows.&#x20;

#### Zecrey Legend

Zecrey Legend is the first zkRollup L2 scaling solution on the BNB chain and NFT engine of Web3 games. It offers instant trading, massive scalability, and low gas fees for minting and trading NFTs without compromising security.

For `Zecrey Legend`, it could be viewed as an NFT marketplace on Layer 2, the first zkRollup based Layer 2 solution on BNB chain. As the strategic partner of Binance Labs and BNB chain, Zecrey Team created the NFT market with a consistent high-quality design and solid cryptographic scheme.&#x20;

`Zecrey Legend` supports `Mint`/`Transfer`/`Auction`/`Withdraw` NFTs for NFT buyers and artists.&#x20;

Users can operate NFTs in low gas (even zero gas) in the layer 2 network and withdraw the layer 2 NFT to the underlying layer 1 network. NFT transactions on Zecrey NFT Market are advantageous with faster speed, low even no gas fee and sound security shared with BNB chain. And royalty can be set by NFT artists to incentivize creative genius.

`Zecrey Legend` mainly provides the following powerful **SDK** components for Web3 games:

1. **Account Management**: including integration with layer 1 and layer 2 user information
2. **Asset Management**: FT-related primitive support, such as Dex, payment, etc.
3. **NFT Operation**: Including NFT query, issuance, order creation, purchase, transfer, etc. In the NFT query part, Legend is supported by a separate marketplace like Opensea, so games can gain easy access to the NFT market on the layer 2 network, and enjoy customized functions without reinventing the wheel.
4. **Resource Storage**: storage of in-game resources, including media resources, etc. Players can enjoy convenient in-game experiences including: NFT mint with 0 gas fee Millisecond level transaction confirmation Fast marketplace integration

## Useful links

Official website: <https://www.zecrey.com/>

Twitter: <https://twitter.com/zecreyprotocol>

Telegram: <https://t.me/zecrey>

Discord: <https://discord.com/invite/U98ghQsJE5>

Medium: <https://zecrey.medium.com/>

Technical Whitepaper: <https://docsend.com/view/ntcsmt7meu84gcqk>

Deck: <https://docsend.com/view/9x2iz4zj9b8awaa4>


# Zecrey Onepager

<figure><img src="/files/G898sqyIPqb8CtuLndgr" alt=""><figcaption><p>Zecrey Onepager Overview</p></figcaption></figure>

Zecrey Protocol is a zkRollup based Layer 2 protocol featuring privacy and scalability.

* Zero: Lightweight Privacy Layer and **Portable** Private Payment Solution.
* Legend: The **first** zkRollup solution on BNB Chain and NFT Engine of Web3 Games.

### **Central Hub for your Digital Assets**

You have at your fingertips the ability to view, manage and aggregate all your digital assets across various blockchains with Zecrey wallet. Gone are the days when you need to go through different websites and wallets to see all of your digital assets.

### **Aggregators for L1s and L2s**

Both `Zero` and `Legend` will be integrated into Zecrey Wallet -- the easy to use product, containing extension, mobile app and web app. Users can handily switch between different L2s and use the functions of Zero or Legend.

### **Zecrey Zero**

#### **Your Privacy Matters**

Privacy is a fundamental human right; all transactions are private on Zero by default. Zero conceals each transaction amount to protect your privacy.

#### **High Efficiency**

No need to take several seconds to provide privacy feature. Millisecond-level privacy transaction experience is facilitated by Zero.

#### **Broad Adoption**&#x20;

Privacy catalyzes broad adoption in DeFi. Zecrey Zero enables privacy features, driving broad adoption in more financial scenarios.

#### **In Math we Trust**&#x20;

Zero utilizes cutting edge Sigma and zk-Snark technology to enable secure, fast and cheap transactions with privacy protection.

### Zecrey Legend

#### **NFT Engine for Web 3 Games**

Legend is a Layer 2 protocol built for NFT, especially for Web 3 Games.

#### **High Scalable NFT Platform**&#x20;

Legend is the first zkRollup based NFT Marketplace on BNB Chain. Fully customized by Zecrey team, enabling thousands of TPS.

#### **Secure, Instant, Reliable**

Security is rooted in underlying L1, same security level as BNB Chain. Faster transaction confirmation, higher transaction reliability.

#### **Designed for developers**&#x20;

Simple and easy to use API/SDK, developers could integrate NFT into its own system in minutes.


# Zecrey Public Testnet Announcement

![](/files/A3VzYmVRphABJS51omnZ)

Zecrey protocol will launch public testnet on Dec 31st, 22:00 EDT, 2021.

During the public testnet period, you can submit the [feedback form](https://forms.gle/ycSFfZRhsx3dwHCg8) to give your user experience and suggestions about the product. Your feedback will make a contribution to Zecrey's further improvement!

### **Public Testnet supports the following features**

* **Multi-chain assets management** in L1 wallet
* **Transactions with privacy protection** in L2
* **Lock & Unlock** multi-chain assets to get rewards
* Make **private** **swap** and **add/remove liquidity** in L2 AMM DEX
* Transfer assets between L1 and L2 through **Deposit & Withdraw**

**Note: The entry point to join public testnet:** [**https://docs.zecrey.com/product-handbook/step-1.-set-up-your-zecrey-wallet**](https://docs.zecrey.com/product-handbook/step-1.-set-up-your-zecrey-wallet)


# Zecrey Testnet Beta Internal Test Announcement

Zecrey protocol will launch its internal testing round on 28th, August, 2021.&#x20;

Zecrey team will send invitation letters along with activation codes to the investment institutions and strategic partners who have supported Zecrey all the time.

For those who are willing to participate in this round, we also prepare the [Zecrey Internal Testnet Beta Invitation Code Application form](https://docs.google.com/forms/d/e/1FAIpQLSf77RulvkjdwldfRuMg4E2NrVXgzyCVtP4cJozC7tjwLRO2Xg/viewform).

Zecrey is a high-performance privacy cross-chain protocol. It aims to be one of the key infrastructures supporting multiple public chains and various layer-2 networks, providing market participants with efficient, convenient, and secure wallets, privacy cross-chain swaps, and general services such as cross-chain bridge.


# Zecrey Ambassador Program Annoucement

## What is the Zecrey Ambassadors Program? <a href="#id-09d4" id="id-09d4"></a>

Zecrey Ambassador program is for our supporters and users who could potentially provide support to our ever-growing community!

Our vision is to make Zecrey community a place for crypto technology communication and innovative thinking. Zecrey will work as a solid privacy guard and excellent cross-chain solution for users in crypto space. The Zecrey Ambassadors program is a way for crypto influencers & enthusiasts alike to join an extensive program for **promoting** the project. We invite you to become a Zecrey Ambassador and help share the value of privacy and cross-chain for a better crypto world. As long as you believe that you might have something you can contribute to building a better Zecrey ecosystem, it’s your show time!

**We expect you to have:**

* Interest in contributing to promotion and community building of Zecrey
* Expertise in and passion for blockchain and crypto technology
* Experience in social media & community management, such as making videos, crafting articles, hosting events, translating, etc.

The Zecrey Ambassadors program includes but is not limited to two main roles:

**A. Social media Influencer**

* Enhancing Zecrey protocol influence on social media (Twitter/Telegram/Medium/YouTube)
* Generating Zecrey protocol posts and sharing to the related communities
* Planning online campaigns and events to boost the Zecrey brand
* Exploring potential strategic partnerships with projects or individuals

**B.** **Content Creator**

* Creating videos, blogs, gifs, memes, viral songs or you name it for Zecrey
* Writing articles about Zecrey Network’s underlying technology and its use in layer2 ecosystem
* Translating Zecrey articles, handbook, posts and other information into another language.

**Why should you join the program?**

Ambassadors will get the following benefits:

* Being a part of the larger community of blockchain enthusiasts and being a key contributor to the Zecrey ecosystem
* Priority access to more information about Zecrey’s moves and campaigns
* Recognition and special roles in Zecrey channels
* Extra bonus in further activities and much more

## **How to apply?** <a href="#b846" id="b846"></a>

1. Fill in the form here: [Apply for Zecrey Ambassador (google.com)](https://docs.google.com/forms/d/e/1FAIpQLSdZmJm3E1NrQ5UWt_x53353iLzhinGlKdjGlzxMVspEs67fHA/viewform)

2\. Once we received your response, your application will be under review by our core team members.

3\. After the reviewing process, qualified individuals will be contacted directly through email.

*We are immensely grateful for having the opportunity to get acquainted with you and hopefully together we can make Zecrey more vibrant than ever.*

## Reference

[*https://zecrey.medium.com/join-the-zecrey-ambassador-program-3e94fd9a5bd6*](https://zecrey.medium.com/join-the-zecrey-ambassador-program-3e94fd9a5bd6)


# Go & JS SDK Basic Guides

## Basic Guide

These guides provide an overview of how to utilize our developer tools to perform key functions of the Zecrey platform.

#### The following guides offer details on developing with:

* [Go SDK](https://github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/tree/dev)


# 1. Install and Initialize

## Overview

We provide the Golang and Javascript versions of Zecrey Marketplace SDK so that developers can easily access Zecrey's NFT marketplace service. It is an API wrapper for Zecrey that provides most of the functionality for the Zecrey platform. Before starting to use the SDK, developers must initialize the client.

## Get Marketplace SDK package

{% tabs %}
{% tab title="Golang" %}
{% code overflow="wrap" %}

```go
go get github.com/zecrey-Labs/zecrey-marketplace-go-sdk
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
{% code overflow="wrap" %}

```javascript
npm i @zecrey/zecrey-legend-js-sdk
```

{% endcode %}
{% endtab %}
{% endtabs %}

* Most forms of the data available are read-only, so user authentication is not required when querying to update the status of Zecrey NFT Marketplace. Therefore, we designed two ways for calling of the client and SDK for Zecrey NFT Marketplace.
  * When signing data to change the status of Zecrey NFT marketplace, you need to initialize the client to call.
  * When you only need to query data or generate a new signer, you can directly call the method in the SDK package.
* In the following, we list the circumstances under which the client should be initialized and when the SDK should be called directly.

| <p><br></p>                     | Client | SDK |
| ------------------------------- | ------ | --- |
| Register Account                | ✅      | ❌   |
| Apply Register-Host             | ✅      | ❌   |
| Create Collection               | ✅      | ❌   |
| Mint NFT                        | ✅      | ❌   |
| Create Sell Offer               | ✅      | ❌   |
| Create Buy Offer                | ✅      | ❌   |
| Cancel Offer                    | ✅      | ❌   |
| Match Offer                     | ✅      | ❌   |
| Transfer NFT                    | ✅      | ❌   |
| Withdraw NFT                    | ✅      | ❌   |
| Get Account Information         | ❌      | ✅   |
| Get Categories Information      | ❌      | ✅   |
| Get Collections Information     | ❌      | ✅   |
| Get NFT Information             | ❌      | ✅   |
| Get Offer Information           | ❌      | ✅   |
| Create L1 Account               | ❌      | ✅   |
| Generate Seed And L2 Public Key | ❌      | ✅   |
| Upload Media                    | ❌      | ✅   |

## **Initialize the client in the correct environment**

{% hint style="success" %}

#### 📚SDK REFERENCE

* [NewClient](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#NewClient)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

{% code overflow="wrap" %}

```go
package main

import (
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)

var (
   accountName = "Alice"
   seed = "0x7ea589236ac7e6034a40ad31f27a6ea1bbaeb7746ba5e8d3408a3abb480a8688"
)

func main() {
   //Initializing the client needs to access accountName and seed
   //Refer to the module of Register users to get parameters of accountName and seed
   client, err := sdk.NewClient(accountName, seed) 	 
   if err != nil { panic(err) }
 }
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const accountName = "Alice.zec";
const seed = "0x7ea589236ac7e6034a40ad31f27a6ea1bbaeb7746ba5e8d3408a3abb480a8688";
//Using accountName and seed is required to initialize the client
//Please refer to the Register users module for the accountName and seed parameters.
const client = new Client(accountName, seed);
```

{% endcode %}
{% endtab %}
{% endtabs %}

## **Call the SDK in the correct environment:**

{% hint style="success" %}

#### 📚SDK REFERENCE

* [IfAccountRegistered](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#IfAccountRegistered)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   accountName := "Alice"
   result, err := sdk.IfAccountRegistered(accountName)
   if err != nil { panic(err) }
   
   data,err:= json.Marshal(result)
   if err != nil { panic(err) }
    
   fmt.Println("GetAccountIsRegistered:",string(data))
}
```

{% endcode %}

#### Example result:&#x20;

{% code overflow="wrap" %}

```json
GetAccountIsRegistered: true
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example&#x20;

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const accountName = "Alice.zec";
const res = await sdk.ifAccountRegistered(accountName);

console.log("GetAccountIsRegistered:", res)
```

{% endcode %}

#### Example result:&#x20;

{% code overflow="wrap" %}

```json
GetAccountIsRegistered: true
```

{% endcode %}
{% endtab %}
{% endtabs %}


# 2. Get Data

## Overview

This guide provides information on how to obtain data from the Zecrey NFT Marketplace. In most cases, this data is about the current status of the NFT marketplace (i.e. asset ownership and asset status). Most forms of data available are read-only, so user authentication is not required to update the Zecrey NFT marketplace status. This section describes the method to directly call the SDK package.

### Examples of obtained data types commonly include：

* Detailed information on assets or a specific asset, including obtaining account information, categories, collections, your own NFTs, tradable offers, etc.
* Information of a specific user in the NFT marketplace

## Account

### Get account details by account name

* Get information on the account by `accountName`

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetAccountByAccountName](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetAccountByAccountName)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example&#x20;

* Get account information with the name "Alice"

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)

func main() {
   accountName := "Alice"
   accountInfo, err := sdk.GetAccountByAccountName(accountName)
   if err != nil { panic(err) }
   
   data, _:= json.Marshal(accountInfo)
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
  account:
    {
        "id":17,
        "account_index":14,
        "account_name":"Alice",    
        "bio":"name:Alice age:18 city:New York ",
        "email":"aliceaccountemail@gmail.com",
        "external_link":"https://alice.xyz",
        "twitter_link":"https://twitter.com/alice",
        "instagram_link":"https://www.instagram.com/alice/",
        "profile_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg",
        "profile_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx.jpg",
        "banner_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf.jpg",
        "banner_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lo3vtlrcslcr1n7tgiuh.jpg",
        "created_at":1667835867
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get account information with the name "Alice"

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const accountName = "Alice.zec";
const res = await sdk.getAccountByAccountName(accountName);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
  account:
    {
        "id":17,
        "account_index":14,
        "account_name":"Alice",    
        "bio":"name:Alice age:18 city:New York ",
        "email":"aliceaccountemail@gmail.com",
        "external_link":"https://alice.xyz",
        "twitter_link":"https://twitter.com/alice",
        "instagram_link":"https://www.instagram.com/alice/",
        "profile_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg",
        "profile_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx.jpg",
        "banner_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf.jpg",
        "banner_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lo3vtlrcslcr1n7tgiuh.jpg",
        "created_at":1667835867
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Get assets by account name

* Query the user's asset information

  | Token | Token ID |
  | ----- | -------- |
  | BNB   | 0        |
  | *LEG* | 1        |
  | *REY* | 2        |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetAccountAssetsInfoByAccountName](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.6/sdk#GetAccountAssetsInfoByAccountName)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get asset information with the name "Alice"

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   accountName := "Alice"
   result, err := sdk.GetAccountAssetsInfoByAccountName(accountName)
   if err != nil { panic(err) }
   
   data, _ := json.Marshal(accountInfo)
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
[{"asset_id":0,"balance":"69516961736982000000","lp_amount":"1141481984833460000","offer_canceled_or_finalized":"170141183617213717799641663991588061916"},{"asset_id":1,"balance":"212085509760300000000","lp_amount":"412765957420000000","offer_canceled_or_finalized":"16438259186243607965933629081649153"},{"asset_id":2,"balance":"244530497503355100600","lp_amount":"5180165258600000000","offer_canceled_or_finalized":"0"}]
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get asset information with the name "Alice"

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "alice.zec";
const res = await sdk.getAccountAssetsInfoByName(account_name);

console.log(res);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
[{"asset_id":0,"balance":"69516961736982000000","lp_amount":"1141481984833460000","offer_canceled_or_finalized":"170141183617213717799641663991588061916"},{"asset_id":1,"balance":"212085509760300000000","lp_amount":"412765957420000000","offer_canceled_or_finalized":"16438259186243607965933629081649153"},{"asset_id":2,"balance":"244530497503355100600","lp_amount":"5180165258600000000","offer_canceled_or_finalized":"0"}]
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Get assets information

* Query user asset information
* Token information

  | Token | Token ID |
  | ----- | -------- |
  | BNB   | 0        |
  | *LEG* | 1        |
  | *REY* | 2        |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetAssetsList](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.6/sdk#GetAssetsList)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Query token information

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   result, err := sdk.GetAssetsList()
   if err != nil { panic(err) }
   
   data, _ := json.Marshal(accountInfo)
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{"assets":[{"asset_id":0,"asset_name":"BNB","asset_decimals":18,"asset_symbol":"BNB","asset_address":"0x00","is_gas_asset":1},{"asset_id":1,"asset_name":"LEG","asset_decimals":18,"asset_symbol":"LEG","asset_address":"0x364Ed72f329f1BD56AE84b941D1c6E4E260cE152","is_gas_asset":0},{"asset_id":2,"asset_name":"REY","asset_decimals":18,"asset_symbol":"REY","asset_address":"0x9f4c0B11D9cAC63351fd002Cd09812138C6055cb","is_gas_asset":0}]}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Query token information

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const res = await sdk.getSupportedAssets();

console.log(res);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
[{"asset_id":0,"asset_name":"BNB","asset_decimals":18,"asset_symbol":"BNB","asset_address":"0x00","is_gas_asset":1},{"asset_id":1,"asset_name":"LEG","asset_decimals":18,"asset_symbol":"LEG","asset_address":"0x364Ed72f329f1BD56AE84b941D1c6E4E260cE152","is_gas_asset":0},{"asset_id":2,"asset_name":"REY","asset_decimals":18,"asset_symbol":"REY","asset_address":"0x9f4c0B11D9cAC63351fd002Cd09812138C6055cb","is_gas_asset":0}]
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Get account index

* Query `accountIndex`

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetAccountIndex](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetAccountIndex)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Query the account index of the name "Alice"

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   accountName := "Alice"
   result, err := sdk.GetAccountIndex(accountName)
   if err != nil { panic(err) }
   
   data,_:= json.Marshal(result)    
   fmt.Println("accountIndex:",result.AccountIndex)
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" lineNumbers="true" %}

```json
accountIndex: 4Example
- Query the account index of the name "Alice"
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec";
const res = await sdk.getAccountIndex(account_name);

console.log("accountIndex:", res);
Example result
accountIndex: 4Example
- Query the account index of the name "Alice"
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec";
const res = await sdk.getAccountIndex(account_name);

console.log("accountIndex:", res);
Example result
accountIndex: 4

```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Query the account index of the name "Alice"

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec";
const res = await sdk.getAccountIndex(account_name);

console.log("accountIndex:", res);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
accountIndex: 4
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Get account registration status

* Query whether the `accountName` has been registered

{% hint style="success" %}

#### 📚SDK REFERENCE

* [IfAccountRegistered](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#IfAccountRegistered)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Query if the account name "Alice" is already registered

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   accountName := "Alice"
   result, err := sdk.IfAccountRegistered(accountName)
   if err != nil { panic(err) }
   
   data,_:= json.Marshal(result) 
   fmt.Println("GetAccountIsRegistered:",string(data))
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
GetAccountIsRegistered: true
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Query if the account name "Alice" is already registered

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec";
const res = await sdk.ifAccountRegistered(account_name);

console.log("GetAccountIsRegistered:", res);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
GetAccountIsRegistered: true
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Category

### Get NFT categories

* Get all NFT categories

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetCategories](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetCategories)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)

func main() {
   result, err := sdk.GetCategories()
   if err != nil { panic(err) }
   
   data,_:= json.Marshal(result)
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "categories":[
</strong>        {
<strong>            "id":1,
</strong><strong>            "name":"Art"
</strong>        },
        {
<strong>            "id":2,
</strong><strong>            "name":"Collection"
</strong>        },
        {
<strong>            "id":3,
</strong><strong>            "name":"domain name"
</strong>        },
        {
<strong>            "id":4,
</strong><strong>            "name":"music"
</strong>        },
        {
<strong>            "id":5,
</strong><strong>            "name":"photography"
</strong>        },
        {
<strong>            "id":6,
</strong><strong>            "name":"physical education"
</strong>        },
        {
<strong>            "id":7,
</strong><strong>            "name":"trading card"
</strong>        },
        {
<strong>            "id":8,
</strong><strong>            "name":"Practical"
</strong>        },
        {
<strong>            "id":9,
</strong><strong>            "name":"virtual reality"
</strong>        },
        {
<strong>            "id":10,
</strong><strong>            "name":"default"
</strong>        }
    ]
}on
</code></pre>

{% endtab %}

{% tab title="Javascript" %}

#### Example

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const res = await sdk.getCategories();

console.log(res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "categories":[
</strong>        {
<strong>            "id":1,
</strong><strong>            "name":"Art"
</strong>        },
        {
<strong>            "id":2,
</strong><strong>            "name":"Collection"
</strong>        },
        {
<strong>            "id":3,
</strong><strong>            "name":"domain name"
</strong>        },
        {
<strong>            "id":4,
</strong><strong>            "name":"music"
</strong>        },
        {
<strong>            "id":5,
</strong><strong>            "name":"photography"
</strong>        },
        {
<strong>            "id":6,
</strong><strong>            "name":"physical education"
</strong>        },
        {
<strong>            "id":7,
</strong><strong>            "name":"trading card"
</strong>        },
        {
<strong>            "id":8,
</strong><strong>            "name":"Practical"
</strong>        },
        {
<strong>            "id":9,
</strong><strong>            "name":"virtual reality"
</strong>        },
        {
<strong>            "id":10,
</strong><strong>            "name":"default"
</strong>        }
    ]
}
</code></pre>

{% endtab %}
{% endtabs %}

## Collections

* In the returned details about a collection, there will be a status attribute indicating its `status` (pending, created, expired, invalid, etc.).
* The `status` of collections can be one of the following:

| **`Status`** | **`CodeNumber`** |
| ------------ | ---------------- |
| PENDING      | 0                |
| CREATED      | 1                |
| EXPIRED      | 2                |
| INVALID      | 10               |

### Get collections of an account by account index

* Get the collections belonging to this account through `accountIndex`
* The results returned include:
  * `confirmedCollectionIdList`: The collections that have been confirmed by Zecrey and exist in the form of an array id. And the details can be obtained through `GetCollectionById`.
  * `pendingCollections`: Collections under the pending status are waiting to be confirmed by Zecrey and cannot be used.

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetCollectionsByAccountIndex](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetCollectionsByAccountIndex)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get collections created by the account name "Alice"
  * Query the `accountIndex` of Alice
  * Obtain the collections created by this account

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   accountName := "Alice"

   accountIndex,err:= sdk.GetAccountIndex(accountName)
   if err != nil { panic(err) }
   
   result, err := sdk.GetCollectionsByAccountIndex(accountIndex)
   if err != nil { panic(err) }
   
   data,_:= json.Marshal(result)
   fmt.Println(string(data))

}
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "sdkCollections":[
</strong>        {
<strong>            "id": 4,
</strong><strong>            "l2_collection_id":4,
</strong><strong>            "account_name":"Alice",
</strong><strong>            "name":"Alice`s space 4",
</strong><strong>            "short_name":"Alice`s space 4",
</strong><strong>            "description":"AliceCollection4 description",
</strong><strong>            "category_id":1,
</strong><strong>            "collection_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg",
</strong><strong>            "external_link":"https://alice.xyz",
</strong><strong>            "twitter_link":"https://twitter.com/alice",
</strong><strong>            "instagram_link":"https://www.instagram.com/alice/",
</strong><strong>            "telegram_link":"https://tgstat.com/channel/@alice",
</strong><strong>            "discord_link":"https://discord.com/api/v10/applications/&#x3C;aliceid>/commands",
</strong><strong>            "logo_image":"https://res.cloudinary.com/zecrey/image/upload/collection/lc02mjan85horu8650td",
</strong><strong>            "logo_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
</strong><strong>            "featured_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q",
</strong><strong>            "featured_Thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx",
</strong><strong>            "banner_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf",
</strong><strong>            "banner_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lo3vtlrcslcr1n7tgiuh",
</strong><strong>            "creator_earning_rate":1000,
</strong><strong>            "status":"PENDING",
</strong><strong>            "expired_at":1668083576082,
</strong><strong>            "created_at":1667910776,
</strong><strong>            "item_count":3,
</strong><strong>            "browse_count":6,
</strong><strong>            "floor_price":2,
</strong><strong>            "one_day_trade_volume":8.7,
</strong><strong>            "total_trade_volume":58.7
</strong>        }
    ]
}
</code></pre>

{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get collections created by the account name "Alice"
  * Query the `accountIndex` of Alice
  * Obtain the collections created by this account

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const accountName = "Alice.zec";
const accountIndex = await sdk.getAccountIndex(accountName);
const res = await sdk.getCollectionsByAccountIndex(accountIndex);

console.log(res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "sdkCollections":[
</strong>        {
<strong>            "id": 4,
</strong><strong>            "l2_collection_id":4,
</strong><strong>            "account_name":"Alice",
</strong><strong>            "name":"Alice`s space 4",
</strong><strong>            "short_name":"Alice`s space 4",
</strong><strong>            "description":"AliceCollection4 description",
</strong><strong>            "category_id":1,
</strong><strong>            "collection_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg",
</strong><strong>            "external_link":"https://alice.xyz",
</strong><strong>            "twitter_link":"https://twitter.com/alice",
</strong><strong>            "instagram_link":"https://www.instagram.com/alice/",
</strong><strong>            "telegram_link":"https://tgstat.com/channel/@alice",
</strong><strong>            "discord_link":"https://discord.com/api/v10/applications/&#x3C;aliceid>/commands",
</strong><strong>            "logo_image":"https://res.cloudinary.com/zecrey/image/upload/collection/lc02mjan85horu8650td",
</strong><strong>            "logo_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
</strong><strong>            "featured_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q",
</strong><strong>            "featured_Thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx",
</strong><strong>            "banner_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf",
</strong><strong>            "banner_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lo3vtlrcslcr1n7tgiuh",
</strong><strong>            "creator_earning_rate":1000,
</strong><strong>            "status":"PENDING",
</strong><strong>            "expired_at":1668083576082,
</strong><strong>            "created_at":1667910776,
</strong><strong>            "item_count":3,
</strong><strong>            "browse_count":6,
</strong><strong>            "floor_price":2,
</strong><strong>            "one_day_trade_volume":8.7,
</strong><strong>            "total_trade_volume":58.7
</strong>        }
    ]
}
</code></pre>

{% endtab %}
{% endtabs %}

### Get collection details by ID

* Get the collection information through `collectionID`

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetCollectionById](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetCollectionById)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get the collection information with`collectionID` =3

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() { 
   var collectionId int64 = 3
   result, err := sdk.GetCollectionById(collectionId)
   data,_:= json.Marshal(result)
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "id": 3,
</strong><strong>    "l2_collection_id":3,
</strong><strong>    "account_name":"Alice",
</strong><strong>    "name":"Alice`s space 3",
</strong><strong>    "short_name":"Alice`s space 3",
</strong><strong>    "description":"AliceCollection3 description",
</strong><strong>    "category_id":1,
</strong><strong>    "collection_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf.jpg",
</strong><strong>    "external_link":"https://alice.xyz",
</strong><strong>    "twitter_link":"https://twitter.com/alice",
</strong><strong>    "instagram_link":"https://www.instagram.com/alice/",
</strong><strong>    "telegram_link":"https://tgstat.com/channel/@alice",
</strong><strong>    "discord_link":"https://discord.com/api/v10/applications/&#x3C;aliceid>/commands",
</strong><strong>    "logo_image":"https://res.cloudinary.com/zecrey/image/upload/collection/lc02mjan85horu8650td",
</strong><strong>    "logo_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
</strong><strong>    "featured_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q",
</strong><strong>    "featured_Thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx",
</strong><strong>    "banner_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf",
</strong><strong>    "banner_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lo3vtlrcslcr1n7tgiuh",
</strong><strong>    "creator_earning_rate":0,
</strong><strong>    "status":"CREATED",
</strong><strong>    "expired_at":1668083576082,
</strong><strong>    "created_at":1667910776,
</strong><strong>    "item_count":3,
</strong><strong>    "browse_count":6,
</strong><strong>    "floor_price":2,
</strong><strong>    "one_day_trade_volume":8.7,
</strong><strong>    "total_trade_volume":58.7
</strong>}
</code></pre>

{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get the collection information with`collectionID` =3

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const collectionId = 3;
const res = await sdk.getCollectionById(collectionId);

console.log(res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "id": 3,
</strong><strong>    "l2_collection_id":3,
</strong><strong>    "account_name":"Alice",
</strong><strong>    "name":"Alice`s space 3",
</strong><strong>    "short_name":"Alice`s space 3",
</strong><strong>    "description":"AliceCollection3 description",
</strong><strong>    "category_id":1,
</strong><strong>    "collection_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf.jpg",
</strong><strong>    "external_link":"https://alice.xyz",
</strong><strong>    "twitter_link":"https://twitter.com/alice",
</strong><strong>    "instagram_link":"https://www.instagram.com/alice/",
</strong><strong>    "telegram_link":"https://tgstat.com/channel/@alice",
</strong><strong>    "discord_link":"https://discord.com/api/v10/applications/&#x3C;aliceid>/commands",
</strong><strong>    "logo_image":"https://res.cloudinary.com/zecrey/image/upload/collection/lc02mjan85horu8650td",
</strong><strong>    "logo_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
</strong><strong>    "featured_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q",
</strong><strong>    "featured_Thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx",
</strong><strong>    "banner_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf",
</strong><strong>    "banner_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lo3vtlrcslcr1n7tgiuh",
</strong><strong>    "creator_earning_rate":0,
</strong><strong>    "status":"CREATED",
</strong><strong>    "expired_at":1668083576082,
</strong><strong>    "created_at":1667910776,
</strong><strong>    "item_count":3,
</strong><strong>    "browse_count":6,
</strong><strong>    "floor_price":2,
</strong><strong>    "one_day_trade_volume":8.7,
</strong><strong>    "total_trade_volume":58.7
</strong>}
</code></pre>

{% endtab %}
{% endtabs %}

## NFT

* In the returned details about an NFT, there will be a status attribute indicating its `status` (pending, created, expired, invalid, etc.).
* The NFT `status` can be one of the following:

  | **`Status`** | **`CodeNumber`** |
  | ------------ | ---------------- |
  | PENDING      | 0                |
  | CREATED      | 1                |
  | EXPIRED      | 2                |
  | INVALID      | 10               |

### Get NFTs of an account

* Get the NFTs belonging to this account through the `accountIndex` or `accountName`
* The results returned include:
  * `ConfirmedAssetIdList`: NFTs that have been confirmed by Zecrey and exist in the form of an array id. And the specific NFT information can be obtained through [Get NFT by ID](https://docs.zecrey.com/go-and-js-sdk-basic-guides/2.-get-data#get-nft-details-by-id)
  * `PendingAssets`: NFTs that are in pending status and waiting to be confirmed by Zecrey, which cannot be used for the following operations: `transfer`, `withdraw`, `listOffer`, `makeOffer`

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetAccountNFTs](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetAccountNFTs)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get all the NFT information of one's own account
  * Get the `accountIndex`
  * Get the NFTs of the `accountIndex`

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   accountName := "Alice"
   
   accountIndex,err:=sdk.GetAccountIndex(accountName)//Get the accountIndex of one's own account
   if err != nil { panic(err) }
   
   result, err := sdk.GetAccountNFTs(accountIndex)//Get all the NFT information of one's own account
   if err != nil { panic(err) } 
   
    data,_:= json.Marshal(result)  
    fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
    "sdkAssets":[
        {
            "id":9,
            "account_name":"lockkkxj",
            "nft_index":4,
            "collection_id":21,
            "creator_earning_rate":0,
            "name":"Pxzkkz01 #2",
            "description":"Description information",
            "media":"https://res.cloudinary.com/zecrey/image/upload/collection/czpvywx2piq42lauuous",
            "image_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/goqywrpyvzjuntaedgas",
            "video_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
            "audio_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/abf4wd7ults27bqxiciz",
            "status":"1",//already created
            "content_hash":"faabea2dac2f88a1a87938cdc518f64e2b05dbd5229ca618a9fd579010fff341",
            "nft_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf.jpg",
            "expired_at":1667964122485,
            "created_at":1667877723,
             "properties":[
                 {
                     "name":"Animal",
                      "value":"Snow owl"
                 }
             ],
            "levels":[
                {
                    "name":"Power",
                    "value":10,
                    "maxValue":0
                }
            ],
            "stats":[
               {
                    "name":"blood",
                    "value":10,
                    "maxValue":2
                }

        ]
        }
    ]
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get all the NFT information of one's own account
  * Get the `accountIndex`
  * Get the NFTs of the `accountIndex`

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const accountName = "amber1.zec";
const res = await sdk.getAccountIndex(accountName);

console.log(res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "sdkAssets":[
</strong>        {
            "id":9,
            "account_name":"lockkkxj",
            "nft_index":4,
            "collection_id":21,
            "creator_earning_rate":0,
            "name":"Pxzkkz01 #2",
            "description":"Description information",
<strong>            "media":"https://res.cloudinary.com/zecrey/image/upload/collection/czpvywx2piq42lauuous",
</strong><strong>            "image_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/goqywrpyvzjuntaedgas",
</strong><strong>            "video_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui,
</strong><strong>            "audio_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/abf4wd7ults27bqxiciz",
</strong>            "status":"1",//already created
            "content_hash":"faabea2dac2f88a1a87938cdc518f64e2b05dbd5229ca618a9fd579010fff341",
<strong>            "nft_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf.jpg",
</strong>            "expired_at":1667964122485,
            "created_at":1667877723,
<strong>             "properties":[
</strong>                 {
<strong>                     "name":"Animal",
</strong><strong>                      "value":"Snow owl"
</strong>                 }
             ],
<strong>            "levels":[
</strong>                {
<strong>                    "name":"Power",
</strong><strong>                    "value":10,
</strong><strong>                    "maxValue":0
</strong>                }
            ],
<strong>            "stats":[
</strong>               {
<strong>                    "name":"blood",
</strong><strong>                    "value":10,
</strong><strong>                    "maxValue":2
</strong>                }

        ]
        }
    ]
}
</code></pre>

{% endtab %}
{% endtabs %}

### Get NFT details by ID

* Get the NFT information through `NftId`

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetNftById](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetNftById)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get the NFT information with `NftId` = 14

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   var nftId int64 = 14
   result, err := sdk.GetNftById(nftId)
   if err != nil { panic(err) }
   
   data, _ := json.Marshal(result)
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json

{
    "asset":{
        "id":14,
        "account_name":"Alice",
        "nft_index":14,//nftIndez will be used to interact with l2
        "collection_id":3,
        "creator_earning_rate":0,
        "name":"Alice number 14 nft",
        "description":"it·s my number 14 nft",
        "media":"https://res.cloudinary.com/zecrey/image/upload/collection/czpvywx2piq42lauuous",
        "image_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/czpvywx2piq42lauuous",
        "video_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/vo6044kd4qjlgbbeqz0h",
        "audio_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/abf4wd7ults27bqxiciz",
        "status":"1",//already created
        "content_hash":"faabea2dac2f88a1a87938cdc518f64e2b05dbd5229ca618a9fd579010fff341",
        "nft_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg",
        "expired_at":1667964122485,
        "created_at":1667877723,
          "properties":[
            {
                "name":"Animal",
                "value":"Snow owl"
            }
        ],
        "levels":[
            {
                "name":"Power",
                "value":10,
                "maxValue":0
            }
        ],
        "stats":[
           {
                "name":"blood",
                "value":10,
                "maxValue":2
            }

        ]
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get the NFT information with `NftId` = 14

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const nftId = 14;
const res = await sdk.getNftById(nftId);

console.log(res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">
{
<strong>    "asset":{
</strong><strong>        "id":14,
</strong><strong>        "account_name":"Alice",
</strong><strong>        "nft_index":14,//nftIndex will be used to interact with l2
</strong><strong>        "collection_id":3,
</strong><strong>        "creator_earning_rate":0,
</strong><strong>        "name":"Alice number 14 nft",
</strong><strong>        "description":"it·s my number 14 nft",
</strong><strong>        "media":"https://res.cloudinary.com/zecrey/image/upload/collection/czpvywx2piq42lauuous",
</strong><strong>        "image_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/czpvywx2piq42lauuous",
</strong><strong>        "video_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/vo6044kd4qjlgbbeqz0h",
</strong><strong>        "audio_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/abf4wd7ults27bqxiciz",
</strong><strong>        "status":"1",//already created
</strong><strong>        "content_hash":"faabea2dac2f88a1a87938cdc518f64e2b05dbd5229ca618a9fd579010fff341",
</strong><strong>        "nft_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg",
</strong><strong>        "expired_at":1667964122485,
</strong><strong>        "created_at":1667877723,
</strong><strong>          "properties":[
</strong>            {
<strong>                "name":"Animal",
</strong><strong>                "value":"Snow owl"
</strong>            }
        ],
<strong>        "levels":[
</strong>            {
<strong>                "name":"Power",
</strong><strong>                "value":10,
</strong><strong>                "maxValue":0
</strong>            }
        ],
<strong>        "stats":[
</strong>           {
<strong>                "name":"blood",
</strong><strong>                "value":10,
</strong><strong>                "maxValue":2
</strong>            }

        ]
    }
}
</code></pre>

{% endtab %}
{% endtabs %}

## Offers

* In the returned details about an offer, there will be a status attribute indicating its `status` (pending, created, expired, invalid, etc.).
* The offer `status` can be one of the following:

| **`Status`**                    | **`CodeNumber`** |
| ------------------------------- | ---------------- |
| Pending                         | 0                |
| Offer Created                   | 1                |
| matchOffer to be Verified on L2 | 2                |
| matchOffer Verified on L2       | 3                |
| Offer Canceled                  | 4                |
| Expired                         | 6                |
| Invalid                         | 10               |

### Get offers of an account&#x20;

* Get the offers of this account through `accountIndex`

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetAccountOffers](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetAccountOffers)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get the offers of this account
  * Get `accountIndex`
  * Get the offers of this account

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)

func main() {
   accountName := "Alice"
   
   accountIndex,err:= sdk.GetAccountIndex(accountName)
   if err != nil { panic(err) }
  
   result, err := sdk.GetAccountOffers(accountIndex)
   if err != nil { panic(err) }
   
   data, _ := json.Marshal(result)
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
    "sdkOffers":[
        {
            "id":15,
            "account_name":"Alice",
            "asset_id":14,
            "created_at":1584313213,
            "direction":1,
            "expired_at":76434131354,
            "payment_asset_amount":100000,
            "payment_asset_id":0,
            "signature":{
                "Type":1,
                "OfferId":1,
                "AccountIndex":4,
                "NftIndex":4,
                "AssetId":0,
                "AssetAmount":1000000000000000000,
                "ListedAt":1667875812560,
                "ExpiredAt":1668307810076,
                "TreasuryRate":30,
                "Sig":"0tFMdyguNXx6mJEtM3CL8OK62M4vmQqzVpre4zLuRgwFb0bR2IOs0v/A2ZsKhSRvKtJhs9yhz008Yz2akYAczQ=="
            },
            "status":2 //The offer has been matExample
- Get the offers of this account
  1. Get accountIndex
  2. Get the offers of this account
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const accountName = "Alice.zec";
const accountIndex = await sdk.getAccountIndex(accountName);
const res = await sdk.getAccountOffers(accountIndex);

console.log(res);
Example result
{
    "sdkOffers":[
        {
            "id":15,
            "account_name":"Alice",
            "asset_id":14,
            "created_at":1584313213,
            "direction":1,
            "expired_at":76434131354,
            "payment_asset_amount":100000,
            "payment_asset_id":0,
            "signature":{
                "Type":1,
                "OfferId":1,
                "AccountIndex":4,
                "NftIndex":4,
                "AssetId":0,
                "AssetAmount":1000000000000000000,
                "ListedAt":1667875812560,
                "ExpiredAt":1668307810076,
                "TreasuryRate":30,
                "Sig":"0tFMdyguNXx6mJEtM3CL8OK62M4vmQqzVpre4zLuRgwFb0bR2IOs0v/A2ZsKhSRvKtJhs9yhz008Yz2akYAczQ=="
            },
            "status":2 //The offer has been matched and is waiting to be verified on L2
        }
        ......
    ]
}ched and is waiting to be verified on L2
        }
        ......
    ]
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get the offers of this account
  * Get `accountIndex`
  * Get the offers of this account

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const accountName = "Alice.zec";
const accountIndex = await sdk.getAccountIndex(accountName);
const res = await sdk.getAccountOffers(accountIndex);

console.log(res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "sdkOffers":[
</strong>        {
<strong>            "id":15,
</strong><strong>            "account_name":"Alice",
</strong><strong>            "asset_id":14,
</strong><strong>            "created_at":1584313213,
</strong><strong>            "direction":1,
</strong><strong>            "expired_at":76434131354,
</strong><strong>            "payment_asset_amount":100000,
</strong><strong>            "payment_asset_id":0,
</strong><strong>            "signature":{
</strong><strong>                "Type":1,
</strong><strong>                "OfferId":1,
</strong><strong>                "AccountIndex":4,
</strong><strong>                "NftIndex":4,
</strong><strong>                "AssetId":0,
</strong><strong>                "AssetAmount":1000000000000000000,
</strong><strong>                "ListedAt":1667875812560,
</strong><strong>                "ExpiredAt":1668307810076,
</strong><strong>                "TreasuryRate":30,
</strong><strong>                "Sig":"0tFMdyguNXx6mJEtM3CL8OK62M4vmQqzVpre4zLuRgwFb0bR2IOs0v/A2ZsKhSRvKtJhs9yhz008Yz2akYAczQ=="
</strong>            },
<strong>            "status":2 //The offer has been matched and is waiting to be verified on L2
</strong>        }
        ......
    ]
}
</code></pre>

{% endtab %}
{% endtabs %}

Note: The direction field in the offer information can help identify whether this offer is a `buy` (0) or a `sell` (1).

| **Field**   | **Category** | **Field Description**             |
| ----------- | ------------ | --------------------------------- |
| `direction` | `int`        | 0 `BuyNftOffer`, 1 `SellNftOffer` |

### Get NFT Offers

* Get the offers of this NFT through `NftId`

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetNftOffers](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetNftOffers)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get the offers of the account with `NftId` = 14

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   nftId:= 14
   result, err := sdk.GetNftOffers(nftId)
   if err != nil { panic(err) }
  
   data, _ := json.Marshal(result) 
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json

sdkAssets: [{
      id:4
      account_name:"Alice"
      asset_id:147
      created_at:1584313213
      direction:1
      expired_at:76434131354
      payment_asset_amount:100000
      payment_asset_id:0
      signature:{"Type":1,"OfferId":1,"AccountIndex":4,"NftIndex":2,"AssetId":0,"AssetAmount":3000000000000000000,"ListedAt":1667875812560,"ExpiredAt":1668307810076,"TreasuryRate":30,"Sig":"0tFMdyguNXx6mJEtM3CL8OK62M4vmQqzVpre4zLuRgwFb0bR2IOs0v/A2ZsKhSRvKtJhs9yhz008Yz2akYAczQ=="}
      status:3
     }
     .....]
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get the offers of the account with `NftId` = 14

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const nftId = 14;
const res = await sdk.getNftOffers(nftId);

console.log(res);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
sdkAssets: [{
      id:4
      account_name:"Alice"
      asset_id:147
      created_at:1584313213
      direction:1
      expired_at:76434131354
      payment_asset_amount:100000
      payment_asset_id:0
      signature:{"Type":1,"OfferId":1,"AccountIndex":4,"NftIndex":2,"AssetId":0,"AssetAmount":3000000000000000000,"ListedAt":1667875812560,"ExpiredAt":1668307810076,"TreasuryRate":30,"Sig":"0tFMdyguNXx6mJEtM3CL8OK62M4vmQqzVpre4zLuRgwFb0bR2IOs0v/A2ZsKhSRvKtJhs9yhz008Yz2akYAczQ=="}
      status:3
     }
     .....]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Get offer details by ID

* Get the information about the offer through `OfferId`&#x20;

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetOfferById](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetOfferById)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get the offer information with `OfferId` = 5

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   offerId:= 5
   result, err := sdk.GetOfferById(OfferId)
   if err != nil { panic(err) }
   
   data, _ := json.Marshal(result)
   fmt.Println( string(data))
   
}
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "offer":{
</strong><strong>        "id":5,
</strong><strong>        "account_name":"amber1",
</strong><strong>        "direction":"1",//1:sell 0:buy
</strong><strong>        "asset_id":7,
</strong><strong>        "payment_asset_id":0,
</strong><strong>        "payment_asset_amount":"3.000000000000000000",//sell at 3 BNB
</strong><strong>        "status":"1",// successfully created
</strong><strong>        "signature":"{\"Type\":1,\"OfferId\":1,\"AccountIndex\":4,\"NftIndex\":2,\"AssetId\":0,\"AssetAmount\":3000000000000000000,\"ListedAt\":1667875812560,\"ExpiredAt\":1668307810076,\"TreasuryRate\":30,\"Sig\":\"0tFMdyguNXx6mJEtM3CL8OK62M4vmQqzVpre4zLuRgwFb0bR2IOs0v/A2ZsKhSRvKtJhs9yhz008Yz2akYAczQ==\"}",
</strong><strong>        "expired_at":1668307810076,
</strong><strong>        "created_at":1667875810
</strong>    }
}
</code></pre>

{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get the offer information with `OfferId` = 5

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const offerId = 5;
const res = await sdk.getOfferById(offerId);

console.log(res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "offer":{
</strong><strong>        "id":5,
</strong><strong>        "account_name":"amber1",
</strong><strong>        "direction":"1",//1:sell 0:buy
</strong><strong>        "asset_id":7,
</strong><strong>        "payment_asset_id":0,
</strong><strong>        "payment_asset_amount":"3.000000000000000000",//sell at 3 BNB
</strong><strong>        "status":"1",// successfully created
</strong><strong>        "signature":"{\"Type\":1,\"OfferId\":1,\"AccountIndex\":4,\"NftIndex\":2,\"AssetId\":0,\"AssetAmount\":3000000000000000000,\"ListedAt\":1667875812560,\"ExpiredAt\":1668307810076,\"TreasuryRate\":30,\"Sig\":\"0tFMdyguNXx6mJEtM3CL8OK62M4vmQqzVpre4zLuRgwFb0bR2IOs0v/A2ZsKhSRvKtJhs9yhz008Yz2akYAczQ==\"}",
</strong><strong>        "expired_at":1668307810076,
</strong><strong>        "created_at":1667875810
</strong>    }
}json
</code></pre>

{% endtab %}
{% endtabs %}

### Get details about NFT listings and offers

* Get the details of the NFT listings and offers and the corresponding NFT information

| Field    | Category | Field Description                 |
| -------- | -------- | --------------------------------- |
| `isSell` | `int64`  | 0 `BuyNftOffer`, 1 `SellNftOffer` |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetListingOffers](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetListingOffers)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Get details of the listing and the corresponding NFT information

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
   var offerType int64 = 1
   result, err := sdk.GetListingOffers(offerType)
   if err != nil { panic(err) }
   
   data, _ := json.Marshal(result)
   fmt.Println(string(data))
}
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "data":{
</strong><strong>        "offer":[
</strong>            {
                {
<strong>                "id":53,
</strong><strong>                "l2_offer_id":18,
</strong><strong>                "direction":1,
</strong><strong>                "asset_id":19,
</strong><strong>                "payment_asset_id":0,
</strong><strong>                "payment_asset_amount":100,
</strong><strong>                "status":1,
</strong><strong>                "signature":"{\"Type\":1,\"OfferId\":18,\"AccountIndex\":18,\"NftIndex\":19,\"AssetId\":0,\"AssetAmount\":100000000000000000000,\"ListedAt\":1668175126138,\"ExpiredAt\":1668607122441,\"TreasuryRate\":30,\"Sig\":\"mYlFH0uvCiipd2bfGHbxgHWUvzbDuNUKTskXbgaATI4FmJxmnSFwA2MzU5cVtcxJn/vh11D8p9n+qCr6nE9cEA==\"}",
</strong><strong>                "expired_at":1668607122441,
</strong><strong>                "created_at":"2022-11-11T13:58:45.799273+00:00",
</strong><strong>                "asset":{
</strong><strong>                    "id":19,
</strong><strong>                    "nft_index":19,
</strong><strong>                    "collection_id":22,
</strong><strong>                    "creator_earning_rate":0,
</strong><strong>                    "name":"ooo #1",
</strong><strong>                    "description":"ooooo",
</strong><strong>                    "media_detail":{
</strong><strong>                        "url":"https://res.cloudinary.com/zecrey/image/upload/v1668066577/collection/een1olis8b2jofcx4pew.jpg"
</strong>                    },
<strong>                    "image_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lc02mjan85horu8650td",
</strong><strong>                    "video_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf",
</strong><strong>                    "audio_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx",
</strong><strong>                    "status":1,
</strong><strong>                    "content_hash":"1f06251dc934955c23173cc2a28536319cda2986f675f41bd48f1b1647bc718f",
</strong><strong>                    "nft_url":"-",
</strong><strong>                    "expired_at":1668152992703,
</strong><strong>                    "created_at":0,
</strong><strong>                    "properties":{
</strong><strong>                        "name":"assetProperty",
</strong><strong>                        "value":"red"
</strong>                    },
<strong>                    "levels":{
</strong><strong>                        "name":"assetLevel",
</strong><strong>                        "value":120,
</strong><strong>                        "maxValue":100
</strong>                    },
<strong>                    "stats":{
</strong><strong>                        "name":"StatType",
</strong><strong>                        "value":400,
</strong><strong>                        "maxValue":200
</strong>                    }
                }
            }
            }
        ]
    }
}
</code></pre>

{% endtab %}

{% tab title="Javascript" %}

#### Example

* Get details of a listing and the corresponding NFT information

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const offerType = 1;
const res = await sdk.getListingOffers(offerType);

console.log(res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "data":{
</strong><strong>        "offer":[
</strong>            {
                {
<strong>                "id":53,
</strong><strong>                "l2_offer_id":18,
</strong><strong>                "direction":1,
</strong><strong>                "asset_id":19,
</strong><strong>                "payment_asset_id":0,
</strong><strong>                "payment_asset_amount":100,
</strong><strong>                "status":1,
</strong><strong>                "signature":"{\"Type\":1,\"OfferId\":18,\"AccountIndex\":18,\"NftIndex\":19,\"AssetId\":0,\"AssetAmount\":100000000000000000000,\"ListedAt\":1668175126138,\"ExpiredAt\":1668607122441,\"TreasuryRate\":30,\"Sig\":\"mYlFH0uvCiipd2bfGHbxgHWUvzbDuNUKTskXbgaATI4FmJxmnSFwA2MzU5cVtcxJn/vh11D8p9n+qCr6nE9cEA==\"}",
</strong><strong>                "expired_at":1668607122441,
</strong><strong>                "created_at":"2022-11-11T13:58:45.799273+00:00",
</strong><strong>                "asset":{
</strong><strong>                    "id":19,
</strong><strong>                    "nft_index":19,
</strong><strong>                    "collection_id":22,
</strong><strong>                    "creator_earning_rate":0,
</strong><strong>                    "name":"ooo #1",
</strong><strong>                    "description":"ooooo",
</strong><strong>                    "media_detail":{
</strong><strong>                        "url":"https://res.cloudinary.com/zecrey/image/upload/v1668066577/collection/een1olis8b2jofcx4pew.jpg"
</strong>                    },
<strong>                    "image_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lc02mjan85horu8650td",
</strong><strong>                    "video_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf",
</strong><strong>                    "audio_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx",
</strong><strong>                    "status":1,
</strong><strong>                    "content_hash":"1f06251dc934955c23173cc2a28536319cda2986f675f41bd48f1b1647bc718f",
</strong><strong>                    "nft_url":"-",
</strong><strong>                    "expired_at":1668152992703,
</strong><strong>                    "created_at":0,
</strong><strong>                    "properties":{
</strong><strong>                        "name":"assetProperty",
</strong><strong>                        "value":"red"
</strong>                    },
<strong>                    "levels":{
</strong><strong>                        "name":"assetLevel",
</strong><strong>                        "value":120,
</strong><strong>                        "maxValue":100
</strong>                    },
<strong>                    "stats":{
</strong><strong>                        "name":"StatType",
</strong><strong>                        "value":400,
</strong><strong>                        "maxValue":200
</strong>                    }
                }
            }
            }
        ]
    }
}
</code></pre>

{% endtab %}
{% endtabs %}


# 3. SDK Signature

| ✅User signature required                                                                                                                                                                                                            | ❌ No user signature required                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Transactions that change blockchain status                                                                                                                                                                                          | [Read-only operations](https://docs.zecrey.com/go-and-js-sdk-basic-guides/2.-get-data)                                                                 |
| <ul><li>Register L2 accounts</li><li>Create NFT-related transactions</li><li>Transfer assets between accounts</li><li>Use Zecrey-Dex for token swap</li><li>Deposit assets to Zecrey L2</li><li>Withdraw assets to BNB L1</li></ul> | <ul><li>Get the account information on Zecrey</li><li>Get the details of L2 assets</li><li>Get the details of the NFT Marketplace</li></ul><p><br></p> |

In Zecrey-Marketplace-SDK, in order to make it easy for developers to register and send transactions, the private key signing process is encapsulated inside the SDK methods. **Thus, developers do not need to understand the principle and process of signing, just use the SDK-client to make method calls to complete the required functions.**

In order to provide developers with a deeper understanding of the process of signing transactions by the SDK, in the following section, we will explain the process of user signature transactions and related function methods. **This section is only intended to give developers a deeper understanding of Zecrey and Zecrey SDK.**

\
Due to the difference in the signature algorithms (ecdsa/eddsa) between L1 and L2 account systems, they use different private keys for transaction signatures:

* A transaction occurring on L1 requires the transaction to be signed on L1. For example, depositing assets from an L1 wallet to an L2 wallet uses the L1 private key.
* Transactions occurring on Zecrey (L2) require the transaction to be signed on L2. For example, all transactions initiated on L2 need to be signed using L2's private key.

**Note that the L2 private key is derived from the L1 private key signature, which means that there is a one-to-one correspondence between the L1 and L2 private keys.** If you generate your own Zecrey (L2) private key, you can make it permanent to avoid repeated operations. There will be no need to regenerate the seed with the private key of L1 in the future.

\
The following examples show how to use the SDK for **account creation, L2 private key generation and transaction signature** respectively.

### Create an account:

* Use the client to generate an L1 account and private key, then generate an L2 seed (private key) and public key

{% hint style="success" %}

#### 📚SDK REFERENCE

* [CreateL1Account](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#CreateL1Account)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)

func main() {
    l1Addr, privateKeyStr, l2pk, seed, err := sdk.CreateL1Account()
    if err != nil { panic(err) }
    
    fmt.Println("l1Addr:", l1Addr) //l1 account
    fmt.Println("privateKeyStr:", privateKeyStr)//l1 private key
    fmt.Println("l2pk:", l2pk)     //l2 public key
    fmt.Println("seed:", seed)     //l2 private key
 }
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
l1Addr: 0xD207262DEA01aE806fA2dCaEdd489Bd2f5FABcFE
seed: 0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052
privateKeyStr: 1a061a8e74cee1ce2e2ddd29f5afea99ecfbaf1998b6d349a8c09a368e637b8e
l2pk: 06278b99871f1d64fcc83bd27713cbf743d957c510a245d6bfb0eae888e35452274a2b4c8c7b7424f25d7d187661225111753197248fa045fd872aa662fdcb24
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example：

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const res = await sdk.createL1Account();

console.log(res);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
  l1Addr: 0xD207262DEA01aE806fA2dCaEdd489Bd2f5FABcFE
  seed: 0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052
  privateKeyStr: 1a061a8e74cee1ce2e2ddd29f5afea99ecfbaf1998b6d349a8c09a368e637b8e
  l2pk: 06278b99871f1d64fcc83bd27713cbf743d957c510a245d6bfb0eae888e35452274a2b4c8c7b7424f25d7d187661225111753197248fa045fd872aa662fdcb24
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Generate L2 private key

* Generate L2 public and private keys with the user's L1 private key

{% hint style="success" %}

#### 📚SDK REFERENCE

* [GetSeedAndL2Pk](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#GetSeedAndL2Pk)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)

func main() {
    privateKey := "0xe94a8b4ddd33b2865a89bb764d70a0c3e3276007ece8f114a47a4e9581ec3567"
    l2pk, seed, err := sdk.GetSeedAndL2Pk(privateKey)
    if err != nil { panic(err) }
    
    fmt.Println("seed:", seed)//l2 private key
    fmt.Println("l2pk:", l2pk)//l2 public key
 }
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
seed: 0x7ea589236ac7e6034a40ad31f27a6ea1bbaeb7746ba5e8d3408a3abb480a8688
l2pk: 22fc6f5d74c8639245462a0af6b5c931bd209c04034b28421a60336635ab85950a3163e68ec29319ca200fac009408369b0a1f75200a118aded920cd240e1358
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example：

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const privateKey = "0xe94a8b4ddd33b2865a89bb764d70a0c3e3276007ece8f114a47a4e9581ec3567";
const res = await sdk.getSeedAndL2Pk(privateKey);

console.log(res);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
  seed: 0x7ea589236ac7e6034a40ad31f27a6ea1bbaeb7746ba5e8d3408a3abb480a8688
  l2pk: 22fc6f5d74c8639245462a0af6b5c931bd209c04034b28421a60336635ab85950a3163e68ec29319ca200fac009408369b0a1f75200a118aded920cd240e1358
 }
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Signature by the signer

* Transaction signature process
  * Encapsulate the transaction bodies
  * Calculate transaction hashes
  * Sign

{% hint style="success" %}

#### 📚SDK REFERENCE

* [SignMessage](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#SignMessage)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Sign the `CreateCollectionTx`

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
   "github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc"
   "github.com/zecrey-labs/zecrey-crypto/wasm/zecrey-legend/legendTxTypes"
   "math/big"
   "time"
)

func main() {
   accountName := "Alice"
   seed := "28e1a3762ff9944e9a4ad79477b756ef0aff3d2af76f0f40a0c3ec6ca76cf24b"
   c, err := sdk.NewClient(accountName, seed)
   if err != nil {
      panic(err)
   }
   expiredAt := time.Now().Add(time.Hour * 24 * 2).UnixMilli()
   accountIndex, _ := sdk.GetAccountIndex(accountName)
   accountNonce, _ := sdk.GetNextNonce(accountIndex)
   txInfo := &sdk.CreateCollectionTxInfo{
      AccountIndex:      accountIndex,
      Name:              fmt.Sprintf("Nft Collection - %d", accountNonce),
      Introduction:      "Great Nft!",
      GasAccountIndex:   1,
      GasFeeAssetId:     0,
      GasFeeAssetAmount: big.NewInt(5000),
      ExpiredAt:         expiredAt,
      Nonce:             accountNonce,
      Sig:               nil,
   }
   hFunc := mimc.NewMiMC()
   convertedTx := sdk.ConvertCreateCollectionTxInfo(txInfo)
   msgHash, _ := legendTxTypes.ComputeCreateCollectionMsgHash(convertedTx, hFunc)
   signature, _ := sdk.SignMessage(c.keyManager,msgHash)
   txInfo.Sig = signature
   data,_:=json.Marshal(txInfo)
   fmt.Println(string(data))

}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
    "AccountIndex":0,
    "CollectionId":0,
    "Name":"Nft Collection - 1",
    "Introduction":"Great Nft!",
    "GasAccountIndex":1,
    "GasFeeAssetId":0,
    "GasFeeAssetAmount":5000,
    "ExpiredAt":1668752525678,
    "Nonce":1,
    "Sig":"QUThasa7ocSNqh4qYtAKvDXW00rVfkUqjZt1IgIXT4QBhbt9XhHvPdIHMaNUPI9jtYdC5JsY526qs1/gdJd5Kg=="
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Sign the `CreateCollectionTx`

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const seed = "28e1a3762ff9944e9a4ad79477b756ef0aff3d2af76f0f40a0c3ec6ca76cf24b";
const accountName = "Alice.zec";
const accountIndex = await sdk.getAccountIndex(accountName);
const txParams = { 
    account_index: accountIndex, 
    introduction: "Great Nft!", 
    name: "Nft Collection - 1",
    gas_account_index:1,
    gas_fee_asset_id:0,
    gas_fee_asset_amount:5000,
    expired_at:1668752525678,
    nonce:1,
}
const res = await sdk.signMessage(seed, message);

console.log("Sig: ", res);
```

{% endcode %}

#### Example result

<pre class="language-json" data-overflow="wrap"><code class="lang-json"><strong>Sig: QUThasa7ocSNqh4qYtAKvDXW00rVfkUqjZt1IgIXT4QBhbt9XhHvPdIHMaNUPI9jtYdC5JsY526qs1
</strong></code></pre>

{% endtab %}
{% endtabs %}

####


# 4. Register Users

## User Registration

The Zecrey account is represented by a public key, which is generated with the L1 private key.User registration consists of two parts:

1. Generating Zecrey L2 user account for the L1 account
2. Registering the L1 to L2 correspondence

This enables the following functionality:

* A user with an L1 account now has an associated L2 account on Zecrey.
* L1 users can deposit L1 assets into their L2 accounts.
* L2 users can perform transactions on Zecrey (create orders, trade assets, transfer assets, etc.).
* L2 users can withdraw their L2 assets to their L1 accounts.

#### On-chain registration

1. First, register a user on the contract related to Zecrey L1.
2. Then Zecrey L2 synchronizes with the L1 registration of the user. All transactions executed by the user on L2 will be recorded under this registered L1/L2 user.

#### What happens during the user registration process?

* Register an account in the L1 contract and match the unique name of the tagged account to this account.
* Link the account to L2 by submitting the associated information.
* The L2 program recognizes the associated information submitted by the user, confirms it, saves it in the database, and the registration of the account is complete.

This is an overview of the user registration process:

<figure><img src="/files/ajvgDURivIqbdk1NKqP7" alt=""><figcaption></figcaption></figure>

## Register Account With Private Key

* Since sending a transaction to L1 will consume a certain amount of gas fee, to ensure successful registration, the user needs to ensure that he or she has BNB in the address.

1. RegisterAccountWithPrivateKey will submit a registration transaction to L1 for registration, and this function will internally determine whether the account has been registered. If it has been registered, will directly return to the client.

   Note: [IfAccountRegistered](https://docs.zecrey.com/go-and-js-sdk-basic-guides/2.-get-data#get-account-registration-status) can determine if the account has been registered.
2. If the RegisterAccountWithPrivateKey function determines internally that the user has not registered on L1, the first step will be executed with the L1 private key, accountName and other information input by the user.

{% hint style="success" %}

#### 📚SDK REFERENCE

* [RegisterAccountWithPrivateKey](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#RegisterAccountWithPrivateKey)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}

#### Example

* Register an account with the name "Alice"
  * Prepare `accountName`, `L1Addr` and `privateKey`.
  * Register an account on L1.
  * If you have not registered before, wait for about 30 seconds and then check whether the registration is successful.

    Note: it takes some time for L1 to confirm the transaction and L2 to synchronize the transaction with L1.

{% code overflow="wrap" %}

```go
package main

import (
   "encoding/json"
   "fmt"
   "time"

   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)

func main() {
   accountName := "Alice"
   l1Addr := "0xD207262DEA01aE806fA2dCaEdd489Bd2f5FABcFE"                             //the address of l1 account
   privateKey := "0x1a061a8e74cee1ce2e2ddd29f5afea99ecfbaf1998b6d349a8c09a368e637b8e" //the private key of l1
   client, err := sdk.RegisterAccountWithPrivateKey(accountName, l1Addr, privateKey)
   if err != nil {
      panic(err)
   }
   isRegister, err := sdk.IfAccountRegistered(accountName)
   if err != nil {
      panic(err)
   }


   if !isRegister{
      time.Sleep(time.Second * 30) //wait for l1 to verify the transaction
      isRegister, err = sdk.IfAccountRegistered(accountName)
      if err != nil {
         panic(err)
      }
      
      data, _ := json.Marshal(isRegister)
      fmt.Println("GetAccountIsRegistered:", string(data))

      accountName, l2pk, seed := client.GetMyInfo() //get information about your account through GetMyInfo()
      fmt.Println("accountName:", accountName)      //account name
      fmt.Println("l2pk:", l2pk)                    //l2 publick key
      fmt.Println("seed:", seed)                    //l2 private key
   }

}
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
GetAccountIsRegistered:true
accountName:Alice
l2pk:22fc6f5d74c8639245462a0af6b5c931bd209c04034b28421a60336635ab85950a3163e68ec29319ca200fac009408369b0a1f75200a118aded920cd240e1358
seed:0x7ea589236ac7e6034a40ad31f27a6ea1bbaeb7746ba5e8d3408a3abb480a8688
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

#### Example

* Register an account with the name "Alice"
  * Prepare `accountName`, `L1Addr` and `privateKey`.
  * Register an account on L1.
  * If you have not registered before, wait for about 30 seconds and then check whether the registration is successful.

    Note: it takes some time for L1 to confirm the transaction and L2 to synchronize the transaction with L1.

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec";
const address = "0xD207262DEA01aE806fA2dCaEdd489Bd2f5FABcFE";
const privateKey = "0x1a061a8e74cee1ce2e2ddd29f5afea99ecfbaf1998b6d349a8c09a368e637b8e";

const res = await sdk.registerAccountWithPrivateKey(account_name, address, privateKey);

console.log(res);
```

{% endcode %}

#### Example result

{% code overflow="wrap" %}

```json
{
    accountName:"Alice.zec",
    l2pk:22fc6f5d74c8639245462a0af6b5c931bd209c04034b28421a60336635ab85950a3163e68ec29319ca200fac009408369b0a1f75200a118aded920cd240e1358
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


# 5. Mint Assets

### Register users

* Before users can mint/collect assets and create projects on Zecrey, they must register as Zecrey users. Please follow [this procedure](https://docs.zecrey.com/go-and-js-sdk-basic-guides/4.-register-users).

### [Set Categories](https://docs.zecrey.com/go-and-js-sdk-basic-guides/2.-get-data#category)

* Zecrey NFT Marketplace has set several default categories to divide the collections. When creating a collection, you must select between one of the categories.

### Upload Media

* Upload pictures

{% hint style="success" %}
&#x20;📚**SDK REFERENCE**

* [UploadMedia](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#UploadMedia)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
**Example**

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    filePath := "/Users/alice/Documents/20221112-142909.jpg"
    result, err := sdk.UploadMedia(filePath)
    if err != nil { panic(err) }
    
    data, _ := json.Marshal(result)    
    fmt.Println(string(data))
}
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
{
    "public_id":"collection/tsgqu4cgj57wrxncllky", //unique Id of the picture
    "url":"https://res.cloudinary.com/zecrey/image/upload/v1668506730/collection/tsgqu4cgj57wrxncllky.jpg" //link of the picture
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
&#x20;   **Example**

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const url = "/Users/alice/Documents/20221112-142909.jpg";
const blob = await (await fetch(url)).blob();
const media = new File([blob], "media");
const res = await sdk.uploadMedia(media);

console.log(res);
```

{% endcode %}

&#x20;   **Example result**

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    "public_id":"collection/tsgqu4cgj57wrxncllky", //unique Id of the picture
</strong><strong>    "url":"https://res.cloudinary.com/zecrey/image/upload/v1668506730/collection/tsgqu4cgj57wrxncllky.jpg" //link of the picture
</strong>}
</code></pre>

{% endtab %}
{% endtabs %}

### Create a Collection

* When minting an NFT, it will be identified in a collection to distinguish different styles or topics. Collections will be submitted to the L1 chain by Zecrey. All collections created through Zecrey will be searchable in the NFT Marketplace.
* The transaction of creating a collection will be confirmed by Zecrey. Once Zecrey confirms this collection, it will be submitted to L1.
* Parameters needed for creating a collection:

| Parameter          | Parameter usage and meaning                                                                     | Required vs Optional |
| ------------------ | ----------------------------------------------------------------------------------------------- | -------------------- |
| accountName        | The account name used to initialize the client                                                  | ✅                    |
| seed               | The user's L2 seed used to initialize the client                                                | ✅                    |
| ShortName          | Used to create and identify a collection; cannot be duplicated with other collections           | ✅                    |
| CategoryId         | Used to create a collection                                                                     | ✅                    |
| CollectionUrl      | The background image displayed for mobile users                                                 | <p><br></p>          |
| ExternalLink       | External link to the collection                                                                 | <p><br></p>          |
| TwitterLink        | Twitter link to the collection                                                                  | <p><br></p>          |
| InstagramLink      | Instagram link to the collection                                                                | <p><br></p>          |
| TelegramLink       | Telegram link to the collection                                                                 | <p><br></p>          |
| DiscordLink        | Discord link of the collection                                                                  | <p><br></p>          |
| LogoImage          | The logo image id of the collection                                                             | <p><br></p>          |
| FeaturedImage      | The feature image id of the collection                                                          | <p><br></p>          |
| BannerImage        | The Banner image id of the collection                                                           | <p><br></p>          |
| Description        | The description of the collection, and filling in "-" is recommended if there is no description | <p><br></p>          |
| CreatorEarningRate | Creator royalities                                                                              | ✅                    |
| PaymentAssetIds    | Asset types used to settle                                                                      | <p><br></p>          |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [CreateCollection](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#Client.CreateCollection)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
**Example**

* Create a collection with the `ShortName` "Alice's space"
  1. Initialize the client
  2. Create a collection

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk/model"
)


func main() {
    accountName := "Alice"
    seed := "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052"
    ShortName := "Alice`s space"
    CategoryId := "1"
    CollectionUrl := "https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg"
    ExternalLink := "https://weibo.com/alice"
    TwitterLink := "https://twitter.com/alice"
    InstagramLink := "https://www.instagram.com/alice/"
    TelegramLink := "https://tgstat.com/channel/@alice"
    DiscordLink := "https://discord.com/api/v10/applications/<aliceid>/commands"
    LogoImage := "collection/lc02mjan85horu8650td" //unique id after uploading images
    FeaturedImage := "collection/ahykviwc0suhoyzusb5q"//unique id after uploading images
    BannerImage := "collection/lo3vtlrcslcr1n7tgiuh"//unique id after uploading images
    Description := "Description information"//description of the collection
    CreatorEarningRate := "0"//reserved field with no substance
    PaymentAssetIds := "[]"
    
   c, err := sdk.NewClient(accountName, seed) 	 
    if err != nil { panic(err) }
    
    result, err := c.CreateCollection(ShortName, CategoryId, CreatorEarningRate,
       model.WithCollectionUrl(CollectionUrl),//variable parameter which is optional
       model.WithExternalLink(ExternalLink),
       model.WithTwitterLink(TwitterLink),
       model.WithInstagramLink(InstagramLink),
       model.WithTelegramLink(TelegramLink),
       model.WithDiscordLink(DiscordLink),
       model.WithLogoImage(LogoImage),
       model.WithFeaturedImage(FeaturedImage),
       model.WithBannerImage(BannerImage),
       model.WithDescription(Description),
       model.WithPaymentAssetIds(PaymentAssetIds))
    if err != nil { panic(err) }
    
    data, err := json.Marshal(result)
    if err != nil { panic(err) }
    fmt.Println(string(data))
 }
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
{
    "collection":{
        "id":22,
        "l2_collection_id":1,
        "account_name":"Alice",
        "name":"collection_Shortname 55",
        "short_name":"collection_Shortname 55",//unique short_name for the collection
        "description":"Description information",
        "category_id":1,
        "collection_url":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg",
        "external_link":"https://weibo.com/alice",
        "twitter_link":"https://twitter.com/alice",
        "instagram_link":"https://www.instagram.com/alice/",
        "telegram_link":"https://tgstat.com/channel/@alice",
        "discord_link":"https://discord.com/api/v10/applications/<aliceid>/commands",
        "logo_image":"https://res.cloudinary.com/zecrey/image/upload/collection/lc02mjan85horu8650td",
        "logo_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
        "featured_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q",
        "featured_Thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/ioy2wcqupbgnuqvdtjfx",
        "banner_image":"https://res.cloudinary.com/zecrey/image/upload/collection/ljvwvjho9ucs5gpwmlkf",
        "banner_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/lo3vtlrcslcr1n7tgiuh",
        "creator_earning_rate":0,//reserved field with no substance
        "status":"PENDING",
        "expired_at":1668083576082,
        "created_at":1667910776,
        "item_count":3,
        "browse_count":0,
        "floor_price":2,
        "one_day_trade_volume":8.7,
        "total_trade_volume":58.7
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Javasript" %}
**Example**

* Create a collection with the `ShortName` "Alice's space"
  1. Initialize the client
  2. Create a collection

With the private key:

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "Alice.zec";
const seed = "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052";

const client = new Client(account_name, seed);
await client.initialize();

const category_id = 2;
const logo_image = "collection/in9tbyo5gheczolvhezx";
const description = "Description information";
const banner_image = "collection/pj4u3xm2j4jzeqcvogfd";
const shortname = "Alice's space";
const creator_earning_rate = 0.02; // 2%
const featured_image = "";
const collection_url = "";
const external_link = "";
const twitter_link = "";
const instagram_link = "";
const discord_link = "";
const telegram_link = "";

const res = await client.createCollection(category_id, logo_image, description, banner_image, shortname, creator_earning_rate, featured_image, collection_url, external_link, twitter_link, instagram_link, discord_link, telegram_link);

console.log("collection id: ", res);
```

{% endcode %}

With the wallet:

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec"; // sender's account name
const account_index = 14; // sender's account index
const category_id = 2;
const logo_image = "collection/in9tbyo5gheczolvhezx";
const description = "Description information";
const banner_image = "collection/pj4u3xm2j4jzeqcvogfd";
const shortname = "Alice's space";
const creator_earning_rate = 0.02; // 2%
const featured_image = "";
const collection_url = "";
const external_link = "";
const twitter_link = "";
const instagram_link = "";
const discord_link = "";
const telegram_link = "";

const res = await sdk.createCollection(account_name, account_index, category_id, logo_image, description, banner_image, shortname, creator_earning_rate, featured_image, collection_url, external_link, twitter_link, instagram_link, discord_link, telegram_link);

console.log("collection id: ", res);
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
collection id: 45971j
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Mint NFT

* Every account has a default collection ID. If the collection ID is not filled in, the NFT will be associated with the default collection ID = 0. Transaction of minting an NFT will be confirmed by Zecrey and once the NFT is confirmed, Zecrey will submit it to L1.
* L2 allows the change of ownership for the NFT. However, the creator of the NFT will never change. Each time an NFT is transferred, the creator will receive a royalty, which is calculated by the NFT's TreasuryRate set by its creator.

{% hint style="success" %}

#### 📚SDK REFERENCE

* [MintNft](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#Client.MintNft)
  {% endhint %}

* Parameters needed for creating an NFT:

  | Parameter               | Parameter usage and meaning                                                                                                                                                                        | Required or not |
  | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
  | accountName             | The account name used to initialize the client                                                                                                                                                     | ✅               |
  | seed                    | The user's L2 seed used to initialize the client                                                                                                                                                   | ✅               |
  | NftUrl                  | The logo image displayed for mobile users                                                                                                                                                          | ✅               |
  | Name                    | NFT name                                                                                                                                                                                           | ✅               |
  | Description             | The description of the NFT, and filling in "-" is recommended if there is no description                                                                                                           | ✅               |
  | assetProperty           | Custom properties                                                                                                                                                                                  | ✅               |
  | assetLevel              | Custom levels                                                                                                                                                                                      | ✅               |
  | assetStats              | Custom stats                                                                                                                                                                                       | ✅               |
  | <p>TreasuryRate<br></p> | Creator royalties will be charged at this rate and the percentage will be in proportion to 10000 during NFT transactions. For example, filling in 50000 means the rate will be 5000/10000 % = 0.5% | ✅               |

* Create an NFT with the name "Alice's BestNft"
  1. Initialize the client
  2. Use json Marshal to transform the properties, levels and stats into string type
  3. Create an NFT

{% tabs %}
{% tab title="Golang" %}
**Example**

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
        var CollectionId int64 = 15 //Get list of collections
        accountName := "Alice"
        seed := "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052"
        c, err := sdk.NewClient(accountName, seed) 	 
        if err != nil { panic(err) }
        
        NftUrl := "https://res.cloudinary.com/zecrey/image/upload/collection/ahykviwc0suhoyzusb5q.jpg"
        Name := "Alice`s BestNft"
        Description := "my first nft"
        Media := "collection/dekkg5j1ptccq9ttliui"//public Id after uploading media 
        TreasuryRate:=10
        assetProperty := Propertie{  //custom properties
           Name:  "assetProperty",
           Value: "red1",
        }
        assetLevel := Level{ //custom levels
           Name:     "assetLevel",
           Value:    120,
           MaxValue: 100,
        }
        assetStats := Stat{//custom stats
           Name:     "StatType",
           Value:    400,
           MaxValue: 200,
        }
        // get content hash
        
        _Properties := []Propertie{assetProperty}
        _Levels := []Level{assetLevel}
        _Stats := []Stat{assetStats}
        
        _PropertiesByte, err := json.Marshal(_Properties)
        _LevelsByte, err := json.Marshal(_Levels)
        _StatsByte, err := json.Marshal(_Stats)
        
        result, err := c.MintNft(
           CollectionId,
           NftUrl, Name,
           TreasuryRate,
           Description, Media,
           string(_PropertiesByte), string(_LevelsByte), string(_StatsByte))
        if err != nil { panic(err) }
        
        data, err := json.Marshal(result)
        if err != nil { panic(err) }
        fmt.Println(string(data))
 }
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
{
    "asset":{
        "id":11,
        "account_name":"Alice.zec",
        "nft_index":-1,//nftindex = -1 means that the NFT is in pending state and operations like transfer cannot be done with this NFT
        "collection_id":15,
        "creator_earning_rate":0,
        "name":"Alice`s BestNft",
        "description":"my first nft",
        "media":"collection/dekkg5j1ptccq9ttliui",
        "image_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
        "video_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
        "audio_thumb":"https://res.cloudinary.com/zecrey/image/upload/collection/dekkg5j1ptccq9ttliui",
        "status":"0",
        "content_hash":"6a7ab257b1f42474d31b2b94b483d2b34702e8d89fa21481574232cd979bdfe3", //ACC:Alice.zec CID:15 NFT:- PROPERTIES: k:assetProperty v:red1 LEVELS: k:assetLevel v:123 STATS: k:StatType v:456 Calculate the hash of the account name, collectionid, shortName, assetProperty, assetLevel, assetStats to get the value
        "nft_url":"-",
        "expired_at":1668085431849,
        "created_at":1667912632,
        "properties":[
            {
                "name":"assetProperty",
                "value":"red1"
            }
        ],
        "levels":[
            {
                "name":"assetLevel",
                "value":120,
                "maxValue":100
            }
        ],
        "stats":[
            {
                "name":"StatType",
                "value":400,
                "maxValue":200
            }
        ]
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
**Example**

With the private key:

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "Alice.zec";
const seed = "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052";
const client = new Client(account_name, seed);
await client.initialize();

const collection_id = 5;
const nft_url = "";
const name = "amber's nft";
const description = "Description information";
const media = "collection/in9tbyo5gheczolvhezx";
const properties = "[{"name":"color","value":"black"}]";
const levels = "[]";
const stats = "[]";
const res = await client.mintNft(collection_id, nft_url, name, description, media, properties, levels, stats);

console.log("NFT id: ", res);
```

{% endcode %}

With the wallet:

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec"; // sender's account name
const account_index = 14; // sender's account index
const collection_id = 5;
const nft_url = "";
const name = "amber's nft";
const description = "Description information";
const media = "collection/in9tbyo5gheczolvhezx";
const properties = "[{"name":"color","value":"black"}]";
const levels = "[]";
const stats = "[]";
const res = await sdk.mintNft(account_name, account_index, collection_id, nft_url, name, description, media, properties, levels, stats);

console.log("NFT id: ", res);
```

{% endcode %}

&#x20; **Example result**

{% code overflow="wrap" %}

```json
NFT id: 78981
```

{% endcode %}
{% endtab %}
{% endtabs %}


# 6. Creating Orders

* Orders are requests to exchange a certain amount of one asset for a different amount of another asset. This typically refers to a listing or an offer in the world of NFTs.

## Where are the orders？

Once an order is created, it will be added to the [Zecrey NFT Marketplace](https://github.com/Zecrey-Labs/zecrey-marketplace/tree/develop). They will be recorded on Zecrey NFT Marketplace to be viewed and available to all participants for trading.

## Zecreymarket SDK

### Initialize SDK

* You need to [initialize the SDK](https://docs.zecrey.com/go-and-js-sdk-basic-guides/1.-install-and-initialize) in order to use it.

### Create a listing

* Parameters needed:

  | Parameter   | Parameter usage and meaning                      | Required or not |
  | ----------- | ------------------------------------------------ | --------------- |
  | accountName | The account name used to initialize the client   | ✅               |
  | seed        | The user's L2 seed used to initialize the client | ✅               |
  | assetType   | Specify the asset type used to purchase the NFT  | ✅               |
  | AssetAmount | The asset amount needed to purchase the NFT      | ✅               |
  | nftId       | Id of the NFT to be sold                         | ✅               |

{% hint style="success" %}
📚**SDK REFERENCE**

* [CreateSellOffer](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#Client.CreateSellOffer)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
&#x20; **Example**

* Create an order to list the NFT with `NftId` = 14
  1. Initialize the client
  2. Create a listing

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    accountName := "Alice"//Zecrey NFT Marketplace SDK will automatically add the suffix ".zec" to the name
    seed := "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052" //l2seed
    assetType = 0    //the asset type to purchase the NFT
    AssetAmount = big.NewInt(1000000) //the asset amount needed to purchase the NFT
    nftId = 14
    c, err := sdk.NewClient(accountName, seed) 	 
    if err != nil { panic(err) }
    
    result, err := c.CreateSellOffer(nftId, assetType, AssetAmount)
    if err != nil { panic(err) }
    data, _ := json.Marshal(result)
    fmt.Println("CreateSellOffer:", string(data))
}
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
CreateSellOffer: 
{
    "offer":{
        "id":21,
        "account_name":"Alice",
        "direction":"1",
        "asset_id":11,
        "payment_asset_id":0,
        "payment_asset_amount":"0.000001000000000000",//This corresponds to the relative value of 10^18 of the AssetAmount(1000000)
        "status":"1",
        "signature":"{\"Type\":1,\"OfferId\":1,\"AccountIndex\":4,\"NftIndex\":14,\"AssetId\":0,\"AssetAmount\":1000000000000,\"ListedAt\":1667963243006,\"ExpiredAt\":1668136043006,\"TreasuryRate\":200,\"Sig\":\"lzpBuJsvntEjcF1e4Y6euAaVCB4LzFWAd2axjKGp3xEAKQB3QcvcgOxgSS54wgVGG1EQNMe1e/Gzg+4Ecxwi+g==\"}",
        "expired_at":1668136043006,
        "created_at":1667963243
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
**Example**

* Create an order to list the NFT with `NftId` = 14
  1. Initialize the client
  2. Create a listing

With the private key:

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "amber1.zec";
const seed = "ee823a72698fd05c70fbdf36ba2ea467d33cf628c94ef030383efcb39581e43f";

const client = new Client(account_name, seed);
await client.initialize();

const nft_index = 14;
const asset_id = 0; // BNB
const asset_amount = "1000000000000000000"; // 1 BNB

const res = await client.createSellOffer(nft_index, asset_id, asset_amount);

console.log(res);
```

{% endcode %}

With the wallet:

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec"; // sender's account name
const account_index = 14; // sender's account index
const nft_index = 14;
const asset_id = 0; // BNB
const asset_amount = "1000000000000000000"; // 1 BNB

const res = await sdk.createSellOffer(account_name, account_index, nft_index, asset_id, asset_amount);

console.log(res);
```

{% endcode %}

&#x20; **Example result**

{% code overflow="wrap" %}

```json
{
    id: 24643,
    signature: "{"Type":1,"OfferId":245,"AccountIndex":4,"NftIndex":7,"AssetId":0,"AssetAmount":1000000000000000000,"ListedAt":1675310419174,"ExpiredAt":1675742417512,"TreasuryRate":200,"Sig":"7obDPs4K25hWF+vY+tXL1I4Y1gmXUcayX34aeQKTJ5AFlQOaug/szcsk3QIweBtGV1oIaM5k+vHoUQUhDjRMQA=="}",
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Make an offer

* Parameters needed:

| Parameter   | Parameter usage and meaning                      | Required vs Optional |
| ----------- | ------------------------------------------------ | -------------------- |
| accountName | The account name used to initialize the client   | ✅                    |
| seed        | The user's L2 seed used to initialize the client | ✅                    |
| assetType   | Specify the asset type used to purchase the NFT  | ✅                    |
| AssetAmount | The asset amount needed to purchase the NFT      | ✅                    |
| nftId       | The Id of the NFT to be purchased                | ✅                    |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [CreateBuyOffer](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#Client.CreateBuyOffer)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
&#x20;**Example**

* Make an offer to the NFT with `NftId` = 14
  1. Initiate the client
  2. Create an offer

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    accountName := "Bob"//Zecrey NFT Marketplace SDK will automatically add the suffix ".zec" to the name
    seed := "17673b9a9fdec6dc90c7cc1eb1c939134dfb659d2f08edbe071e5c45f343d008" //l2seed
    c, err := sdk.NewClient(accountName, seed) 	 
    if err != nil { panic(err) }
    
    assetType = 0    //specify the asset type to purchase the NFT
    AssetAmount = big.NewInt(1000000) //the asset amount needed to purchase the NFT with 1 as the smallest unit of the token type
    nftId = 14
    result, err := c.CreateBuyOffer(nftId, assetType, AssetAmount)
    if err != nil { panic(err) }
    data, _ := json.Marshal(result)
    fmt.Println("CreateBuyOffer:", string(data))
}
```

{% endcode %}

&#x20; **Example result**

{% code overflow="wrap" %}

```json
CreateBuyOffer:
{
    "offer":{
        "id":22,
        "account_name":"Bob",
        "direction":"0",
        "asset_id":14,
        "payment_asset_id":0,
        "payment_asset_amount":"0.000001000000000000",//This corresponds to the relative value of 10^18 of the AssetAmount(1000000)
        "status":"1",
        "signature":"{\"Type\":0,\"OfferId\":2,\"AccountIndex\":2,\"NftIndex\":14,\"AssetId\":0,\"AssetAmount\":1000000000000,\"ListedAt\":1667963545528,\"ExpiredAt\":1668136345528,\"TreasuryRate\":200,\"Sig\":\"XEpxPmmVXYJ2A+YBom4B7pe4Tm+rgvAqkH5MQHO1NaIFby8sgnTlpGpabAx9U7RytUqQc57hOrsFyCzEx4kCbQ==\"}",
        "expired_at":1668136345528,
        "created_at":1667963545
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
&#x20; **Example**

* Make an offer to the NFT with `NftId` = 14
  1. Initiate the client
  2. Create an offer

With the private key:

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "amber1.zec";
const seed = "ee823a72698fd05c70fbdf36ba2ea467d33cf628c94ef030383efcb39581e43f";

const client = new Client(account_name, seed);
await client.initialize();

const nft_index = 14;
const asset_id = 0; // BNB
const asset_amount = "1000000000000000000"; // 1 BNB

const res = await client.createSellOffer(nft_index, asset_id, asset_amount);

console.log(res);
```

{% endcode %}

With the wallet:

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec"; // sender's account name
const account_index = 14; // sender's account index
const nft_index = 14;
const asset_id = 0; // BNB
const asset_amount = "1000000000000000000"; // 1 BNB

const res = await sdk.createSellOffer(account_name, account_index, nft_index, asset_id, asset_amount);

console.log(res);
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
{
    id: 24643,
    signature: "{"Type":0,"OfferId":245,"AccountIndex":4,"NftIndex":7,"AssetId":0,"AssetAmount":1000000000000000000,"ListedAt":1675310419174,"ExpiredAt":1675742417512,"TreasuryRate":200,"Sig":"7obDPs4K25hWF+vY+tXL1I4Y1gmXUcayX34aeQKTJ5AFlQOaug/szcsk3QIweBtGV1oIaM5k+vHoUQUhDjRMQA=="}",
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Cancel an order

* To cancel a previous offer/listing order, you can use the `cancelOffer` request.

{% hint style="success" %}

#### 📚SDK REFERENCE

* [CancelOffer](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#Client.CancelOffer)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
&#x20;**Example**

* Cancel offer/order with `offerId` = 22
  1. Initialize the client
  2. Cancel the offer/order

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)

func main() {
    accountName := "Alice"//Zecrey NFT Marketplace SDK will automatically add the suffix ".zec" to the name
    seed := "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052" //l2seed
    OfferId := 22    //View offers/orders through "Get NFT list of offers"
    c, err := sdk.NewClient(accountName, seed) 	 
    if err != nil { panic(err) }
    
    result, err := c.CancelOffer(AssetId, assetType, AssetAmount)
    if err != nil { panic(err) }
    
    data, _ := json.Marshal(result)
    fmt.Println(string(data))
}
```

{% endcode %}

&#x20;**Example result**

{% code overflow="wrap" %}

```json
{
    "offer":{
        "id":22,
        "account_name":"Alice",
        "direction":"0",
        "asset_id":9,
        "payment_asset_id":0,
        "payment_asset_amount":"0.000001000000000000",
        "status":"4",//cancelled
        "signature":"{\"Type\":0,\"OfferId\":2,\"AccountIndex\":2,\"NftIndex\":4,\"AssetId\":0,\"AssetAmount\":1000000000000,\"ListedAt\":1667963545528,\"ExpiredAt\":1668136345528,\"TreasuryRate\":200,\"Sig\":\"XEpxPmmVXYJ2A+YBom4B7pe4Tm+rgvAqkH5MQHO1NaIFby8sgnTlpGpabAx9U7RytUqQc57hOrsFyCzEx4kCbQ==\"}",
        "expired_at":1668136345528,
        "created_at":1667963545
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
&#x20; **Example**

* Cancel offer/order with `offerId` = 22
  1. Initialize the client
  2. Cancel the offer/order

&#x20; With the private key:

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "amber1.zec";
const seed = "ee823a72698fd05c70fbdf36ba2ea467d33cf628c94ef030383efcb39581e43f";

const client = new Client(account_name, seed);
await client.initialize();

const offer_id = 24504;
const res = await client.cancelOffer(offer_id);

console.log("offer id: ", res)
```

{% endcode %}

&#x20; With the wallet:

{% code overflow="wrap" %}

```json
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec"; // sender's account name
const account_index = 14; // sender's account index
const offer_id = 24504;
const res = await sdk.cancelOffer(account_name, account_index, offer_id);

console.log("offer id: ", res)
```

{% endcode %}

&#x20; **Example result**

```
offer id: 24504
```

{% endtab %}
{% endtabs %}


# 7. Match Orders

Matching orders is to fill the offers or listings with traders' corresponding actions to buy or sell the NFTs for the transactions to be completed.

### Initialize SDK

* You need to initialize the SDK in order to use it.

### Match Orders

* To select the correct order, please refer to [Offers](https://docs.zecrey.com/go-and-js-sdk-basic-guides/2.-get-data#offers).
* Parameters needed:<br>

  | <p>Parameter<br></p> | Parameter usage and meaning                                             | Required or not |
  | -------------------- | ----------------------------------------------------------------------- | --------------- |
  | accountName          | The account name used to initialize the client                          | ✅               |
  | assetType            | Specify the asset type used to purchase or sell the NFT                 | ✅               |
  | AssetAmount          | The asset amount to purchase or sell the NFT                            | ✅               |
  | offerId              | Select an NFT order that is listed for sale or made an offer by someone | ✅               |
  | isSell               | To buy (false) or sell (true) the target NFT                            | ✅               |

{% hint style="success" %}
**📚SDK REFERENCE**

* [AcceptOffer](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#Client.AcceptOffer)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
&#x20;**Example：**

* Purchase the NFT with `offerId` = 31
  1. Initialize the client
  2. Purchase NFT

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    accountName := "Alice"//Zecrey NFT Marketplace SDK will automatically add the suffix ".zec" to the name
    seed := "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052" //l2 seed
    var offerId int64 = 31 //select a listed NFT
    AssetAmount = big.NewInt(1000000000000000000) //the amount used to purchase
    isSell := false
    c, err := sdk.NewClient(accountName, seed) 	 
    if err != nil { panic(err) }
    
    result, err := c.AcceptOffer(offerId, isSell, AssetAmount)//false represents "buy" while true represents "sell"
    if err != nil { panic(err) }
    
    data, _ := json.Marshal(result)
    fmt.Println(string(data))
}
```

{% endcode %}

**Example result**

* Information about the status change of the target order will be returned. Please refer to [Offers](https://docs.zecrey.com/go-and-js-sdk-basic-guides/2.-get-data#offers) for the status information.
* The information returned is all about the target order except for "account\_name".

{% code overflow="wrap" %}

```json

{
    "offer":{
        "id":31,
        "account_name":"Alice",//User's account name
        "direction":"1",
        "asset_id":241,
        "payment_asset_id":0,
        "payment_asset_amount":"1.000000000000000000",//This corresponds to the relative value of 10^18 of the AssetAmount(1000000)
        "status":"2", //Status changed to 2
        "signature":"{\"Type\":1,\"OfferId\":1,\"AccountIndex\":3,\"NftIndex\":247,\"AssetId\":0,\"AssetAmount\":1000000000000000000,\"ListedAt\":1667875678292,\"ExpiredAt\":1668350875000,\"TreasuryRate\":30,\"Sig\":\"kpaBoImpjmeI+PlOzkcCr7Tquf16qtriprOUUy3E1JUDjwcttXut8GEu6UV/H4dtJvnqKyD6FwK08hqv0vO67A==\"}",
        "expired_at":1668350875000,
        "created_at":1667875678
    }
}
```

{% endcode %}

{% endtab %}

{% tab title="Javascript" %}
**Example：**

* Purchase the NFT with `offerId` = 31
  1. Initialize the client
  2. Purchase NFT

With the private key:

<pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "amber1.zec";
const seed = "ee823a72698fd05c70fbdf36ba2ea467d33cf628c94ef030383efcb39581e43f";

const client = new Client(account_name, seed);
await client.initialize();

const offer_id = 31;
const res = await client.acceptOffer(offer_id);

<strong>console.log("offer id: ", res);
</strong></code></pre>

With the wallet:

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec"; // sender's account name
const account_index = 14; // sender's account index
const offer_id = 31;
const res = await sdk.acceptOffer(account_name, account_index, offer_id);

console.log("offer id: ", res);
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
offer id: 3
```

{% endcode %}
{% endtab %}
{% endtabs %}

&#x20;&#x20;

&#x20;<br>


# 8. Asset Deposits

* Users are able to deposit assets from L1 to L2 in Zecrey.

### Initialize SDK

* You will need to initialize the SDK in order to use it.

### Deposit NFT to L2

* Parameters needed:

  | Parameter    | <p>Parameter usage and meaning<br></p>                                                                     | Requirement |
  | ------------ | ---------------------------------------------------------------------------------------------------------- | ----------- |
  | accountName  | The account name used to initialize the client                                                             | ✅           |
  | seed         | The user's L2 seed used to initialize the client                                                           | ✅           |
  | privateKey   | Since this transaction involves L1, the private key of user's L1 account is needed to sign the transaction | ✅           |
  | nftL1Address | The corresponding L1 address of the NFT                                                                    | ✅           |
  | nftIndex     | The unique ID of NFT in L1                                                                                 | ✅           |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [DepositNft](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.6/sdk#Client.DepositNft)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
&#x20;**Example**

* Deposit the NFT with `nftIndex` = 511
  * Initialize client
  * Deposit the NFT with `nftIndex` = 511

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    var nftIndex int64 = 511
    accountName := "Bob"
    seed := "17673b9a9fdec6dc90c7cc1eb1c939134dfb659d2f08edbe071e5c45f343d008"
    privateKey := "0xe94a8b4ddd33b2865asadfasda0c3e3276007ece8f114a47a4e9581ec3567"
    nftL1Address := common.HexToAddress("0x805e286D05388911s41a0E3c7b9713415607c72")
    c, err := NewClient(accountName, seed)
    if err != nil {
       t.Fatal(err)
    }
    depositNftTransaction, err := c.DepositNft(accountName, privateKey, nftL1Address, nftIndex)
    if err != nil {
       t.Fatal(err)
    }
    fmt.Println("tx hash: ",depositNftTransaction.Hash())
}
```

{% endcode %}

&#x20; **Example Result**

{% code overflow="wrap" %}

```json
tx hash: 0x832b75753c073b29a11431386f2faa744ced1c95603e8ea30e4aa5fd7ca3d14dgolang
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
**Example**

Advance approval for NFT is require

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const privateKey = "1bcb0ae8c17945acfaf9ea546c0b754a599fddf27425bac7e532590324137a7d"; // the private key of the L1 which is sending the transaction
const account = "Bob"; // the receiving L2 account in NFT deposit
const asset_contract = "0xD0b6eee86DFAE935E837EcC187A63D3882eDA022"; // the l1 contract address of NFT
const token_id = 4; // the ID of NFT in L1 contract

const res = await sdk.depositNft(privateKey, account, asset_contract, token_id);

console.log("tx hash: ", res);
```

{% endcode %}

&#x20; **Example Result**

{% code overflow="wrap" %}

```json
tx hash: 0x832b75753c073b29a11431386f2faa744ced1c95603e8ea30e4aa5fd7ca3d14d
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Deposit FT to L2

* Parameters needed:

  | Parameter   | Parameter usage and meaning                                                                                | Requirement |
  | ----------- | ---------------------------------------------------------------------------------------------------------- | ----------- |
  | accountName | The account name used to initialize the client                                                             | ✅           |
  | seed        | The user's L2 seed used to initialize the client                                                           | ✅           |
  | privateKey  | Since this transaction involves L1, the private key of user's L1 account is needed to sign the transaction | ✅           |
  | AssetId     | Token ID                                                                                                   | ✅           |
* Token information

  | Token | Token ID | Parameter        |
  | ----- | -------- | ---------------- |
  | BNB   | 0        | sdk.BNBAssetId   |
  | *LEG* | 1        | sdk.*LEG*AssetId |
  | *REY* | 2        | sdk.*REY*AssetId |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [Deposit](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.6/sdk#Client.Deposit)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
**Example**

* Deposit 10000 BNB to L2
  * Initialize client
  * Deposit
    1. For BEP20 token, you need to import the token address

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    var nftId int64 = 6
    accountName := "Bob"
    seed := "17673b9a9fdec6dc90c7cc1eb1c939134dfb659d2f08edbe071e5c45f343d008"
    privateKey := "0xe94a8b4ddd33b2865asadfasda0c3e3276007ece8f114a47a4e9581ec3567"
    var assetAmount int64 = 10000
    var tokenAddress  = common.HexToAddress("")
    c, err := NewClient(accountName, seed)
    if err != nil { panic(err) }
    
    depositBnbTransaction, err := c.Deposit(accountName, privateKey, sdk.BNBAssetId, assetAmount, tokenAddress)
    if err != nil { panic(err) }
    
    fmt.Println("tx hash:",depositBnbTransaction.Hash())
}
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
tx hash: 0x0f20b7cf4f6526b7d67efba10c9e14b0c093eb9c50c7ebd8190413bc0b4c6dd6
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
**Example**

1. Deposit BEP20 assets like REY and LEG (advance approval required for assets)

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const privateKey = "1bcb0ae8c17945acfaf9ea546c0b754a599fddf27425bac7e532590324137a7d"; // the private key of the L1 which is sending the transaction
const account = "Bob"; // the L2 account that LEG is deposited to
const amount = "100000000000000"; // 0.0001 LEG
const asset_contract = "0x364Ed72f329f1BD56AE84b941D1c6E4E260cE152"; // the contract address of LEG

const res = await sdk.deposit(privateKey, account, amount, asset_contract);

console.log("tx hash: ", res);
```

{% endcode %}

2. Deposit BNB

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const privateKey = "1bcb0ae8c17945acfaf9ea546c0b754a599fddf27425bac7e532590324137a7d"; // the private key of the L1 which is sending the transaction
const account = "Bob"; // the L2 account that LEG is deposited to
const amount = "100000000000000"; // 0.0001 BNB 

const res = await sdk.deposit(privateKey, account, amount);

console.log("tx hash: ", res);
```

{% endcode %}

**Example Result**

{% code overflow="wrap" %}

```json
tx hash: 0xca0f43ae1e7d3ff868170fee2d0a1254772294aca43f2cf221aa602bd3cd5db3
```

{% endcode %}

<br>
{% endtab %}
{% endtabs %}


# 9. Asset Transfers

For various reasons, users may wish to transfer their assets from one wallet to another, for example, to send assets as gifts.

### Initialize SDK

* You need to initialize the SDK in order to use it.

### Create transfer

* All NFT transactions will be confirmed by Zecrey. Zecrey will ensure that it is submitted to L1 once the transaction is confirmed.
  * Parameters needed:

    | Parameter     | Parameter usage and meaning                      | Required vs Optional |
    | ------------- | ------------------------------------------------ | -------------------- |
    | accountName   | The account name used to initialize the client   | ✅                    |
    | seed          | The user's L2 seed used to initialize the client | ✅                    |
    | toAccountName | The receiver's account name                      | ✅                    |

{% hint style="success" %}
&#x20;📚**SDK REFERENCE**

* [TransferNft](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#Client.TransferNft)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
**Example**

* `TransferNft` allows users to change the owner of NFT. However, the creator of the NFT will never change. Each time an NFT is transferred, the creator will receive a royalty, which is calculated by the NFT's `TreasuryRate` set by its creator.
* Alice transfers to Bob the NFT with `NftId` = 6
  1. Initialize the client
  2. Transfer the NFT to Bob

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    var NftId int64 = 6
    accountName := "Alice"
    seed := "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052"
    toAccountName := "Bob"
    
    c, err := sdk.NewClient(accountName, seed) 	 
    if err != nil { panic(err) }
    
    result, err := c.TransferNft(NftId, toAccountName)
    if err != nil { panic(err) }
    
    data, _ := json.Marshal(result)
    fmt.Println("TransferNft:", string(data))
}
```

{% endcode %}

&#x20; **Example result**

{% code overflow="wrap" %}

```json
TransferNft: {"success":true}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
**Example**

* TransferNft allows users to change the owner of NFT. However, the creator of the NFT will never change. Each time an NFT is transferred, the creator will receive a royalty, which is calculated by the NFT's TreasuryRate set by its creator.
* Alice transfers to Bob the NFT with `NftId` = 6
  1. Initialize the client
  2. Transfer the NFT to Bob

With the private key:

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "Alice.zec";
const seed = "ee823a72698fd05c70fbdf36ba2ea467d33cf628c94ef030383efcb39581e43f";

const client = new Client(account_name, seed);
await client.initialize();

const nft_id = 6;
const to_account_name = "Bob.zec";
const res = await client.transferNft(nft_id, to_account_name);

console.log("success", res);
```

{% endcode %}

With the wallet:

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec"; // sender's account name
const account_index = 14; // sender's account index
const nft_id = 6;
const to_account_name = "Bob.zec";
const res = await sdk.transferNft(account_name, account_index, nft_id, to_account_name);

console.log("success", res);
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
success: true
```

{% endcode %}
{% endtab %}
{% endtabs %}

&#x20;&#x20;


# 10. Asset Withdrawals

Users are able to withdraw assets from L2 to L1 in Zecrey.

### Initialize SDK

* You need to initialize the SDK in order to use it.

### [Mint asset](https://docs.zecrey.com/go-and-js-sdk-basic-guides/5.-mint-assets)

### Withdraw NFT to L1

* Parameters needed:

| Parameter   | Parameter usage and meaning                      | Required vs Optional |
| ----------- | ------------------------------------------------ | -------------------- |
| accountName | The account name used to initialize the client   | ✅                    |
| seed        | The user's L2 seed used to initialize the client | ✅                    |
| nftId       | The corresponding ID of the NFT to be withdrawn  | ✅                    |

{% hint style="success" %}
&#x20;**📚SDK REFERENCE**

* [WithdrawNft](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.5/sdk#Client.WithdrawNft)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
**Example**

* Withdraw NFT with `NftId` = 6
  1. Initialize the client
  2. Withdraw the NFT

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    var nftId int64 = 6
    accountName := "Bob"
    seed := "17673b9a9fdec6dc90c7cc1eb1c939134dfb659d2f08edbe071e5c45f343d008"
    c, err := sdk.NewClient(accountName, seed) 	 
    if err != nil { panic(err) }
    
    result, err := c.WithdrawNft(nftId)
    if err != nil { panic(err) }
    
    data, _ := json.Marshal(result)
    fmt.Println("WithdrawNft:", string(data))
}
```

{% endcode %}

&#x20; **Example result**

{% code overflow="wrap" %}

```json
WithdrawNft: {"success":true}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
&#x20; **Example**

* Withdraw NFT with `NftId` = 6
  1. Initialize the client
  2. Withdraw the NFT

&#x20; With the private key:

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "amber1.zec";
const seed = "ee823a72698fd05c70fbdf36ba2ea467d33cf628c94ef030383efcb39581e43f";

const client = new Client(account_name, seed);
await client.initialize();

const nft_id = 48;
const to_address = "0x09E45d6FcF322c4D93E6aFE7076601FF10BA942E";
const res = await client.withdrawNft(nft_id, to_address);

console.log("success: ", res);
```

{% endcode %}

&#x20; With the wallet:

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const account_name = "Alice.zec"; // sender's account name
const account_index = 14; // sender's account index
const nft_id = 48;
const to_address = "0x09E45d6FcF322c4D93E6aFE7076601FF10BA942E";
const res = await sdk.withdrawNft(account_name, account_index, nft_id, to_address);

console.log("success: ", res);
```

{% endcode %}

&#x20; **Example result**

{% code overflow="wrap" %}

```json
success: true
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Withdraw FT to L1

* Query current user asset through [GetAccountAssetsInfoByAccountName](/go-and-js-sdk-basic-guides/2.-get-data#get-account-details-by-account-name)
* Parameters needed:

  | Parameter   | Parameter usage and meaning                      | Requirement |
  | ----------- | ------------------------------------------------ | ----------- |
  | accountName | The account name used to initialize the client   | ✅           |
  | seed        | The user's L2 seed used to initialize the client | ✅           |
  | nftId       | ID of the NFT to be withdrawn                    | ✅           |
  | tol1Address | Specify an L1 address to withdraw                | ✅           |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [Withdraw](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.6/sdk#Client.Withdraw)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
**Example**

* Withdraw 100000 BNB to L1
  * Initialize client
  * Withdraw 100000 BNB

{% code overflow="wrap" %}

```javascript
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    seed := "13243b9a9fdec6dc90c7cc1eb1c939134dfb659d2f0asdfas5413213213213213"
    accountName := "bob"
    tol1Address := "0x< a l1 address you want to withdraw>"
    assetAmount := int64(100000)
    c, err := sdk.NewClient(accountName, seed)
    if err != nil { panic(err) }
   
    result, err := c.Withdraw(tol1Address,sdk.BNBAssetId, assetAmount)
    if err != nil { panic(err) }
    
    data, err := json.Marshal(result)
    fmt.Println("Withdraw:", string(data))
}
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
Withdraw: {"tx_id":"DJIkgT9j2f1uX2xkWR+fJ35Kyg/HDJ4trixtL9CNG/k="}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
**Example**

* Withdraw 100000 BNB to L1
  * Initialize client
  * Withdraw 0.0001 BNB

{% code overflow="wrap" %}

```javascript
import { Client } from "@zecrey/zecrey-legend-js-sdk";

const account_name = "amber1.zec";
const seed = "ee823a72698fd05c70fbdf36ba2ea467d33cf628c94ef030383efcb39581e43f";

const client = new Client(account_name, seed);
await client.initialize();

const asset_id = 0; // BNB
const amount = "100000000000000"; // 0.0001 BNB
const to_address = "0x09E45d6FcF322c4D93E6aFE7076601FF10BA942E";

const res = await client.withdraw(asset_id, amount, to_address);

console.log("tx id: ", res);
```

{% endcode %}

**Example result**

{% code overflow="wrap" %}

```json
tx id: LNwRbx6JwTDcSTt5tEosiD2wO4RGre8VxAu9nWayiGs=
```

{% endcode %}
{% endtab %}
{% endtabs %}


# 11. Full Exit

* In order to ensure the security of users' assets, users are given the right to take out their assets at any time. They can return the assets to their accounts by sending a transaction to L1.<br>

### Initialize SDK

* You need to initialize the SDK in order to use it.

### NFT Full Exit

* Parameters needed:

  | Parameter   | Parameter usage and meaning                                                                                | Requirement |
  | ----------- | ---------------------------------------------------------------------------------------------------------- | ----------- |
  | accountName | The account name used to initialize the client                                                             | ✅           |
  | seed        | The user's L2 seed used to initialize the client                                                           | ✅           |
  | privateKey  | Since this transaction involves L1, the private key of user's L1 account is needed to sign the transaction | ✅           |
  | nftIndex    | The unique ID of NFT in L1                                                                                 | ✅           |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [FullExitNft](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.6/sdk#Client.FullExitNft)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
&#x20;**Example**

* FullExit the NFT with `nftIndex` = 130
  * Initialize client
  * FullExit the NFT with `nftIndex` = 130

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    accountName := "alice"
    privateKey := "0xe94a8b4ddd33b2865a89bb764d70a0c3e3276007ece8f114a47a4e9581ec3567"
    nftIndex := uint32(130)
    seed := "13243b9a9fdec6dc90c7cc1eb1c939134dfb659d2f0asdfas5413213213213213"
    c, err := NewClient(accountName, seed)
    fullExitNftTransaction, err := c.FullExitNft(accountName, privateKey, nftIndex)
    if err != nil {
       t.Fatal(err)
    }
    fmt.Println("tx hash:", fullExitNftTransaction.Hash())
}
```

{% endcode %}

&#x20; **Example Result**

{% code overflow="wrap" %}

```json
tx hash: 0x3e78bf427bbe8bc6be629b6bcd3a88cb65234b7da209134787a8f39c8ace1d4a
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
**Example**

* FullExit the NFT with `nftIndex` = 130

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const privateKey = "1bcb0ae8c17945acfaf9ea546c0b754a599fddf27425bac7e532590324137a7d";
const account = "alice"; 
const nft_index = 130;

const res = await sdk.fullExitNft(privateKey, account, nft_index);
```

{% endcode %}
{% endtab %}
{% endtabs %}

### FT Full Exit

* Parameters needed

  * BNB、LEG、REY's token addresses are needed and the details can be obtained through GetAssetsList

  | Parameter   | Parameter usage and meaning                                                                                | Required or not |
  | ----------- | ---------------------------------------------------------------------------------------------------------- | --------------- |
  | accountName | The account name used to initialize the client                                                             | ✅               |
  | seed        | The user's L2 seed used to initialize the client                                                           | ✅               |
  | privateKey  | Since this transaction involves L1, the private key of user's L1 account is needed to sign the transaction | <p>✅<br></p>    |
  | asset       | asset Token address                                                                                        | ✅               |

{% hint style="success" %}

#### 📚SDK REFERENCE

* [FullExit](https://pkg.go.dev/github.com/Zecrey-Labs/zecrey-marketplace-go-sdk@v1.0.6/sdk#Client.FullExit)
  {% endhint %}

{% tabs %}
{% tab title="Golang" %}
**Example**

* Deposit 10000 BNB to L2
  * Initialize client
  * FullExit 100000 BNB

{% code overflow="wrap" %}

```go
package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    accountName := "alice"
    privateKey := "0xe94a8b4ddd33b2865a89bb764d70a0c3e3276007ece8f114a47a4e9581ec3567"
    assetAddress := common.HexToAddress("")//_asset Token address, 0 address for BNB
    seed := "13243b9a9fdec6dc90c7cc1eb1c939134dfb659d2f0asdfas5413213213213213"
    c, err := NewClient(accountName, seed)
    var amount int64 = 100000
    if err != nil {
       t.Fatal(err)
    }
    fullExitTransaction, err := c.FullExit(accountName, privateKey, assetAddress)
    if err != nil {
       t.Fatal(err)
    }
    fmt.Println("tx hash:",fullExitTransaction)
}
```

{% endcode %}

**Example Result**

{% code overflow="wrap" %}

```json
tx hash: 0x72aac80edfcb5c2f5c34e4b7acccc4831ef8ad61b1ef0396407b9fb31ed151fd
```

{% endcode %}

{% endtab %}

{% tab title="Javascript" %}
**Example**

1. BNB

{% code overflow="wrap" %}

```javascript
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const privateKey = "1bcb0ae8c17945acfaf9ea546c0b754a599fddf27425bac7e532590324137a7d";
const account = "alice"; 
const asset_contract = "0x00"; // this address represents BNB

const res = await sdk.fullExit(privateKey, account, asset_contract );
```

{% endcode %}

2. LEG and REY and other BEP20 assets

{% code overflow="wrap" %}

```json
import { SDK } from "@zecrey/zecrey-legend-js-sdk";

const sdk = new SDK();
await sdk.initial();

const privateKey = "1bcb0ae8c17945acfaf9ea546c0b754a599fddf27425bac7e532590324137a7d";
const account = "alice"; 
const asset_contract = "0x364Ed72f329f1BD56AE84b941D1c6E4E260cE152"; // contract address of LEG

const res = await sdk.fullExit(privateKey, account, asset_contract);
```

{% endcode %}
{% endtab %}
{% endtabs %}


# 12. Demo of SDK Calling

<figure><img src="/files/EQFnn2SXXcgPeChJfnJs" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/uHVYbG76j0JaOLlYI0Zd" 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="/files/TgIxs3sjMaKFsoZ3q1pV" alt=""><figcaption></figcaption></figure>

* Unconnected status

<figure><img src="/files/DM4VaDwMw3EnBYnJSa4d" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/Hni8nXlW0Jep0FH4gzWL" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/ZxhuK6cALrXmAXl9YlLx" alt=""><figcaption></figcaption></figure>

* Sign the request to connect to the wallet address.

<figure><img src="/files/6jfh5X1zstmrRNhXATiG" 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="/files/iHEMva09jVqR7Ohp12oT" alt=""><figcaption></figcaption></figure>

* Confirm the registration to create a Legend account.

<figure><img src="/files/Zb1SPZK6kv0sjfujDO0Y" 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="/files/t429NJ7hWGMSHtcfkBhk" 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="/files/JtCgD36EyYhZNx2qFHX5" 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="/files/QjqnVfSEbIUJznLJX61H" alt=""><figcaption></figcaption></figure>

* View the NFT in Zecrey web app marketplace.

<figure><img src="/files/BGJUhxUriBAD0pjA5Gyj" alt=""><figcaption></figcaption></figure>

* View the NFT in Zecrey mobile marketplace.

![](/files/UEbSfIRzPAvk7fXOWER1)


# Zecrey Video Guide

Get to know Zecrey in the following videos: &#x20;

{% embed url="<https://www.youtube.com/watch?v=YDCOnxs7pGg>" %}
**Quick Intro to Zecrey's two Layer 2s: Zecrey Legend & Zecrey Zero**
{% endembed %}

{% embed url="<https://www.youtube.com/watch?v=sFCQIBJJ1KE>" %}
**Understand Zecrey in 3 minutes**
{% endembed %}

{% embed url="<https://www.youtube.com/watch?t=24s&v=Gxro3nmLvpQ>" %}
**Introduction to the Zecrey Protocol**&#x20;
{% endembed %}


# Concepts Explained


# Crypto Knowledge


# Layer 1 (L1)

Layer 1 network is the basic layer of the blockchain. Both Ethereum and Bitcoin are layer 1 blockchains, as they are the cornerstone of the entire network, allowing various layer 2 networks to be built on top of them. The success of Ethereum has caused the current network congestion and a massive increase in the gas price. And some L1 blockchains have to make sacrifices in terms of security and decentralization in order to achieve higher transaction throughput and lower transaction fees than Ethereum. Therefore, better scalability solutions are necessary for the long-term development of the blockchain network. This is where Layer 2 comes in.


# Layer 2 (L2)

On Layer 2 networks, transaction fees will be drastically reduced by packing multiple off-chain transactions into a single L1 transaction, making it easier for everyone to participate in Ethereum. The L2 network blockchain settles transactions on the Ethereum mainnet, enabling users to benefit from the security of the Ethereum network. As transactions per second (TPS) increases, transaction fees decrease, and new technologies develop, new applications will emerge within the ecology and boost user experience. The Ethereum ecosystem stays steadfast in supporting L2 networks because L2 network scaling is the only way to solve the scalability trilemma while maintaining decentralization and security. Zecrey is an outstanding Layer 2 privacy protocol utilizing cutting-edge zk-Rollup technology.


# ZK-Rollup

Rollup is currently the preferred Layer 2 solution for scaling Ethereum. By packing hundreds of transactions into a single transaction on the L1 network, it helps users drastically reduce the gas fee. Rollup inherits the security of Ethereum by submitting transaction data to L1 network. There are two different ways to implement Rollup: optimistic rollup and zero-knowledge rollup (zk-Rollup). Their main difference is how the transaction data is submitted to L1. Zk-Rollup will package hundreds of off-chain transactions and generate encrypted proofs to submit on chain. It is the Ethereum scalability solution that Vitalik shows a preference for its long-term technical advantage. Zk-Rollup's advantages include: faster completion time, because once the proof is sent to the main chain, the transaction state is instantly verified; less vulnerable to economic attacks that optimistic rollup may suffer; secure and decentralized, as the data needed to restore the state is stored on layer 1. Zecrey employs state-of-the-art zk-Rollup and advanced cryptographic technology to maintain the scalability, security, and privacy of the system.


# Gas Fee

Gas refers to the amount of computational work required to perform a specific operation on the Ethereum network. Since each Ethereum transaction requires computational resources to execute, each transaction requires a fee. By requiring a fee for every computation executed on the blockchain, bad actors can be prevented from spamming the network. The fundamental unit of computation is "gas". Gas limit refers to the maximum amount of gas you are willing to consume on a transaction. More complicated transactions involving smart contracts require more computational work, so they require a higher gas limit than a simple payment. Although a transaction includes a limit, any gas not used in a transaction is returned to the user (i.e. max fee - (base fee + tip) is returned). On Zecrey L1 and Legend wallet(the NFT-oriented L2 solution of BNB chain), the native token of the blockchain will be used as the gas token. On Zero wallet, users can choose any supported token as gas fee in the transaction.


# NFT

NFT is the abbreviation of non-fungible tokens, representing unique cryptographic tokens based on blockchain. The difference between NFTs and FTs(fungible tokens) is that NFTs cannot be divided and exchanged equivalently like FTs, because each NFT is unique and cannot be replicated and replaced. It is just similar to a physical collectible, but it's an indelible digital asset generated on the blockchain. As the realm of NFTs emerges with popular projects and fascinating innovations, NFTs can be in the form of pictures, gifs, music, in-game items, generative art and even domain names or Tweet. NFTs can also represent real-world property rights, individuals' identities and much more. In this field that combines technology and art, people's imaginations never end. Zecrey Team has created an L2 NFT Marketplace based on the BNB chain in strategic cooperation with Binance, providing users with an ultra-high-performance NFT trading experience.


# Zecrey Basics


# Multi-chain asset management

![](/files/MldFMTWrR4YVuse5vb9f)

Zecrey supports one-stop multi-chain assets management of heterogeneous chains, including BNB, Ethereum, NEAR, Avalanche, Aurora, Polygon, Cronos. Zecrey layer 1 provides a convenient and user-friendly design to help users manage multi-chain assets in one interface. On Zecrey, users don’t need to switch networks to check assets and make transactions as on other wallets like Metamask. You can also choose to group or ungroup assets and search and filter assets easily by chain or token. Every on-chain asset gets sorted neatly and is at your fingertip when transacting!


# Zecrey L1 wallet

Zecrey L1 wallet is an all-in-one wallet that helps users manage their multi-chain assets conveniently. It supports multiple networks including BNB, Ethereum, NEAR, Avalanche, Aurora, Polygon, and Cronos, and the list will be extended as Zecrey moves forward. Zecrey L1 wallet stands out in its multi-chain management, fast and secure transactions, and excellent UI. Functions on Zecrey L1 wallet include Transfer, Deposit, and NFT collection.


# Zecrey Legend L2 wallet

As Zecrey's significant milestone, Legend is the new Layer 2 network developed by Zecrey team in strategic cooperation with Binance. Built up with advanced zk-Rollup technology, Legend mainly serves as the BNB chain's L2 version specially designed for NFT marketplace. Transactions are boosted with lightning-fast speed, extremely low gas, solid security and seamless user experience on Legend. Functions on Zecrey Legend L2 include NFT Marketplace (NFT Mint, Buy, Sell, Transfer, Withdraw, etc.), Transfer, Swap, Withdraw, Add & Remove Liquidity.


# Zecrey Zero L2 wallet

Zecrey Zero is the original Layer 2 of Zecrey featuring privacy. It is an L2 network rooted in zk-Rollup with high scalability and native privacy feature. With Zero, users can enjoy convenient asset management, millisecond-class speed, negligible gas fees, and various Defi functions altogether with their privacy fully protected. Functions on Zecrey Zero L2 include Transfer, Swap, Withdraw, Add & Remove Liquidity, all with privacy protection by default.&#x20;

**Note**: Zecrey Zero L2 is **not** available currently. We'll bring Zero back to our users as we move forward according to the roadmap.


# Deposit

![](/files/AJuM3TMuXnDWmT5qETlv)

### **What is “Deposit”？**

The function of “**Deposit**” is to send layer 1 assets to your layer 2. Assets deposited to L2 are not distinguished by their original chain networks but by token types. Currently, L2 Legend supports BNB chain, and users can deposit BNB, LEG, and REY tokens from BNB chain to Legend L2.

### **What is the role of "Deposit" in Zecrey？**？

"Deposit" is for users to send their assets from Layer 1 to Layer 2 wallet, so they can make transactions on Legend's NFT market or with Zero's privacy feature. For now, transactions on Legend's Zecrey NFT market only support BNB token, for it's the native token of BNB chain and the NFT market is built on BNB's Layer 2.

### Why does the process of deposit need some time?

It’s a considered security issue. The system will wait for an appropriate block number to guarantee the security of transactions, which is to avoid rollback or fork. For example, the system will wait for 10 blocks in Ethereum network, so while a transaction is committed in the No.100 block, the result of this transaction will be displayed in Zecrey layer 2 until No.110 block is committed.


# Withdraw

![](/files/uCvsAb5dx81mPkmz0Ssu)

### What is "Withdraw"?

“Withdraw” is the process of sending L2 assets back to L1 chains. Currently, this function is activated on Zecrey Legend and users can withdraw BNB, LEG, and REY token from L2 back to L1's BNB chain.


# Zecrey DEX

### **What is Zecrey L2 swap？**

Swap in Zecrey L2 is a typical decentralized exchange (DEX) based on an automatic market maker (AMM). Users can deposit assets into L2 to swap for target assets, and add liquidity to earn benefits. On Zero, the gas token of swap can be any token supported by Zecrey.

### **What is Liquidity?**

In Zecrey, Liquidity providers(LP) will receive REY token at a certain APY as a reward for providing liquidity to the liquidity pool of decentralized swap DEX. The liquidity pool is a pool of tokens locked in a smart contract to increase market liquidity among traders. A liquidity pool has two kinds of tokens, which is a trading pair. When a new liquidity pool is created, the first LP will set the initial price in the pool. If that price in the pool is inconsistent with the global market, there will be profitable arbitrage opportunities and the LP will suffer impermanent losses. So the LP is incentivized to keep the exchange ratio of the two assets close to the market price.


# The State of Transactions

### **Pending**

The transaction has taken place on L2 and has entered L2's mempool, but has yet to be verified on-chain.

![](/files/VoZ1U4ItZds3fWCfdMUB)

### **Committed**

The transaction in mempool has been packaged into the block and the data has been submitted to the chain.

![](/files/E3JaCcBwmB2JJth5li75)

### **Verified**

The verification has been submitted to the chain and the legitimacy of the block has been verified.

![](/files/F7K6bz5QHEZAxVCVrXh9)

### **Executed**

The transaction in the block has finally been executed on L1.

![](/files/j4N5aXNAry5sUbwTk1gn)


# Get Started


# How to import an account？

![](/files/wF31MyFPrMfkzVllp2kF)

When Zecrey is newly installed or has been reset, click "**Import Account**" on the homepage, and enter the recovery phrase and set a new password for login.&#x20;

To import another account to Zecrey wallet, click on the avatar in the bottom bar of the wallet to open the account panel, select "**Import Account**", enter your private key and confirm.


# How to create a new account？

![](/files/AtPR7gJk8FRhX3Mr66r6)

When using Zecrey Wallet for the first time, click "**Create New Account**" on the homepage, set the wallet password for Zecrey login, save the secret recovery phrase and keep it safe.&#x20;

There can be multiple accounts in one wallet and each one of them has a unique address and recovery phrase. To create another account in your Zecrey wallet, click on the avatar in the bottom bar to open the account panel, select "**Create New Account**" and it'll be done in a few seconds.


# How to receive and send assets with QR code？

![](/files/1lEuHgQTj4E915jui1Dx)![](/files/8YFW16XOYoUeMRbeQudK)

Besides copying the address to transact, you can also use the QR code for more convenient trade. Click on the button of QR code on the homepage and select the chain, or click on an asset and select **Receive**. Share the QR code and people would be able to use it to send the correspondent asset to you (double-check it's the correct chain and token type). You can also click on the scan button to scan another's QR code, which could be found on the homepage or on the address bar of the transfer interface.


# How to export the private key?

![](/files/1NljSoSp7SYyU8ikXcIv)

Click the avatar in the bottom bar of the wallet to open the account panel, select "**Account Detail"**, click "**Export Private Key",** enter the password to view the private key of the address, and click to copy. Please keep the private key safe and do not show it to anyone!


# How to export the recovery phrase？

![](/files/ZewseSnbVHeAftZS1BNW)

Click the avatar in the bottom bar of the wallet to open the account panel, enter "**Settings**", select "**Security & Privacy**", click "**Secret Recovery Phrase**", and enter the password to view the recovery/backup/seed phrase. Users can choose to copy it to the clipboard or save it as CSV file. Please save the backup phrase properly and do not show it to anyone!


# How to use Zecrey NFT Marketplace?

Zecrey NFT marketplace supports NFT Mint, Transfer, Sell, Buy, Deposit, Withdraw, etc. Users can get access by downloading our mobile application or visiting our NFT market webpage.

![](/files/Nvey4LC0IevLVyCorpEG)


# How to adjust the gas fee?

![](/files/3IKfs2X8vGy8FAB3VkMK)![](/files/TOHqnF25UKbNFBzeMU0Z)

Gas fee is the fundamental cost to compensate for the computational power required to conduct a transaction. Gas limit refers to the maximum amount of gas you are willing to consume on a transaction. In Zecrey Layer 1 wallet, gas fees are automatically calculated for users to select the slow, average or fast mode. In the advanced setting, users can manually adjust the gas fee and gas limit. Setting an overly high or low gas may cause unnecessary cost or transaction failure, for L1 transactions are dependent on the state of the blockchain. If the on-chain gas fee fluctuates greatly or the block is congested, even a well-calculated gas fee can face a possibility of failure. On Zecrey Layer 2, all gas fees for transactions are fixed at 0.1%.


# How to check my transaction record?

![](/files/naUo7Oh4zI8Kun2FBKpK)![](/files/wYKDhUwJt3FzmxZcEued)

Click into Activity and find the transaction to view the detailed information. Zecrey supports viewing activities by chain so users can filter the transactions conveniently. You can also click on any token on the homepage to view all the transaction records of this particular asset. To check the details of the transaction on Zecrey Explorer, click the view button in the upper right corner of the transaction interface.


# How to manage my contacts?

![](/files/muBqBnDXYNPhUQSWzvZI)![](/files/pnACv6U4maI9ExSrN4LZ)

Zecrey has designed an address book where you can keep your frequently-used address and manage them easily.

To manage your contacts, click on the avatar in the bottom bar to open the account panel, and select "**My contacts**" to view the list. You can change the name, view the transaction records, make quick transfer to this contact or delete the contact in the contact detail interface.

If you want to add a new contact, select "**Recent**", find it and click on the button on the right end of the bar. This "**Add Contact**" button will become "**Quick Transfer**" if you've added this address. Pretty cool, hah?

![](/files/xzxjHMvuF6OtkosZuy95)![](/files/GzPgE0aIvOARCFE8kcXw)

You can also directly import a contact by clicking "**Add Contact**" on the lower end of the address book. Fill in the name and Ethereum address, and choose one of the interesting Zecrey avatars!

When conducting transactions, users can directly choose from their contacts by clicking on the address book button.

Note: Zecrey won't keep your contact data for privacy and decentralization reason. If you uninstall the Zecrey Wallet, your contacts will NOT be restored when the account is imported. Please properly save your contact data!


# How to set the language?

![](/files/89I4JwvVP5In2vv1uIkg)

Click the avatar on the bottom bar of the wallet to open the account panel, enter "**Settings**", and select "**Language**" to set the language preference of the plug-in wallet. Currently, Zecrey wallet supports English and Simplified Chinese.Note: When using Zecrey wallet for the first time, the display language is set according to the browser's default language, and users can adjust their language preferences later.


# How to give feedback?

![](/files/RVI712bU2LjTgKuWt589)![](/files/oQpDH0nxSV5rVwLMQyUc)

Select **Support & Feedback** in the Profile, fill in the required content and submit your feedback.


# FAQs

### **How does Zecrey protocol protect users' privacy?**

Zecrey layer 2 is a fully decentralized layer under privacy protection. In other words, all transactions are with privacy protection in layer 2. Zecrey team adopts Sigma protocol to develop privacy algorithm, and it shows high efficiency(at most 1-2 seconds).

### **What's the difference between L1 and L2 transfer?**

The basic function is similar for users to transfer certain assets to other users. In L1 wallet, users enter a long string L1 address to make transactions, while in L2, users can transfer to an L2 short-domain address with ".zec" suffix. What is more, all L2 transactions on Zero are under Zecrey's built-in privacy protection.

### **What is Slippage Tolerance?**

Slippage Tolerance is the pricing difference between the price at the confirmation time and the actual price of the transaction users are willing to accept when swapping on AMMs. This difference is mainly caused by market fluctuations. Slippage tolerance is set as a percentage of the total swap value.

On Zecrey wallet, slippage tolerance appears in DEX transactions like L2 swap and moving liquidity. There are three options of slippage for users to choose: 0.1%, 0.5%, 1%. If the price moves higher than the slippage you set, the order will be automatically canceled.

### **Why doesn't the amount in transaction history match the actual amount sometimes?**

The amount of transactions in L1 is not restricted, but if you make transfers in a pretty small amount (usually less than 0.00001), it may be recorded as 0 in activities though the actual amount remains unchanged.

### **What is the difference between Zecrey Zero and Zecrey Legend?**

They are both Zecrey’s Layer2s power up by our zk-Rollup tech with high scalability and solid security, while Zecrey Zero is our Layer 2 with privacy feature by default, and Zecrey Legend is the basis of the first Layer 2 NFT marketplace on BNB Chain.

### **Why is my transaction always pending and can I speed it up?**

Before being executed, an L2 transaction needs to be generated on L2, enter L2's mempool, be packaged into the block, and the block will be submitted to the chain and verified on chain, so there could be a delay in the process due to multiple reasons. L1 transactions are much simpler but sometimes it also takes time for transaction data to be confirmed and included in the chain. Usually, the best way to speed it up is by adding gas fee. Choose a higher gas fee during the transaction or view the activity afterward and select "**Speed up**" to boost your pending transaction.

### **How to connect Zecrey wallet with Dapps?**

Dapp is the decentralized application you use to interact with various blockchain projects such as Defi, NFT market and Metaverse games. To connect Zecrey wallet with these Dapps, choose "**connect wallet**" on their page and select Zecrey. If you don't see Zecrey on the list, you can **set Zecrey as the default wallet** in our settings, then click on another wallet to initiate Zecrey. And you can set or unset Zecrey as the default wallet anytime. Click on **Next** to confirm the request when you see the wallet popup.

Be careful with your wallet authorization and do not connect to Dapps or websites you don't trust!

### **What can I do with Zecrey official NFT?**

Zecrey Chameleon Avatar NFT was free-minted in our community on 23rd, October 2021. It could be traded on the NFTrade market now. <https://nftrade.com/assets/bsc/0x8c6be54dcca5eed3390b37c9d8ef9eb0358ac3a8>

In the future, various collections of Zecrey official NFTs will be released with utilities empowering our community.

### **Can I reset the wallet password?**

Zecrey Wallet password cannot be changed directly. If you forget your password, please reset your wallet in the settings, and then set a new password when importing your account with the seed phrase.

### **How do I keep the security of my wallet account?**

Keep your secret key and recovery phrase somewhere safe, preferably offline. Never share them with anyone or any website, and stay away from suspicious links and downloads. Be aware of spam and don't connect your wallet to websites you don't trust. Use a hardware wallet if a huge amount of crypto assets is involved.<br>

\
Have more questions or feedback to tell us? Join our [Discord](https://discord.com/invite/U98ghQsJE5) to get further support!


# Zecrey Products Introduction

Welcome to download Zecrey mobile app and extension through our [official website](https://www.zecrey.com/download).&#x20;

**Zecrey provides the following products to meet various usage scenarios:**

**Zecrey Mobile APP for** [**iOS**](https://apps.apple.com/us/app/zecrey/id6446452252) **and** [**Android**](https://play.google.com/store/apps/details?id=com.zecrey.app), which includes L1 wallet, L2-Legend wallet, and Zecrey NFT Marketplace. The mobile app contains Zecrey's complete functions, and both iOS and Android systems are supported. Users need to import or create an account to use the wallet.

[**Zecrey Extension**](https://chrome.google.com/webstore/detail/zecrey/ojbpcbinjmochkhelkflddfnmcceomdi), which includes L1 wallet and L2-Legend wallet. It is a convenient way to use Zecrey wallet and interact with Dapp in the browser. Users need to import or create an account to use the wallet.

[**Zecrey Web App (NFT Marketplace)**](https://nftmarket.zecrey.com/), where users can enjoy the world of NFTs more conveniently on the webpage. Users need to connect to an in-browser wallet extension (Zecrey or Metamask) before operation.

If you have any questions or suggestions, join our [Discord](https://discord.com/invite/U98ghQsJE5) to get further support in the Zecrey community!


# Set up your Zecrey Wallet


# Download and Install Zecrey

### [**Get Zecrey Mobile App & Extension**](https://www.zecrey.com/download)

To install Zecrey Mobile App, simply search for ‘Zecrey’ in the iOS [App Store](https://apps.apple.com/us/app/zecrey/id6446452252), [Google Play](https://play.google.com/store/apps/details?id=com.zecrey.app\&pli=1) store and [Chrome Web Store](https://chrome.google.com/webstore/detail/zecrey/ojbpcbinjmochkhelkflddfnmcceomdi), and click on the ‘Install’ button. You can also download and install Zecrey products via our [official website](https://www.zecrey.com/download).&#x20;

<figure><img src="/files/vY3fFQwvEoCSIx3Qs3Ip" alt=""><figcaption></figcaption></figure>

Zecrey mobile app is available on both Android and iOS systems. You can download the app from the Android [Google Play](https://play.google.com/store/apps/details?id=com.zecrey.app\&pli=1) or the iOS [App Store](https://apps.apple.com/us/app/zecrey/id6446452252). Additionally, we offer Zecrey in-browser plugin wallet that can be downloaded from the [Chrome Web Store](https://chrome.google.com/webstore/detail/zecrey/ojbpcbinjmochkhelkflddfnmcceomdi).

For Legend Testnet Phase II, we'll focus on iOS and Web App plus extension wallet.

<figure><img src="/files/97FULSDuIh8lu1Fvw7HP" alt=""><figcaption></figcaption></figure>

### [Zecrey NFT Marketplace (web app)](https://nftmarket.zecrey.com/)&#x20;

You can find the web app for Zecrey NFT Marketplace by clicking on the NFT button on Zecrey’s official website.

Link of Zecrey NFT Marketplace web app: <https://nftmarket.zecrey.com/>

<figure><img src="/files/G47LHIq82mLLMOsAEfgA" alt=""><figcaption></figcaption></figure>


# Create a New Wallet

When you choose to create a new wallet, you need to back up this new set of seed phrase carefully. DON'T TAKE A SCREENSHOT.

### Create a new wallet in Mobile App

**Step 1**: Enter the app, click "**Create or Import Wallet**", choose "**Create Wallet**", and accept Zecrey Privacy Policy to proceed.

![](/files/XpvTjTtItrZIGBwo6oND)![](/files/QjNMzpjGUC85BhyffMqr)

**Step 2**: Confirm and back up your secret phrase carefully. Always keep it somewhere safe and do not take a screenshot or share it with anyone. You can view your secret phrase later in Privacy & Security.

![](/files/XVWyJnCXBcP3AxdqM3LC)

**Step 3**: Set a 6-digit password for account security and transaction confirmation. If you forget the wallet password, you will need to reset Zecrey wallet in the setting, and re-import your account with the recovery phrase and set a new password.

![](/files/qeu6cZFKOkAPG3Tawzbm)

###

### Create a new wallet in Extension

**Step 1**: Click "**Get Started**" in the extension and choose "**Create Wallet**" on the page you are redirected to.

<div align="left"><figure><img src="/files/Pcth2EEHEkE1tAVQrfDX" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/20RICy29RrANJ09k5PKY" alt=""><figcaption></figcaption></figure>

**Step 2**: Set a 6-digit password for account security and transaction confirmation. The wallet password cannot be changed directly. If you forget the password, you will need to reset Zecrey wallet, and re-import your account with the recovery phrase, and set a new password.

<figure><img src="/files/EJG3VvmJVkIqbiRJK0TR" alt=""><figcaption></figcaption></figure>

**Step 3**: Get your secret phrase, confirm and back up it carefully. Always keep it somewhere safe and do not take a screenshot or share it with anyone. You can view your secret phrase later in Privacy & Security.

<figure><img src="/files/ZvLMHqM0ACuXk58YmTv7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/PyygzlPqRX0bglGvOJUZ" alt=""><figcaption></figcaption></figure>


# Import an Existing Wallet with Mnemonic

If you have your seed phrase prepared beforehand, you can import it into Zecrey Wallet.

There are two types of "importing an existing wallet" within a wallet.

* import a wallet with mnemonic(a.k.a. seed phrase)
* import a wallet with a private key

For the first time to use Zecrey wallet, you need to have a set of seed phrase ready. Either you can create one with our wallet or you can just use the set you have before.&#x20;

The reason why we need a set of seed phrase for usage of a wallet is users can generate many new accounts within the wallet later.&#x20;

And within the wallet, you can import any new account with a private key.&#x20;

### Import an Existing Wallet in **Mobile App**

**Step 1**: Enter the app, click "**Create or Import Wallet**", and choose "**Import Wallet**".

![](/files/vsHlrLSc1nkqdQFUgMRP)

**Step 2**: Enter your recovery phrase and click "**Import**".

![](/files/mO0I0VLCOsjaQrVBiX3m)

**Step 3**: Set a 6-digit password for account security and transaction confirmation. If you forget the wallet password, you will need to reset Zecrey wallet in the setting, import your account with the recovery phrase and set a new password.

![](/files/m3X45lwSrPNUOnIkGJTQ)

###

### Import an Existing Wallet in Extension

**Step 1**: Enter the app, click "**Create or Import Wallet**", and choose "**Import Wallet**".

![](/files/tjzqLo3VGG5LpDDOydlw)

<figure><img src="/files/MNYurF2KGhRyDrIRsKtI" alt=""><figcaption></figcaption></figure>

**Step 2**: Enter your recovery phrase and set a 6-digit password for account security and transaction confirmation. If you forget the wallet password, you will need to reset Zecrey wallet in the setting, import your account with the recovery phrase, and set a new password.

<figure><img src="/files/9yJmu7yeon7kvFul3Vbf" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ie6fW5J5PtNHxlVMv0j7" alt=""><figcaption></figcaption></figure>


# Claim Test Tokens for Testnet

Before starting the Legend testnet, you will need to claim some BNB tokens on the BNB Chain. Zecrey Legend is an L2 built on the BNB Chain and the gas fee requires its native token BNB, therefore, holding BNB on BNB Chain would be adequate for carrying out the basic functions in Zecrey Legend Testnet. If you want to claim test tokens on other L1 blockchains, you can search for the official faucets of other chains to claim test tokens.

1. Go to [BNB Chain Faucet](https://testnet.binance.org/faucet-smart).
2. Enter your BEP-20 address. You can use the address created in Zecrey Wallet or Metamask, or other addresses compatible with BEP-20 or ERC-20.
3. Click "Give me BNB", you'll get 0.5 BNB on BNB Chain after a while. Now you are good to go!<br>

   <figure><img src="/files/STTbiLYI4tU8Cpe42qoX" alt=""><figcaption></figcaption></figure>


# Testing Requirements

Duration for Phase II: 1:00 pm UTC, 31st March to 1:00 pm UTC, 30th April, 2023

[iOS app](https://apps.apple.com/us/app/zecrey/id6446452252): March 31st at 1pm UTC to April 10th at 1pm UTC

[Web app](https://nftmarket.zecrey.com/) and [extension](https://chrome.google.com/webstore/detail/zecrey/ojbpcbinjmochkhelkflddfnmcceomdi): April 10th at 1pm UTC to 30th at 1 pm UTC

We will check whether the user participating in the testnet has completed the following operations to verify the eligibility for claiming OAT on [Galxe](https://galxe.com/Zecrey/campaign/GCpX8UpFJb) and joining NFT lucky draw event on [QuestN](https://app.questn.com/quest/756005762779357520):

1. [Register L2 account](/product-handbook/zecrey-legend-l2/l2-account-registration): register Legend L2 account with a short-domain name address \[*xxx.zec*]. If you have tested in Phase I, you can skip the L2 registration part and proceed with the Phase I account.
2. [Mint NFT](/product-handbook/zecrey-nft-marketplace/mint-nft): create your own NFT
3. [Buy NFT](/product-handbook/zecrey-nft-marketplace/buy-nft): make an offer or buy a listed NFT
4. [Sell NFT](/product-handbook/zecrey-nft-marketplace/sell-nft): list your NFT or accept another’s offer \[we recommend you to set the price below 0.1 BNB when you list an NFT so that others can afford it and make a deal]
5. Submit feedback here: [Legend testnet Phase II feedback form](https://docs.google.com/forms/d/e/1FAIpQLSeC-8Qb1DIRE3XKmUGPQdzUHSTT5bo4bEZoDKBEqdeOtc0aeA/viewform)

For more details, read the section of "Requirements" within our medium article: <https://zecrey.medium.com/zecrey-launches-phase-2-of-legend-testnet-join-now-6f326ec92ff4>.


# Rewards for Phase II Testnet

### 1. [Claim OAT on **Galxe**](https://galxe.com/Zecrey/campaign/GCpX8UpFJb)

**For the credential "L1 Address for Zecrey Legend Public Testnet Phase 2 and meet requirements", you need to fulfill all** [**testing requirements**](/product-handbook/set-up-your-zecrey-wallet/testing-requirements) **in our Phase II testnet.**

There are two ways to participate in the testnet and claim Galxe OAT:

#### Test with new Zecrey address

1. [Create a new wallet](/product-handbook/set-up-your-zecrey-wallet/create-a-new-wallet) in the Zecrey app and complete the testnet requirements.&#x20;
2. Import the seed phrase or private key of your Zecrey testnet address into Metamask (or any other wallet extension you use) and connect it to Galxe. Please back up the secret recovery phrase of your original wallet beforehand before you reinstall Metamask to import the recovery phrase.
3. If you already have a Galxe account before, you need to remove and reconnect the socials of the address you already connected with Galxe first. The step-by-step guide is: Click on Galxe Settings -> Social Link -> Remove Twitter and Discord, and import the private key of the testnet address into the wallet extension you are connecting with Galxe, then bind the socials again to verify and claim OAT.

#### Test with an existing address

1. Import your existing wallet into the Zecrey app and use it to participate in the testnet.
2. Claim OAT on Galxe.

The testnet address credential would auto-sync with our backend data every 12 hours, please wait for it to be updated before you can claim the OAT.

### **2.** [**Join Lucky Draw of Genesis NFT WLs on QuestN**](https://app.questn.com/quest/756005762779357520)

For phase II of Legend Testnet, we’ll give away up to 5,000 NFTs by selecting from the qualified participants randomly on [QuestN](https://app.questn.com/quest/756005762779357520) \[Previously Quest3].

**For the address you submitted to be eligible for NFT lucky draw, you need to fulfill all** [**testing requirements**](/product-handbook/set-up-your-zecrey-wallet/testing-requirements) **in our Phase II testnet.**

Don't worry if the address you submitted is in process for **we will not review the Answer Submission entry** or distribute whitelist and point rewards **on QuestN**. We will review the result and announce the winners of the lucky draw in the Zecrey community after the event ends on April 30th.

The Genesis NFTs will be minted on Zecrey Legend, the native Layer 2 NFT Marketplace when Legend mainnet launches. Please stay tuned to our announcement on Twitter, Discord and Telegram.

### **3. Feedback Reward**

We value feedback from our community members and strive to provide opportunities for them to share their thoughts and ideas with us. That’s why we will select about 100 users who provide the most helpful, constructive feedback and reward each of them with one Genesis NFT whitelist. This feedback reward will be open for users of all our products, including Zecrey iOS/Android app, web app and extension.

There are three ways to give us feedback:

1. Fill in the [Legend testnet Phase II feedback form](https://docs.google.com/forms/d/e/1FAIpQLSeC-8Qb1DIRE3XKmUGPQdzUHSTT5bo4bEZoDKBEqdeOtc0aeA/viewform). Make sure you fill in the same L1 and L2 address used in the testnet.
2. Join our [Discord community](https://discord.com/invite/U98ghQsJE5), and [open a ticket](https://discord.com/channels/842672945574182943/1048464565387665498) for one-on-one support and feedback. You can also send your suggestions to the feedback channel or community discussion forum.
3. Click the Support & Feedback button in our app to report bugs, tell us your user experience, what you like about Zecrey, and what you think should be improved.


# Zecrey L1 Wallet


# Multi-chain Assets Management

Zecrey L1 Wallet provides flexible multi-chain asset management all in one place so users don’t need to switch networks to check their multi-chain assets, and you can conveniently search for the assets you want even during transactions. Adding or hiding tokens on different chains is also supported.

### Multi-chain Assets Management in Mobile App

#### **Sort and search for assets**

1. Choose to group or ungroup assets displayed on the home page as you prefer in "**General Setting**" ->"**Multi-Chain Assets Manage**". In ungrouped mode, different assets on different chains will be displayed individually; while in grouped mode, assets will be sorted by token type.
2. Users can search for assets easily by entering the name of the token or the blockchain in the search box, or using the asset filter to view assets on a single chain. This function is also supported during transactions to quickly find the asset you want.
3. Click on an asset, select "**Multi-Chain**" on the asset detail page, and the same asset you own on different chains will be displayed here.

![](/files/dWkYlgw2qxY1Qab0pXWW)![](/files/VgJubTFqFvjzJ1Z5kYpu)

### ![](/files/ffHXuoMPvbk4lZXs4RNy)![](/files/X4Ol4BRGAciWQssLUA5I)

#### **Add or remove assets**

1. Click on the plus button in the lower right corner of the wallet and you can see all the supported tokens on different chains displayed on this interface. Enter the token or blockchain to search for the asset you want.
2. Check or uncheck an asset to add or remove it from your home page. Removing a token only means hiding it from the asset list of your wallet, and the asset itself will not be changed or erased from your address in any case. You can re-add a token anytime and it will appear again on the wallet homepage.

![](/files/suMv8LJueNzicrApNebO)![](/files/dA5J2zvoB0jX63AydyCT)![](/files/qbvVNMpwTyhQBV55loLN)


# L1 Transfer

### L1 Transfer in **Mobile App**

**Step 1**: Click on the paper-plane-shaped button on the homepage to select a token, or click on the asset you want and select "**Transfer**" on the asset detail page.

<figure><img src="/files/p5l2rbAPYym3LxLIOafi" alt=""><figcaption></figcaption></figure>

**Step 2**: Enter another L1 address to receive the asset and input the transfer amount within the limit of your balance. You can also select a contact's address from your address book or scan the QR code of the receiver's address. In any way, make sure the address is of the same chain you choose to transfer on, or the asset you transfer may get lost.

**Step 3**: Choose an appropriate gas fee between the three speeds of **Slow**, **Average** and **Fast**, which is automatically calculated according to the current on-chain state and your transaction amount. You can also enter a gas fee manually in the **Advanced Setting**. The type of gas fee burned in L1 transactions depends on the network where you make the transaction. For example, if you make a transfer on Avalanche, the gas fee will be its native token AVAX.

<figure><img src="/files/9E2diPOBDkOOBXua0Lnb" alt=""><figcaption></figcaption></figure>

**Step 4**: Confirm and enter your password to complete the transaction.

### L1 Transfer in Extension

**Step 1**: Click on "**Transfer**" on the L1 account page and select the network and token type.

![](/files/GP3ay5Y5Gqgo191R9VIf)![](/files/CezRLO7XDYkcYVj6Wz4k)

**Step 2**: Enter another L1 address to receive the asset and input the transfer amount within the limit of your balance. You can also select a contact's address from your address book. In any way, make sure the address is of the same chain you choose to transfer on, or the asset you transfer may get lost.

**Step 3**: Choose an appropriate gas fee between the three speeds of **Slow**, **Average** and **Fast**, which is automatically calculated according to the current on-chain state and your transaction amount. You can also manually change the gas fee by adjusting gas price (GWEI) and gas limit. The type of gas fee burned in L1 transactions depends on the network where you make the transaction. For example, if you make a transfer on Avalanche, the gas fee will be its native token AVAX.

![](/files/FtW4DJhA4DsnHGVrN4Y2)![](/files/66rvuQbqUadEHh2DEtRD)

**Step 4**: Confirm the transaction.

![](/files/GgbbcyDl3RclgknrZb5Y)


# Deposit

Deposit asset from Layer 1 to Layer 2.

### **What is Deposit**

Zecrey Legend is a zk-rollup based layer 2 protocol on top of BNB chain.&#x20;

To deposit is to send assets on the underlying L1(BNB Chain) to your L2 account for further transactions on L2. Assets deposited to L2 are no longer distinguished by their original chain networks. Currently, this function is activated on Legend and BNB Chain, and users can deposit BNB from BNB Chain to their Legend L2 accounts.

You need to [register a Legend](/product-handbook/zecrey-legend-l2/l2-account-registration) account before depositing to L2.

### **Deposit in Mobile App**

**Step 1**: Enter **Trade Center** and click "**Deposit**" to select a token. or click on the asset you want and select "**Deposit**" on the asset detail page.&#x20;

<figure><img src="/files/k9XKms6xbB0Mn7FR9oKT" alt=""><figcaption></figcaption></figure>

**Step 2**: Input the deposit amount within the limit of your balance.

**Step 3**: Choose an appropriate gas fee between the three speeds of **Slow**, **Average** and **Fast**, which is automatically calculated according to the current on-chain state and your transaction amount. You can also enter a gas fee manually in the **Advanced Setting**. The type of gas fee burned in L1 transactions depends on the network where you make the transaction. For depositing assets on BNB Chain to Legend, the gas fee will be charged in BNB.

<figure><img src="/files/es33ScKpGPEQNajlh7vR" alt=""><figcaption></figcaption></figure>

**Step 4**: Confirm and enter your password to complete the transaction. Once the transaction on L1 is confirmed, the deposit will be added to your Legend L2 balance.

### **Deposit in** Extension

**Step 1**: Click "**Deposit**" and select the token you want to deposit.

![](/files/05CmH0ErSOZ25APW5fiw)![](/files/IQNX7gjKBxR2H3t7das9)

**Step 2**: Input the deposit amount within the limit of your balance. You can also select **Deposit to other Layer2 account**.

![](/files/ER5jh9zpi658l25MKiEI)![](/files/TdhT5tFbTVOdJvPDLPwP)

**Step 3**: The gas fee will be automatically calculated according to the current on-chain state and your transaction amount. You can also manually change the gas fee by adjusting gas price (GWEI) and gas limit. The type of gas fee burned in L1 transactions depends on the network where you make the transaction. For depositing assets on BNB Chain to Legend, the gas fee will be charged in BNB.

**Step 4**: Confirm the transaction. Once the transaction on L1 is confirmed, the deposit will be added to your Legend L2 balance.

![](/files/IUyPd3EVxMFGGm2sOkct)![](/files/LU4PjQNrXZtxJShYgVYv)


# L1 NFT Management

Zecrey supports users to view, transfer or deposit their NFTs in L1 wallet. Users can transfer the NFT to another address or deposit it to Legend-L2 for trading in Zecrey NFT Marketplace. Zecrey L1 wallet can also receive NFTs withdrawn from Zecrey Legend account. Currently, Zecrey only supports L1 NFT functions on BNB chain. To explore more NFT functions, switch to L2-Legend wallet and visit Zecrey NFT Marketplace.


# View NFT Assets

Click on "**NFT**" beside the **Assets** on the homepage to view your NFT assets sorted by collections. You can also search for an NFT, view a collection and click on an NFT to see its details.

<figure><img src="/files/urqV8pElkMpzUvNMsD8X" alt=""><figcaption></figcaption></figure>


# L1 NFT Transfer

**Step 1**: Click on "**NFT**" beside the Assets on the homepage, select the NFT you want and click on "**Send**".

**Step 2**: Enter another L1 address to receive the NFT. You can also scan the QR code of the receiver's address. In any way, make sure the address is BEP-20 compatible for Zecrey only supports NFT functions on BNB chain currently, or the NFT you transfer may get lost.

<figure><img src="/files/akMpS5T6DlcX4OHzk2Vm" alt=""><figcaption></figcaption></figure>

**Step 3**: Choose an appropriate gas fee between the three speeds of **Slow**, **Average** and **Fast**, which is automatically calculated according to the current on-chain state and your transaction amount. You can also enter a gas fee manually in the **Advanced Setting**. The gas fee of L1 NFT transactions is charged in BNB token.

**Step 4**: Confirm and enter your password to complete the transaction.


# NFT Deposit

You need to [register a Legend](/product-handbook/zecrey-legend-l2/l2-account-registration) account before depositing to L2.

### NFT Deposit in Mobile App

**Step 1:** Click on "**NFT**" beside the Assets on the homepage, select the NFT and click on "**Deposit**". You need to register a Legend account before depositing.

**Step 2:** Choose an appropriate gas fee between the three speeds of **Slow**, **Average** and **Fast**, which is automatically calculated according to the current on-chain state and your transaction amount. You can also enter a gas fee manually in the **Advanced Setting**. The gas fee of L1 NFT transactions is charged in BNB token.

<figure><img src="/files/nv0cHQbwMT8sj3lm9u0p" alt=""><figcaption></figcaption></figure>

**Step 3**: Confirm and enter your password to complete the transaction. Once the transaction on L1 is confirmed, the deposited NFT will be added to your Legend L2 account.

### NFT Deposit in Extension

**Step 1:** Click "**NFT**" on the homepage, enter your NFT collection, select the NFT, and click on "**Deposit**".&#x20;

![](/files/l4pOu0WntSHqNd9JsQIc)<img src="/files/RCIZcS5qs9uXBvcOx1sr" alt="" data-size="original">

**Step 2:** Choose an appropriate gas fee between the three speeds of **Slow**, **Average** and **Fast**, which is automatically calculated according to the current on-chain state and your transaction amount. The gas fee of L1 NFT transactions is charged in BNB token.

![](/files/Xd3WayBj1Zh1Fx91Fals)

**Step 3**: Confirm the transaction. Once the transaction on L1 is confirmed, the deposited NFT will be added to your Legend L2 account.


# Zecrey Legend L2

Functions on Zecrey Legend L2 include NFT Marketplace (Mint, Buy, Sell, Send and Withdraw NFT), Transfer, Swap, Withdraw, Add & Remove Liquidity. Transactions are boosted with lightning-fast speed, extremely low gas, solid security and seamless user experience on Legend.


# L2 Account Registration

### **What is Zecrey Legend L2 account?**

Zecrey has applied ZNS(Zecrey Name Service) system so users can own their special human-readable L2 addresses. Zecrey Legend L2 wallet address employs a special short domain name with **".zec"** as the suffix. Before use, you have to activate the Legend account and create your short domain address. After activation, you can enjoy the functions on Zecrey L2-Legend (Transfer, Withdraw) and NFT Marketplace (Mint, Buy, Sell, Transfer and Withdraw NFT).

### **Register Legend L2 account in Mobile App**&#x20;

**Step 1:** Click the **Layer Switcher** on the upper left corner, select **Zecrey Legend**, and if your Legend account hasn't been activated, you will be prompted to register. You can also enter Legend registration interface by following the pop-up activation guide when L2 functions are involved.

<figure><img src="/files/nKNeyLYAPoklISYSP5JZ" alt=""><figcaption></figcaption></figure>

**Step 2:** Set your unique account ID and click “**Register**” to activate the L2 account. Zecrey L2 account address is a short domain address suffixed with **".zec"**.

**Step 3:** Check your L2 address and click "**Confirm**". All Legend transactions use BNB as gas fee for Legend is an L2 built on BNB Chain. There will be a fee for registering an L2 Account ID, but the first 10,000 users will get a 100% discount, which means you can register an L2 Account ID for free!

FYI: After the first 10,000 users, users need to pay a little BNB to register an L2 account.

<figure><img src="/files/XhlOma2WvghcoY4noEqF" alt=""><figcaption></figcaption></figure>

**Step 4:** The ZNS proof will be verified on BNB Chain within a few minutes. Click the Layer Switcher to switch between L1 and L2 accounts after the L2 account is activated.

### **Register Legend L2 account in Extension**&#x20;

**Step 1:** Click the **Layer Switcher** on the lower left corner, select **Legend**, and if your Legend account hasn't been activated, you will be prompted to register. You can also enter Legend registration interface by following the pop-up activation guide when L2 functions are involved.

![](/files/voHfXefnjW50vrGZ89ED)![](/files/KyjstaXpAohKAmbk3Wuj)

**Step 2:** Click **Register** and set your unique account ID. Zecrey L2 account address is a short domain address suffixed with ".zec".

**Step 3:** Check your L2 address and click "**Confirm**". All Legend transactions use BNB as gas fee for Legend is an L2 built on BNB Chain.&#x20;

![](/files/HR6Y0awS0o1Kd7Q1mjHR)![](/files/b386MAiol958B176L030)

**Step 4:** The ZNS proof will be verified on BNB Chain within a few minutes. Click the Layer Switcher to switch between L1 and L2 accounts after the L2 account is activated.

![](/files/X8ti9Jq7hIDcbjypqh0O)


# L2 Transfer

### **What's the difference between transfer in L1 and L2?**

The basic function is similar for users to transfer certain assets to another address. In L1 wallet, you enter L1 long-string addresses to make transactions; while in Legend L2 wallet, you transfer to L2 short-domain addresses with ".zec" suffix.

### **L2 Transfer in Mobile App**

**Step 1:** Click the lightning-shaped button on the L2 Legend homepage to select a token, or click on the asset you want and select "**Transfer**" on the asset detail page.

<div align="left"><figure><img src="/files/uzBL6Qbtl8F49NBknlNj" alt=""><figcaption></figcaption></figure></div>

**Step 2:** Enter another L2 address to receive the asset and input the transfer amount within the limit of your balance. You can also select a contact's address from your address book or scan the QR code of the receiver's address. You can even add a transfer memo to the receiver.

<div align="left"><figure><img src="/files/snxqP3JIwyrWNUsMDnmd" alt=""><figcaption></figcaption></figure></div>

**Step 3:** Click "**Transfer**" and check the details. On Legend, gas fees are paid in BNB and are fixed at 0.1%.

**Step 4:** Confirm and enter your password to complete the transaction.

### **L2 Transfer in Extension**

**Step 1:** Click **Transfer** on the L2 Legend homepage to select a token.

![](/files/EVzZ0YccQC08ffHKZthp)![](/files/0fcbX0qvK63d8Bc0immH)

**Step 2:** Enter another L2 address (xxx.zec) to receive the asset and input the transfer amount within the limit of your balance.

![](/files/0HkDnhZCPMawduyMfqii)

**Step 3:** Click "**Transfer**" and check the details. On Legend, gas fees are paid in BNB and are fixed at 0.1%.

**Step 4:** Confirm the transaction.

![](/files/k2Ly6GOTXlnpxali5kd0)![](/files/oiJPLUeg9dfVWKZEYvpY)


# Withdraw

### **What is Withdraw?**

Withdraw is the process of sending L2 assets to L1 blockchains. Currently, this function is partially activated on BNB chain, and users can withdraw BNB token from Legend L2 to BNB chain.

### **How to withdraw assets?**

**Step 1:** Enter the **Trade Center** on Legend homepage and click "**Withdraw**" to select an asset.

<figure><img src="/files/WW9f7jkh8CMoH8JoB9IA" alt=""><figcaption></figcaption></figure>

**Step 2:** Enter an L1 wallet address and the amount of asset to withdraw. Click "**My address**" to autofill your L1 address or input another BEP-20 address. Gas fees are paid in BNB and are fixed at 0.1% on Legend.

**Step 3:** Confirm and enter your password to complete the transaction.


# Zecrey NFT Marketplace

Zecrey NFT marketplace is built on Legend, the BNB Chain's L2 network specially designed for NFT marketplace. With advanced zk-Rollup technology, the NFT transactions are boosted with lightning-fast speed, extremely low gas, solid security and seamless user experience on Legend.

<figure><img src="/files/VvMzCJK2pgM9Mi0sHdmx" alt=""><figcaption></figcaption></figure>

Users can create NFTs and NFT collections, buy/sell/transfer/withdraw NFTs in Zecrey NFT Marketplace.


# Explore NFT Marketplace

#### Browse Zecrey NFT Marketplace

Enter Zecrey NFT Marketplace on L2-Legend and you can explore different sections on the homepage including Popular NFT Collections, Top Rankings, and Trending.

<figure><img src="/files/wbFn5qV3Dv9A5rwrjZtg" alt=""><figcaption></figcaption></figure>

#### Explore NFTs

Users can search for NFT items or collections in the search bar, and filter the NFTs according to their verified state, listed time, price and owners in the bottom bar of the NFT Ranking page.

<figure><img src="/files/q28116NamdkvgRq8sdVj" alt=""><figcaption></figcaption></figure>

#### Check NFT collections

Click on an item or a collection to see its info in full detail. In the bottom bar of the collection detail page, the NFTs can be filtered by their state, listed time, price and owners.

<figure><img src="/files/sm2y5e0SCVjYNvmnkxPY" alt=""><figcaption></figcaption></figure>


# Connect Zecrey Extension to NFT Marketplace

**Step 1**: To connect Zecrey wallet with our NFT marketplace on web app, choose "**connect wallet**" on the upper left of the web app and select Zecrey. It is recommended to connect with Zecrey extension to experience the full NFT experience on Legend L2.&#x20;

<figure><img src="/files/QXp5zXECbyyT829j418M" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/VDglAOk5e7a7TBaWKDdf" alt=""><figcaption></figcaption></figure>

**Step 2**: Click on **Next** to confirm the request when you see the wallet extension popup.

<figure><img src="/files/B0agtDmY1HJfcIjY4fG2" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/r87p3fmG3v8RLBW10NDi" alt=""><figcaption></figcaption></figure>


# Create NFT Collection

### **What is an NFT collection?**

An NFT collection consists of a set of NFTs produced by an artist (or a group of artists). Most NFT collections include many items with similar artistic styles, although each one differs slightly from the others.

### **Create an NFT collection in Mobile App**

**Step 1:** Switch to Zecrey L2-Legend wallet, click on "**NFT**" beside the **Assets** on the homepage, choose "**Create**", and select "**NFT Collection**".

**Step 2:** Upload a collection cover, enter the name of the collection, choose to fill in the description and upload a banner image.

<figure><img src="/files/hpi07TdWKhyrSp0poaVu" alt=""><figcaption></figcaption></figure>

**Step 3:** You can also click **More Options** if you want to add more details. Fill in the collection URL; enter the official website, Twitter, Discord, and Telegram links of your NFT collection; set the creator royalty at a certain percentage from 0 to 10 for your NFT collection, so you'll receive this percentage of the final deal price every time your items are resold in the future. You'll receive your royalty every month in your Legend account.

**Step 4:** Click on "**Create**" to finish creating the NFT collection. You can view it in your NFT assets later.

### **Create an NFT collection in Web App and Extension**

Before you start, you need to [Connect Zecrey Extension to NFT Marketplace](/product-handbook/zecrey-nft-marketplace/connect-zecrey-extension-to-nft-marketplace).

**Step 1:** Enter your account by clicking the avatar in the upper left corner of Zecrey web app, and click on "**My Collections**".&#x20;

<figure><img src="/files/tA8rXmP8Q4ICe4MFoi5r" alt=""><figcaption></figcaption></figure>

**Step 2:** Click "**Create**" to create an NFT collection.

<figure><img src="/files/4y8JJ8zxGdM9mE36osgl" alt=""><figcaption></figcaption></figure>

**Step 3:** Upload a collection cover, enter the name of the collection, choose to fill in the description, upload a banner image, and fill in a collection URL. If you want to add more details, enter the official website, Twitter, Discord, and Telegram links of your NFT collection. And you can set the creator royalty at a certain percentage from 0 to 10 for your NFT collection, so you'll receive this percentage of the final deal price every time your items are resold in the future. You'll receive your royalty every month in your Legend account.

**Step 4:** Click on "**Create**" and verify the transaction in your wallet extension. You can view it in your NFT collections later.

<figure><img src="/files/k8JGWcLcGXSihyGueefJ" alt=""><figcaption></figcaption></figure>


# Mint NFT

### **What is Minting NFT?**

Minting NFTs refers to the conversion of digital files such as images, video files, music, or in-game items into crypto assets stored on blockchains. This minting process ensures the authentication of each NFT by providing a digital signature that is used to track NFT ownership.

### **Mint NFT in Web App and Extension**

Before you start, you need to [Connect Zecrey Extension to NFT Marketplace](/product-handbook/zecrey-nft-marketplace/connect-zecrey-extension-to-nft-marketplace).

**Step 1:** Click on "**Create**" on the top bar of Zecrey NFT Marketplace web app.

**Step 2:** Upload a file (JPG, PNG, and GIF files less than 100 MB supported currently), fill in the name and description, and select the collection it will belong to.

**Step 3:** If you want to add more details, enter the official website of your NFT to build its community; set properties and levels for this NFT, properties are traits that set NFTs apart such as color, mood, shape, material, etc., and levels indicate the NFT's strength or weakness of certain qualities; set the NFT item as explicit and sensitive content so that others won't be able to see it in this collection. Double-check the NFT info for it cannot be revised after minting.

**Step 4:** Click **Create** and verify the transaction in your wallet extension. Congrats, you've created your own NFT and it will be shown in your NFT assets!

<figure><img src="/files/Vlo1SyYaA8zzKbiujRv2" alt=""><figcaption></figcaption></figure>

FYI: If you want to mint or create a new NFT and set it to your  latest created NFT collection, if the NFT collection's status is under pending, you cannot successfully create the NFT.

### **Mint NFT in Mobile App**

**Step 1:** Switch to Zecrey L2-Legend wallet, click on "**NFT**" beside the **Assets** on the homepage, choose "**Create**", and select "**NFT Item**". Another quick entrance is to click the camera button in the upper left corner of the NFT Marketplace, and take a photo or select one from your gallery.

<figure><img src="/files/sCeKXfetJuppDzOFpbkC" alt=""><figcaption></figcaption></figure>

**Step 2:** Upload a file (JPG, PNG, and GIF files less than 100 MB supported currently), fill in the name and description, and select the collection it will belong to.

<figure><img src="/files/QK9InRoGqLglHAuaYRE4" alt=""><figcaption></figcaption></figure>

**Step 3:** You can also click **More Options** if you want to add more details. Enter the official website of your NFT to build its community; set properties and levels for this NFT, properties are traits that set NFTs apart such as color, mood, shape, material, etc., and levels indicate the NFT's strength or weakness of certain qualities; set the NFT item as explicit and sensitive content so that others won't be able to see it in this collection. Double-check the NFT info for it cannot be revised after minting.

**Step 4:** Click **Create** and **Confirm**. Congrats, you've created your own NFT and it will be shown in your NFT assets!


# Buy NFT

Buy a listed NFT in NFT Marketplace; Make an offer to a listed NFT; Cancel offers.

### **How does NFT Trade work?**

NFT owners will list an NFT and set a price if they want to put it on the market. Select an NFT in the marketplace to see if it's listed for sale. You can also filter the listed NFTs to see the ones that can be traded now. A listed NFT will have its current price shown on the info page, and you can buy it at that price, or you can make an offer if you want to trade at a different price. An unlisted NFT won't show a set price in its details and you can make an offer to it. If the owner accepts the offer within the set duration, you will get the NFT at the price you set. You can also cancel your NFT listings or offers anytime before the deal is closed. A service fee of 2.5% and the royalty set by the NFT creator will be charged in the NFT trade.

### **Buy a listed NFT in Web App and Extension**

Before you start, you need to [Connect Zecrey Extension to NFT Marketplace](/product-handbook/zecrey-nft-marketplace/connect-zecrey-extension-to-nft-marketplace).

**Step 1:** Enter Zecrey Web App, search or explore the NFT Marketplace to find the listed NFT you want. You can use the "**Buy Now"** toggle to check out listed NFTs, set a price limit, or use the sorter to rank listed NFTs by price.

<figure><img src="/files/t7mIbjvys4skxYEY772L" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/BMWAsbim4MFwEBmQ1Te2" alt=""><figcaption></figcaption></figure>

**Step 2:** Click "**Buy NFT**"in the NFT detail page to proceed. Check the price and the gas fee. Gas fees are paid in BNB and are fixed at 0.1% on Legend. Confirm and verify the transaction in your wallet extension. You can check the details in "**Activity**" later.

<figure><img src="/files/Odu7ssXKYr1bFdNqD6ZJ" alt=""><figcaption></figcaption></figure>

### **Make an offer in Web App and Extension**

Before you start, you need to [Connect Zecrey Extension to NFT Marketplace](/product-handbook/zecrey-nft-marketplace/connect-zecrey-extension-to-nft-marketplace).

**Step 1**: Enter Zecrey Web App, find the NFT you want, and click "**Make Offer**" on its detail page. You can make an offer at the price you want whether the NFT is listed or not.

<figure><img src="/files/1CbW9tiUmcmF2JDpKqCl" alt=""><figcaption></figcaption></figure>

**Step 2:** Set a price and a time limit for this offer. The offer will be automatically canceled if it's not accepted within the set duration. Gas fees are paid in BNB and are fixed at 0.1% on Legend. The price will only be deducted from the buyer's account after the offer is accepted and the NFT transaction is executed, but the gas fee will not be refunded once the offer is made.

<figure><img src="/files/BpR9ppIDVoHgbowRRvJz" alt=""><figcaption></figcaption></figure>

**Step 3:** Confirm and verify the transaction in your wallet extension. You can check its details in "**Offers"** later.

<figure><img src="/files/Xpu1XQUUmHtBlxDvVwni" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/YVVIM3B8rJfqAoOgHELT" alt=""><figcaption></figcaption></figure>

### **Cancel an offer in Web App and Extension**

Before you start, you need to [Connect Zecrey Extension to NFT Marketplace](/product-handbook/zecrey-nft-marketplace/connect-zecrey-extension-to-nft-marketplace).

**Step 1:** Enter Zecrey NFT Marketplace on Web App, click into the avatar in the upper right corner to view **My Offers.** Select **Offer Made**, click on the offer you want to cancel, and click **Cancel Offer.**

<figure><img src="/files/7F3ikerRbSKOOf0516Yb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/anuBAWiju0AD9iHkO4w1" alt=""><figcaption></figcaption></figure>

**Step 2:** **Confirm** to cancel the offer. Gas fees are paid in BNB and are fixed at 0.1% on Legend.

<figure><img src="/files/8isybsq2fbv9iUMyV3Cf" alt=""><figcaption></figcaption></figure>

### **Buy a listed NFT in Mobile App**

**Step 1:** Enter Zecrey NFT Marketplace on L2-Legend, find the listed NFT you want and click "**Buy NFT**", check the price and the gas fee. Gas fees are paid in BNB and are fixed at 0.1% on Legend.

<figure><img src="/files/st9vPH99voTYLk9XHV1q" alt=""><figcaption></figcaption></figure>

**Step 2:** Confirm the transaction. You can check its details in the NFT transaction list in the upper right corner of NFT Marketplace, and select **Purchases**.

### **Make an offer in Mobile App**

**Step 1**: Enter Zecrey NFT Marketplace on L2-Legend, find the NFT you want and click "**Make Offer**", set a price and a time limit for this offer. The offer will be automatically canceled if it's not accepted within the set duration.

<figure><img src="/files/UBXyLbOJ1X2nF1FzsdyT" alt=""><figcaption></figcaption></figure>

**Step 2:** Gas fees are paid in BNB and are fixed at 0.1% on Legend. The price will only be deducted from the buyer's account after the offer is accepted and the NFT transaction is executed, but the gas fee will not be refunded once the offer is made.

**Step 3:** Confirm the transaction. You can check its details in the NFT transaction list in the upper right corner of NFT Marketplace, and select **Offers** -> **Offers Made**.

### **Cancel an offer in Mobile App**

**Step 1:** Enter Zecrey NFT Marketplace on L2-Legend, click into the upper right corner to view **My Offers**, click into **Offers Made** under **Offers**, find the offer you made and click **Cancel Offer.**

<figure><img src="/files/tU55pZJqtPoM19nZKILR" alt=""><figcaption></figcaption></figure>

**Step 2:** Confirm to cancel the offer. Gas fees are paid in BNB and are fixed at 0.1% on Legend.


# Sell NFT

### How to sell NFT in web app?

You need to make sure you are connecting Legend [NFT Marketplace](https://nftmarket.zecrey.com/) with Zecrey extension wallet.

**Step 1**: Click your account's avatar and you can find the following screen.&#x20;

<figure><img src="/files/vTQcWOlfxVuj4ibICrVK" alt=""><figcaption></figcaption></figure>

**Step 2**: And then click "Profile", just remove the filter "Buy Now" and you can find all the NFTs you own now.

<figure><img src="/files/t46IoS75bW0mbKZrxOk3" alt=""><figcaption></figcaption></figure>

For each NFT, just click "...", you'll find the Quick Action page and click "Sell NFT".

<figure><img src="/files/vsdUacLBO6ivU8MrV9Yq" alt=""><figcaption></figcaption></figure>

**Step 4**: Fill out the price and set up duration and then click List NFT button to confirm the sell. You'll need to sign the transaction with Zecrey extension wallet.

<figure><img src="/files/GqVIOYrvTNDqNjlpukXl" alt=""><figcaption></figcaption></figure>

### **How to list an NFT in Mobile?**

**Step 1:** Switch to Zecrey L2-Legend wallet and click on "**NFT**" beside the **Assets** on the homepage to view your NFT assets sorted by collections. Select the NFT you want and click "**Sell**".

<figure><img src="/files/ADxqGTa34uLcCLrRl1QZ" alt=""><figcaption></figcaption></figure>

**Step 2:** Set the price and the time limit for the listing. The listing will be automatically canceled if it's not purchased within the set duration. Gas fees are paid in BNB and are fixed at 0.1% on Legend.

<figure><img src="/files/Q0BJO4sAAGUD8nQYxw8g" alt=""><figcaption></figcaption></figure>

**Step 3:** Confirm to finish the listing. You can cancel it any time in **My Orders** -> **Ordering** before it's purchased.

### **How to accept an offer?**

**Step 1:** Enter Zecrey NFT Marketplace on L2-Legend, and click into the upper right corner to view **My Orders**, click into **Ordering** or **Offer Received** under **Offers**, and find the offer you want to accept.

<figure><img src="/files/wRAwesnpAzmDCbnb2V2t" alt=""><figcaption></figcaption></figure>

**Step 2:** Click on **Approve Offer** and check the details. Gas fees are paid in BNB and are fixed at 0.1% on Legend.

**Step 3:** Confirm to finish the transaction. You can check its details in **My Orders** -> **Sold**.

### **How to cancel a listing?**

**Step 1:** Enter Zecrey NFT Marketplace on L2-Legend, click into the upper right corner to view **My Orders**, click into **Ordering**, find the listing you want to cancel and click **Cancel Order.**

<figure><img src="/files/sNpOim3bczwfPhS0Qg1S" alt=""><figcaption></figcaption></figure>

**Step 2:** Confirm to cancel the offer. Gas fees are paid in BNB and are fixed at 0.1% on Legend. You can enter **My Orders** to view it and choose to **Sell Again** with a different price and time limit.


# Transfer NFT

### How to transfer NFT in Web App

You need to make sure you are connecting Legend [NFT Marketplace](https://nftmarket.zecrey.com/) with Zecrey extension wallet.

**Step 1**: Click your account's avatar and you can find the following screen.&#x20;

<figure><img src="/files/vTQcWOlfxVuj4ibICrVK" alt=""><figcaption></figcaption></figure>

**Step 2**: And then click "Profile", just remove the filter "Buy Now" and you can find all the NFTs you own now.

<figure><img src="/files/t46IoS75bW0mbKZrxOk3" alt=""><figcaption></figcaption></figure>

For each NFT, just click "...", you'll find the Quick Action page and click "Transfer NFT".

<figure><img src="/files/grIXS71XbbthdraKi5XL" alt=""><figcaption></figcaption></figure>

**Step 3**: Fill out the Legend L2 address you want to transfer and click "Transfer" button to pop up Zecrey extension to sign the transaction.

<figure><img src="/files/qUNpRPmwHWpfc6X5eYM4" alt=""><figcaption></figcaption></figure>

### **How to transfer NFT in Mobile App**

**Step 1:** Switch to Zecrey L2-Legend wallet and click on "**NFT**" beside the **Assets** on the homepage to view your NFT assets sorted by collections. Select the NFT you want and click "**Send**".

<figure><img src="/files/wZMj3CmRjJsM0oTo2pzG" alt=""><figcaption></figcaption></figure>

**Step 2:** Enter another Legend L2 address suffixed with ".zec" to receive the NFT. You can also scan the QR code of the receiver's L2 address. Gas fees are paid in BNB and are fixed at 0.1% on Legend.

<figure><img src="/files/wpCT3YS2UPq2UZl8Umme" alt=""><figcaption></figcaption></figure>

**Step 3:** Confirm the transaction. You can view the details in **My Transactions** of **Trade Center**.


# Withdraw NFT

### How to withdraw NFT from L2 to L1 in Web App

You need to make sure you are connecting Legend [NFT Marketplace](https://nftmarket.zecrey.com/) with Zecrey extension wallet.

**Step 1**: Click your account's avatar and you can find the following screen.&#x20;

<figure><img src="/files/vTQcWOlfxVuj4ibICrVK" alt=""><figcaption></figcaption></figure>

**Step 2**: And then click "Profile", just remove the filter "Buy Now" and you can find all the NFTs you own now.

<figure><img src="/files/t46IoS75bW0mbKZrxOk3" alt=""><figcaption></figcaption></figure>

For each NFT, just click "...", you'll find the Quick Action page and click "Withdraw NFT".

<figure><img src="/files/0458Ompslk0gtfJ9wpME" alt=""><figcaption></figcaption></figure>

**Step 3**: After click Withdraw NFT option, fill out the L1 address or just click "My BNB Chain Address" to withdraw to your own L1 address.

Click "Withdraw" button and pop up the extension wallet to sign the transaction.

<figure><img src="/files/6jRpGSMZhScdPSSXRi9I" alt=""><figcaption></figcaption></figure>

### **How to withdraw NFT from L2 to L1 in Mobile App**

**Step 1:** Switch to Zecrey L2-Legend wallet and click on "**NFT**" beside the **Assets** on the homepage to view your NFT assets sorted by collections. Select the NFT you want and click "**Withdraw**".

<figure><img src="/files/EvwYNEhIJlxSA1fUYOWk" alt=""><figcaption></figcaption></figure>

**Step 2:** Enter a BNB L1 address to receive the NFT. Click "**My address**" to autofill your L1 address or input another BEP-20 L1 address. Gas fees are paid in BNB and are fixed at 0.1% on Legend.

<figure><img src="/files/7F44s2Uq5GaSA412O4NZ" alt=""><figcaption></figcaption></figure>

**Step 3:** Confirm the transaction. You can view the details in **My Transactions** of **Trade Center**.


# View NFT Assets

Click on "**NFT**" beside the **Assets** on the homepage to view your NFTs sorted by collections. You can search for an NFT collection, view the activity and info of a collection, and click on an NFT to see its details. Swift NFT transaction functions including **Transfer**, **Sell** and **Withdraw** are accessible at the bottom of the detail page.

<figure><img src="/files/d3SPdzk08iEJuDsb4vL9" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/nkFO9F4tr8vV98p5Tci4" alt=""><figcaption></figcaption></figure>


# Manage NFT Transactions

Enter Zecrey NFT Marketplace on L2-Legend, and click into the upper right corner to view **My Orders**, where all of your NFT transactions are recorded. You can view and manage them in different categories including **Ordering**, **Offers**, **Purchases** and **Sold**.

### **Ordering**

**Ordering** is all the ongoing transactions that haven't been finished yet, and it could be the offers you received, the offers you made, and the NFTs you listed for sale. Click to see the details and proceed to the next step according to the transaction type.

<figure><img src="/files/6GZ8VxtNeYGBQYEuGW5G" alt=""><figcaption></figcaption></figure>

### **Offers**

**Offers** include offers you made and offers you received, shown in **Offer Made** and **Offer Received** respectively. Click to see the details and proceed to the next step according to the transaction type.

<figure><img src="/files/Yn9VFeVLXnkVIUudZGL5" alt=""><figcaption></figcaption></figure>

### **Purchases**

**Purchases** are the records of the NFTs you acquired by purchase. Click to see the details and view the transaction on Zecrey Explorer.

<figure><img src="/files/2aZZT5F4frizf4qFnpmT" alt=""><figcaption></figcaption></figure>

### **Sold**

**Sold** is the records of the NFTs you sold to others. Click to see the details and view the transaction on Zecrey Explorer.

<figure><img src="/files/EmmZxuDkdMQwM8ImDzxW" alt=""><figcaption></figcaption></figure>


