Script
How to use the batch minting script.
SUIRC-20 Batch Minting Script Usage Guide
This document provides instructions on how to use the batch minting script for the Sui blockchain using TypeScript and Sui TypeScript SDK. This script automates the process of minting tokens multiple times in a batch.
Prerequisites
Before you can run the script, ensure you have the following prerequisites:
- Node.js: Install Node.js (including npm) from Node.js Official Website.
Installation
- Clone or download the script to your local machine.
- Install necessary dependencies by running:
Preparing the Private Key
Store your private key in a file named private-key.txt in the same directory as the script. This key is used to authenticate transactions on the Sui network. Ensure this file is kept secure and not shared.
Running the Script
To run the script, use the following command structure:
amount
: The amount of the token to mint per operation. This should be equal to the tick’s deploy configuration.tick
: The tick (identifier) of the token you wish to mint.times
: The number of times you want to mint the specified amount of tokens.
Example
To mint 10 units of a token with the tick “test” for 100 times, use the following command:
Upon successful execution, the script will output the details of each transaction, including the total amount of tokens minted and the transaction IDs. For example:
Security and Considerations
- Private Key Security: The private key file (private-key.txt) should be kept secure and confidential.
- PackageID: Users need to replace the
SUIRC20
package online 14
onmint.ts
. - Error Handling: The script includes basic error handling. Monitor the output for any errors or failed transactions.
- Testing: It is recommended to thoroughly test the script in a test environment before running it on the main network.