V2 (recommended)
swapQuote(params: SwapV2QuoteParams)
Get a quote with normalized token direction.
bestMarketplace: stringswapId: stringfromTokenAmount/toTokenAmount: stringsmetrics: per-marketplace fulfillment and pricingmarketplaces: 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.
txid: stringmarketplace: stringrbfProtection?:{ 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 intry/catch and surface useful hints (slippage, insufficient balance, marketplace unsupported, swap expired). For network issues, check connectivity and API key validity.