Skip to main content

Example 0 – Aggregator (swaps + borrow)

Example 1 – Buy runes (BTC → rune)

Example 2 – Sell runes (rune → BTC)

Example 3 – Alkanes swap (BTC → token)

Error-handling tips

  • Network issues: check API key + connectivity; retry with backoff.
  • Slippage/amount errors: increase slippage or reduce amount.
  • Marketplace errors: try another marketplace from the quote.
  • Swap expiration: re-run swapQuote to refresh the session.