Developer guidesAPI integration

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:

  1. Platform URL - Know your ATK platform URL (e.g., https://your-platform.example.com)
  2. Deploy ATK - Have a running ATK instance (local or hosted)
  3. Sign up - Create a user account through the ATK UI with email/password
  4. Enable PINCODE - Set up PINCODE during onboarding. Manage it from Account → Wallet.
  5. Admin role - Your account must have admin role 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

StepWhatMethod
1Initialize ClientcreateClient
2Get user infoclient.user.me
3Grant system rolesSet Up Roles guide
4Create fund tokenclient.token.create (type: "fund")
5Grant token rolesclient.token.grantRole (Set Up Roles Step 4)
6Unpause tokenclient.token.unpause
7Mint fund unitsclient.token.mint
8Verify balances & NAV claimsclient.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: Use 18 for fractional units (recommended) or 0 for whole units only
  • countryCode: 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 the fundClasses values (LONG_SHORT_EQUITY, ABSOLUTE_RETURN, REGIONAL, etc.)
  • category: One of the fundCategories values (MULTI_STRATEGY, VENTURE_CAPITAL, EQUITY_HEDGE, etc.)
  • managementFeeBps: Management fee in basis points (0-10,000). 150 = 1.5% annual fee
  • uniqueIdentifier: 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 address
  • recipients: Array of recipient wallet address(es) - must be verified in identity registry
  • amounts: Array of amounts in smallest unit (BigInt)
    • When decimals = 18, scale by 10^18 (e.g., BigInt("100000000000000000000") = 100 units)
    • If you used 0 decimals, amounts are literal unit counts (e.g., BigInt(100) = 100 units)

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 tokenManager system role via Set Up Roles guide Step 2.
  • "Basis points cannot exceed 10000" → Keep managementFeeBps between 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 emergency role is assigned. Wait for transaction confirmation after granting roles.
  • "Permission denied" during mint → Confirm supplyManagement role 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.

On this page