Quickstart
Install
To get started, install the latest version of Stableit SDK.
npm install @stable-io/sdk
Initialize the SDK
import { ViemSigner } from "@stable-io/sdk";
import { privateKeyToAccount } from "viem/accounts";
import StableSDK from "@stable-io/sdk";
const privateKey = process.env.EVM_PRIVATE_KEY;
const account = privateKeyToAccount(privateKey);
const sdk = new StableSDK({
network: "Testnet",
signer: new ViemSigner(account),
rpcUrls: { // optional
Ethereum: "https://ethereum-sepolia.rpc.subquery.network/public",
},
});
How to use the SDK
1
Initialize the SDK
Create a Stableit SDK instance by providing a network, signer (e.g. Viem account), and optional RPCs.
2
Find Routes
Call findRoutes(intent) with source/target chains, amount, and addresses to get available transfer routes.
3
Check Funds (optional but recommended)
Use checkHasEnoughFunds(route) to ensure the sender can cover all fees.
4
Execute the Route
Run executeRoute(route) to sign and submit all necessary transactions—either using pre-approval or permit.
Last updated
Was this helpful?