What We’re Building
A Next.js app that pairs Dynamic’s embedded wallets with Iron Finance’s payment rails so a user can:- Complete one-time KYC, register their embedded wallet, and add a SEPA bank account
- Onramp: get a live EUR → USDC quote, execute it, and receive a virtual IBAN (vIBAN) to send a SEPA transfer to. USDC is delivered to the embedded wallet automatically.
- Offramp: get a live USDC → EUR quote, execute it, and receive a deposit address. Sending USDC to it triggers a SEPA payout to the registered IBAN.
- View prior onramps and offramps with live status
How It Works
Iron exposes a quote + execute model around its/api/autoramps endpoint:
- Quote (
GET /api/autoramps/quote) returns a signed, time-limited rate for the requested direction, amount, and rails. - Execute (
POST /api/autoramps) creates an autoramp from that quote. The response includesdeposit_rails— a vIBAN (for onramps) or a deposit crypto address (for offramps) the user sends funds to. - When the deposit arrives, Iron converts and settles automatically to the destination registered on the autoramp (the user’s embedded wallet for onramps, their IBAN for offramps).
- Create an Iron customer
- Complete KYC identity verification (hosted link)
- Sign any required compliance documents
- Register the Dynamic embedded wallet (signed proof of ownership — Travel Rule)
- Add a SEPA bank account
- Done
Building the Application
Project setup
Scaffold a Next.js app and follow the JavaScript quickstart. This guide uses the headless@dynamic-labs-sdk/client (not the React SDK) with the EVM extension.
Dashboard: Under Chains & Networks, enable Ethereum and the stablecoin networks you use with Iron (for example Ethereum mainnet for USDC). Under Sign-in Methods, enable Email OTP and Google under Social Sign-in. Under Security → Allowed Origins, add the origin where the app runs (for example
http://localhost:3000).Install Dependencies
Configure Environment Variables
.env.local
IRON_API_KEY. Set IRON_ENVIRONMENT=sandbox while testing — in sandbox mode, KYC approvals can be simulated without real documents.
Initialize Dynamic
Create the Dynamic client with the EVM extension atsrc/lib/dynamic.ts:
src/lib/dynamic.ts
createDynamicClient(). The client auto-initializes on import — no explicit initializeClient() call is needed.
Configure Wallet Context (Providers)
Create aWalletContext that tracks the current EVM account and exposes auth/wallet helpers to all components:
src/lib/providers.tsx
Create Server-Side Iron API Routes
All calls to Iron are made from Next.js API routes. This keeps your Iron credentials server-side only. For example,src/app/api/iron/customers/route.ts:
src/app/api/iron/customers/route.ts
/api/iron/customers/[id]/wallets— register a crypto wallet with an Iron customer (required for Travel Rule compliance)/api/iron/customers/[id]/banks— add a SEPA bank account (fiat address)/api/iron/autoramps— create an onramp or offramp autoramp/api/iron/fiatcurrencies— list supported fiat currencies
src/app/api/iron/customers/[id]/banks/route.ts:
src/app/api/iron/customers/[id]/banks/route.ts
updateUser to persist progress in the user’s metadata across sessions so users don’t have to restart if they close the tab.
src/lib/hooks/useKYCMetadata.ts
Build the Onboarding Flow
The onboarding page (src/app/onboard/page.tsx) walks users through six steps. Use useWallet() to access the current EVM account for wallet registration and signing.
Wallet registration requires signing a proof-of-ownership message:
Build the Ramp Interface
With onboarding complete, the main page lets users create autoramps for either direction. The UI has two tabs: Offramp (crypto → fiat) and Onramp (fiat → crypto). Creating an Offramp Autoramp (Crypto → Fiat)Load Registered Wallets and Banks
Transaction History
List prior ramps withGET /api/iron/customers/[id]/autoramps. Each item includes kind, status, the embedded quote, and the deposit_rails so you can render a detail view without re-fetching.
Run the Application
http://localhost:3000. Make sure that origin is in Security → Allowed Origins in the Dynamic dashboard.
Conclusion
This integration demonstrates how Dynamic’s embedded wallets combine with Iron’s payment infrastructure to deliver a compliant onramp and offramp experience:- Embedded Wallets — Dynamic’s JS SDK handles wallet creation, authentication, and message signing; no seed phrase management for users
- KYC & Compliance — Iron’s hosted onboarding flow handles identity verification, document signing, and Travel Rule compliance
- Offramp — Users send USDC to an Iron-managed wallet address and receive EUR via SEPA directly in their bank account
- Onramp — Users send EUR via SEPA to a virtual IBAN and receive USDC in their Dynamic embedded wallet
- Persistent Autoramps — Conversion rules are set up once and reused for every subsequent deposit
- Persistent State — Dynamic user metadata (
updateUser) keeps onboarding progress safe across sessions