Skip to main content
You’ll install @stablechain/sdk, create a client signed by a private key, send a USDT0 transfer on Stable Testnet, and fetch a bridge and swap quote. Total time: about five minutes.
Stable uses USDT0 as the gas token. You only need testnet USDT0 to transact — there’s no separate native asset to fund.

Prerequisites

1. Install

Save your test key:

2. Create a client

Create index.ts:
createStable accepts three signing modes: account (server-side, shown above), transport (browser wallet via custom(window.ethereum)), or walletClient (a pre-built viem WalletClient). See Use the SDK with viem for all three.

3. Send a USDT0 transfer

Append to index.ts:
Run it:
Open the hash on the testnet explorer to confirm.

4. Quote a bridge

Bridge USDT0 from Ethereum Sepolia to Stable Testnet. quoteBridge is a read-only call — no signature, no gas:
Pass the quote into stable.bridge({ ...params, quote }) to execute. The SDK picks LayerZero for USDT0 → USDT0 routes and LI.FI for everything else.

5. Quote a swap

Swaps run on Stable through LI.FI. The quote returns the expected output and a pre-built transaction:
Call stable.swap({ ...params, quote: swapQuote }) to execute. Approval for ERC-20 sources is handled internally.

SDK reference

Every parameter, return type, and error class.

Use with viem

Switch between private-key, browser-wallet, and pre-built WalletClient signing.

Use with wagmi

Wire the SDK into a React app using wagmi hooks.
Last modified on May 11, 2026