OneSwap SDK
OneSwap lets you add token swaps to any app on the Canton Network.Amulet when you mean CC (Amulet).
What you get
- Swap tokens —
CC (Amulet),USDCx, and other CIP-56 tokens - Direct-party flow — users deposit from their own Canton party directly to pool parties
- Real-time quotes — prices, price impact, slippage protection, traffic-cost estimates
- Event-driven — poll or listen for swap completion
How swaps work
- Your app authenticates the developer with an API key
- The end user signs a OneSwap challenge with their wallet
- OneSwap verifies the signature and returns a short-lived wallet token
- You call
client.swaps.create()with that wallet token attached - OneSwap returns the pool swap party as
depositAddressplus adepositReference - The user sends tokens directly from that same party to the pool party and passes through the reference when the wallet supports Canton reason/reference metadata
- OneSwap executes the swap automatically and returns output to the depositor party
party ID string from the browser.
Current swap intents remain valid for 24 hours. Respect the returned expiresAt instead of assuming a shorter window.
Create your os_live_... API key in the wallet-authenticated OneSwap developer portal. SDK developer auth and SDK swap flows do not use site-access tokens or access codes. Legacy POST /api/sdk/register and POST /api/sdk/login are retired and return 410 Gone.
Quickstart
Install, configure, and run your first swap
SDK Methods
Every method and parameter