Deploy and Mint Equity using the TypeScript Client
Step-by-step guide for creating and minting equity 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. When creating the equity token (Step 4), you'll need to choose:
- Equity class - Type of equity (e.g.,
COMMON_EQUITYfor common stock,PREFERRED_EQUITYfor preferred stock) - Equity category - Specific classification (e.g.,
VOTING_COMMON_STOCKfor voting shares,DUAL_CLASS_SHARESfor dual-class structures) - Optional ISIN - International Securities Identification Number if your shares are registered (e.g.,
"US0378331005")
You can use an empty array [] for initialModulePairs to start with basic compliance and configure modules later.
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 equity token | client.token.create (type: "equity") |
| 5 | Grant token roles | client.token.grantRole (from Set Up Roles Step 4) |
| 6 | Unpause token | client.token.unpause |
| 7 | Mint shares | client.token.mint |
| 8 | Verify holders and metadata | 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 tokenscomplianceManager- Optional, if your compliance flow requires custom claim topics (Reg D vs. Reg S, KYC tiers, ROFR modules)
-
Register identity:
- CRITICAL: You must register your identity before minting equity tokens. This is required by the ERC-3643 standard.
- Use
client.system.identity.createto register your wallet address in the identity registry. - If minting to other recipients, they must also be registered before Step 7.
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 equity token
Parameters:
type: Must be"equity"name: Equity name (e.g., "Series B Voting Shares")symbol: Equity symbol (e.g., "SBVS")decimals: Use0for whole-share cap table parity (per the equity user guide) or18for fractionalized ownershipcountryCode: ISO country code (840 = USA, 056 = Belgium, 276 = Germany)priceCurrency: ISO currency code (e.g., "USD")basePrice: Reference valuation per share (e.g.,from("10.00", 2)= USD 10.00)class: One of theequityClassesvalues (COMMON_EQUITY,PREFERRED_EQUITY,SECTOR_INDUSTRY_EQUITY, etc.)category: One of theequityCategoriesvalues (VOTING_COMMON_STOCK,DUAL_CLASS_SHARES, etc.)uniqueIdentifier: Optional ISIN for reporting (omit for private or pre-ISIN rounds)initialModulePairs: Compliance modules (empty array[]for basic setup)
Expected: Returns equity 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 equity 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 change compliance modules or ROFR settings via API.
Step 6: unpause the equity
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 shares
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 equity contract addressrecipients: Array of recipient wallet address(es) - must be verified in identity registryamounts: Array of amounts in smallest unit (BigInt)- When
decimals = 0, amounts are literal share counts (e.g.,BigInt(100)= 100 shares) - If you used 18 decimals, scale by
10^18like any ERC-20 (e.g.,BigInt("100000000000000000000")= 100 shares)
- 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 equity holders with their balances. You should see the recipient with the minted balance plus identity claims that include the price reference, share class, and any compliance metadata.
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.
"RecipientNotVerified" → The recipient wallet must be registered in the identity registry before minting. Follow Set Up Roles guide Step 3 to register the recipient wallet using client.system.identity.create.
"Invalid enum value" for class or category → Use values from the platform taxonomy (COMMON_EQUITY, PREFERRED_EQUITY, VOTING_COMMON_STOCK, etc.).