Skip to main content

Availability

The LeoKit SDK is not published on npm. Don’t install a package named leokit-sdk from npm or any other registry: we don’t own that name, so anything published there isn’t ours.
To swap from your code today, use one of these:
  • The REST API with your LeoKit API key.
  • LeoDex’s public Swap API: one free key, no account, three HTTP calls.
  • The openswap CLI. Packages published by the npm user leodex are ours.
The SDK has five entry points:

Create a Client

LeoKitConfig

sdk.getConfig() returns the resolved ResolvedConfig (defaults filled in). sdk.getNetwork() returns the active Network.

End-to-End Swap

Where to Go Next

Wallets

19 adapters: MetaMask, Phantom, Ledger, Keplr, Trust, WalletConnect…

Quotes & Swaps

getQuote, streamQuote, executeSwap, transfer, transaction tracking

Limit Orders

THORChain / MAYAChain native limit orders

Shielded ZCash

WebZjs-backed shielded balance scan and transfer

Utilities

Amount math, chain helpers, asset parsing, error handling, events, icons