/v2 swaps.
How it works
Funding the lockup is accepting the quote: there is no separate accept step.
The SDK splits the work in two:
IntentsCorridortalks to the maker: discovery card, quotes, and status. It is in the core of every runtime.- The Arkade venue (
@kaleidorg/swap-sdk/arkade, TypeScript and React Native) does what needs an Arkade wallet: funding, claiming, refunding, and recovery.
ARKD appears in the maker’s pair catalogue, but createReverseSwap({ to: "ARKD" }) is refused: use the corridor.
Setup
@arkade-os/sdk. The corridor speaks to the same maker URL as the rest of the SDK.
Discover the corridor
TypeScript
corridor.cardRaw(), verify the Schnorr signature over the SHA-256 of the compact card without its sig field (in the maker’s serialization order, processed losslessly), and establish trust in its discovery_pubkey separately.
Quote
A refusal is an answer, not an error: it comes back as a value.bigint amounts, so a quote can be passed straight to @arkade-os/swap.
Pay or receive with the venue
Install the venue’s peers alongside the SDK:@arkade-os/sdk and @arkade-os/swap.
TypeScript
venue.reconcile() from your own scheduler (an interval in Node, chrome.alarms in an MV3 extension). Each pass claims funded receives, refunds matured sends, and settles records from chain evidence. The venue runs no timers of its own and does not trust status messages from the relay.
On React Native, import the venue from @kaleidorg/swap-sdk-react-native/arkade.
If something goes wrong
- The maker refuses a quote: that is an answer, not an error. Show
answer.reasonand try another amount. - The maker never pays your invoice:
venue.reconcile()refunds the lockup once its deadline passes. - Your app restarts mid-swap: the venue saved its record before you funded anything. Use a persistent store, then keep calling
reconcile().