# Welcome to Volary.io

## Overview

At Volary, we are pioneering the real-world application of blockchain technology to redefine control over digital identities, assets, and exchanges. Our platform is engineered to integrate essential blockchain capabilities, laying the groundwork necessary for a wide range of distributed services and offerings.

### <mark style="color:blue;">Addressing Core Challenges</mark>

Volary stands at the forefront of tackling key challenges in the realms of self-sovereign digital identity, data security, asset management, and the facilitation of distributed economies. Our approach not only identifies these pivotal issues but also provides innovative and practical solutions, ensuring a secure, efficient, and user-centric experience.

### <mark style="color:blue;">Empowering Users and Developers</mark>

We are committed to empowering our users and developers with a plethora of resources and comprehensive guides, all tailored to enhance your engagement within the Volary ecosystem. Whether you are building new solutions or seeking to expand your knowledge, Volary is your trusted partner.

Our platform boasts an expansive suite of tools and Software Development Kits (SDKs) designed to streamline the development process. These resources empower developers to build seamlessly upon our robust and reliable foundation, fostering innovation and creativity in the blockchain space.

## Quick links

{% content-ref url="/pages/SktJBjWCN3saOsPooYZz" %}
[What we do](/overview/what-we-do)
{% endcontent-ref %}

## Get Started

We've put together some helpful guides for you to get a headstart with our Template Library and SDKs.

{% content-ref url="/pages/XJqm0x1pn18yzQlmNFWA" %}
[Get Started](/template-library/get-started)
{% endcontent-ref %}

{% content-ref url="/pages/ybonC1jMeKcfSHDnqKkF" %}
[Kickstart with our SDKs](/sdks-guide/kickstart-with-our-sdks)
{% endcontent-ref %}

{% content-ref url="/pages/ZTROZ8RfF4hB7cDYTlI8" %}
[KRYPTOKASE](/kryptokase/kryptokase-overview)
{% endcontent-ref %}


# What we do

## Overview

### 📍 Aerie: A New Era in NFT Minting and Management

Dive into the future with Volary's Aerie Platform – a trailblazing platform redefining the NFT landscape. Our innovative approach unlocks unprecedented possibilities in NFT minting and management, setting a new standard for digital asset interaction.&#x20;

Experience the seamless fusion of security and efficiency, tailored for the dynamic world of digital art and assets.

### 📍 Revolutionary SDKs

At Volary, we don't just follow trends – we set them.&#x20;

Our comprehensive suite of Software Development Kits (SDKs) is your gateway to mastering blockchain's most sought-after token standards, including ERC721, ERC1155, and the pioneering Soulbound tokens.&#x20;

Whether you're a seasoned developer or just starting, our SDKs offer the perfect blend of simplicity and power, enabling you to effortlessly forge digital assets of the future.

### 📍 Smart Contract Library

Unlock the full potential of blockchain with our intuitive Smart Contract Library. Designed for innovators and visionaries, this resource eliminates the complexities of smart contract coding. Jumpstart your blockchain journey with our pre-crafted, adaptable smart contracts, and transform your creative ideas into reality faster and more efficiently than ever before.

### 📍 **Your Partner in Blockchain Innovation**

At Volary, we are more than just a technology provider – we are your partner in innovation. Our platform is a beacon for creators, developers, and disruptors, a place where cutting-edge technology meets boundless creativity.&#x20;

Join us in shaping the future of the digital world, where your vision has the power to redefine what's possible in blockchain technology.

## Aerie: Video Overview

Got 10 minutes? Check out a video overview of Aerie:

{% embed url="<https://www.youtube.com/watch?t=224s&v=45cfnNdiRJI>" %}

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f4e8">📨</span> <a href="#kickstart-with-our-sdks">Kickstart with our SDKs</a></summary>

</details>

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f575">🕵️</span> <a href="#template-library">Template Library</a></summary>

</details>


# Kickstart with our SDKs

At Volary, we provide a comprehensive suite of Software Development Kits (SDKs) designed to empower developers in the rapidly evolving world of blockchain technology. Our SDKs cater to a wide range of blockchain platforms and functionalities, ensuring you have the tools you need to build innovative and efficient blockchain solutions.

## Our Diverse Range of SDKS

1. **EVM-Chains SDK**: Dive into the Ethereum Virtual Machine (EVM) ecosystem with our robust SDK, designed to streamline development on EVM-compatible chains.
2. **Solana Lib**: Leverage the speed and efficiency of the Solana blockchain with our dedicated Solana library, tailored for high-performance decentralized applications.
3. **Casper Lib**: Explore the potential of the Casper network with our Casper library, enhancing your ability to build scalable and secure blockchain solutions.
4. **ENS Lib**: Integrate Ethereum Name Service (ENS) functionalities seamlessly into your applications with our specialized ENS library.
5. **Tokenomics Lib**: Master the art of token economics with our Tokenomics library, offering tools and insights to design effective token models.
6. **XY-Finance Lib**: Innovate in decentralized finance (DeFi) with our XY-Finance library, providing access to advanced financial protocols and services.
7. **Wallet Lib**: Create secure and user-friendly wallets with our Wallet library, ensuring a safe and intuitive user experience.
8. **Explorer Lib**: Develop blockchain explorers with ease using our Explorer library, enabling users to track and analyze blockchain transactions and activities.

## Supported Chains :chains:

Our SDKs are compatible with a variety of leading blockchain networks, including:

* **Solana**: Known for its high throughput and low transaction costs.
* **EVM Chains**: Embrace the vast EVM ecosystem, including Ethereum, Binance Smart Chain, and more.
* **Casper**: A future-proof blockchain designed for enterprise adoption.
* **Near**: Pioneering a scalable and user-friendly blockchain experience.

## Your Journey Begins Here :man\_running:

Whether you are developing decentralized applications, crafting innovative token models, or building the next generation of blockchain infrastructure, Volary's SDK Guide is your go-to resource. Explore our libraries, harness the power of supported chains, and push the boundaries of what's possible in the blockchain space.

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="26d3">⛓️</span><a href="/pages/iSC8c8vCTP7RDFMYtX92"> Blockchain SDKs</a></summary>

</details>

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f3af">🎯</span><a href="/pages/0v8vOIcrrqsvdBWUSPEx"> DAG EVM Hybrid Layer 1</a></summary>

</details>

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f916">🤖</span> <a href="/pages/dgoMdEDUHjkLh2zYtl0a">AI Guide</a></summary>

</details>


# Blockchain SDKs

<details>

<summary><a href="/pages/cOXkoutd8Dp0rk8m285B">✔️ Solana SDK</a></summary>

A toolkit for developing decentralized applications on the Solana blockchain, featuring high throughput and low transaction costs.

</details>

<details>

<summary><a href="/pages/N5Rat7gJ2OnW7xwZbDM2">✔️ EVM Chains SDK</a></summary>

A development kit for creating applications compatible with Ethereum Virtual Machine (EVM)-based blockchains.

</details>

<details>

<summary><a href="/pages/FOEUcVTpEDJCufnJU9kE">✔️ Tokenomics SDK</a></summary>

A framework designed to assist in creating and managing digital economies and token-based models in applications.

</details>

<details>

<summary><a href="/pages/uDigXIeU1g2FV4NlIe6c">✔️ Storage SDK</a></summary>

A set of tools and libraries for integrating decentralized storage solutions in blockchain or web applications.

</details>

<details>

<summary><a href="/pages/4NbiM5rFbS9nTPf2a66P">✔️ Casper SDK</a></summary>

A toolkit for building and deploying applications on the Casper Network, a proof-of-stake blockchain ecosystem.

</details>

<details>

<summary><a href="/pages/DgTEHWGku0LmgDlfX87e">✔️ XY-Finance SDK</a></summary>

Provides tools for seamless integration of cross-chain and multi-chain functionalities in decentralized finance (DeFi) applications.

</details>

<details>

<summary><a href="/pages/yaV0iTNJh5cbA1hnNpLn">✔️ Wallet SDK</a></summary>

A comprehensive suite for integrating wallet functionalities, enabling secure management and transaction of digital assets.

</details>

<details>

<summary><a href="/pages/g58SVRiii2KcXOWWPqOM">✔️ Explorer SDK</a></summary>

A toolkit for developing blockchain explorers, facilitating the tracking and visualization of transactions and activities on a blockchain network.

</details>


# Solana SDK

The Solana lib SDK is a powerful toolkit designed to provide developers with seamless access to the Solana blockchain. This SDK simplifies the process of building and deploying decentralized applications on the Solana network, allowing developers to interact with the blockchain using a collection of pre-built functions and features.

&#x20;

With Solana lib, developers gain the ability to generate new accounts, retrieve existing accounts from private keys, send and receive SOL, create new tokens, transfer tokens, and mint NFTs. By incorporating these functionalities, developers can seamlessly integrate Solana into their projects, resulting in the creation of fast, secure, and scalable decentralized applications.


# generateAccount

## Description

The `generateWallet` function utilizes the Solana Keypair library to generate a new public and private key pair. It conveniently returns an object that includes the generated public and private keys represented as strings.

## Parameter

This function does not take any parameters

## Response

| Property     | Type   | Description                                  |
| ------------ | ------ | -------------------------------------------- |
| `publicKey`  | string | The generated public key in Base58 encoding  |
| `privateKey` | string | The generated private key in Base58 encoding |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

&#x20;

You can install Volary SDK using either **npm** or **yarn**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `generateAccount` request using the Volary SDK:

```javascript
// import Nest SDK
import { Solana } from '@nest25/solana-lib';

// create a new instance of the SDK
const Sol = new Solana();

async function main() {
  // generate a new wallet
  let wallet = await Sol.generateAccount();
  console.log(wallet);
}

main();
```

### Response

```sh
 {
        wallet: {
          publicKey: 'J3k6z8xgH8YiDxw18oxnjYQubBfcyTTQjPieHYvxP3e2',
          privateKey: '97pdpveR9T9KFFpmiBy5EpL1Te6vV6nKHNXAgfVMV8nd7y2V7EfqcfyzmRWJ5utLEkA2ThCWWxqmTw94Hv3nt34'
        }
}
```

## Use Cases

* **Decentralized Applications (DApps):** Developers building decentralized applications on the Solana blockchain can utilize this function to generate new public and private key pairs for their users.
* **Crypto Wallets:** Crypto wallets can leverage the `generateWallet` function to generate new key pairs for users who wish to create a new wallet.
* **Cryptocurrency Exchanges:** Cryptocurrency exchanges can integrate the `generateWallet` function to generate new key pairs for users who want to create a new account on their platform.


# getAccountFromSecretKey

## Description

The `getWalletFromSecretKey` takes a secret key as input and generates a public key and a private key. The generated keys can be used to interact with various blockchain networks.

## Parameter

| Parameter   | Type   | Description                             |
| ----------- | ------ | --------------------------------------- |
| `secretKey` | string | A string representation of a secret key |

## Response

| Property     | Type   | Description                               |
| ------------ | ------ | ----------------------------------------- |
| `publicKey`  | string | A string representation of a public key   |
| `privateKey` | string | A string representation of a private key. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either `npm` or `yarn`. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `getAccountFromSecretKey` request using the Volary SDK:

<pre class="language-javascript"><code class="lang-javascript">// import Nest SDK
import { Solana } from '@nest25/solana-lib';

// create a new instance of the SDK
const Sol = new Solana();

<strong>async function main() {
</strong>  // get the account from the secret key
  let wallet = Sol.getAccountFromSecretKey(your-secret-keyThe getWalletFromSecretKey function is a JavaScript function that takes a secret key as input and generates a public key and a private key. The generated keys can be used to interact with various blockchain networks.The getWalletFromSecretKey function is a JavaScript function that takes a secret key as input and generates a public key and a private key. The generated keys can be used to interact with various blockchain networks.The getWalletFromSecretKey function is a JavaScript function that takes a secret key as input and generates a public key and a private key. The generated keys can be used to interact with various blockchain networks.);
  console.log(wallet);
}

main();
</code></pre>

### Response

```sh
  {
        publicKey: '9jBxBwCHt6R5CgxhpjH43M6141JMCdjccjfWufnEB2r8',
        privateKey: '4DfysqXg2xiG3XnychN9gF1ffPs8omn1QQCzLJBsUJA6ZQwKCqVWF11YbZx29kmmHYDzs2GcA6S1D4QeuHiYRYjN'
}
```

## Use Cases

* **Crypto Wallets:** Crypto wallets can leverage this function to generate a secure public and private key pair for a user's account.
* **Decentralized Applications (DApps):** DApps can integrate the getAccountFromSecretKey function to generate a public and private key pair for users to interact with the application.
* **Blockchain Developers:** Blockchain developers can utilize the getAccountFromSecretKey function to generate a public and private key pair for testing and development purposes.


# getBalance

## Description

The `getBalance` function you provided is specific to the Solana blockchain. It retrieves the balance of a given address.

## Parameter

| Parameter | Data Type | Description                                                                                 |
| --------- | --------- | ------------------------------------------------------------------------------------------- |
| `env`     | string    | The environment or network (e.g., "mainnet", "testnet") in which the Solana address exists. |
| `address` | string    | The Solana address for which the balance needs to be retrieved.                             |

## Response

| Field     | Data Type | Description                                                                          |
| --------- | --------- | ------------------------------------------------------------------------------------ |
| `code`    | number    | A numeric value indicating the execution status (1 for success, 0 for error).        |
| `error`   | any       | The error object containing details about the encountered error, if applicable.      |
| `balance` | number    | The balance of the specified Solana address in SOL (converted to a readable format). |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either `npm` or `yarn`. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `getAccountFromSecretKey` request using the Volary SDK:

```javascript
const {Solana} = require("@nest25/solana-lib")

const Sol = new Solana();

async function main () {
    const balance = await Sol.getBalance("HyAEtjw6d4qEf7ew7LUN8UV7Hes3wXk9yBL6kG9yCpfP");
    console.log(balance);
}

main();
```

### Response

```sh
 { code: 1, balance: 18.692812614 }
```

## Use Cases

* This `getBalance function` can be used for various purposes such as displaying the account balance to the user, verifying account funds, or performing balance-related calculations.


# sendSOL

## Description

The `sendSOL` function enables the transfer of SOL tokens between two wallets on the Solana blockchain.&#x20;

## Parameter

| Name                  | Type   | Description                                    |
| --------------------- | ------ | ---------------------------------------------- |
| `fromWalletSecretKey` | string | The secret key of the wallet sending SOL       |
| `toWalletAddress`     | string | The public address of the wallet receiving SOL |
| `amount`              | number | The amount of SOL to be transferred            |

## Response

| Name        | Type   | Description                                          |
| ----------- | ------ | ---------------------------------------------------- |
| `signature` | string | The transaction signature returned by the blockchain |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either `npm` or `yarn`. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `sendSOL` request using the Volary SDK:

```javascript
// import Nest SDK
import { Solana } from '@nest25/solana-lib';

// create a new instance of the SDK
const Sol = new Solana();

async function main() {
 // send SOL to an address
  let receipt = await Sol.sendSOL(
    '3Q6Wn4hggUWuiD3iEjGaMYurKBywTXiWWjxp1yGCQvFvWPmZ4dff8SXuUEknfLRzqXfobSB46k9rbmDzjrDE3ZqK',
    'HyAEtjw6d4qEf7ew7LUN8UV7Hes3wXk9yBL6kG9yCpfP',
    '1',
  )
  console.log({receipt});
}

main();
```

### Response

```sh
{
   SUYgr3ZrqUKaTD5vJok2AzzfKg2mkP8ZXzUDH1PH55uKKHxwUrA8w23SKxm7AgV8yyTrTHQ8BNhcbhqx15z7NMH
}
```

## Use Cases

* **Sending payments:** The function can be used to send SOL payments from one wallet to another, enabling users to pay for goods and services on Solana-based platforms.
* **Exchanges:** The function can be used by cryptocurrency exchanges to facilitate the buying and selling of SOL.
* **Wallets:** The function can be integrated into Solana-based wallets to allow users to send and receive SOL tokens.


# mintNFT

## Description

The `mintNFT` function allows for the creation of a new NFT (non-fungible token) using the Metaplex library and returns the newly created NFT

## Parameter

| Parameter    | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| `privateKey` | string | Private key of the user's account |
| `uri`        | string | URI of the NFT                    |
| `nftName`    | string | Name of the NFT                   |
| `nftSymbol`  | string | Symbol of the NFT                 |

## Response

| Property    | Type   | Description                                     |
| ----------- | ------ | ----------------------------------------------- |
| `uri`       | string | URI of the created NFT                          |
| `name`      | string | Name of the created NFT                         |
| `symbol`    | string | Symbol of the created NFT                       |
| `publicKey` | string | Public key of the user's account                |
| `metadata`  | string | Metadata of the created NFT including its image |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either `npm` or `yarn`. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `mintNFT` request using the Volary SDK:

```javascript
// import Nest SDK
import { Solana } from '@nest25/solana-lib';

// create a new instance of the SDK
const Sol = new Solana();

async function main() {
  // mint NFT and receive the mint address
  let receipt = await Sol.mintNFT(
    'your-private-key',
    'https://gateway.pinata.cloud/ipfs/QmXA4C9ywuHeS425pJVd5sCLRP4oQgoPTsNdeRpDQizR6d?_gl=1*t4k2m9*_ga*MTYyMDQ1NTgwNC4xNjc4NDI2ODQ1*_ga_5RMPXG14TE*MTY3ODQzODc2Ni40LjAuMTY3ODQzODc4My40My4wLjA',
    'Harsh',
    'BHATT',
  );
  console.log(receipt.mintAddress);
}

main();
```

### Response

```sh
 PublicKey [PublicKey(EtfzPGmMjfm2dQRuwemFtheMX2zCHr7FAdkv6gtaFBC1)] 
```

## Use Cases

* **Digital Art Marketplaces:** Digital art marketplaces can leverage this function to create NFTs for digital artworks.
* **Gaming Platforms:** Gaming platforms can utilize the mintNFT function to create NFTs for in-game items, virtual assets, and collectibles.
* **Music and Media Industry:** The music and media industry can make use of the mintNFT function to create NFTs for unique digital assets such as songs, videos, and other digital content.


# estimateTransferToken

## Description

The `estimateTransferToken` function is an asynchronous function that provides an estimate of the transfer token amount. It returns an object containing the code and the result, or an error object if an error occurs during execution.

## Parameter

This function does not take any parameter.

## Response

| Field    | Data Type | Description                                                                   |
| -------- | --------- | ----------------------------------------------------------------------------- |
| `code`   | Number    | A numeric value indicating the execution status (1 for success, 0 for error). |
| `result` | String    | The estimated transfer token amount.                                          |
| `error`  | String    | The error message if an error occurs during execution.                        |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either `npm` or `yarn`. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `estimateTransferToken` request using the Volary SDK:

```javascript
const {Solana} = require("@nest25/solana-lib")

const Sol = new Solana();

async function main () {
    const receipt = await Sol.estimateTransferToken();
    console.log(receipt);
}

main();
```

### Response

```sh
{ code: 1, result: '0.000005' }
```

## Use Cases

* **Obtaining an estimate of the transfer token amount:** By invoking this function, you can fetch an estimated value for the transfer token amount.
* **Checking execution status:** The returned `code` value can be used to determine the success or failure status of the function call.
* **Retrieving the estimated amount:** If the estimation is successful, the resulting estimated transfer token amount will be provided for further reference.
* **Handling errors:** In case of any error during the execution of the function, the returned object will contain the error message.


# estimateMint

## Description

The `estimateMint` function is an asynchronous function that provides an estimate of the minting amount. It returns an object containing the code and the result, or an error object if an error occurs during execution.

## Parameter

This function does not take any parameter.

## Response

| Field    | Data Type | Description                                                                   |
| -------- | --------- | ----------------------------------------------------------------------------- |
| `code`   | Number    | A numeric value indicating the execution status (1 for success, 0 for error). |
| `result` | String    | The estimated minting amount                                                  |
| `error`  | String    | The error message if an error occurs during execution.                        |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either `npm` or `yarn`. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `estimateMint` request using the Volary SDK:

```javascript
const {Solana} = require("@nest25/solana-lib")

const Sol = new Solana();

async function main () {
    const receipt = await Sol.estimateMint();
    console.log(receipt);
}

main();
```

### Response

```sh
 { code: 1, result: '0.00001' }
```

## Use Cases

* **Obtaining an estimate of the minting amount:** By invoking this function, you can fetch an estimated value for the minting amount.
* **Checking execution status:** The returned `code` value can be used to determine the success or failure status of the function call.
* **Retrieving the estimated amount:** If the estimation is successful, the resulting estimated minting amount will be provided for further reference.
* **Handling errors:** In case of any error during the execution of the function, the returned object will contain the error message.


# estimateSOLTransfer

## Description

The `estimateSOLTransfer` function is an asynchronous function that provides an estimate of the SOL transfer amount.

It returns an object containing the code and the result, or an error object if an error occurs during execution.

## Parameter

This function does not take any parameter.

## Response

| Field    | Data Type | Description                                                                   |
| -------- | --------- | ----------------------------------------------------------------------------- |
| `code`   | Number    | A numeric value indicating the execution status (1 for success, 0 for error). |
| `result` | String    | The estimated SOL transfer amount                                             |
| `error`  | String    | The error message if an error occurs during execution.                        |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either `npm` or `yarn`. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `estimateSOLTransfer` request using the Volary SDK:

```javascript
const {Solana} = require("@nest25/solana-lib")

const Sol = new Solana();

async function main () {
    const receipt = await Sol.estimateSOLTransfer();
    console.log(receipt);
}

main();
```

### Response

```sh
 { code: 1, result: '0.000005' }
```

## Use Cases

* **Obtaining an estimate of the SOL transfer amount:** By invoking this function, you can fetch an estimated value for the SOL transfer amount.
* **Checking execution status:** The returned `code` value can be used to determine the success or failure status of the function call.
* **Retrieving the estimated amount:** If the estimation is successful, the resulting estimated SOL transfer amount will be provided for further reference.
* **Handling errors:** In case of any error during the execution of the function, the returned object will contain the error message.


# estimateMintToken

## Description

The `estimateMintToken` function is an asynchronous function that provides an estimate of the minted token amount.&#x20;

It returns an object containing the code and the result, or an error object if an error occurs during execution.

## Parameter

This function does not take any parameter.

## Response

| Field    | Data Type | Description                                                                   |
| -------- | --------- | ----------------------------------------------------------------------------- |
| `code`   | Number    | A numeric value indicating the execution status (1 for success, 0 for error). |
| `result` | String    | The estimated minte token amount.                                             |
| `error`  | String    | The error message if an error occurs during execution.                        |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either `npm` or `yarn`. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `estimateMintToken` request using the Volary SDK:

```javascript
const {Solana} = require("@nest25/solana-lib")

const Sol = new Solana();

async function main () {
    const receipt = await Sol.estimateMintToken();
    console.log(receipt);
}

main();
```

### Response

```sh
 { code: 1, result: '0.000005' }
```

## Use Cases

* **Obtaining an estimate of the minted token amount:** By invoking this function, you can fetch an estimated value for the minted token amount.
* **Checking execution status:** The returned `code` value can be used to determine the success or failure status of the function call.
* **Retrieving the estimated amount:** If the estimation is successful, the resulting estimated minted token amount will be provided for further reference.
* **Handling errors:** In case of any error during the execution of the function, the returned object will contain the error message.


# createToken

## Description

The `createToken` function allows for the creation of a new token on the Solana blockchain.&#x20;

## Parameter

| Name         | Type   | Description                                                      |
| ------------ | ------ | ---------------------------------------------------------------- |
| `privatekey` | string | Private key of the account that will be used to create the token |
| `amount`     | number | Amount of tokens to mint                                         |

## Response

| Name   | Type   | Description                                    |
| ------ | ------ | ---------------------------------------------- |
| `mint` | string | The public key of the newly created token mint |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `createToken` request using the Volary SDK:

```javascript
// import Nest SDK
import { Solana } from '@nest25/solana-lib';

// create a new instance of the SDK
const Sol = new Solana();

async function main() {
  // create a new token
  let receipt = await Sol.createToken(
    'your-private-key',
    100000000000,
  );
  console.log(receipt);
}

main();
```

### Response

```
BwBuqE9hoBmzBNtE2XS7X4icrAC327QQ393rncLENGft
```

## Use Cases

* **Token Issuers:** The function can be used by token issuers to create and issue their own custom tokens on the Solana blockchain.
* **DeFi Applications:** The function can be used by DeFi applications to create custom tokens that can be used for a variety of purposes such as staking, governance, and liquidity provision.
* **NFT Marketplaces:** The function can be used by NFT marketplaces to create unique tokens for each NFT that is listed on the platform.


# transferToken

## Description

The `transferToken` function transfers a specified amount of a token from one address to another using the private key associated with the sender's wallet and returns a transaction signature.

## Parameter

The function does not take any parameters.

## Response

| Name         | Type   | Description                                |
| ------------ | ------ | ------------------------------------------ |
| `publicKey`  | string | The generated public key in Base58 format  |
| `privateKey` | string | The generated private key in Base58 format |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

Here is an example of how to make a `transferToken` request using the Volary SDK:

<br>

```javascript
// import Nest SDK
import { Solana } from '@nest25/solana-lib';

// create a new instance of the SDK
const Sol = new Solana();

async function main() {
  // transfer token to another wallet
  let receipt = await Sol.transferToken(
    '2VckPpaPxNuzQrwzFf6NPFNh8dB9qGzoGBEJi9QRFNrGhPWYvPuUcBnDJbVwHEgkPUtwvoTxdKpjLh3wzUEGXQ3A',
    50,
    '3R9zwizFGE7seURD2H8MuAigmCRgRLj7zh8HZaXqU7fE',
  );
  console.log(receipt);
}

main();
```

### Response

```
5vyVarLuPLYscZB9svFXLFruLbhV18TsZ2eccqdawYaM2rz82QENVj2iryZkbE4P4w97SgUcNDuaamtMFWUSHTrT
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to generate new key pairs for their users.
* **Online Marketplaces:** The function can be used by online marketplaces to facilitate payments using Solana.
* **Cryptocurrency Exchanges:** The function can be used by cryptocurrency exchanges to generate new key pairs for their users to use on Solana.


# EVM Chains SDK

The EVM Chains Library SDK is a comprehensive development toolkit, granting developers seamless access to various blockchain networks, including Finance, Ethereum, Polygon, Kylatn, and more.

&#x20;

This SDK is purposefully crafted to facilitate the streamlined creation and deployment of decentralized applications across various blockchain networks. Equipped with an extensive array of pre-built functions and features, developers can effortlessly interact with different blockchain networks.&#x20;

These capabilities include sending and receiving transactions, retrieving blockchain data, querying blockchain state, and much more.


# BulkNFT


# deployContract

## Description

The **`deployContract`** function returns a Promise that resolves to a newly deployed ERC721 contract on the specified blockchain network.

The function takes in the blockchain type, a private key, and a base URI for the contract's metadata. The returned contract object can then be used to interact with the deployed contract on the blockchain

## Parameters

| Parameter    | Type   | Description                                                                                                               |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `blockchain` | string | Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `privateKey` | string | Requires a private key corresponding to the account that will be used to deploy the contract.                             |
| `baseURI`    | string | Expects a string that represent the Token's base URI                                                                      |

## Response

| Property          | Type   | Description                                                            |
| ----------------- | ------ | ---------------------------------------------------------------------- |
| `Promise<Object>` | object | Returns an object containing the transaction hash and contract address |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deployContract` request using the Volary SDK:

<br>

```
// import the Nest SDK
const { BulkNft } = require('@nest25/evm-chains-lib');

// create a new instance of the SDK
const bulkNFT = new BulkNft();
// call the deployContract method
const main = async () => {
    // deploy a contract on the Polygon network
    const contract = await bulkNFT.deployContract(
        'polygon',
        'dd2cfa6243af4e467dcfe1b45402bfe2bca32acc6d27565b3791db5de1c9dd49',
        'bingo',
    );
    // print the contract address
    console.log(contract.address);
    expect(contract).toHaveProperty('address');
};
// call the main function
main();
```

### Response

```
Transaction Hash: 0xa81b67ec1e80d5d6c6c6bdc59201437a9be7174108dbfe71b6348f44645f5264, Contract Address: 0x5aAB360f4eEC9C823175711d22D7D0C920D4481a
```

### Use Cases

* **Contract deployment:** The primary use case for the **`deployContract`** function is to deploy an ERC721 contract on a specified blockchain network. This allows users to create and deploy their unique tokens on a blockchain.
* **Token metadata**: The **`deployContract`** function takes in a base URI parameter, which can be used to specify the metadata for the token contract. This can include information such as token name, description, and image, and is commonly used to provide additional context about a token.
* **Automated token deployment:** The **`deployContract`** function can be integrated into automated deployment workflows, allowing developers to automatically deploy new token contracts as part of their continuous integration and deployment process.


# bulkMint

## Description

The `bulkMint` function is an asynchronous function that takes in a blockchain type, a contract address, a receiver address, a count, and a private key. It mints a specified number of ERC721 tokens to the given receiver address and returns the transaction receipt.

## Parameters

| Parameter         | Type   | Description                                                                                                               |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `blockchain`      | string | Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `contractAddress` | string | Requires a contract address of the token                                                                                  |
| `receiver`        | string | Expects the receiving account address for the transfer                                                                    |
| `count`           | string | Requires a count parameter indicating the number of tokens to transfer                                                    |
| `privateKey`      | string | The private key of the account used for token transfer                                                                    |

## Response

| Property          | Type   | Description                             |
| ----------------- | ------ | --------------------------------------- |
| `Promise<Object>` | object | Returns the transaction receipt object. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a bulkMint request using the Volary SDK:

```
// import the Nest SDK
const { BulkNft } = require('@nest25/evm-chains-lib');

// create a new instance of the SDK
const bulkNFT = new BulkNft();
// define the main function
const main = async () => {
    // call the bulkMint method
    const receipt = await bulkNFT.bulkMint(
        'klay',
        '0x83f1cec2f0526427330775a6cd2fc15b52eaa0ce',
        '0x13CC66D6611bb754647Bf2977881eA0e35A48FB4',
        '100',
        '3160dea9213bb3673b10a8c61103004e80a77046ea991778824f9d2b0a539835',
    );

    // print the receipt
    console.log({ receipt });
};
// call the main function
main();
```

### Response

```
{
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 230,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0x281d66', _isBigNumber: true },
    to: '0x83F1ceC2f0526427330775A6CD2FC15B52eaA0cE',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0x9d2450a6000000000000000000000000000000000000000000000000000000000000006400000000000000000000000013cc66d6611bb754647bf2977881ea0e35a48fb4',
    accessList: [],
    hash: '0x4954973368c1ded4b90ae336b9f5168e9cc2be6e57396eb68f45f1338cc92546',
    v: 1,
    r: '0x8425bb110cf1b321b8bc73f87178cbbef92a2e9fec696035084f5f83a41e017e',
    s: '0x2ed9bbbbe486d2c0dc286692155725b488c1b4462f485c98e096b973e7bfeba8',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **Bulk token distribution:** The primary use case for the **`bulkMint`** function is to distribute multiple ERC721 tokens to a specified receiver address in bulk.
* **Automated token distribution:** The **`bulkMint`** function can be integrated into automated workflows for token distribution, allowing developers to automatically distribute tokens as part of their continuous integration and deployment process.


# NFT


# deployContract

## Description

The `deployContract` function is an asynchronous function that deploys a contract on a specified blockchain.

It deploys different types of contracts based on the provided contract type, blockchain, and other parameters. The function utilizes other contract-specific deployment functions to handle the deployment process.

## Parameters

| Parameter    | Data Type | Description                                             |
| ------------ | --------- | ------------------------------------------------------- |
| `contract`   | string    | The type of contract to be deployed.                    |
| `blockchain` | string    | The target blockchain for contract deployment.          |
| `privateKey` | string    | The private key associated with the deploying account.  |
| `params`     | nftParams | Additional parameters required for contract deployment. |
| `env`        | string    | The environment for contract deployment.                |

## Response

| Field   | Data Type | Description                                                                     |
| ------- | --------- | ------------------------------------------------------------------------------- |
| `code`  | Number    | A numeric value indicating the execution status (1 for success, 0 for error).   |
| `error` | any       | The error object containing details about the encountered error, if applicable. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deployContract` request using the Volary SDK:

<br>

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');
const privateKey = '0xYOUR_PRIVATE_KEY';

async function main() {
    const params = {
        name: 'TEST',
        symbol: 'TST',
    };
    const result = await nft.deployContract('erc721', 'klay', privateKey, params);
    console.log('result', result.hash);
}

main();
```

### Response

```sh
0xd56417a007ee79523c26ef47175104be43afd3f460a4c78938f2804ecd8fb069
```

### Use Cases

* **Deploying an ERC721 contract:** This function deploys an ERC721 contract on the specified blockchain, using the provided private key and deployment environment.
* **Deploying an ERC1155 contract:** If the contract type is ERC1155, this function deploys an ERC1155 contract on the target blockchain.
* **Deploying an ERC20 contract:** For the ERC20 contract type, this function deploys an ERC20 contract with the specified maximum cap, name, symbol, private key, and deployment environment.
* **Deploying a SoulBound contract:** If the contract type is SoulBound, this function deploys a SoulBound contract with the specified name, symbol, private key, and deployment environment.
* **Handling unsupported contract types:** If the provided contract type is not supported, the function returns an error indicating that the contract type is not supported.


# mint

## Description

The `mint` function is an asynchronous function that mints a new token for a specific contract on a specified blockchain.&#x20;

It supports different contract types and performs the minting operation accordingly. The function utilizes contract-specific minting functions to handle the minting

## Parameters

| Parameter         | Data Type  | Description                                                         |
| ----------------- | ---------- | ------------------------------------------------------------------- |
| `contract`        | string     | The type of contract for which the token will be minted.            |
| `blockchain`      | string     | The target blockchain on which the contract is deployed.            |
| `contractAddress` | string     | The address of the contract on the specified blockchain.            |
| `privateKey`      | string     | The private key associated with the account performing the minting. |
| `params`          | mintParams | Additional parameters required for the minting operation.           |
| `env`             | string     | The environment for the minting operation.                          |

## Response

| Field     | Data Type | Description                                                                                                      |
| --------- | --------- | ---------------------------------------------------------------------------------------------------------------- |
| `code`    | Number    | A numeric value indicating the execution status (1 for success, 0 for error).                                    |
| `error`   | any       | The error object containing details about the encountered error, if applicable.                                  |
| `receipt` | any       | The receipt object containing information about the minting transaction, such as transaction hash and addresses. |
| `tokenId` | any       | The ID of the minted token.                                                                                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `mint` request using the Volary SDK:<br>

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');
const privateKey = '0xYOUR_PRIVATE_KEY';

async function main() {
    const params = {
        receiver: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
        uri: ['1234'],
    };
    const result = await nft.mint('erc721', 'klay', '0x7a0f416cae7bd4d4f9112a6bb609423290d2945e', privateKey, params);
    console.log(result.transactionHash);
}

main();

```

### Response

```sh
0x617e90b96033b6fbe439f0e89ea54e2a76dc902489b2c602f2f2e8d0698a57d4

```

### Use Cases

* **Minting an ERC721 token:** This function mints a new ERC721 token on the specified blockchain and contract. It requires the receiver address and the URI of the token.
* **Minting an ERC1155 token:** For the ERC1155 contract type, this function mints a new ERC1155 token with the specified receiver, amount, URI, and other required parameters.
* **Minting a SoulBound token:** If the contract type is SoulBound, this function mints a new SoulBound token with the specified receiver, URI, and other parameters.
* **Handling unsupported contract types:** If the provided contract type is not supported, the function returns an error indicating that the contract type is not found.


# convertToVLRY

## Description

The `convertToVLRY` function is a synchronous function that converts an amount from USD to VLRY based on a predefined exchange rate.&#x20;

The function takes a USD amount as input and calculates the equivalent amount in VLRY using the exchange rate.

## Parameters

| Parameter   | Data Type | Description                                |
| ----------- | --------- | ------------------------------------------ |
| `usdAmount` | number    | The amount in USD to be converted to VLRY. |

## Response

| Field    | Data Type | Description                                                                     |
| -------- | --------- | ------------------------------------------------------------------------------- |
| `code`   | Number    | A numeric value indicating the execution status (1 for success, 0 for error).   |
| `error`  | any       | The error object containing details about the encountered error, if applicable. |
| `result` | Object    | An object containing the converted amount in VLRY and the exchange rate.        |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `convertToVLRY` request using the Volary SDK:<br>

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const response = nft.USDToVLRY(1);
    console.log(response);
}

main();
```

```sh
```

### Response

```sh
{ code: 1, result: { vlryAmount: 6.666666666666667, vlryRate: 0.15 } }
```

### Use Cases

* **The `convertToVLRY` function can be used to convert an amount from USD to VLRY.**\
  For example, if you have an amount in USD and you want to know the equivalent value in VLRY, you can use this function. It calculates the conversion based on the predefined exchange rate and returns the converted amount along with the exchange rate.

&#x20;


# VLRYToUSD

## Description

The `VLRYToUSD` function is a synchronous function that converts an amount from VLRY to USD based on a predefined exchange rate. The function takes a VLRY amount as input and calculates the equivalent amount in USD using the exchange rate.

## Parameters

| Parameter    | Data Type | Description                                |
| ------------ | --------- | ------------------------------------------ |
| `VLRYAmount` | number    | The amount in VLRY to be converted to USD. |

## Response

| Field    | Data Type | Description                                                                     |
| -------- | --------- | ------------------------------------------------------------------------------- |
| `code`   | Number    | A numeric value indicating the execution status (1 for success, 0 for error).   |
| `error`  | any       | The error object containing details about the encountered error, if applicable. |
| `result` | Object    | An object containing the converted amount in USD and the exchange rate.         |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `VLRYToUSD` request using the Volary SDK:<br>

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const response = nft.VLRYToUSD(1);
    console.log("response", response);
}

main();

```

```sh
```

### Response

```sh
{ code: 1, result: { usdAmount: 0.15, vlryRate: 0.15 } }
```

### Use Cases

* **The `VLRYToUSD` function can be used to convert an amount from VLRY to USD**. For example, if you have an amount in VLRY and you want to know the equivalent value in USD, you can use this function. It calculates the conversion based on the predefined exchange rate and returns the converted amount along with the exchange rate.

&#x20;


# VLRYToCRYPTO

## Description

The `VLRYToCRYPTO` function is an asynchronous function that converts an amount from VLRY to a specific cryptocurrency based on the selected blockchain.&#x20;

The function takes a VLRY amount and the blockchain symbol as input.

## Parameters

| Parameter    | Data Type | Description                                               |
| ------------ | --------- | --------------------------------------------------------- |
| `VLRYAmount` | number    | The amount in VLRY to be converted to the cryptocurrency. |
| `blockchain` | string    | The symbol or name of the blockchain for the conversion.  |

## Response

| Field    | Data Type | Description                                                                     |
| -------- | --------- | ------------------------------------------------------------------------------- |
| `code`   | Number    | A numeric value indicating the execution status (1 for success, 0 for error).   |
| `error`  | any       | The error object containing details about the encountered error, if applicable. |
| `result` | any       | The result of the conversion operation.                                         |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `VLRYToCRYPTO` request using the Volary SDK:<br>

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const response = await nft.VLRYToCRYPTO(1, 'ETH');
    console.log(response);
}

main();

```

```sh
```

### Response

```sh
{ code: 1, result: { symbol: 'ETH', amount: 0.00007652561765770977 } }
```

### Use Cases

* **The `VLRYToCRYPTO` function can be used to convert an amount from VLRY to a specific cryptocurrency based on the selected blockchain.** \
  You can provide the amount in VLRY and specify the blockchain symbol, and the function will make a request to the BC\_STACK\_URL API to perform the conversion. The response will contain the result of the conversion, which can be further processed or displayed to the user.

&#x20;


# transferOwnership

## Description

The `transferOwnership` function is an asynchronous function that facilitates the transfer of ownership for a given contract on a specified blockchain.

## Parameters

| Parameter         | Data Type | Description                                                                        |
| ----------------- | --------- | ---------------------------------------------------------------------------------- |
| `contract`        | string    | The type of contract ('ERC721', 'ERC1155', 'ERC20', 'SOULBOUND').                  |
| `blockchain`      | string    | The name or symbol of the blockchain.                                              |
| `contractAddress` | string    | The address of the contract on the blockchain.                                     |
| `privateKey`      | string    | The private key of the current owner.                                              |
| `newOwner`        | string    | The address of the new owner to whom the ownership will be transferred.            |
| `env`             | string    | The environment or network where the contract exists (e.g., 'mainnet', 'testnet'). |

## Response

| Field    | Data Type | Description                                                                                                                                                                  |
| -------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`   | number    | A numeric value indicating the execution status (1 for success, 0 for error).                                                                                                |
| `error`  | any       | The error object containing details about the encountered error, if applicable.                                                                                              |
| `result` | any       | The result object containing the outcome of the ownership transfer operation. The structure of the result object may vary depending on the contract type and implementation. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `VLRYToCRYPTO` request using the Volary SDK:<br>

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');
const privateKey = "your private key"

async function main() {
    const result = await nft.transferOwnership(
        'erc20',
        'ava',
        '0xc653bf7cdd8775f8d6fc2deb664d54b793914ca8',
        privateKey,
        '0x0EDdA2D7b045c0de5DF076bC367FB23af698df40',
    );
    console.log(result);
}

main();

```

### Response

```sh
```

### Use Cases

* The `transferOwnership` function can be used to transfer ownership of a contract on a specified blockchain. It is useful when there is a need to change the owner of a contract to another address.

&#x20;


# transfer

## Description

The `transfer` function is an asynchronous function that facilitates the transfer of assets or tokens for a given contract on a specified blockchain.

## Parameters

| Parameter         | Data Type | Description                                                                                                                                                                                                                  |
| ----------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `contract`        | string    | The type of contract ('ERC721', 'ERC1155', 'ERC20').                                                                                                                                                                         |
| `blockchain`      | string    | The name or symbol of the blockchain.                                                                                                                                                                                        |
| `contractAddress` | string    | The address of the contract on the blockchain.                                                                                                                                                                               |
| `privateKey`      | string    | The private key of the sender's account.                                                                                                                                                                                     |
| `params`          | object    | The transfer parameters containing information such as the receiver's address, amount, token ID, and additional data. The structure of the transferParams object may vary depending on the contract type and implementation. |
| `env`             | string    | The environment or network where the contract exists (e.g., 'mainnet', 'testnet').                                                                                                                                           |

## Response

| Field              | Data Type | Description                                                                                                                                                                  |
| ------------------ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`             | number    | A numeric value indicating the execution status (1 for success, 0 for error).                                                                                                |
| `error`            | any       | The error object containing details about the encountered error, if applicable.                                                                                              |
| `deployedContract` | any       | The result object containing the outcome of the transfer operation. The structure of the deployedContract object may vary depending on the contract type and implementation. |
| `tokenId`          | any       | The token ID associated with the transferred asset or token.                                                                                                                 |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a bulkMint request using the Volary SDK:

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');
const privateKey = "your private key"

async function main() {
    const params = {
        receiver:"0x3624AcFD985d984Be37f448a49dfCC0F014A1EeF",
        tokenId:"0"
    };
    const result = await nft.transfer(
        "erc721",
        "klay",
        "0x7a0f416cae7bd4d4f9112a6bb609423290d2945e",
        privateKey,
        params,
    );
    console.log(result);
}

main();

```

```
```

### Response

```
{
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 230,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0x281d66', _isBigNumber: true },
    to: '0x83F1ceC2f0526427330775A6CD2FC15B52eaA0cE',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0x9d2450a6000000000000000000000000000000000000000000000000000000000000006400000000000000000000000013cc66d6611bb754647bf2977881ea0e35a48fb4',
    accessList: [],
    hash: '0x4954973368c1ded4b90ae336b9f5168e9cc2be6e57396eb68f45f1338cc92546',
    v: 1,
    r: '0x8425bb110cf1b321b8bc73f87178cbbef92a2e9fec696035084f5f83a41e017e',
    s: '0x2ed9bbbbe486d2c0dc286692155725b488c1b4462f485c98e096b973e7bfeba8',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* The `transfer` function can be used to transfer assets or tokens from one account to another on a specified blockchain. \
  It supports different contract types such as ERC721, ERC1155, and ERC20. By providing the necessary parameters, such as the contract type, blockchain, contract address, private key, transfer parameters (e.g., receiver's address, amount, token ID, additional data), and environment, the function performs the transfer operation and returns the result.


# estimateFee


# ERC20


# deploy

## Description

The `estimateFee` function is an asynchronous function used to estimate the fee for deploying an ERC20 contract on a specified blockchain and environment.

## Parameters

| Parameter      | Data Type | Description                                                             |
| -------------- | --------- | ----------------------------------------------------------------------- |
| `blockchain`   | string    | The blockchain on which the contract will be deployed.                  |
| `contract`     | string    | The contract type ('erc20' for ERC20 contract deployment).              |
| `functionType` | string    | The function type ('deploy' for contract deployment).                   |
| `env`          | string    | The environment or network of the blockchain.                           |
| `amount`       | number    | The amount used for the 'mint' function (optional, default value is 1). |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deploy` request using the Volary SDK:

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc20', 'deploy', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
 result {
        code: 1,
        result: 0.198800945917596,
        VLRYEstimate: 2504.2981665760003,
        USDEstimate: 375.64472498640004
      }
```

### Use Cases

* **Estimating ERC20 contract deployment fee:** By invoking this function with the contract type as 'erc20' and function type as 'deploy', you can estimate the fee for deploying an ERC20 contract on the specified blockchain and environment.
* **Sending HTTP request:** The function sends an HTTP request to the blockchain explorer's API to estimate the fee for contract deployment.


# mint

## Description

The `estimateFee` function is an asynchronous function used to estimate the gas fee required for the `mint` operation of an ERC20 token on a specific blockchain and environment.&#x20;

## Parameters

| Parameter           | Data Type | Description                                                                      |
| ------------------- | --------- | -------------------------------------------------------------------------------- |
| `blockchain`        | string    | The blockchain on which the ERC20 token exists.                                  |
| `contract`          | string    | The contract type, in this case, 'erc20'.                                        |
| `functionType`      | string    | The type of function for which to estimate the fee, in this case, 'mint'.        |
| `env`               | string    | The environment or network of the blockchain.                                    |
| `amount (optional)` | number    | The amount of ERC20 tokens to be minted. (Only required for 'mint' functionType) |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated gas fee in the blockchain's native currency.            |
| `VLRYEstimate` | number    | The estimated gas fee in VLRY (a virtual currency).                   |
| `USDEstimate`  | number    | The estimated gas fee in USD.                                         |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `mint` request using the Volary SDK:

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc20', 'mint', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
 result {
        code: 1,
        result: 0.009567552928786952,
        VLRYEstimate: 120.52259181961612,
        USDEstimate: 18.078388772942418
      }
```

### Use Cases

* **Estimate ERC20 Mint Gas Fee:** By invoking this function with the appropriate blockchain, contract, functionType ('mint'), and environment, you can estimate the gas fee required for the `mint` operation of an ERC20 token.
* **Supporting Multiple Blockchains:** The function allows estimating gas fees for ERC20 mint operations on different blockchains by specifying the blockchain parameter (e.g., 'Ethereum', 'Binance Smart Chain', etc.).
* **Providing Results in Different Currencies:** The function returns the estimated gas fee in the native currency of the specified blockchain, as well as its equivalent in VLRY and USD, providing flexibility for users who prefer different currencies.


# transfer

## Description

The `estimateFee` function is used to estimate the transaction fee for different types of ERC-20 token transfers.&#x20;

## Parameters

| Parameter           | Data Type | Description                                                                   |
| ------------------- | --------- | ----------------------------------------------------------------------------- |
| `blockchain`        | string    | The blockchain on which the ERC20 token exists.                               |
| `contract`          | string    | The contract type, in this case, 'erc20'.                                     |
| `functionType`      | string    | The type of function for which to estimate the fee, in this case, 'transfer'. |
| `env`               | string    | The environment or network of the blockchain.                                 |
| `amount (optional)` | number    | The amount of ERC20 tokens to be transferred.                                 |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated gas fee in the blockchain's native currency.            |
| `VLRYEstimate` | number    | The estimated gas fee in VLRY (a virtual currency).                   |
| `USDEstimate`  | number    | The estimated gas fee in USD.                                         |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `transfer` request using the Volary SDK:

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc20', 'transfer', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
result {
        code: 1,
        result: 0.008017217841645946,
        VLRYEstimate: 100.9930000544191,
        USDEstimate: 15.148950008162863
      }
```

### Use Cases

1. **User Wallet Integration**: The `estimateFee` function can be used to provide users with an estimated transaction fee before they initiate a token transfer. This gives users the ability to make an informed decision about their transaction.
2. **DApp Transaction Confirmation**: In a decentralized application (DApp), when a user initiates a token transfer, the DApp can call this function to display the estimated fee to the user before proceeding with the transaction. This enhances user experience and ensures transparency.
3. **Transaction Cost Comparison**: For platforms or services that support multiple blockchain networks, this function can be used to compare transaction costs across different blockchains. This helps users choose the most cost-effective blockchain for their token transfers.


# ERC721


# deploy

## Description

The `estimateFee` function is an asynchronous function used to estimate the fee for deploying an ERC721 contract on a specified blockchain and environment.

## Parameters

| Parameter      | Data Type | Description                                                             |
| -------------- | --------- | ----------------------------------------------------------------------- |
| `blockchain`   | string    | The blockchain on which the contract will be deployed.                  |
| `contract`     | string    | The contract type ('erc721' for ERC721 contract deployment).            |
| `functionType` | string    | The function type ('deploy' for contract deployment).                   |
| `env`          | string    | The environment or network of the blockchain.                           |
| `amount`       | number    | The amount used for the 'mint' function (optional, default value is 1). |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deploy` request using the Volary SDK:

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc721', 'deploy', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
 result {
        code: 1,
        result: 0.4566197654759562,
        VLRYEstimate: 5752.045274360977,
        USDEstimate: 862.8067911541465
      }
```

### Use Cases

* **Estimating ERC721 contract deployment fee:** By invoking this function with the contract type as 'erc20' and function type as 'deploy', you can estimate the fee for deploying an ERC721 contract on the specified blockchain and environment.
* **Sending HTTP request:** The function sends an HTTP request to the blockchain explorer's API to estimate the fee for contract deployment.


# mint

## Description

The `estimateFee` function is an asynchronous function used to estimate the gas fee required for the `mint` operation of an ERC721 token on a specific blockchain and environment.&#x20;

## Parameters

| Parameter           | Data Type | Description                                                                      |
| ------------------- | --------- | -------------------------------------------------------------------------------- |
| `blockchain`        | string    | The blockchain on which the ERC721 token exists.                                 |
| `contract`          | string    | The contract type, in this case, 'erc721'.                                       |
| `functionType`      | string    | The type of function for which to estimate the fee, in this case, 'mint'.        |
| `env`               | string    | The environment or network of the blockchain.                                    |
| `amount (optional)` | number    | The amount of ERC20 tokens to be minted. (Only required for 'mint' functionType) |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `mint` request using the Volary SDK:

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc721', 'mint', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
  result {
        code: 1,
        result: 0.017027652251499114,
        VLRYEstimate: 214.49756246229526,
        USDEstimate: 32.17463436934429
      }
```

### Use Cases

* **Estimate ERC20 Mint Gas Fee:** By invoking this function with the appropriate blockchain, contract, functionType ('mint'), and environment, you can estimate the gas fee required for the `mint` operation of an ERC721 token.
* **Supporting Multiple Blockchains:** The function allows estimating gas fees for ERC721 mint operations on different blockchains by specifying the blockchain parameter (e.g., 'Ethereum', 'Binance Smart Chain', etc.).
* **Providing Results in Different Currencies:** The function returns the estimated gas fee in the native currency of the specified blockchain, as well as its equivalent in VLRY and USD, providing flexibility for users who prefer different currencies.


# transfer

## Description

The `estimateFee` function is used to estimate the transaction fee for different types of ERC-20 token transfers.&#x20;

## Parameters

| Parameter           | Data Type | Description                                                                   |
| ------------------- | --------- | ----------------------------------------------------------------------------- |
| `blockchain`        | string    | The blockchain on which the ERC721 token exists.                              |
| `contract`          | string    | The contract type, in this case, 'erc721'.                                    |
| `functionType`      | string    | The type of function for which to estimate the fee, in this case, 'transfer'. |
| `env`               | string    | The environment or network of the blockchain.                                 |
| `amount (optional)` | number    | The amount of ERC20 tokens to be transferred.                                 |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `transfer` request using the Volary SDK:

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc721', 'transfer', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
 result {
        code: 1,
        result: 0.00823501830131858,
        VLRYEstimate: 103.73663534911066,
        USDEstimate: 15.560495302366599
      }
```

### Use Cases

* **User Wallet Integration**: The `estimateFee` function can be used to provide users with an estimated transaction fee before they initiate a token transfer. This gives users the ability to make an informed decision about their transaction.
* **DApp Transaction Confirmation**: In a decentralized application (DApp), when a user initiates a token transfer, the DApp can call this function to display the estimated fee to the user before proceeding with the transaction. This enhances user experience and ensures transparency.
* **Transaction Cost Comparison**: For platforms or services that support multiple blockchain networks, this function can be used to compare transaction costs across different blockchains. This helps users choose the most cost-effective blockchain for their token transfers.


# ERC1155


# deploy

## Description

The `estimateFee` function is an asynchronous function used to estimate the fee for deploying an ERC1155 contract on a specified blockchain and environment.

## Parameters

| Parameter      | Data Type | Description                                                             |
| -------------- | --------- | ----------------------------------------------------------------------- |
| `blockchain`   | string    | The blockchain on which the contract will be deployed.                  |
| `contract`     | string    | The contract type ('erc1155' for ERC1155 contract deployment).          |
| `functionType` | string    | The function type ('deploy' for contract deployment).                   |
| `env`          | string    | The environment or network of the blockchain.                           |
| `amount`       | number    | The amount used for the 'mint' function (optional, default value is 1). |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deploy` request using the Volary SDK:

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc1155', 'deploy', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
 result {
        code: 1,
        result: 0.32836054791881764,
        VLRYEstimate: 4136.362200559341,
        USDEstimate: 620.454330083901
      }
```

### Use Cases

* **Estimating ERC1155 contract deployment fee:** By invoking this function with the contract type as 'erc20' and function type as 'deploy', you can estimate the fee for deploying an ERC1155 contract on the specified blockchain and environment.
* **Sending HTTP request:** The function sends an HTTP request to the blockchain explorer's API to estimate the fee for contract deployment.


# mint

## Description

The `estimateFee` function is an asynchronous function used to estimate the gas fee required for the `mint` operation of an ERC1155 token on a specific blockchain and environment.&#x20;

## Parameters

| Parameter           | Data Type | Description                                                                      |
| ------------------- | --------- | -------------------------------------------------------------------------------- |
| `blockchain`        | string    | The blockchain on which the ERC721 token exists.                                 |
| `contract`          | string    | The contract type, in this case, 'erc721'.                                       |
| `functionType`      | string    | The type of function for which to estimate the fee, in this case, 'mint'.        |
| `env`               | string    | The environment or network of the blockchain.                                    |
| `amount (optional)` | number    | The amount of ERC20 tokens to be minted. (Only required for 'mint' functionType) |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `mint` request using the Volary SDK:

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc1155', 'mint', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
result {
        code: 1,
        result: 0.011711203649552238,
        VLRYEstimate: 147.52618853296894,
        USDEstimate: 22.12892827994534
      }
```

### Use Cases

* **Estimate ERC20 Mint Gas Fee:** By invoking this function with the appropriate blockchain, contract, functionType ('mint'), and environment, you can estimate the gas fee required for the `mint` operation of an ERC1155 token.
* **Supporting Multiple Blockchains:** The function allows estimating gas fees for ERC1155 mint operations on different blockchains by specifying the blockchain parameter (e.g., 'Ethereum', 'Binance Smart Chain', etc.).
* **Providing Results in Different Currencies:** The function returns the estimated gas fee in the native currency of the specified blockchain, as well as its equivalent in VLRY and USD, providing flexibility for users who prefer different currencies.


# transfer

## Description

The `estimateFee` function is used to estimate the transaction fee for different types of ERC-20 token transfers.&#x20;

## Parameters

| Parameter           | Data Type | Description                                                                   |
| ------------------- | --------- | ----------------------------------------------------------------------------- |
| `blockchain`        | string    | The blockchain on which the ERC1166 token exists.                             |
| `contract`          | string    | The contract type, in this case, 'erc1155'.                                   |
| `functionType`      | string    | The type of function for which to estimate the fee, in this case, 'transfer'. |
| `env`               | string    | The environment or network of the blockchain.                                 |
| `amount (optional)` | number    | The amount of ERC20 tokens to be transferred.                                 |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `transfer` request using the Volary SDK:

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc1155', 'transfer', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
 result {
        code: 1,
        result: 0.0047190052161507155,
        VLRYEstimate: 59.44537163202108,
        USDEstimate: 8.916805744803161
      }
```

### Use Cases

* **User Wallet Integration**: The `estimateFee` function can be used to provide users with an estimated transaction fee before they initiate a token transfer. This gives users the ability to make an informed decision about their transaction.
* **DApp Transaction Confirmation**: In a decentralized application (DApp), when a user initiates a token transfer, the DApp can call this function to display the estimated fee to the user before proceeding with the transaction. This enhances user experience and ensures transparency.
* **Transaction Cost Comparison**: For platforms or services that support multiple blockchain networks, this function can be used to compare transaction costs across different blockchains. This helps users choose the most cost-effective blockchain for their token transfers.


# Soulbound


# deploy

## Description

The `estimateFee` function is an asynchronous function used to estimate the fee for deploying a Soulbound contract on a specified blockchain and environment.

## Parameters

| Parameter      | Data Type | Description                                                             |
| -------------- | --------- | ----------------------------------------------------------------------- |
| `blockchain`   | string    | The blockchain on which the contract will be deployed.                  |
| `contract`     | string    | The contract type ('soulbound' for Soulbound contract deployment).      |
| `functionType` | string    | The function type ('deploy' for contract deployment).                   |
| `env`          | string    | The environment or network of the blockchain.                           |
| `amount`       | number    | The amount used for the 'mint' function (optional, default value is 1). |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deploy` request using the Volary SDK:

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'soulbound', 'deploy', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
 result {
        code: 1,
        result: 0.3385880027271927,
        VLRYEstimate: 4265.197585155393,
        USDEstimate: 639.779637773309
      }
```

### Use Cases

* **Estimating Soulbound contract deployment fee:** By invoking this function with the contract type as 'erc20' and function type as 'deploy', you can estimate the fee for deploying an Soulbound contract on the specified blockchain and environment.
* **Sending HTTP request:** The function sends an HTTP request to the blockchain explorer's API to estimate the fee for contract deployment.


# mint

## Description

The `estimateFee` function is an asynchronous function used to estimate the gas fee required for the `mint` operation of a Soulbound token on a specific blockchain and environment.&#x20;

## Parameters

| Parameter           | Data Type | Description                                                                      |
| ------------------- | --------- | -------------------------------------------------------------------------------- |
| `blockchain`        | string    | The blockchain on which the Soulbound token exists.                              |
| `contract`          | string    | The contract type, in this case, 'soulbound'.                                    |
| `functionType`      | string    | The type of function for which to estimate the fee, in this case, 'mint'.        |
| `env`               | string    | The environment or network of the blockchain.                                    |
| `amount (optional)` | number    | The amount of ERC20 tokens to be minted. (Only required for 'mint' functionType) |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated fee for the contract deployment.                        |
| `VLRYEstimate` | number    | The estimated fee in VLRY (virtual asset).                            |
| `USDEstimate`  | number    | The estimated fee in USD (United States Dollar).                      |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `mint` request using the Volary SDK:

```sh
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'soulbound', 'mint', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
  result {
        code: 1,
        result: 0.01619173481997752,
        VLRYEstimate: 203.96749943112556,
        USDEstimate: 30.595124914668833
      }

```

### Use Cases

* **Estimate ERC20 Mint Gas Fee:** By invoking this function with the appropriate blockchain, contract, functionType ('mint'), and environment, you can estimate the gas fee required for the `mint` operation of a Soulbound token.
* **Supporting Multiple Blockchains:** The function allows estimating gas fees for Soulbound mint operations on different blockchains by specifying the blockchain parameter (e.g., 'Ethereum', 'Binance Smart Chain', etc.).
* **Providing Results in Different Currencies:** The function returns the estimated gas fee in the native currency of the specified blockchain, as well as its equivalent in VLRY and USD, providing flexibility for users who prefer different currencies.


# Contracts


# ERC20


# deployContract

## Description

The `deployContract` function deploys an ERC20 token contract on a specified blockchain network with the given name and symbol and returns the contract.

## Parameters

| Parameter    | Type   | Description                                                                                                       |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------- |
| `blockchain` | string | Takes a parameter specifying the name of the blockchain network(For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `privateKey` | string | The private key of the account to sign the transaction                                                            |
| `name`       | string | The name of the ERC20 token to be deployed                                                                        |
| `symbol`     | string | The symbol of the ERC20 token to be deployed                                                                      |

## Response

|                   |        |                                         |
| ----------------- | ------ | --------------------------------------- |
| `Promise<Object>` | object | Returns the transaction receipt object. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deployContract` request using the Volary SDK:

```
// import the Nest SDK
const { ERC20 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC20 class
const erc20 = new ERC20();

// define the main function
const main = async () => {
    // call the deployContract method
    const contract = await erc20.deployContract('klay','your-private-key',"testErc20","TEST");

    // print the receipt
    console.log(`Contract deployed at ${contract.address}. Transaction hash: ${contract.deployTransaction.hash}`);
};
// call the main function
main();
```

### Response

```
Contract deployed at 0xCE9d9f032587f6680A061896e28d51641a155E9B. Transaction hash: 0x0a1619c524cd447b19957c31862b6e4a397ccce03588712e28bb37619d26c86e
```

## Use Cases

* **Creating a new ERC20 token:** The primary use case for the **`deployContract`** function is to create a new ERC20 token contract on a specified blockchain network, with the specified name and symbol.
* **Custom token configuration:** The **`deployContract`** function allows for custom configuration of the ERC20 token contract, such as the total supply and decimal places.


# transfer

## Description

The `transfer` function is an asynchronous function that transfers a specified amount of ERC20 tokens from the caller's wallet to the specified receiver address and returns the transaction receipt.

## Parameters

| Parameter         | Type   | Description                                                                                                               |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `blockchain`      | string | Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `contractAddress` | string | Requires the contract address of the token (ERC20) that is already deployed                                               |
| `receiver`        | string | Expects the receiving account address for the transfer of the token (ERC20)                                               |
| `amount`          | string | Requires an amount of tokens to be transferred                                                                            |
| `privateKey`      | string | The private key of the account to sign the transaction                                                                    |

## Response

| Property          | Type   | Description                            |
| ----------------- | ------ | -------------------------------------- |
| `Promise<Object>` | object | Returns the transaction receipt object |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `transfer` request using the  Volary SDK:

```
// import the Nest SDK
const { ERC20 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC20 class
const erc20 = new ERC20();

// define the main function
const main = async () => {
    // call the transfer method
    const receipt = await erc20.transfer('ava','0x3c40d011838f0ecd5b601104eeb5e27172c92231','0x13CC66D6611bb754647Bf2977881eA0e35A48FB4',"1","your-private-key");

    // print the receipt
    console.log({ receipt });
};
// call the main function
main();
```

### Response

```
 {
  receipt: {
    type: 2,
    chainId: 43113,
    nonce: 1,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0x5444', _isBigNumber: true },
    to: '0x3c40d011838F0EcD5B601104EEb5E27172C92231',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0xa9059cbb00000000000000000000000013cc66d6611bb754647bf2977881ea0e35a48fb40000000000000000000000000000000000000000000000000000000000000001',
    accessList: [],
    hash: '0x7c898df5d92011d5ad1e5abc5cf6d45fe9e82e236d7a58bcc79de67bc6faf3bb',
    v: 1,
    r: '0xb488a4d4208aaab0a36674c47afda8c4dd8dbc3d9f09d256478d4836d37a09c8',
    s: '0x7a441f0b8a5617a93af70124a48e1b998e4b5e311d56d88d5d74f0ffd06a6bbb',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **Token transfer:** The primary use case for the transfer function is to transfer a specified amount of ERC20 tokens from one address to another on a given blockchain network.
* **Payment processing:** The transfer function can also be used to process payments in a decentralized way by allowing users to send ERC20 tokens as payment for goods or services.
* **Exchange trading:** The transfer function can be used in decentralized exchanges to facilitate the trading of ERC20 tokens between different parties.


# mint

## Description

The `mint` function is an asynchronous function that mints a specified amount of ERC20 tokens to the specified receiver address and returns the transaction receipt.

## Parameters

| Parameter         | Type   | Description                                                                                                               |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `blockchain`      | string | Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `contractAddress` | string | Requires a contract address of the token (ERC20) that is already deployed                                                 |
| `receiver`        | string | Expects the receiving account address for the mint of the token (ERC20)                                                   |
| `amount`          | string | Expects the receiving account address for the mint of the token (ERC20)                                                   |
| `privateKey`      | string | Expects the receiving account address for the mint of the token (ERC20)                                                   |

## Response

| Property          | Type   | Description                            |
| ----------------- | ------ | -------------------------------------- |
| `Promise<Object>` | object | Returns the transaction receipt object |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a mint request using the Volary SDK:

```
// import the Nest SDK
const { ERC20 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC20 class
const erc20 = new ERC20();

// define the main function
const main = async () => {
    // call the mint function
    const receipt = await erc20.mint(
        'klay',
        '0x3c40d011838f0ecd5b601104eeb5e27172c92231',
        '0x13CC66D6611bb754647Bf2977881eA0e35A48FB4',
        '100',
        'your-private-key',
    );

    // print the receipt
    console.log({ receipt });
};
// call the main function
main();
```

### Response

```
 {
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 237,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0xa822', _isBigNumber: true },
    to: '0x3c40d011838F0EcD5B601104EEb5E27172C92231',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0x40c10f1900000000000000000000000013cc66d6611bb754647bf2977881ea0e35a48fb40000000000000000000000000000000000000000000000000000000000000064',
    accessList: [],
    hash: '0xadbd2e3e340fa378b87b8d40225c3e9e17daf0f3bb86e2316398549504759562',
    v: 1,
    r: '0xe377d367c0f892d67884b1134ff5c35dfb9e9ecec15d2409843c560a19a9168c',
    s: '0x1477b80e71f3fda2096006fcffd0bb48c7bbe455c73ba8a9f7e8bbaca84c2478',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **Bulk token distribution:** The primary use case for the **`mint`** function is to distribute multiple ERC20 tokens to a specified receiver address in bulk.
* **Automated token distribution:** The **`mint`** function can be integrated into automated workflows for token distribution, allowing developers to automatically distribute tokens as part of their continuous integration and deployment process.


# ERC721


# deployContract

## Description

The `deployContract` function deploys an ERC721 token contract on a specified blockchain network with the given name and symbol and returns the deployed contract.

## Parameters

|              |        |                                                                                                                           |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `blockchain` | string | Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `privateKey` | string | The private key of the account to sign the transaction                                                                    |
| `name`       | string | Expects the name of the token (ERC721)                                                                                    |
| `symbol`     | string | Requires the symbol of the token (ERC721)                                                                                 |

## Response

| Property          | Type   | Description                             |
| ----------------- | ------ | --------------------------------------- |
| `Promise<Object>` | object | Returns the transaction receipt object. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deployContract` request using the Volary SDK:

```javascript
// import the Nest SDK
const { ERC721 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC721 class
const erc721 = new ERC721();

// define the main function
const main = async () => {
    // call the deployContract function
    const contract = await erc721.deployContract(
        'klay',
        'your-private-key',
        'testErc721',
        'TEST',
    );

    // print the contract address and transaction hash
    console.log(`Contract deployed at ${contract.address}. Transaction hash: ${contract.deployTransaction.hash}`);
};
// call the main function
main();
```

### Response

```
Contract deployed at 0x6e94C8C4AE6DaE35dAA4f51B448Dbbf03C70890a. Transaction hash: 0xc9824dd43296e500cdd09aecb6e0cb85eac0255bbb3505856a31a9da2b394a60
```

## Use Cases

* **Collectibles**: ERC721 tokens can be used to create unique collectible items such as digital art, trading cards, and rare items.
* **Identity verification**: ERC721 tokens can be used to represent a unique identity, such as digital certificates, diplomas, and other official documents.


# transfer

## Description

The `transfer` function transfers a specified ERC721 token with the given token ID from the caller's wallet to the specified receiver address and returns the transaction receipt.

## Parameters

| Parameter         | Type   | Description                                                                                  |
| ----------------- | ------ | -------------------------------------------------------------------------------------------- |
| `blockchain`      | string | Specifies the name of the blockchain network (e.g. eth, bsc, polygon, ava, gnosis, moonbeam) |
| `contractAddress` | string | The address of the deployed ERC721 contract                                                  |
| `tokenId`         | string | The ID of the ERC721 token to be transferred                                                 |
| `receiver`        | string | The receiving address for the token transfer                                                 |
| `privateKey`      | string | The private key of the account used to sign the transaction                                  |

## Response

| Property         | Type   | Description                                                              |
| ---------------- | ------ | ------------------------------------------------------------------------ |
| Promise\<Object> | object | Returns the transaction receipt object for the transfer of ERC721 token. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `transfer` request using the Volary SDK:

```jsx
// import the Nest SDK
const { ERC721 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC721 class
const erc721 = new ERC721();

// define the main function
const main = async () => {
    // call the transfer function
    const receipt = await erc721.transfer(
        'klay',
        '0xe668c72d4c67236a712ce69a91c74358586f31ed',
        '0',
        '0x5aAB360f4eEC9C823175711d22D7D0C920D4481a',
        'your-private-key',
    );

    // print the receipt
    console.log({receipt});
};
// call the main function
main();
```

### Response

```jsx
{
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 243,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0x7918', _isBigNumber: true },
    to: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0x23b872dd000000000000000000000000e668c72d4c67236a712ce69a91c74358586f31ed0000000000000000000000005aab360f4eec9c823175711d22d7d0c920d4481a0000000000000000000000000000000000000000000000000000000000000000',
    accessList: [],
    hash: '0x92ee1f4fc09bc4a8339d229cb744195096769825a221cb56ae6d8539ff64870e',
    v: 1,
    r: '0x63e80e4d17176063699cb6fd63654bb12ed0eafabc6a984d0c4d88d383199190',
    s: '0x650d0ae0d9f59dce63bb4539e27d0b999f94da3f11e906ab5b1d71fb539b7764',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **NFT transfer:** The transfer function can be used to transfer a specific ERC721 NFT from one address to another on a given blockchain network.
* **Marketplace transactions:** The transfer function can be used in NFT marketplaces to transfer ownership of ERC721 tokens between different users.
* **Auction bidding:** The transfer function can be used to transfer ERC721 tokens as part of auction bidding in a decentralized manner.


# mint

## Description

The `mint` function is an asynchronous function that mints a specified amount of ERC20 tokens to the specified receiver address and returns the transaction receipt.

## Parameters

| Parameter         | Type   | Description                                                                                                               |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `blockchain`      | string | Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam) |
| `contractAddress` | string | Requires a contract address of the token (ERC20) that is already deployed                                                 |
| `receiver`        | string | Expects the receiving account address for the mint of the token (ERC20)                                                   |
| `amount`          | string | Requires an amount of tokens to be minted                                                                                 |
| `privateKey`      | string | The private key of the account to sign the transaction                                                                    |

## Response

| Property          | Type   | Description                             |
| ----------------- | ------ | --------------------------------------- |
| `Promise<Object>` | object | Returns the transaction receipt object. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `mint` request using the Volary SDK:

```jsx
// import the Nest SDK
const { ERC721 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC721 class
const erc721 = new ERC721();

// define the main function
const main = async () => {
    // call the mint function
    const receipt = await erc721.mint(
        'klay',
        '0x3c40d011838f0ecd5b601104eeb5e27172c92231',
        '0x13CC66D6611bb754647Bf2977881eA0e35A48FB4',
        '100',
        'your-private-key',
    );

    // print the receipt
    console.log({ receipt });
};
// call the main function
main();
```

### Response

```jsx
 {
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 237,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0xa822', _isBigNumber: true },
    to: '0x3c40d011838F0EcD5B601104EEb5E27172C92231',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0x40c10f1900000000000000000000000013cc66d6611bb754647bf2977881ea0e35a48fb40000000000000000000000000000000000000000000000000000000000000064',
    accessList: [],
    hash: '0xadbd2e3e340fa378b87b8d40225c3e9e17daf0f3bb86e2316398549504759562',
    v: 1,
    r: '0xe377d367c0f892d67884b1134ff5c35dfb9e9ecec15d2409843c560a19a9168c',
    s: '0x1477b80e71f3fda2096006fcffd0bb48c7bbe455c73ba8a9f7e8bbaca84c2478',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **Bulk token distribution:** The primary use case for the **`mint`** function is to distribute multiple ERC20 tokens to a specified receiver address in bulk.
* **Automated token distribution:** The **`mint`** function can be integrated into automated workflows for token distribution, allowing developers to automatically distribute tokens as part of their continuous integration and deployment process.


# approve

## Description

The `approve` function allows the owner of an ERC721 token to grant approval to another address or contract to transfer the token on their behalf.

## Parameters

| Parameter         | Type   | Description                                                        |
| ----------------- | ------ | ------------------------------------------------------------------ |
| `blockchain`      | string | The blockchain network to use, e.g., Ethereum, Binance Smart Chain |
| `contractAddress` | string | The address of the ERC721 contract containing the token            |
| `tokenId`         | string | The ID of the token to approve for transfer                        |
| `spender`         | string | The address of the account or contract to grant transfer approval  |
| `privateKey`      | string | The private key of the token owner's account                       |

## Response

| Field     | Type   | Description                                        |
| --------- | ------ | -------------------------------------------------- |
| `code`    | number | 1 for success, 0 for failure                       |
| `receipt` | object | The transaction receipt of the approve transaction |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `approve` request using the Volary SDK:

```jsx
const {ERC721} = require('@nest25/evm-chains-lib')
// create a new wallet instance
const erc721 = new ERC721();
const privateKey = "your private key here"

const main = async () => {
    // approve erc721 token
    const receipt=await erc721.approve(
        'klay',
        '0xE4eD9066bD1A34994445cAd01Cb9A73A59b8A045',
        '1',
        '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
        privateKey
        )
    // print receipt
    console.log(receipt);
}
main()
```

### Response

```jsx
  
```

## Use Cases

* **Crypto wallets:** They can use this function to grant approval to other addresses or contracts to transfer their ERC721 tokens on their behalf.
* **DApp developers:** Developers can use this function to enable users to grant approval to their smart contracts to transfer their ERC721 tokens.


# ERC1155


# deployContract

## Description

The **`deployContract`** function deploys an ERC-1155 token contract on a specified blockchain network with a specified **`baseUri`** and returns the deployed contract.

## Parameters

| Parameter    | Type   | Description                                                                                                                                           |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `blockchain` | string | Specifies the name of the blockchain network on which the contract will be deployed (For eg. bsc, polygon, eth, ava, gnosis, moonbeam)                |
| `privateKey` | string | The private key of the account used to deploy the contract                                                                                            |
| `baseUri`    | string | The base URI for the contract metadata. This is used to retrieve additional information about the contract such as the name, symbol, and description. |

## Response

| Property          | Type   | Description                           |
| ----------------- | ------ | ------------------------------------- |
| `Promise<Object>` | object | Returns the deployed contract object. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deployContract` request using the Volary SDK:

```jsx
// import the Nest SDK
const { ERC1155 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC1155 class
const erc1155 = new ERC1155();

// define the main function
const main = async () => {
    // deploy the contract
    const contract = await erc1155.deployContract(
        'klay',
        'your-private-key',
        'baseUri',
    );

    // print the contract address and transaction hash
    console.log(`Contract deployed at ${contract.address}. Transaction hash: ${contract.deployTransaction.hash}`);
};
// call the main function
main();
```

### Response

```jsx
Contract deployed at 0xe6811ffc22D567A0267B5260211C34074e091022. Transaction hash: 0x99916877816ce81f0091a5107282b077d9f637824bf9291c355762bee4b13713
```

## Use Cases

* **Contract deployment:** The primary use case for the **`deployContract`** function is to deploy a new smart contract on a specified blockchain network, using the provided **`erc11155Abi`** and **`erc11155ByteCode`** to generate the contract code.
* **Token issuance:** The deployed contract can be used to issue new tokens on the specified blockchain network, which can be used for various purposes such as rewards, governance, or utility tokens.


# transfer

## Description

The `transfer` function transfers a specified ERC721 token with the given token ID from the caller's wallet to the specified receiver address and returns the transaction receipt.

## Parameters

| Parameter         | Type   | Description                                                                                  |
| ----------------- | ------ | -------------------------------------------------------------------------------------------- |
| `blockchain`      | string | Specifies the name of the blockchain network (e.g. eth, bsc, polygon, ava, gnosis, moonbeam) |
| `contractAddress` | string | The address of the deployed ERC721 contract                                                  |
| `tokenId`         | string | The ID of the ERC721 token to be transferred                                                 |
| `receiver`        | string | The receiving address for the token transfer                                                 |
| `privateKey`      | string | The private key of the account used to sign the transaction                                  |

## Response

| Property          | Type   | Description                                                              |
| ----------------- | ------ | ------------------------------------------------------------------------ |
| `Promise<Object>` | object | Returns the transaction receipt object for the transfer of ERC721 token. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `transfer` request using the Volary SDK:

```jsx
// import the Nest SDK
const { ERC721 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC721 class
const erc721 = new ERC721();

// define the main function
const main = async () => {
    // call the transfer function
    const receipt = await erc721.transfer(
        'klay',
        '0xe668c72d4c67236a712ce69a91c74358586f31ed',
        '0',
        '0x5aAB360f4eEC9C823175711d22D7D0C920D4481a',
        'your-private-key',
    );

    // print the receipt
    console.log({receipt});
};
// call the main function
main();
```

### Response

```jsx
{
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 243,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0x7918', _isBigNumber: true },
    to: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0x23b872dd000000000000000000000000e668c72d4c67236a712ce69a91c74358586f31ed0000000000000000000000005aab360f4eec9c823175711d22d7d0c920d4481a0000000000000000000000000000000000000000000000000000000000000000',
    accessList: [],
    hash: '0x92ee1f4fc09bc4a8339d229cb744195096769825a221cb56ae6d8539ff64870e',
    v: 1,
    r: '0x63e80e4d17176063699cb6fd63654bb12ed0eafabc6a984d0c4d88d383199190',
    s: '0x650d0ae0d9f59dce63bb4539e27d0b999f94da3f11e906ab5b1d71fb539b7764',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **NFT transfer:** The `transfer` function can be used to transfer a specific ERC721 NFT from one address to another on a given blockchain network.
* **Marketplace transactions:** The `transfer` function can be used in NFT marketplaces to transfer ownership of ERC721 tokens between different users.
* **Auction bidding:** The `transfer` function can be used to transfer ERC721 tokens as part of auction bidding in a decentralized manner.


# mint

## Description

The `mint` function is an asynchronous function that mints a specified amount of ERC20 tokens to the specified receiver address and returns the transaction receipt.

## Parameters

<table><thead><tr><th width="233">Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>blockchain</code></td><td>string</td><td>Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam)</td></tr><tr><td><code>contractAddress</code></td><td>string</td><td>Requires a contract address of the token (ERC20) that is already deployed</td></tr><tr><td><code>receiver</code></td><td>string</td><td>Expects the receiving account address for the mint of the token (ERC20)</td></tr><tr><td><code>amount</code></td><td>string</td><td>Requires an amount of tokens to be minted</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The private key of the account to sign the transaction</td></tr></tbody></table>

## Response

<table><thead><tr><th width="222">Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>Promise&#x3C;Object></code></td><td>object</td><td>Returns the transaction receipt object.</td></tr></tbody></table>

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `mint` request using the Volary SDK:

```jsx
// import the Nest SDK
const { ERC20 } = require('@nest25/evm-chains-lib');

// create a new instance of the ERC20 class
const erc20 = new ERC20();

// define the main function
const main = async () => {
    // call the mint function
    const receipt = await erc20.mint(
        'klay',
        '0x3c40d011838f0ecd5b601104eeb5e27172c92231',
        '0x13CC66D6611bb754647Bf2977881eA0e35A48FB4',
        '100',
        'your-private-key',
    );

    // print the receipt
    console.log({ receipt });
};
// call the main function
main();
```

### Response

```jsx
 {
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 237,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0xa822', _isBigNumber: true },
    to: '0x3c40d011838F0EcD5B601104EEb5E27172C92231',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0x40c10f1900000000000000000000000013cc66d6611bb754647bf2977881ea0e35a48fb40000000000000000000000000000000000000000000000000000000000000064',
    accessList: [],
    hash: '0xadbd2e3e340fa378b87b8d40225c3e9e17daf0f3bb86e2316398549504759562',
    v: 1,
    r: '0xe377d367c0f892d67884b1134ff5c35dfb9e9ecec15d2409843c560a19a9168c',
    s: '0x1477b80e71f3fda2096006fcffd0bb48c7bbe455c73ba8a9f7e8bbaca84c2478',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **Bulk token distribution:** The primary use case for the **`mint`** function is to distribute multiple ERC20 tokens to a specified receiver address in bulk.
* **Automated token distribution:** The **`mint`** function can be integrated into automated workflows for token distribution, allowing developers to automatically distribute tokens as part of their continuous integration and deployment process.


# balanceOf

## Description

The `balanceOf` function is an asynchronous function that retrieves the balance of a specific token for a given address in a specified contract on a particular blockchain.

## Parameters

| Parameter         | Data Type | Description                                                                        |
| ----------------- | --------- | ---------------------------------------------------------------------------------- |
| `blockchain`      | string    | The name or symbol of the blockchain.                                              |
| `contractAddress` | string    | The address of the contract on the blockchain.                                     |
| `address`         | string    | The address for which the token balance is to be retrieved.                        |
| `tokenId`         | string    | The ID of the token for which the balance is to be retrieved.                      |
| `env`             | string    | The environment or network where the contract exists (e.g., 'mainnet', 'testnet'). |

## Response

| Field    | Data Type | Description                                                                     |
| -------- | --------- | ------------------------------------------------------------------------------- |
| `code`   | number    | A numeric value indicating the execution status (1 for success, 0 for error).   |
| `error`  | any       | The error object containing details about the encountered error, if applicable. |
| `result` | string    | The balance of the specified token for the given address.                       |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `balanceOf` request using the Volary SDK:

```jsx
const { ERC1155 } = require('@nest25/evm-chains-lib');

const erc1155 = new ERC1155();
const privateKey = "your private key"

async function main() {
    const response = await erc1155.balanceOf('ava','0x1d224f9ba0c15058601e18b171e87cdadfc8de45',"0x1148d4a18e53f8072734325ed5e72dbb7aeb6fa6",'354856');
    console.log(response)
}

main();


```

### Response

```jsx
{ code: 1, result: '85' }
```

## Use Cases

* The `balanceOf` function can be used to retrieve the balance of a specific token for a given address in a contract.


# Soulbound


# deployContract

## Description

The `deployContract` function is used to deploy a Soulbound contract on a specified blockchain network.

## Parameters

| Name         | Type   | Description                                                    |
| ------------ | ------ | -------------------------------------------------------------- |
| `blockchain` | string | The blockchain network on which the contract will be deployed. |
| `privateKey` | string | The private key of the wallet used to deploy the contract.     |
| `name`       | string | The name of the Soulbound contract to be deployed.             |
| `symbol`     | string | The symbol of the Soulbound contract to be deployed.           |

## Response

| Name       | Type   | Description                                                                                                        |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------ |
| `code`     | number | A code indicating the success or failure of the function. 1 indicates success, while 0 indicates failure.          |
| `contract` | object | An object containing information about the deployed contract, including the contract address and transaction hash. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `deployContract` request using the Volary SDK:

```jsx
const {SOULBOUND} = require('@nest25/evm-chains-lib')
// create instance of SOULBOUND
const soul = new SOULBOUND();
const privateKey = "your private key here"

const main = async () => {
    // deploy soulbound contract
    const contract = await soul.deployContract(
        'optimism',
        privateKey,
        "SulBoundbyHarshInSDK",
        "SDDK");
    // print contract address
    console.log(contract.address);
}
main()
```

### Response

```jsx
Contract deployed at 0xe6811ffc22D567A0267B5260211C34074e091022. Transaction hash: 0x99916877816ce81f0091a5107282b077d9f637824bf9291c355762bee4b13713
```

## Use Cases

* **NFT marketplaces:** They can use this function to deploy Soulbound contracts for their non-fungible tokens, which can restrict their transfer to only certain whitelisted addresses.
* **Gaming:** Companies can use this function to deploy Soulbound contracts for in-game assets, which can restrict their transfer to only certain authorized players.


# Wallet


# getBalance

## Description

The **`getBalance`** function takes a blockchain network name and an account address as inputs and returns the balance of that account in the specified cryptocurrency

## Parameters

<table><thead><tr><th width="247">Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>blockchain</code></td><td>string</td><td>Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam)</td></tr><tr><td><code>address</code></td><td>string</td><td>The address for which to retrieve the balance</td></tr></tbody></table>

## Response

| Property             | Type      | Description                                                                                                |
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
| `Promise<BigNumber>` | BigNumber | Returns the current ether balance of the specified address on the specified blockchain network blockchain. |

## Example Request and Response

### Prerequisites&#x20;

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `getBalance` request using the Volary SDK:

```jsx
// import the Nest SDK
const { Wallet } = require('@nest25/evm-chains-lib');

// create a new wallet
const wallet = new Wallet();

// define the main function
const main = async () => {
    // get the balance of the contract
    let balance = await wallet.getBalance('gnosis', '0xE668C72D4C67236A712Ce69A91C74358586f31ed');

    // convert the balance to a string
    const balanceToString = balance.toString();
    // print the balance
    console.log(balanceToString);
};
// call the main function
main();
```

### Response

```jsx
 6803371899323
```

## Use Cases

* **Wallet Balance:** The function can be used to get the balance of a wallet address for a specific blockchain network, helping users to keep track of their crypto assets.
* **Payment Systems**: Payment systems can use the function to verify the balance of a user's account before processing transactions, ensuring that the user has sufficient funds to complete the payment.


# sendEther

## Description

The **`sendEther`** function sends a specified amount of Ether from the account associated with the provided private key to a specified address on a given blockchain network.

## Parameters

<table><thead><tr><th width="259">Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>blockchain</code></td><td>string</td><td>Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam)</td></tr><tr><td><code>address</code></td><td>string</td><td>The receiving account address for the transfer of Ether</td></tr><tr><td><code>amount</code></td><td>string</td><td>The amount of Ether to be transferred</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The private key of the account to sign the transaction</td></tr></tbody></table>

## Response

| Property          | Type   | Description                             |
| ----------------- | ------ | --------------------------------------- |
| `Promise<Object>` | object | Returns the transaction receipt object. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `sendEther` request using the Volary SDK:

```jsx
// import the Nest SDK
const { Wallet } = require('@nest25/evm-chains-lib');

// create a new wallet
const wallet = new Wallet();

// define the main function
const main = async () => {
    // send Ether
    let receipt = await wallet.sendEther(
        'klay',
        '0x3D5Cc05B5419CcD3c1bD510ab026C76F42D20871',
        '10',
        '3160dea9213bb3673b10a8c61103004e80a77046ea991778824f9d2b0a539835'
    )

    // print the receipt
    console.log({receipt);
};
// call the main function
main();
```

### Response

```jsx
{
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 247,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0x5208', _isBigNumber: true },
    to: '0x3D5Cc05B5419CcD3c1bD510ab026C76F42D20871',
    value: BigNumber { _hex: '0x8ac7230489e80000', _isBigNumber: true },
    data: '0x',
    accessList: [],
    hash: '0xad169c8ebe54a152ae5c50b578b88ef3bd765d62a3161e594b0743636af338b4',
    v: 0,
    r: '0xb8b9e3326cb0df557cf6f24d8173edbf4fd4df535047ace869e22051bffedd0f',
    s: '0x194c5f94dd1cf2644f369b78f2498549fb026d1721692c7b2d340a4836e904be',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to send Ether from one wallet to another.
* **Online Marketplaces:** The function can be used by online marketplaces to facilitate payments in Ether for goods and services.
* **Cryptocurrency Exchanges:** The function can be used by cryptocurrency exchanges to facilitate the buying and selling of Ether.


# depositEther

## Description

The `depositEther` function is used to transfer Ether from one wallet to another by sending it to the designated receptor contract with a unique ID.

## Parameters

| Parameter    | Type   | Description                                    |
| ------------ | ------ | ---------------------------------------------- |
| `id`         | string | Unique identifier for the transfer transaction |
| `amount`     | string | Amount of Ether to be transferred              |
| `privateKey` | string | Private key of the sender's wallet             |

## Response

| Property  | Type   | Description                                                                                     |
| --------- | ------ | ----------------------------------------------------------------------------------------------- |
| `code`    | number | Status code indicating whether the transfer was successful or not. (1 for success, 0 for error) |
| `receipt` | object | Transaction receipt object returned by the Ethereum network                                     |
| `error`   | object | Error object containing details of any errors that occurred during the transfer                 |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `depositEther` request using the Volary SDK:

```jsx
const {Wallet} = require('@nest25/evm-chains-lib')
// create a new wallet instance
const wallet = new Wallet();
const privateKey = "your private key here"

const main = async () => {
    // deposit 0.001 ETH to the wallet
    let receipt = await wallet.depositEther(
        '123',
        '0.001',
        privateKey
    )
    // print the receipt
    console.log(receipt);
}
main()
```

### Response

```jsx
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to send Ether from one wallet to another.
* **Online Marketplaces:** The function can be used by online marketplaces to facilitate payments in Ether for goods and services.
* **Cryptocurrency Exchanges:** The function can be used by cryptocurrency exchanges to facilitate the buying and selling of Ether.


# checkIfAddress

## Description

The `checkIfAddress` function is an asynchronous function that verifies whether an address or contract is valid on a specific blockchain

## Parameters

| Parameter    | Data Type | Description                                  |
| ------------ | --------- | -------------------------------------------- |
| `address`    | string    | The address or contract to be validated.     |
| `blockchain` | string    | The name or symbol of the target blockchain. |

## Response

| Field   | Data Type | Description                                                                              |
| ------- | --------- | ---------------------------------------------------------------------------------------- |
| `code`  | Number    | A numeric value indicating the execution status (1 for success, 0 for error).            |
| `valid` | boolean   | Indicates whether the provided address or contract is valid on the specified blockchain. |
| `error` | any       | The error object containing details about the encountered error, if applicable.          |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `depositEther` request using the Volary SDK:

```jsx
import { Wallet } from '@nest25/evm-chains-lib';

const wallet = new Wallet();

async function main() {
    let { valid } = await wallet.checkIfAddress('SOL', 'HKCYfyqDgcMUZywmkHGduHin799i4sdsAG9TihgAb4Qn');
    console.log({ valid });
}

main();

```

### Response

```jsx
 { valid: true }
```

## Use Cases

* **Checking blockchain availability:** This function communicates with an external API to fetch available blockchains and verifies if the provided blockchain is supported.
* **Handling errors:** In case of any error during the execution of the function or if the blockchain is not found, the returned object will contain the error details.


# NFTMarketPlace


# listNFT

## Description

The `listNFT` function is used to list a non-fungible token (NFT) for sale on a decentralized marketplace.&#x20;

It takes in various parameters, including the blockchain on which the NFT exists, the user's private key for that blockchain, the ID of the token, the price at which it is to be sold, the duration of any bidding period (if applicable), whether it is being listed for auction, and the address of the NFT contract.<br>

## Parameters

| Name              | Type    | Description                                                     |
| ----------------- | ------- | --------------------------------------------------------------- |
| `blockchain`      | string  | The blockchain on which the NFT exists.                         |
| `privateKey`      | string  | The private key of the user making the listing.                 |
| `tokenId`         | string  | The ID of the NFT to be listed.                                 |
| `price`           | string  | The price at which the NFT is to be listed.                     |
| `biddingDuration` | string  | The duration of any bidding period (if applicable), in seconds. |
| `forAuction`      | boolean | Whether the NFT is being listed for auction.                    |
| `nftAddress`      | string  | The address of the NFT contract.                                |

## Response

| Name      | Type   | Description                                                        |
| --------- | ------ | ------------------------------------------------------------------ |
| `code`    | number | The status code of the response (1 for success, 0 for failure).    |
| `receipt` | string | The transaction hash of the listing transaction on the blockchain. |
| `error`   | string | The error message if the operation fails.                          |

## Example Request and Response

### Prerequisites&#x20;

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `listNFT` request using the Volary SDK:

```jsx
const {NftMarketPlace} = require('@nest25/evm-chains-lib')
// create instance of SOULBOUND
const nftMarketPlace = new NftMarketPlace();
const privateKey = "your private key here"
// nft contract address
let nftContract = '0xaa223c2379daf21526925a07fe466fad7269103a';

const main = async () => {
    // list nft
    const contract = await nftMarketPlace.listNFT(
        'klay', 
        privateKey,
        "1",
        "1",
        "0",
        false,
        nftContract
    );
    // print result
    console.log(contract);
}
main()
```

### Response

```jsx
 
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to allow their users to list their NFTs for sale on decentralized marketplaces.
* **Online Marketplaces:** The function can be used by online marketplaces to create a decentralized marketplace for NFTs.
* **NFT Platforms:** The function can be used by NFT platforms to allow their users to sell their NFTs on third-party marketplaces.


# buyNFT

## Description

The `buyNFT` function facilitates the purchase of a non-fungible token (NFT) on a blockchain-based marketplace.&#x20;

The function requires the blockchain name, the private key of the user's wallet, the ID of the token, the payment amount in cryptocurrency, and the address of the NFT contract.

## Parameters

| Parameter    | Type   | Description                                                                                      |
| ------------ | ------ | ------------------------------------------------------------------------------------------------ |
| `blockchain` | string | The name of the blockchain on which the NFT is being sold (e.g., Ethereum, Binance Smart Chain). |
| `privateKey` | string | The private key of the user's wallet.                                                            |
| `tokenId`    | string | The ID of the token being purchased.                                                             |
| `payment`    | string | The amount of cryptocurrency being sent as payment.                                              |
| `nftAddress` | string | The address of the NFT contract.                                                                 |

## Response

| Parameter | Type   | Description                                                                                      |
| --------- | ------ | ------------------------------------------------------------------------------------------------ |
| `code`    | number | A code indicating whether the transaction was successful (1) or unsuccessful (0).                |
| `receipt` | string | The transaction hash of the purchase, returned if the transaction was successful.                |
| `error`   | string | An error message, returned if the transaction was unsuccessful. The message describes the error. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `buyNFT` request using the Volary SDK:

```jsx
const {NftMarketPlace} = require('@nest25/evm-chains-lib')
// create instance of SOULBOUND
const nftMarketPlace = new NftMarketPlace();
const privateKey = "your private key here"
// nft contract address
let nftContract = '0xaa223c2379daf21526925a07fe466fad7269103a';

const main = async () => {
    // buy nft with klay
    const contract = await nftMarketPlace.buyNFT(
        'klay',
        privateKey,
        '1',
        '10',
        nftContract
    );
    // print result
    console.log(contract);
}
main()
```

### Response

```jsx
{
  receipt: {
    type: 2,
    chainId: 1001,
    nonce: 247,
    maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0bdfd63e00', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0x5208', _isBigNumber: true },
    to: '0x3D5Cc05B5419CcD3c1bD510ab026C76F42D20871',
    value: BigNumber { _hex: '0x8ac7230489e80000', _isBigNumber: true },
    data: '0x',
    accessList: [],
    hash: '0xad169c8ebe54a152ae5c50b578b88ef3bd765d62a3161e594b0743636af338b4',
    v: 0,
    r: '0xb8b9e3326cb0df557cf6f24d8173edbf4fd4df535047ace869e22051bffedd0f',
    s: '0x194c5f94dd1cf2644f369b78f2498549fb026d1721692c7b2d340a4836e904be',
    from: '0xE668C72D4C67236A712Ce69A91C74358586f31ed',
    wait: [Function (anonymous)]
  }
}
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to allow users to purchase NFTs on a blockchain-based marketplace.
* **NFT Marketplaces:** The function can be used by NFT marketplaces to facilitate the purchase of NFTs using cryptocurrency.
* **Cryptocurrency Exchanges:** The function can be used by cryptocurrency exchanges to enable users to buy and sell NFTs using cryptocurrency.


# getNFT

## Description

The `getNFT` function retrieves information about a specific NFT (Non-Fungible Token) from a marketplace smart contract deployed on a blockchain.&#x20;

The function requires a private key to authenticate the request and fetches the NFT details by calling the getNFT method of the marketplace contract.

## Parameters

| Parameter    | Type   | Description                                                  |
| ------------ | ------ | ------------------------------------------------------------ |
| `blockchain` | string | The name of the blockchain on which the NFT is deployed.     |
| `privateKey` | string | The private key of the wallet to authenticate the request.   |
| `tokenId`    | string | The ID of the NFT to retrieve.                               |
| `nftAddress` | string | The address of the NFT contract on the specified blockchain. |

## Response

| Field Name       | Type    | Description                                                                      |
| ---------------- | ------- | -------------------------------------------------------------------------------- |
| `code`           | number  | The response code indicating the success or failure of the request.              |
| `seller`         | string  | The address of the seller who listed the NFT for sale.                           |
| `nftContaddress` | string  | The address of the NFT contract on the specified blockchain.                     |
| `tokenid`        | string  | The ID of the NFT to retrieve.                                                   |
| `priceList`      | string  | The price at which the NFT is listed for sale.                                   |
| `highestbid`     | string  | The current highest bid on the NFT, if it's up for auction.                      |
| `highestbidder`  | string  | The address of the current highest bidder on the NFT.                            |
| `biddingend`     | string  | The date and time when the bidding for the NFT will end, if it's up for auction. |
| `islisted`       | boolean | Indicates if the NFT is currently listed for sale.                               |
| `issold`         | boolean | Indicates if the NFT has been sold.                                              |
| `forauction`     | boolean | Indicates if the NFT is up for auction.                                          |
| `error`          | string  | The error message in case of a failed request.                                   |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `getNFT` request using the Volary SDK:

```jsx
const {NftMarketPlace} = require('@nest25/evm-chains-lib')
// create instance of SOULBOUND
const nftMarketPlace = new NftMarketPlace();
const privateKey = "your private key here"
// nft contract address
let nftContract = '0xaa223c2379daf21526925a07fe466fad7269103a';

const main = async () => {
    // get NFT
    const contract = await nftMarketPlace.getNFT(
        'klay',
        privateKey,
        '1',
        nftContract
    );
    // print NFT
    console.log(contract);
}
main()
```

### Response

```jsx
```

## Use Cases

* **Online Marketplaces:** The function can be used by online marketplaces to retrieve information about an NFT listed for sale by a user.
* **Cryptocurrency Wallets:** The function can be used by cryptocurrency wallets to display details of the NFTs owned by the user.
* **NFT Trading Platforms:** The function can be used by NFT trading platforms to display information about a specific NFT that users are interested in buying or selling.


# placeBid

## Description

The `placeBid` function is used to place a bid on an NFT (non-fungible token) in a specific blockchain network's marketplace. It takes the required parameters and connects to the blockchain using the provided private key to interact with the smart contract.

## Parameters

| Parameter    | Type   | Description                                                       |
| ------------ | ------ | ----------------------------------------------------------------- |
| `blockchain` | string | The blockchain network where the NFT marketplace contract resides |
| `privateKey` | string | The private key of the user's wallet to connect to the blockchain |
| `tokenId`    | string | The unique identifier of the NFT in the marketplace               |
| `payment`    | string | The amount of cryptocurrency to bid for the NFT                   |
| `nftAddress` | string | The address of the NFT contract on the blockchain                 |

## Response

| Field     | Type   | Description                             |
| --------- | ------ | --------------------------------------- |
| `code`    | number | The status code of the transaction      |
| `receipt` | object | The transaction receipt object returned |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `placeNFT` request using the Volary SDK:

```jsx

const {NftMarketPlace} = require('@nest25/evm-chains-lib')
// create instance of SOULBOUND
const nftMarketPlace = new NftMarketPlace();
const privateKey = "your private key here"

const main = async () => {
    // place bid
    const bidder = await nftMarketPlace.placeBid(
        'klay',
        privateKey,
        1,
        10,
    );
    // print result
    console.log(bidder);
}
main()
```

### Response

```jsx
```

## Use Cases

* **Crypto wallets:** The function can be used by crypto wallets to enable users to place bids on NFTs available in various blockchain networks.
* **NFT Marketplaces:** The function can be used by online NFT marketplaces to facilitate the bidding process for buyers and sellers.
* **Cryptocurrency Exchanges:** The function can be used by cryptocurrency exchanges to enable users to place bids on NFTs using their exchange wallets.

<br>


# transferNFT

## Description

The `transferNFT` function allows users to transfer non-fungible tokens (NFTs) from their wallet to another user's wallet on a specified blockchain.&#x20;

It uses the appropriate smart contract for the selected blockchain to execute the transfer.

## Parameters

| Parameter    | Type   | Description                                                   |
| ------------ | ------ | ------------------------------------------------------------- |
| `blockchain` | string | The name of the blockchain where the NFT is being transferred |
| `privateKey` | string | The private key of the user's wallet                          |
| `tokenId`    | string | The ID of the NFT being transferred                           |
| `nftAddress` | string | The address of the NFT contract on the blockchain             |

## Response

| Field     | Type   | Description                                           |
| --------- | ------ | ----------------------------------------------------- |
| `code`    | number | Indicates success (1) or failure (0) of the operation |
| `receipt` | object | The receipt of the transfer transaction if successful |
| `error`   | string | The error message if the operation fails              |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `transferNFT` request using the Volary SDK:

```jsx

const { NFTMarketPlace } =  require('@nest25/evm-chains-lib')
const nftMarketPlace = new NFTMarketPlace();
const privateKey = 'your private key here'
const contractAddress = 'your contract address here'

const main = async () => {
     const contract = await nftMarketPlace.transferNFT(
        'klay',
        privateKey,
        contractAddress,
        1,
    )
    console.log(contract);
}
main()
```

### Response

```jsx
```

## Use Cases

* **Crypto Wallets:** The `transferNFT` function can be used by crypto wallets to facilitate the transfer of NFTs between users on a specific blockchain.
* **NFT Marketplaces:** The function can be used by NFT marketplaces to allow users to transfer their NFTs to other users on the platform.
* **NFT Collectors**: The `transferNFT` function can be used by NFT collectors to transfer their NFTs to other collectors or buyers on a specific blockchain.

<br>


# BlockchainInfo


# availableBlockchains

## Description

The `availableBlockchains` function is an asynchronous function that retrieves a list of available blockchains supported by the blockchain gateway. <br>

## Parameters

This function does not take any parameter.

## Response

| ield          | Data Type | Description                                                                     |
| ------------- | --------- | ------------------------------------------------------------------------------- |
| `code`        | number    | A numeric value indicating the execution status (1 for success, 0 for error).   |
| `error`       | any       | The error object containing details about the encountered error, if applicable. |
| `blockchains` | array     | An array of available blockchains. Each blockchain is represented as a string.  |

## Example Request and Response

### Prerequisites&#x20;

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `availableBlockchains` request using the Volary SDK:

```jsx
const { BlockchainInfo } = require('@nest25/evm-chains-lib');

const info = new BlockchainInfo();

async function main() {
    const response = await info.availableBlockchains()
    console.log(response)
}

main();

```

### Response

```sh
 {
        code: 1,
        blockchains: [
          {
            name: 'Ethereum',
            symbol: 'ETH',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/ethereum-eth-logo.png',
            explorer: 'https://goerli.etherscan.io',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Binance Smart Chain',
            symbol: 'BNB',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/bnb-bnb-logo.png',
            explorer: 'https://testnet.bscscan.com',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Polygon',
            symbol: 'MATIC',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/matic-logo.webp',
            explorer: 'https://mumbai.polygonscan.com',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Avalanche',
            symbol: 'AVA',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/avalanche-avax-logo.png',
            explorer: 'https://testnet.snowtrace.io',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Klaytn',
            symbol: 'KLAY',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/klaytn-klay-logo.png',
            explorer: 'https://baobab.scope.klaytn.com',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Volary',
            symbol: 'VLRY',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/vlry.png',
            explorer: 'https://explorer.volary.io',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Casper',
            symbol: 'CSPR',
            nft: false,
            wallet: false,
            evm: false,
            logo: 'https://ik.imagekit.io/nest/casper-cspr-logo.png',
            explorer: 'https://testnet.cspr.live',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Solana',
            symbol: 'SOL',
            nft: true,
            wallet: true,
            evm: false,
            logo: 'https://ik.imagekit.io/nest/solana-sol-logo.png',
            explorer: 'https://solscan.io/?cluster=devnet',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Aurora',
            symbol: 'AUR',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/aurora.png',
            explorer: 'https://explorer.testnet.aurora.dev',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Moonbeam',
            symbol: 'GLMR',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/moonbeam.png',
            explorer: 'https://moonbase.moonscan.io',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Gnosis',
            symbol: 'GNO',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/gnosis-gno-gno-logo.png',
            explorer: 'https://beacon.gnosisscan.io',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Optimism',
            symbol: 'OP',
            nft: true,
            evm: true,
            wallet: true,
            logo: 'https://ik.imagekit.io/nest/optimism-ethereum-op-logo.png',
            explorer: 'https://goerli-optimism.etherscan.io',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Arbitrum',
            symbol: 'ARB',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/arbitrum-arb-logo.png',
            explorer: 'https://testnet.arbiscan.io',
            hasEnoughBalance: [Object]
          },
          {
            name: 'Celo',
            symbol: 'CELO',
            nft: true,
            wallet: true,
            evm: true,
            logo: 'https://ik.imagekit.io/nest/celo-celo-logo.png',
            explorer: 'https://explorer.celo.org/baklava/',
            hasEnoughBalance: [Object]
          }
        ]
      }
```

## Use Cases

* The `availableBlockchains` function can be used to fetch a list of available blockchains supported by the blockchain gateway. It can be helpful when providing a selection of blockchains for users to choose from or when validating the blockchain input in other functions.


# availableContracts

## Description

The `availableContracts` function is an asynchronous function that retrieves a list of available contracts for a specific blockchain.<br>

## Parameters

| Parameter    | Data Type | Description                                            |
| ------------ | --------- | ------------------------------------------------------ |
| `blockchain` | string    | The blockchain for which to fetch available contracts. |

## Response

| Field   | Data Type | Description                                                                                                       |
| ------- | --------- | ----------------------------------------------------------------------------------------------------------------- |
| `code`  | number    | A numeric value indicating the execution status (1 for success, 0 for error).                                     |
| `error` | any       | The error object containing details about the encountered error, if applicable.                                   |
| `types` | array     | An array of available contract types for the specified blockchain. Each contract type is represented as a string. |

## Example Request and Response

### Prerequisites&#x20;

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `availableContracts` request using the Volary SDK:

```javascript
const { BlockchainInfo } = require('@nest25/evm-chains-lib');

const info = new BlockchainInfo();

async function main() {
    const response = await info.availableContracts('klay')
    console.log(response)
}

main();

```

```jsx
```

### Response

```sh
{
        code: 1,
        types: [
          { contract: 'ERC20', parameters: [Object] },
          { contract: 'ERC721', parameters: [Object] },
          { contract: 'ERC1155', parameters: [Object] },
          { contract: 'Soulbound', parameters: [Object] }
        ]
      }
```

## Use Cases

* The `listAvailableContracts` function can be used to fetch a list of available contracts for a specific blockchain supported by the blockchain gateway. It can be helpful when providing a selection of contract types for users to choose from or when validating the contract type input in other functions.


# Tokenomics SDK


# createStake

## Description

The `createStake` function creates a new stake in a staking contract on the blockchain.&#x20;

It takes in several parameters including the amount of cryptocurrency to be staked, the duration of the stake, whether the stake is a liquidity provider (LP) stake and the user's private key

## Parameters

| Name         | Type   | Description                          |
| ------------ | ------ | ------------------------------------ |
| `amount`     | string | The amount of tokens to be staked.   |
| `duration`   | string | The duration of the stake in seconds |
| `isLp`       | string | Whether the stake is an LP stake     |
| `privateKey` | string | The private key of the user's wallet |

## Response

| Property  | Type   | Description                                                       |
| --------- | ------ | ----------------------------------------------------------------- |
| `receipt` | object | The transaction receipt object for the stake creation transaction |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `createStake` request using the Volary SDK:

```javascript
// import Nest SDK library
const { staking } = require('@nest25/tokenomics-lib');
// private key of the account you want to use
const TEST_PRIVATE_KEY = 'your-private-key';
// create a new instance of staking
const Staking = new staking();
async function main() {
  // create a new stake
  const result = await Staking.createStake('1', '100', false, TEST_PRIVATE_KEY);
  // print the result
  console.log(result);
}
main();
```

### Response

```sh
 {
        type: 2,
        chainId: 8888,
        nonce: 71,
        maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
        maxFeePerGas: BigNumber { _hex: '0xd09dc300', _isBigNumber: true },
        gasPrice: null,
        gasLimit: BigNumber { _hex: '0x03e562', _isBigNumber: true },
        to: '0x077e4F1496693B7c45128c436eF933ccaFe6d291',
        value: BigNumber { _hex: '0x00', _isBigNumber: true },
        data: '0x012cae390000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000',
        accessList: [],
        hash: '0x87fe62ca7a46c3bf264857c7073ae5d589ac15b237f9198023befab0b76540d9',
        v: 1,
        r: '0x6351d9d8fd124e736e1bca8142b6cd867dfa2ccfe33d284666eed512176807aa',
        s: '0x692c6c0f54976975f5159d420b5abc0ba28af70e21b457c1ba0db9af4968c488',
        from: '0x5712d28795106f0105C01e99A708d018C1d70E52',
        confirmations: 0,
        wait: [Function (anonymous)]
      }

```

## Use Cases

* **Crypto Staking Platforms:** The function can be used by crypto staking platforms to allow users to create new stakes in staking contracts on the blockchain.
* **Decentralized Finance (DeFi) Applications:** The function can be used by DeFi applications to enable users to stake their cryptocurrency and earn rewards on the blockchain.
* **Cryptocurrency Wallets:** The function can be used by cryptocurrency wallets to allow users to stake their cryptocurrency directly from their wallets.


# removeStake

## Description

The `removeStake` function allows users to remove a previously staked amount from a staking contract and returns a transaction receipt upon successful execution.&#x20;

## Parameters

| Name         | Type   | Description                                     |
| ------------ | ------ | ----------------------------------------------- |
| `stakeId`    | number | The ID of the stake to be removed               |
| `amount`     | string | The amount of the stake to be removed           |
| `privateKey` | string | The user's private key for the staking contract |

## Response

<table><thead><tr><th>Property</th><th width="92">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>receipt</code></td><td>object</td><td>The transaction receipt object </td></tr></tbody></table>

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `removeStake` request using the Volary SDK:

```javascript
// import Nest SDK library
const { staking } = require('@nest25/tokenomics-lib');
// private key of the account you want to use
const TEST_PRIVATE_KEY = 'your-private-key';
// create a new instance of staking
const Staking = new staking();
async function main() {
  // call removeStake function
  const result = await Staking.removeStake(2, '1', TEST_PRIVATE_KEY);
  // print the result
  console.log(result);
}
main();

```

### Response

```
{
        type: 2,
        chainId: 8888,
        nonce: 72,
        maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
        maxFeePerGas: BigNumber { _hex: '0xd09dc300', _isBigNumber: true },
        gasPrice: null,
        gasLimit: BigNumber { _hex: '0x07b123', _isBigNumber: true },
        to: '0x077e4F1496693B7c45128c436eF933ccaFe6d291',
        value: BigNumber { _hex: '0x00', _isBigNumber: true },
        data: '0x2d67f0b900000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000de0b6b3a7640000',
        accessList: [],
        hash: '0x608b1c3a7af858d091c1717534d0a740988a3748027dd1eefcc5a9baaca69cac',
        v: 0,
        r: '0xde2811060e6cbec614ba797dee12314a0afed55c0e2e8cd40390652a46cad725',
        s: '0x21e7e26e4973e69c3c19a007cc154e2aa26fead25f74809cb1e3e3cca4ebb705',
        from: '0x5712d28795106f0105C01e99A708d018C1d70E52',
        confirmations: 0,
        wait: [Function (anonymous)]
      }
```

## Use Cases

* **Staking Platforms:** The function can be used by staking platforms to allow users to remove their staked tokens and receive rewards.
* **DeFi Applications:** The function can be used by DeFi applications that implement staking features to allow users to withdraw their staked tokens.
* **Blockchain-based Games:** The function can be used by blockchain-based games that offer staking mechanics to enable players to remove their staked tokens as needed.


# approveVolary

## Description

The `approveVolary` function allows for the approval of a certain amount of tokens to be spent by another address, typically a smart contract.&#x20;

## Parameters

| Name         | Type   | Description                                            |
| ------------ | ------ | ------------------------------------------------------ |
| `spender`    | string | The address of the spender, typically a smart contract |
| `amount`     | string | The amount of tokens to approve for spending           |
| `privateKey` | string | The private key of the user's wallet                   |

## Response

| Property  | Type   | Description                                                                                                            |
| --------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| `receipt` | object | A transaction receipt object that includes information about the transaction, such as the transaction hash and status. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `approveVolary` request using the Volary SDK:

```javascript
// import Nest SDK library
const { volary } = require('@nest25/tokenomics-lib');
// private key of the account you want to use
const TEST_PRIVATE_KEY = 'your-private-key';
// address of the staking contract
const STAKING_CONTRACT_ADDRESS = '0x077e4F1496693B7c45128c436eF933ccaFe6d291';

// create a new instance of staking
const Volary = new volary();

async function main() {
  // approve Volary to stake
  const result = await Volary.approveVolary(STAKING_CONTRACT_ADDRESS, '2', TEST_PRIVATE_KEY);
  // print the result
  console.log(result);
}
main();

```

### Response

```sh
{
        type: 2,
        chainId: 8888,
        nonce: 74,
        maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
        maxFeePerGas: BigNumber { _hex: '0xd09dc300', _isBigNumber: true },
        gasPrice: null,
        gasLimit: BigNumber { _hex: '0x6983', _isBigNumber: true },
        to: '0x51d93eFc7a629C6c8e61de078d71b6E5c7F84B80',
        value: BigNumber { _hex: '0x00', _isBigNumber: true },
        data: '0x095ea7b3000000000000000000000000077e4f1496693b7c45128c436ef933ccafe6d2910000000000000000000000000000000000000000000000001bc16d674ec80000',
        accessList: [],
        hash: '0xd5a8ae72ae6a21babe3c0a025f7dfb05b4e0bd20c8870cd2220d5effe91ddc09',
        v: 1,
        r: '0xd5cfb759e73ed11e0efbb7e5fea3c5d56df6fe1c0e9db4d74d8f2fc4d184becf',
        s: '0x2938514e8e57b7c89af0515004f895ab81e38dc60792971a3f684fe959579cd4',
        from: '0x5712d28795106f0105C01e99A708d018C1d70E52',
        confirmations: 0,
        wait: [Function (anonymous)]
      }he
```

## Use Cases

* **DeFi Applications:** The function can be used by DeFi applications to approve the spending of a certain amount of tokens by a smart contract.
* **DEX Platforms:** The function can be used by DEX platforms to allow users to approve the spending of their tokens for trading on the platform.
* **Lending Platforms:** The function can be used by lending platforms to allow borrowers to approve the spending of their tokens as collateral.


# transferVolary

## Description

The `transferVolary` function enables the transfer of Volary tokens from one wallet to another using the recipient's address, the amount of tokens to be transferred, and the sender's private key

## Parameters

<table><thead><tr><th>Name</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>address</code></td><td>string</td><td>The address of the recipient </td></tr><tr><td><code>amount</code></td><td>string</td><td>The amount of Volary tokens to be transferred</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The prvate key of he sender's wallet to sign the transaction</td></tr></tbody></table>

## Response

<table><thead><tr><th>Property</th><th width="130">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>receipt</code></td><td>object</td><td>Returns a transaction receipt object that has informatiob about the transfer tranaction</td></tr></tbody></table>

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `transferVolary` request using the Volary SDK:

```
// import Nest SDK library
const { volary } = require('@nest25/tokenomics-lib');
// private key of the account you want to use
const TEST_PRIVATE_KEY = 'your-private-key';
// address of the staking contract
const STAKING_CONTRACT_ADDRESS = '0x077e4F1496693B7c45128c436eF933ccaFe6d291';

// create a new instance of staking
const Volary = new volary();

async function main() {
  // transfer Volary to staking contract
  const result = await Volary.transferVolary(STAKING_CONTRACT_ADDRESS, '1', TEST_PRIVATE_KEY);
  // print the result
  console.log(result);
}
main();
```

### Response

```sh
  {
        type: 2,
        chainId: 8888,
        nonce: 75,
        maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
        maxFeePerGas: BigNumber { _hex: '0xd09dc300', _isBigNumber: true },
        gasPrice: null,
        gasLimit: BigNumber { _hex: '0x91d3', _isBigNumber: true },
        to: '0x51d93eFc7a629C6c8e61de078d71b6E5c7F84B80',
        value: BigNumber { _hex: '0x00', _isBigNumber: true },
        data: '0xa9059cbb000000000000000000000000077e4f1496693b7c45128c436ef933ccafe6d2910000000000000000000000000000000000000000000000000de0b6b3a7640000',
        accessList: [],
        hash: '0x47c4b71c263293e04c0705c1e26f9bf0e4a10f784dea484dea30771e2c59aed9',
        v: 1,
        r: '0xa2912befef749788bb0e9f4905066ae2b1d9b0a9f1967ac0e10e52043076e4f7',
        s: '0x59bd5aee7c65313dc3a4980a977bdbc8c03081a6493cc46308cd04c758a1c387',
        from: '0x5712d28795106f0105C01e99A708d018C1d70E52',
        confirmations: 0,
        wait: [Function (anonymous)]
      }
```

## Use Cases

* **Token Holders:** The function can be used by Volary token holders to send Volary tokens to other Ethereum addresses.
* **Cryptocurrency Exchanges:** The function can be used by cryptocurrency exchanges that support Volary to facilitate the buying and selling of Volary tokens.
* **Decentralized Applications:** The function can be used by developers building decentralized applications that require the transfer of Volary tokens between wallets on the Ethereum blockchain.


# getBalance

## Description

The `getBalance` function allows retrieving the balance of a specific address on the blockchain network.&#x20;

## Parameters

<table><thead><tr><th>Name</th><th width="119">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>address</code></td><td>string</td><td>The address to retrieve balance</td></tr></tbody></table>

## Response

| Property  | Type   | Description                          |
| --------- | ------ | ------------------------------------ |
| `balance` | string | The balance of the specified address |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `getBalance` request using the Volary SDK:

```
// import Nest SDK library
const { volary } = require('@nest25/tokenomics-lib');

// create a new instance of staking
const Volary = new volary();

async function main() {
  // get balance of an address
  const result = await Volary.getBalance('0x22df7dfA1e579EE501f7D688542E8e3cB40ded89');
  // print the result
  console.log(result);
}
main();
```

### Response

```
1000.0
```

## Use Cases

* **Wallet Applications:** The `getBalance` function can be used in wallet applications to show the current balance of an address to the user.
* **Financial Services:** The function can be used by financial services to retrieve the balance of an address for accounting and auditing purposes.
* **Online Marketplaces:** The function can be used by online marketplaces to check the balance of an address before completing a transaction.


# claimRewards

## Description

The `claimRewards` function allows a user to claim their rewards from a reward pool for a specific stake.&#x20;

## Parameters

| Name         | Type   | Description                                                                                          |
| ------------ | ------ | ---------------------------------------------------------------------------------------------------- |
| `stakeId`    | number | The ID of the stake for which the user wants to claim rewards                                        |
| `amount`     | string | The amount of rewards the user wants to claim. The amount should be in ether format, such as '0.01'. |
| `privateKey` | string | The private key of the user's wallet.                                                                |

## Response

| Property | Type   | Description                                                                                                      |
| -------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| receipt  | object | The receipt object that contains the transaction hash and other details of the transaction that claimed rewards. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `claimRewards` request using the Volary SDK:

```
// import Nest SDK library
const { rewards } = require('@nest25/tokenomics-lib');

// create a new instance of the rewards class
const Rewards = new rewards();

async function main() {
  // claim rewards for a given user and amount
  const result = await Rewards.claimRewards(49, '0.3', TEST_PRIVATE_KEY);
  // log the result
  console.log(result);
}
main();

```

### Response

```
 {
        type: 2,
        chainId: 8888,
        nonce: 4,
        maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
        maxFeePerGas: BigNumber { _hex: '0xd09dc300', _isBigNumber: true },
        gasPrice: null,
        gasLimit: BigNumber { _hex: '0x016917', _isBigNumber: true },
        to: '0x5A98631C9Bb0a2139D70986D96F51E5872CEF5b9',
        value: BigNumber { _hex: '0x00', _isBigNumber: true },
        data: '0x594dd43200000000000000000000000000000000000000000000000000000000000000310000000000000000000000000000000000000000000000000429d069189e0000',
        accessList: [],
        hash: '0x58c18fe9f282ab015d3826f91cb0a1c5b3bc141793c9da1c1947aa40dc93a6f5',
        v: 0,
        r: '0xc93fa73f99a4ca2a54dd0c1aba9d77b2fa9003665525e898b34ec13ac102f1ac',
        s: '0x01eddbc9f1b11be8d4042dce811cf3a7f205ee74710ec9db061733e800f0ba9a',
        from: '0x87658a6c698D1392d45B0AB756F969361AcB912d',
        confirmations: 0,
        wait: [Function (anonymous)]
      }
```

## Use Cases

* **Crypto Staking Platforms**: The claimRewards function can be used by crypto staking platforms to allow users to claim their rewards from the reward pool for their specific stake.
* **Decentralized Finance (DeFi) Applications**: The function can be used by DeFi applications that offer staking as one of their services, allowing users to claim their rewards from the reward pool.
* **Crypto Wallets**: The claimRewards function can be used by crypto wallets that support staking to enable their users to claim their rewards.


# addRewards

## Description

The `addRewards` function allows a user to add rewards to a staked position on the volary blockchain network.

## Parameters

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| `rewards`    | string | The amount of rewards to be added |
| `stakeId`    | number | The ID of the staked position     |
| `signature`  | string | The signature of the user         |
| `privateKey` | string | The private key of the user       |

## Response

| Property  | Type   | Description                                   |
| --------- | ------ | --------------------------------------------- |
| `receipt` | object | The transaction receipt for the rewards added |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `addRewards` request using the Volary SDK:

```
// import Nest SDK library
const { rewards } = require('@nest25/tokenomics-lib');

// create a new instance of the rewards class
const Rewards = new rewards();

async function main() {
  // add rewards to a user
  const result = await Rewards.addRewards(
    '1',
    49,
    '0x67bf60c0aeb9198cd464b57dd9049526bbf7c7dd2cb84f9051ee542aececf21876f81e402eff398a179ab7be23f443c588a5524473bcd16d65e6ec725d8c8c341c',
    TEST_PRIVATE_KEY,
  );
  // log the result
  console.log(result);
}
main();
```

### Response

```
 {
        type: 2,
        chainId: 8888,
        nonce: 3,
        maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
        maxFeePerGas: BigNumber { _hex: '0xd09dc300', _isBigNumber: true },
        gasPrice: null,
        gasLimit: BigNumber { _hex: '0x0271c6', _isBigNumber: true },
        to: '0x5A98631C9Bb0a2139D70986D96F51E5872CEF5b9',
        value: BigNumber { _hex: '0x00', _isBigNumber: true },
        data: '0x1d4151520000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000310000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004167bf60c0aeb9198cd464b57dd9049526bbf7c7dd2cb84f9051ee542aececf21876f81e402eff398a179ab7be23f443c588a5524473bcd16d65e6ec725d8c8c341c00000000000000000000000000000000000000000000000000000000000000',
        accessList: [],
        hash: '0x99ee1728a91b8953e44852c72e8af4eb18763fad8608c00a3fe0cb4e363c98e4',
        v: 0,
        r: '0x1548a48052e82ff2a1ca71d5ab8992e0afeab86a81c6c8db4f9a75b51758507a',
        s: '0x5a4bec8ae710f939d40cb8aebd254ae3d36a665a29a7e8b763baeb8eb8dbab1e',
        from: '0x87658a6c698D1392d45B0AB756F969361AcB912d',
        confirmations: 0,
        wait: [Function (anonymous)]
      }
```

## Use Cases

* **Staking Platforms:** The function can be used by staking platforms to add rewards to the stakeholders' accounts.
* **Governance Systems:** The function can be used by governance systems to distribute rewards to the participants for their contributions to the network.
* **Token Distribution:** The function can be used by token distribution systems to distribute rewards to early adopters or token holders.


# swapVlry

## Description

The `swapVlry` function swaps a specified amount of tokens for an equivalent value of the Volary token using Uniswap or Sushiswap DEXes.&#x20;

## Parameters

| Name         | Type   | Description                                                                                |
| ------------ | ------ | ------------------------------------------------------------------------------------------ |
| `inAmount`   | string | The amount of Ethereum to swap for Vlry tokens.                                            |
| `privateKey` | string | The private key of the wallet performing the transaction.                                  |
| `exchange`   | string | The decentralized exchange to use for the swap. It can be either "uniswap" or "sushiswap". |
| `slippage`   | string | The maximum percentage of slippage that can occur during the swap. Defaults to 50 (0.5%).  |

## Response

<table><thead><tr><th>Property</th><th width="128">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>receipt</code> </td><td>object</td><td>Returns a transaction receipt of the swap implementation</td></tr></tbody></table>

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `getSwapAmountVolary` request using the Volary SDK:

````
```javascript
// import Nest SDK library
const { dex } = require('@nest25/tokenomics-lib');

// create a new instance of the dex class
const Dex = new dex();

async function main() {
  // swap 0.001 VLRY for ETH on Uniswap
  const result = await Dex.swapVlry('0.001', TEST_PRIVATE_KEY, 'uniswap');
  // print the result
  console.log(result);
}
```
````

### Response

```
Received 262895397847755609 VLRY
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to swap Ether for Volary tokens on supported DEX platforms like Uniswap, Sushiswap and Pancakeswap.
* **Cryptocurrency Exchanges:** The function can be used by cryptocurrency exchanges to facilitate the buying and selling of Volary tokens using Ether on supported DEX platforms.
* **Crypto Traders:** The function can be used by crypto traders to swap Ether for Volary tokens on supported DEX platforms and potentially gain profit from price differences between platforms.


# getSwapAmountVolary

## Description

The `getSwapAmountVolary` function is used to calculate the expected output amount of a Volary token swap based on the input amount and the selected exchange, with an optional slippage tolerance parameter.&#x20;

The function uses the Uniswap or Sushiswap router contract to get the swap rate and then calculates the expected output amount.

## Parameters

| Name         | Type   | Description                                                                                                   |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------- |
| `inAmount`   | string | The input amount of Volary tokens to be swapped.                                                              |
| `privateKey` | string | The private key of the user's wallet.                                                                         |
| `exchange`   | string | The exchange to use for the swap calculation. Supported values are "uniswap", "sushiswap", and "pancakeswap". |
| `slippage`   | string | Optional parameter to set the slippage tolerance for the swap calculation, default is 50.                     |

## Response

| Property       | Type   | Description                                          |
| -------------- | ------ | ---------------------------------------------------- |
| `outputAmount` | string | The expected output amount of tokens after the swap. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `getSwapAmountVolary` request using the Volary SDK:

```
// import Nest SDK library
const { dex } = require('@nest25/tokenomics-lib');

// create a new instance of the dex class
const Dex = new dex();

async function main() {
  // get swap amount from Volary
  const result = await Dex.getSwapAmountVolary('0.001', TEST_PRIVATE_KEY, 'uniswap');
  // log the result
  console.log(result);
}
main();
```

### Response

```
 Received 262895397847755609 VLRY
```

## Use Cases

* **Automated Trading Bots:** The `getSwapAmountVolary` function can be used by trading bots to calculate the expected output of a Volary token swap and execute the trade based on the predicted output.
* **Portfolio Management:** The function can be used by portfolio managers to determine the expected value of a Volary token swap before making a decision to execute the trade.
* **Crypto Exchanges:** Crypto exchanges can use this function to calculate the expected output amount for a Volary token swap and display it to users before they execute the trade on their platform.


# Storage SDK


# uploadToIPFS

## Description

The `uploadToIPFS` function uploads JSON data to the IPFS using the Pinata API and returns the IPFS hash of the uploaded data.

## Parameters

| Parameter            | Type   | Description                 |
| -------------------- | ------ | --------------------------- |
| `pinataApiKey`       | string | Pinata API key              |
| `pinataSecretApiKey` | string | Pinata API secret key       |
| `data`               | object | Data to be uploaded to IPFS |

## Response

| Property   | Type   | Description                    |
| ---------- | ------ | ------------------------------ |
| `ipfsHash` | string | IPFS hash of the uploaded data |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/storage-lib
OR
yarn add @nest25/storage-lib
```

### Request

Here is an example of how to make a `uploadToIPFS` request using the Volary SDK:

```javascript
// import Nest SDK library
const { StorageLibrary } = require('@nest25/storage-lib');
// create an instance of the storage library
const storageLibrary = new StorageLibrary();
// set the pinata api key and secret api key
const pinataApiKey = 'your-api-key';
const pinataSecretApiKey = 'your-secret-key';

async function main() {
  // upload data to IPFS
  const data = {
    name: 'test',
    age: 30,
  };
  // upload data to IPFS
  const result = await storageLibrary.uploadToIPFS(pinataApiKey, pinataSecretApiKey, data);
  // print the result
  console.log(result);
}
main();

```

### Response

```sh
 {
      IpfsHash: 'Qme6nVQjNfnrbFiZ5VFgbjvVL21xATkmH1gQWiQxtKJ6JY',
      PinSize: 32,
      Timestamp: '2023-03-09T08:36:16.052Z',
      isDuplicate: true
}
```

## Use Cases

* **NFT Marketplaces:** The function can be used by NFT marketplaces to upload NFT metadata to IPFS.
* **Decentralized Applications (DApps):** The function can be used by DApps to store data, such as user profiles or transaction records, on the IPFS network.
* **Digital Asset Management:** The function can be used by digital asset management systems to store and retrieve digital files, such as images or videos, on IPFS.


# fetchMetadata

## Description

The `fetchMetaData`function retrieves metadata associated with a given IPFS hash. It sends a GET request to the IPFS gateway to fetch the metadata and returns it as a response.&#x20;

## Parameters

| Parameter  | Type   | Description                                |
| ---------- | ------ | ------------------------------------------ |
| `ipfsHash` | string | The IPFS hash associated with the metadata |

## Response

| Property | Type   | Description                                         |
| -------- | ------ | --------------------------------------------------- |
| `data`   | object | The metadata object retrieved from the IPFS gateway |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/storage-lib
OR
yarn add @nest25/storage-lib
```

### Request

Here is an example of how to make a `fetchMetaData` request using the Volary SDK:

```
// import Nest SDK library
const { StorageLibrary } = require('@nest25/storage-lib');
// create an instance of the storage library
const storageLibrary = new StorageLibrary();

async function main() {
  // fetch metadata from ipfs hash and print it
  const ipfsHash = await storageLibrary.fetchMetadata('Qme6nVQjNfnrbFiZ5VFgbjvVL21xATkmH1gQWiQxtKJ6JY');
  console.log(ipfsHash);
}
main();
```

### Response

```
{ res: { name: 'test', age: 30 } }
```

## Use Cases

* **NFT Marketplaces:** The function can be used by NFT marketplaces to retrieve metadata for NFTs stored on IPFS.
* **DApps:** The function can be used by decentralized applications to retrieve metadata stored on IPFS.
* **DeFi Platforms:** The function can be used by DeFi platforms to retrieve metadata for various assets stored on IPFS.


# Casper SDK


# generateWallet

## Description

The `generateWallet` function generates a new key pair using the Ed25519 cryptographic algorithm.&#x20;

It then returns the public key, private key, and account hash for the newly generated wallet

## Parameters

This function does not take any parameters.

## Response

<table><thead><tr><th>Name</th><th width="130">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>privateKey</code></td><td>string</td><td>The private key of the newly generated wallet</td></tr><tr><td><code>publicKey</code></td><td>string</td><td>The public key of the newly generated wallet</td></tr><tr><td><code>accountHash</code></td><td>string</td><td>The account hash of the newly generated wallet on the specified blockchain network</td></tr></tbody></table>

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `generateWallet` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

async function main() {
  // generate a new wallet
  let wallet = await casper.generateWallet();
  console.log({ wallet });
}

main();

```

### Response

```sh
{
        wallet: {
          privateKey: '5PjVtasdHeiRVvKaRyhG7qKfWxZnzwez9FbNS9Qx8hALSiAWoE6C6HFSoctqxaZbErNNk9yYyfPwQ9pKiuSbyoi',
          publicKey: '01442e4e84C5Da665eCcFbf766400E9C6B21A0000f8cdc202E35133dA4A41A3715',
          accountHash: 'account-hash-26d819b30dafeb95f3bd333f1ba27ecab71b5a3637ea8e63725b8374abbe3875'
        }
      }
```

## Use Cases

* **Decentralized Applications:** The function can be used by decentralized applications to generate new public-private key pairs for user accounts and facilitate transactions on blockchain networks.
* **Blockchain Development:** The function can be used by developers to quickly generate test accounts and keys for development and testing purposes.
* **Blockchain Education:** The function can be used by educators and students to demonstrate and learn about public-private key pairs and their role in blockchain transactions.


# fetchWalletFromPrivateKey

## Description

The `fetchWalletfromPrivateKey` function generates a key pair (public key and private key) from a given private key. It makes use of the CasperClient library and the Ed25519 algorithm to generate the key pair.

## Parameters

| Name         | Type   | Description                                         |
| ------------ | ------ | --------------------------------------------------- |
| `privateKey` | string | The private key to be used to generate the key pair |
| `RPC_API`    | string | The RPC API to be used by the CasperClient          |

## Response

| Name      | Type   | Description                                                              |
| --------- | ------ | ------------------------------------------------------------------------ |
| `keyPair` | object | An object containing the generated public key and private key as buffers |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `fetchWalletfromPrivateKey` request using the Volary SDK:

````javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

// set testnet variables
const privateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  // fetch wallet from private key
  let { keyPair } = await casper.fetchWalletfromPrivateKey(privateKey, RPC_API);
  console.log(keyPair);
}
// call main function
main();

```
````

### Response

```sh
  {
        keyPair: t {
          publicKey: t { isCLValue: true, data: [Uint8Array], tag: 1 },
          privateKey: Uint8Array(64) [
            136, 103,  79,  12,  53,  66, 163, 104,  97, 238, 253,
            201,  63, 217,  28, 226,   8,  28, 163, 193, 111, 158,
            233, 203, 206, 234, 204, 112,  91, 196, 214, 176,  58,
             21, 106,  80, 252,  98, 132, 186,  67, 106, 237, 234,
            249, 107,  85, 172,  26,  12,  87, 238, 159, 138,  70,
            191,  28, 101,  24, 175, 233, 178, 245, 108
          ],
          signatureAlgorithm: 'ed25519'
        }
      }
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to generate key pairs from private keys.
* **Blockchain Applications:** The function can be used by blockchain applications to interact with the Casper network and sign transactions with generated key pairs.

<br>


# fetchAccountHash

## Description

The `fetchAccountHash` function takes a public key as input, converts it to an account hash using a third-party API, and returns the account hash as a string.

## Parameters

| Name        | Type   | Description                         |
| ----------- | ------ | ----------------------------------- |
| `publicKey` | string | The public key of the user's wallet |

## Response

| Name          | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| `accountHash` | string | The account hash of the user's wallet |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `fetchAccountHash` request using the Volary SDK:

```javascript

// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

async function main() {
  const publicKey = '013a156a50fc6284ba436aedeaf96b55ac1a0c57ee9f8a46bf1c6518afe9b2f56c';
  // fetch account hash from public key
  let accountHash = await casper.fetchAccountHash(publicKey);
  // print account hash
  console.log({ accountHash });
}
// call main function
main();
```

### Response

```sh
{
        accountHash: 'account-hash-6a43e8538b4b695b6670c30ecd1f9fea26400573954be066fda6314fc8e17f13'
}
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to retrieve the account hash of a user's wallet for transaction purposes.
* **Payment Gateways:** The function can be used by payment gateways to retrieve the account hash of a user's wallet for payment processing.


# getBalance

## Description

The `getBalance` function allows developers to retrieve the account balance of a specified public key on the Casper blockchain.

## Parameters

| Parameter   | Type   | Description                                               |
| ----------- | ------ | --------------------------------------------------------- |
| `publicKey` | string | The public key of the account to retrieve the balance for |
| `RPC_API`   | string | The RPC API endpoint of the Casper network                |

## Response

| Name      | Type   | Description                            |
| --------- | ------ | -------------------------------------- |
| `balance` | string | The balance of the account as a string |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `getBalance` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

const publicKey = '013a156a50fc6284ba436aedeaf96b55ac1a0c57ee9f8a46bf1c6518afe9b2f56c';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  let balance = await casper.getBalance(publicKey, RPC_API);
  console.log({ balance });
}
// call main function
main();
```

### Response

```sh
 { balance: '1975238447828' }
```

## Use Cases

* **Wallets:** The function can be used by cryptocurrency wallets to display the account balance of the user.
* **DApps:** The function can be used by decentralized applications on the Casper network to retrieve the account balance of a user.
* **Exchanges:** The function can be used by cryptocurrency exchanges to check the balance of user accounts before allowing them to make trades.

<br>


# transferTokens

## Description

The `transferTokens` function allows users to transfer tokens from one account to another on the Casper blockchain network.

## Parameters

| Parameter    | Type   | Description                               |
| ------------ | ------ | ----------------------------------------- |
| `RPC_API`    | string | The RPC endpoint of the Casper network    |
| `privateKey` | string | The private key of the sender's account   |
| `to`         | string | The public key of the recipient's account |
| `amount`     | number | The amount of tokens to transfer          |

## Response

| Name     | Type   | Description                                       |
| -------- | ------ | ------------------------------------------------- |
| `txHash` | string | The hash of the transaction on the Casper network |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request&#x20;

Here is an example of how to make a `transferTokens` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

const privateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  const to = '013a156a50fc6284ba436aedeaf96b55ac1a0c57ee9f8a46bf1c6518afe9b2f56c';
  const amount = 25 * 10 ** 9;
  // send CSPR tokens
  const txHash = await casper.transferTokens(RPC_API, privateKey, to, amount);
  console.log({ txHash });
}
// call main function
main();
```

### Response

```sh
{
        txHash: '6a72b901b92bbb6490da1d49ecc912d06c3358f17184f6213d04434dc8f451a4'
}
```

## Use Cases

* **Token Transfers:** The function can be used to transfer tokens from one account to another on the Casper blockchain network.
* **DApp Development:** The function can be used by developers to integrate token transfers into their decentralized applications built on the Casper blockchain network.


# deployNFTContract

## Description

The `deployNFTContract` function is a JavaScript function that facilitates the deployment of a new NFT contract on the Casper blockchain. The function uses the CasperClient and CEP47Client libraries to create and deploy the contract on the blockchain.

## Parameters

<table><thead><tr><th>Name</th><th width="126">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>RPC_API</code></td><td>string</td><td>The URL of the RPC API for the Casper network</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The user's private key for the Casper network</td></tr><tr><td><code>contractName</code></td><td>string</td><td>The name of the NFT contract to be deployed</td></tr><tr><td><code>tokenName</code></td><td>string</td><td>The name of the NFT token</td></tr><tr><td><code>symbol</code></td><td>string</td><td>The symbol of the NFT token</td></tr><tr><td><code>metadata</code></td><td>string</td><td>The metadata for the NFT token</td></tr></tbody></table>

## Response

| Name                   | Type   | Description                                                                                  |
| ---------------------- | ------ | -------------------------------------------------------------------------------------------- |
| `contractDeployResult` | object | The contract deployment result containing the hash, contract, and other relevant information |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `deployNFTContract` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

// set testnet variables
const privateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  // contract name for nft contract
  const contractName = 'RWSCT NFT Contract';
  // token name for nft contract
  const tokenName = 'Real World Smart Contract Token';
  // token symbol for nft contract
  const symbol = 'RWSCT';
  // metadata for nft contract
  const metadata = 'name RWSCT, description NFT_Contract, image img, royalty null, royaltyReceiver null';
  // deploy nft contract
  const txHash = await casper.deployNFTContract(RPC_API, privateKey, contractName, tokenName, symbol, metadata);
  // print txHash
  console.log(`Contract hash: ${txHash.hash}`);
}
// call main function
main();

```

### Response

```sh
    {
        hash: '20366757cf99cd8bb3db1ff2bb3b515dbb1a603bfba1e8633eab7b5cd310d4e0'
    }
```

## Use Cases

* **NFT Marketplaces:** The function can be used by NFT marketplaces to deploy new NFT contracts on the Casper blockchain.
* **Individual Creators:** The function can be used by individual creators to deploy their own NFT contracts and tokens on the Casper blockchain.
* **Businesses:** The function can be used by businesses to deploy their own branded NFT contracts and tokens on the Casper blockchain for promotional and marketing purposes.


# mintNFT

## Description

The `mintNFT` function is designed to facilitate the minting of non-fungible tokens (NFTs) on the Casper blockchain network. It takes user inputs to create and send a transaction to the network for minting the NFT

## Parameters

<table><thead><tr><th>Parameter</th><th width="156">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>RPC_API</code></td><td>string</td><td>The RPC API endpoint of the Casper blockchain network</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The private key of the wallet that will be used to mint the NFT</td></tr><tr><td><code>metadata</code></td><td>object</td><td>The metadata of the NFT that is being minted</td></tr></tbody></table>

## Response

| Property  | Type   | Description                                     |
| --------- | ------ | ----------------------------------------------- |
| `tokenId` | string | The unique identifier of the minted NFT         |
| `txHash`  | string | The transaction hash of the minting transaction |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `mintNFT` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

// set testnet variables
const testPrivateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  // metadata for nft
  const metadata = {
    name: 'Bored Ape Mango',
    description: 'Bored Ape Mango DESCRIPTION',
    image: 'img',
    royalty: '40',
  };
  // mint free nft
  const result = await casper.mintNFT(RPC_API, testPrivateKey, metadata);
  console.log(result);
}
// call main function
main();
```

### Response

```sh
 {
        tokenId: '164298',
        txHash: '0e65c21af14e52ecf426b46cad8df84940ab7c4a05e6c5e41eb993c855b7defc'
}
```

## Use Cases

* **Digital Art Marketplaces:** The function can be used by digital art marketplaces to mint NFTs for the artworks that are being sold on their platforms.
* **Gaming Industry:** The function can be used by the gaming industry to mint NFTs for in-game items and assets, which can be traded and sold on various marketplaces.
* **Collectibles:** The function can be used by collectibles platforms to mint NFTs for various types of collectibles, such as sports cards, rare coins, and other memorabilia.


# mintFreeNFT

## Description

The `mintFreeNFT` function is used to mint a free NFT (Non-Fungible Token) for a specified recipient with the provided metadata. It sends a request to a blockchain explorer API with specific parameters, including the recipient's address and the metadata required to create the NFT. The function then receives a response indicating the status of the minting process.

## Parameters

| Parameter   | Data Type | Description                                                                                                   |
| ----------- | --------- | ------------------------------------------------------------------------------------------------------------- |
| `recipient` | any       | The recipient's address to whom the minted NFT will be transferred.                                           |
| `metadata`  | any       | The metadata required to create the NFT, such as token name, description, and any other relevant information. |

## Response

| Field    | Data Type | Description                                                                                                                                        |
| -------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`   | number    | A code indicating the status of the API request (1 for success, 0 for error).                                                                      |
| `result` | any       | The response data indicating the status of the NFT minting process. The specific structure may vary depending on the blockchain explorer API used. |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `mintFreeNFT` request using the Volary SDK:

```javascript
```

### Response

```sh
{
        code: 1,
        bid_tx_hash: '1ffc4f4ad1458d0355a837d8bfdcb475568dcda6b29ef30eaaee80dbf970e5bb'                                                     aaee80dbf970e5bb'
}
```

## Use Cases

* **Rewarding Users**: In a decentralized application (DApp) or online platform, the `mintFreeNFT` function can be used to reward users with free NFTs as part of promotional events, loyalty programs, or achievements.
* **Minting Collectibles**: The function can be employed in collectible NFT projects, where users can mint their own unique NFTs with custom metadata representing collectible items, artwork, or game assets.
* **NFT Giveaways**: For marketing or community engagement purposes, the function can be used to conduct NFT giveaways, allowing users to claim NFTs for free within a specified timeframe.
* **Airdrops**: In token airdrop campaigns, the `mintFreeNFT` function can be utilized to distribute NFTs to recipients who meet certain criteria, such as holding a specific token or being part of a particular community.
* **Testing and Development**: During the development and testing phase of an NFT-related project, the function can be used to create test NFTs with predefined metadata for simulation and debugging purposes.


# checkNFT

## Description

The `checkNFT` function checks the ownership and metadata of a specific non-fungible token (NFT) on the Casper blockchain and returns the NFT's ownership and metadata

## Parameters

<table><thead><tr><th>Name</th><th width="158">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>RPC_API</code></td><td>string</td><td>The RPC API endpoint of the Casper blockchain</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The user's private key in string format</td></tr><tr><td><code>tokenId</code></td><td>string</td><td>The user's private key in string format</td></tr></tbody></table>

## Response

<table><thead><tr><th>Name</th><th width="111">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code></td><td>number</td><td>Indicates if the function was successful (1) or not (0)</td></tr><tr><td><code>balanceOf</code></td><td>number</td><td>The balance of the user's account</td></tr><tr><td><code>ownerOfTokenOne</code></td><td>string</td><td>The public key of the NFT's owner</td></tr><tr><td><code>tokenOneMeta</code></td><td>object</td><td>The metadata of the NFT</td></tr></tbody></table>

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `checkNFT` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

// set testnet variables
const privateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  // check NFT data using tokenId
  const checkData = await casper.checkNFT(RPC_API, privateKey, '164298');
  console.log(checkData);
}
// call main function
main();
```

### Response

```sh
 {
        status: 1,
        balanceOf1: '6',
        ownerOfTokenOne: 'account-hash-b42ea6c352d692cff179749a5023189f92bec6ce81d2c19ad1a1ac2c2c009189',
        tokenOneMeta: Map(4) {
          'description' => 'Bored Ape Mango DESCRIPTION',
          'image' => 'img',
          'name' => 'Bored Ape Mango',
          'royalty' => '40'
        }
}
```

## Use cases

* **NFT marketplaces:** The function can be used by NFT marketplaces to verify the ownership and metadata of NFTs before displaying them for sale.
* **NFT collectors:** The function can be used by NFT collectors to check the ownership and metadata of NFTs they have acquired.
* **Smart contract developers:** The function can be used by smart contract developers to check the ownership and metadata of NFTs in their contracts.


# approveSale

## Description

The `approveSale` function facilitates the approval of a sale transaction of a non-fungible token (NFT) on the Casper blockchain.

The function makes use of the CasperClient and CEP47Client libraries to interact with the Casper blockchain and returns the transaction hash for the sale approval.

## Parameters

<table><thead><tr><th>Parameter</th><th width="147">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>RPC_API</code></td><td>string</td><td>The RPC API URL of the Casper network</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The private key of the user</td></tr><tr><td><code>tokenId</code></td><td>number</td><td>The ID of the NFT to be sold</td></tr></tbody></table>

## Response

| Property  | Type   | Description                               |
| --------- | ------ | ----------------------------------------- |
| `tokenId` | number | The ID of the NFT that was sold           |
| `txHash`  | string | The transaction hash of the sale approval |

## Example Request and Response

### Prerequisites&#x20;

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `approveSale` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

// set testnet variables
const testPrivateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  // call approveSale function
  const result = await casper.approveSale(RPC_API, testPrivateKey, 872222);
  console.log(result);
}
// call main function
main();
```

### Response

```sh
 {
        tokenId: 872222,
        txHash: '67e8a347a345dfc6718ccaad513df7bc9c33a99b5273ae14f22c90b06585c627'
}
```

## Use Cases

* **NFT Marketplace:** The function can be used by an NFT marketplace to facilitate the sale of NFTs on the Casper blockchain.
* **Individual NFT Owners:** The function can be used by individual NFT owners to approve the sale of their NFTs on the Casper blockchain.
* **NFT Collectors:** The function can be used by NFT collectors to approve the sale of NFTs they wish to acquire on the Casper blockchain.


# transferNFT

## Description

The `transferNFT` function allows for the transfer of a non-fungible token (NFT) between two addresses on the Casper blockchain network.&#x20;

The function uses the CEP47Client library and makes use of the CasperServiceByJsonRPC to retrieve the state root hash and account information.

## Parameters

| Name         | Type   | Description                             |
| ------------ | ------ | --------------------------------------- |
| `RPC_API`    | string | The RPC API for the Casper network      |
| `privateKey` | string | The private key of the owner of the NFT |
| `receiver`   | string | The receiver address for the NFT        |
| `tokenId`    | string | The ID of the NFT being transferred     |
| `owner`      | string | The current owner of the NFT            |

## Response

| Name      | Type   | Description                          |
| --------- | ------ | ------------------------------------ |
| `tokenId` | string | The ID of the transferred NFT        |
| `txHash`  | string | The transaction hash of the transfer |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `transferNFT` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

// set testnet variables
const testPrivateKey = 'your-private-key';
const publicKey = '013a156a50fc6284ba436aedeaf96b55ac1a0c57ee9f8a46bf1c6518afe9b2f56c';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  // transfer NFT
  const result = await casper.transferNFT(
    RPC_API,
    testPrivateKey,
    872222,
    '017224493871278b24d2e9588b0ccc2f80e226aaff9b676ca00d031221bc73b61e',
    publicKey,
  );
  // print result
  console.log(result);
}
// call main function
main();
```

### Response

```sh
 {
        tokenId: 872222,
        txHash: '97d7b930bfb83474202ec4f5351be8c6666de3e212398b6cb814b163ca3192f3'
}
```

## Use Cases

* **NFT Marketplaces:** The `transferNFT` function can be used by NFT marketplaces to facilitate the transfer of NFTs between buyers and sellers.
* **Gaming Platforms:** The function can be used by gaming platforms to transfer NFT assets between players.
* **Decentralized Applications:** The `transferNFT` function can be used by developers building decentralized applications that require the transfer of NFTs on the Casper network.




---

[Next Page](/llms-full.txt/1)

