🔗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

ParameterTypeDescription

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

PropertyTypeDescription

Promise<Object>

object

Returns the transaction receipt object.

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/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib

Request

Here is an example of how to make a bulkMint request using the NEST® 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.

Last updated