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


---

# Agent Instructions: Querying This Documentation

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

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

```
GET https://docs.volary.io/sdks-guide/blockchain-sdks/solana-sdk/createtoken.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

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