⛏️createToken

Description

The createToken function allows for the creation of a new token on the Solana blockchain.

Parameter

NameTypeDescription

privatekey

string

Private key of the account that will be used to create the token

amount

number

Amount of tokens to mint

Response

NameTypeDescription

mint

string

The public key of the newly created token mint

Example Request and Response

Prerequisites

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

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

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 NEST® SDK:

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

Last updated