Here we can see how to issue a new token. Each token depends on who issued the token. They all have the same codeHash and the args value depends on the issuer.
import { ConnectionService, Environments, WalletService, Logger } from"../src";constckbUrl="http://localhost:8117/rpc";constindexerUrl="http://localhost:8117/indexer";constmnemonic="private pond zero popular fashion omit february obscure pattern city camp pistol";constmain=async () => {try {constconnectionService=newConnectionService(ckbUrl, indexerUrl,Environments.Testnet);constwallet=newWalletService(connectionService, mnemonic);consttxHash=awaitwallet.issueTokens(1000, mnemonic);Logger.info(txHash);// This balance will be updated when we sync after the tx status is committedawaitwallet.synchronize();consttokensBalance=wallet.getTokensBalance();Logger.info(tokensBalance); } catch (error) {Logger.error(`${error.name}: ${error.message}`); }};main();
This method is not properly tested and should be used only on testnet.