What You’ll Learn
- Create a Para account and wallet client
- Onboard users into Dinari with their Para wallet
- Order tokenized stocks with Dinari
Overview
The user signs in with Para, and your server creates a DinariEntity and has the user complete Dinari’s hosted KYC. Once KYC passes, you open a Dinari Account and link the user’s Para wallet to it by having Para sign an ownership message. To trade, Dinari issues an order permit, Para signs it, and the order is submitted; the dShares then arrive in the user’s Para wallet.
Why Combine Para and Dinari
What You Need
- Para API key from the Para dashboard
- Dinari sandbox credentials (
DINARI_API_KEY_ID,DINARI_API_SECRET_KEY) from the Dinari Partner Portal. See the Dinari Quickstart for setup.
Part 1: Set Up Para and Dinari
Step 1: Install and Configure
.env
Step 2: Initialize the Clients
Complete Para authentication before signing anything.client.ts
server.ts
Part 2: Onboard the User
Each user maps to a DinariEntity (holds KYC), which owns an Account (holds orders and balances). Every step below reuses what already exists, so retries and server restarts are safe.
Step 3: Create an Entity
server.ts
reference_id, and persist the returned IDs in your database.
Step 4: Verify Identity (KYC)
Dinari hosts the identity check. Create a managed check and show the returned URL to the user.server.ts
PASS. Keep polling on PENDING, INCOMPLETE, or NEEDS_REVIEW; stop on FAIL.
server.ts
Step 5: Create an Account
Only after KYC passes.server.ts
Step 6: Link the Para Wallet
Dinari verifies wallet ownership with a signed message.eip155:0 links the wallet as an EOA across all supported EVM chains.
server.ts
Part 3: Place an Order
Step 7: Create an Order Permit
Find a dShare for the stock on your chain, then ask Dinari for an EIP-712 permit authorizing the payment.server.ts
asset_token_quantity instead; limit orders add limit_price.
Step 8: Sign and Submit
client.ts
- Gasless (Dinari Submits)
- Self-Submitted
Dinari broadcasts the order and pays the gas.
server.ts
Step 9: Track the Order
server.ts
Complete Example
The happy path from start to finish: a new user passes KYC, links their Para wallet, and buys $100 of AAPL with a gasless order. Lines marked// client run in the browser with Para; everything else runs on your server.