Create TRC10 Token on TRON network with nodejs

Nhan Cao
Nhan Cao
Jan 21 · 2 min read

Create TRC20 Token on TRON network with nodejs

About TRC10:

Create TRON wallet with browser extension


Go to setting, update environment to shasta

Get some TRX for development:

Install tronweb:

npm i tronweb --save


import TronWeb from 'tronweb'export default class TRONTokenClient {
async start(): Promise<any> {
const mainNetProvider = '';
const testNetProvider = '';
const netProvider = testNetProvider;
const HttpProvider = TronWeb.providers.HttpProvider; // Optional provider, can just use a url for the nodes instead
const fullNode = new HttpProvider(`${netProvider}`); // Full node http endpoint
const solidityNode = new HttpProvider(`${netProvider}`); // Solidity node http endpoint
const eventServer = `${netProvider}`; // Contract events http endpoint
const privateKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const tronWeb = new TronWeb(
const defaultTestAddress = tronWeb.address.fromPrivateKey(privateKey);
await this.createTestTRC10Token(tronWeb, defaultTestAddress, privateKey);
// Verify at:
async signAndSubmitTx(tronWeb, rawTxObject, privateKey) {
const sign = await tronWeb.trx.sign(rawTxObject, privateKey);
const tx = await tronWeb.trx.sendRawTransaction(sign);
// console.log(tx);
return tx;
async createTestTRC10Token(tronWeb, issuerAddress, privateKey) {
try {
let options = {
name: 'EricCaoToken',
abbreviation: 'nhancv',
description: 'Nhan Cao Token for Test',
url: '',
totalSupply: 1000000000,
trxRatio: 1, // How much TRX will tokenRatio cost?
tokenRatio: 1, // How many tokens will trxRatio afford?
saleStart: + 10000, // sale start mus > now
saleEnd: + 31536000000, // 365 days
freeBandwidth: 0, // The creator's "donated" bandwidth for use by token holders
freeBandwidthLimit: 0, // Out of totalFreeBandwidth, the amount each token holder get
frozenAmount: 0,
frozenDuration: 0
const issuerHex = tronWeb.address.toHex(issuerAddress);
const rawTxObj = await tronWeb.transactionBuilder.createToken(options, issuerHex);
const res = await this.signAndSubmitTx(tronWeb, rawTxObj, privateKey);
} catch (e) {

Note: An account can only issue one asset

Nhan Cao

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade