Deploy and Mint a Fund using the TypeScript Client
Step-by-step guide for creating and minting fund 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)
Note: Your wallet address is available via ATK while signing up, or you can get it from Step 2. You'll need it for Steps 3, 5, and 7.
Quick reference
| Step | What | Method |
|---|---|---|
| 1 | Initialize Client | createClient |
| 2 | Get user info | client.user.me |
| 3 | Grant system roles | Set Up Roles guide |
| 4 | Create fund token | client.token.create (type: "fund") |
| 5 | Grant token roles | client.token.grantRole (Set Up Roles Step 4) |
| 6 | Unpause token | client.token.unpause |
| 7 | Mint fund units | client.token.mint |
| 8 | Verify balances & NAV claims | 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: Grant yourself the tokenManager system role to create tokens.
Follow the Set Up Roles guide:
- Grant system roles:
tokenManager- Required to create tokens - Register identity: REQUIRED before minting
Those sections in the roles guide include the full code snippets—copy them 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 and register your identity.
Step 4: Create fund token
Note: Ensure you have the tokenManager system role from Step 3.
Parameters:
type: Must be"fund"name: Fund name (e.g., "Global Growth Fund Class A")symbol: Fund symbol (e.g., "GGFA")decimals: Use18for fractional units (recommended) or0for whole units onlycountryCode: ISO country code (840 = USA, 056 = Belgium, 276 = Germany)priceCurrency: ISO currency code (e.g., "USD")basePrice: Reference NAV per unit (e.g.,from("100.00", 2)= USD 100.00)class: One of thefundClassesvalues (LONG_SHORT_EQUITY,ABSOLUTE_RETURN,REGIONAL, etc.)category: One of thefundCategoriesvalues (MULTI_STRATEGY,VENTURE_CAPITAL,EQUITY_HEDGE, etc.)managementFeeBps: Management fee in basis points (0-10,000).150= 1.5% annual feeuniqueIdentifier: Optional ISIN for reporting (omit for private or unregistered funds)initialModulePairs: Compliance modules (empty array[]for basic setup)
Expected: Returns fund 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/redemptions) and emergency (for unpausing) roles on the fund 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.
Note: Add governance to the roles array if you plan to update valuation or redemption parameters via API.
Step 6: Unpause the fund
New tokens start paused. Unpause to enable transfers:
Expected: Transaction completes and fund is unpaused.
Step 7: Mint fund units
IMPORTANT: The recipient wallet address must be registered in the identity registry before minting. If you're minting to your own wallet, ensure your identity is registered (see Step 3). For other recipients, register them using Set Up Roles guide Step 3.
Parameters:
contract: Your fund contract addressrecipients: Array of recipient wallet address(es) - must be verified in identity registryamounts: Array of amounts in smallest unit (BigInt)- When
decimals = 18, scale by10^18(e.g.,BigInt("100000000000000000000")= 100 units) - If you used 0 decimals, amounts are literal unit counts (e.g.,
BigInt(100)= 100 units)
- When
Expected: Returns transaction hash.
Note: This step requires the supplyManagement role from Step 5. If you get "RecipientNotVerified" error, register the recipient wallet in the identity registry first using client.system.identity.create (see Set Up Roles guide Step 3).
Step 8: Verify holders
Expected: Shows fund holders with their balances. You should see the recipient with the minted balance plus identity claims (NAV, management fee, optional ISIN), mirroring the dashboard view.
FULL SCRIPT
Troubleshooting
- "tokenManager required" → Grant
tokenManagersystem role via Set Up Roles guide Step 2. - "Basis points cannot exceed 10000" → Keep
managementFeeBpsbetween 0 and 10,000. - "Invalid enum value" for class/category → Use values from
fundClasses/fundCategories(e.g.,LONG_SHORT_EQUITY,VENTURE_CAPITAL). - "Token is paused" → Run Step 6 and ensure
emergencyrole is assigned. Wait for transaction confirmation after granting roles. - "Permission denied" during mint → Confirm
supplyManagementrole from Step 5. - "RecipientNotVerified" → Register the recipient wallet in the identity registry using Set Up Roles guide Step 3.
- "PINCODE_INVALID" → Reset or re-enter PINCODE from Account → Wallet.