Skip to main content

V2 (recommended)

swapQuote(params: SwapV2QuoteParams)

Get a quote with normalized token direction.
Response highlights
  • bestMarketplace: string
  • swapId: string
  • fromTokenAmount / toTokenAmount: strings
  • metrics: per-marketplace fulfillment and pricing
  • marketplaces: per-marketplace amounts + swapIds

swapPSBT(params: SwapV2PSBTParams)

Create PSBT(s) for the swap; returns an array because some swaps need multiple signatures.

swapSubmit(params: SwapV2SubmitParams)

Submit signed PSBTs to complete the swap.
Response highlights
  • txid: string
  • marketplace: string
  • rbfProtection?: { fundsPreparationTxId, fulfillmentId }
  • isRbfTxid: boolean

V1 (legacy rune trading)

These methods stay for existing integrations and RBF flows.
  • signIn({ ord_address, btc_address, ord_public_key, btc_public_key, provider })
  • bind({ btcAddress, nftAddress, sign })
  • points({ ord_address })
  • popularCollections()
  • search({ rune_name, sell? })
  • fetchQuote({ btcAmount, runeName, address, marketplaces?, themeID?, sell?, rbfProtection?, fill? })
  • getPSBT({ orders, address, publicKey, paymentAddress, paymentPublicKey, runeName, utxos?, feeRate?, slippage?, themeID?, sell?, rbfProtection? })
  • confirmPSBT({ orders, address, publicKey, paymentAddress, paymentPublicKey, signedPsbtBase64, signedRbfPsbtBase64?, swapId, runeName, sell?, marketplaces?, rbfProtection? })

V1 flow (short)

Errors

All methods throw descriptive errors. Wrap calls in try/catch and surface useful hints (slippage, insufficient balance, marketplace unsupported, swap expired). For network issues, check connectivity and API key validity.