Deploy and Mint a Bond using the TypeScript Client
Step-by-step guide for creating and minting bond tokens using the ATK TypeScript Client
PREREQUISITES
Before running these commands, you need to:
- Platform URL - Know your ATK platform URL (e.g.,
https://your-platform.example.com) - Deploy ATK - Have a running ATK instance (local or hosted)
- Sign up - Create a user account through the ATK UI with email/password
- Enable PINCODE - Set up PINCODE during onboarding. Manage it from Account → Wallet.
- Admin role - Your account must have
adminrole to grant system roles (Step 3) - Stablecoin (denomination asset) - Have a deployed stablecoin contract address. You can create one using the Stablecoin Guide or use an existing stablecoin contract address
Note: Your wallet address is available via ATK while signing up, or you can get it from Step 2. You'll need your wallet address and a deployed stablecoin contract address (denomination asset) for this guide.
Quick reference
| Step | What | Method |
|---|---|---|
| 1 | Initialize Client | createClient |
| 2 | Get user info | client.user.me |
| 3 | Grant system roles | See Set Up Roles guide |
| 4 | Create bond | client.token.create (type: "bond") |
| 5 | Grant token roles | See Set Up Roles guide |
| 6 | Unpause | client.token.unpause |
| 7 | Mint bonds | client.token.mint |
| 8 | Verify | client.token.holders |
STEP-BY-STEP COMMANDS
Step 1: Initialize Client
Initialize the ORPC client with your platform URL and authentication token.
Client helper implementation
The createClient helper configures the ORPC client with required serializers and headers. Implementation:
Step 2: check you're logged in
Save your wallet address - you'll need it!
Step 3: set up system roles
REQUIRED: Complete these steps to grant yourself the necessary system roles.
Follow the Set Up Roles guide:
- Grant system roles:
tokenManager- Required to create tokens
Those sections in the roles guide include the full TypeScript client calls—copy the code snippets directly to satisfy this step.
Note: Only users with admin role can grant system roles. If you don't have admin access, ask your system administrator to grant you the tokenManager role.
Step 4: create bond token
Parameters:
type: Must be"bond"name: Bond name (e.g., "Test Corporate Bond")symbol: Bond symbol (e.g., "TCBD")decimals: Usually18for bondscountryCode: ISO country code (840 = USA, 056 = Belgium, 276 = Germany)cap: Maximum supply (e.g.,1000000000000000000000000n= 1M bonds with 18 decimals)faceValue: Redemption value per bond (e.g.,1000000000000000000000n= 1000 tokens with 18 decimals)maturityDate: When the bond matures (Date object)denominationAsset: Your stablecoin contract address from the stablecoin guideinitialModulePairs: Compliance modules (empty array[]for basic setup)
Expected: Returns bond data with id (contract address)
SAVE THE CONTRACT ADDRESS from the response! You need it for Step 5.
Step 5: grant token roles
REQUIRED: Grant yourself supplyManagement (for minting) and emergency (for unpausing) roles on the bond contract.
Note: When you create a token, you automatically receive the admin role (which allows you to grant other roles) and the governance role. You must grant yourself supplyManagement and emergency roles before minting and unpausing.
Expected: The role grant transaction completes. Wait for transaction confirmation before proceeding to Step 6.
Step 6: unpause the bond
New tokens start paused. Unpause to enable transfers:
Note: This step requires the emergency role from Step 5. Make sure Step 5 completed successfully and the transaction was confirmed before unpausing.
Step 7: mint bonds
Parameters:
contract: Your bond contract addressrecipients: Array of recipient wallet address(es)amounts: Array of amounts in smallest unit (BigInt)- To mint X bonds with 18 decimals, use:
X * 10^18 - Example:
100n * 10n**18n= 100 bonds
- To mint X bonds with 18 decimals, use:
Expected: Returns transaction hash.
Note: This step requires the supplyManagement role from Step 5.
Step 8: verify the mint
Expected: Shows bond holders with their balances.
FULL SCRIPT
Troubleshooting
"Authentication missing" → Check your auth token in createClient.
"PINCODE_INVALID" → Reconfirm your PINCODE.
"USER_NOT_AUTHORIZED" / "tokenManager required" → Follow the Set Up Roles guide Step 2 to grant the tokenManager role (requires admin access).
"Permission denied" → Follow the Set Up Roles guide Step 4 to grant token roles.
"Token is paused" → Make sure Step 6 (unpause) succeeded and you have emergency role.
"Invalid denomination asset" → Verify your stablecoin contract address from the stablecoin guide.
"Maturity date must be in the future" → Use a future date.
API reference
Interactive ORPC API documentation with live testing capabilities. Explore type-safe procedures for token lifecycle, DALP operations, compliance enforcement, and identity management.
Deploy and Mint a Deposit Token using the TypeScript Client
Step-by-step guide for creating and minting deposit tokens using the ATK TypeScript Client