🎉 ⏱ Ready to build? Get early access now!⏱ 🎉
Create your own token with TypeScript
Creating tokens that can be used as your own currency with the thirdweb TypeScript SDK
Intro
This guide explains how to create your own currency. We need to create a project in the dashboard and create a Token module inside our project. We also need to connect a wallet. So if you don't have a wallet, make sure to sign up with MetaMask or CoinWallet. If don't have a wallet, you can follow this guide to create one.
Dashboard setup
The first thing we need to do is head over to the dashboard and create a project and a Token module. if you don't know how to do this, check out this guide.
Once your Token module has been created, it's time to mint our own currency, but we don't need the dashboard for that! For use cases where the interaction has a high frequency and requires conditions, using the sdk is more efficient.

The code
1. Install the SDK
Next up use we'll install the ThirdWeb SDK using npm!
SDK installation and setup with TypeScript
- @3rdweb/sdk - thirdweb TypeScript SDK.
- ethers - will give us very useful utils.
- dotenv - to hide our private key.
- typescript - since this is a TypeScript project
- @types/node - typing for node as a dev dependency.
- tslib - utility package
npm init -y npm install @3rdweb/sdk ethers dotenv npm install --save-dev typescript @types/node ts-node tslib
2. Import the SDK
Let's take the code step by step.
Create a file called currency.ts

In order to make use of our SDK, you need to establish a connection to a blockchain. Click here to learn how to connect to the blockchain and instantiate our SDK.
For this guide, you will need to instantiate the SDK following these steps, using your own signer with thirdweb.
3. Define which module to use
Now we need to define which module we want to use. This is the module we just created inside our project Making your own currency. We called the module Pratham Coin. This module has an address. We need to pass the address here. You can find the address here, under Pratham Coin:
In our currency.ts
we include the following code.
The token variable uses the token module inside the sdk with our address for the token smart contract.

// Instantiate Token module const token = sdk.getTokenModule("0x74846071E984C0039c597b0f3975814d111eF5F6");
4. Time to mint the coins (tokens)!
The arguments passed over here are the same as minting the tokens inside the dashboard. If you want to familiarize yourself with the process, check out the dashboard! Ethereum deals with 18 decimals, so we need to adjust the input figure.
// Set the amount of currency you want to mint // (Actual amount, number of decimals) const amount = ethers.utils.parseUnits("1000", 18) // Minting the currency, 1000 Pratham coin async function mintCurrency() { console.log(await token.mint(amount)) } // Running the entire thing mintCurrency()
So the only thing left is to run our code! Open a terminal and paste the following:
# Runs the TypeScript file npx ts-node index.ts
5. Results
Get the balance to check it out or head over to the dashboard.

That's it!
Congratulations! You have now created your own currency using only TypeScript code! The next step is spending it!