Skip to main content

Rubic SDK — Overview

Rubic SDK is a lightweight TypeScript wrapper around the Rubic API. It provides a typed, ergonomic interface for integrating cross-chain and on-chain token swaps into any JavaScript or TypeScript application.

What it covers

  • Quoting — get all routes or the best route for a swap
  • Swapping — get transaction data ready to sign and send
  • Deposit trades — routes that don’t require a source wallet (send funds to a deposit address)
  • Status tracking — poll transaction status until it settles, with a built-in waitForStatus helper
  • Utility — allowance, approve, claim, refund, wallet auth
  • Info — supported chains and providers

Architecture

Your App


SDK.create({ referrer, apiKey, ... })

   ├── routes/     quoteAll · quoteBest · quoteDepositTrades
   │               swap · swapBest · swapDepositTrade

   ├── info/       getChains · getProviders · getStatusExtended
   │               waitForStatus (polling helper)

   └── utility/    allowance · checkApprove · claim
                   celerRefund · authWalletMessage · healthcheck

Supported swap types

TypeDescription
Cross-chainSwap tokens across different blockchains via bridges
On-chainSwap tokens within the same blockchain via DEXes
Deposit tradesCross-chain swaps where you send funds to a deposit address (no wallet required on source)

Pages