Configure

SDK Constructor

new StableSDK({ network, signer, rpcUrls })

Parameters

1

network

Specifies whether the SDK operates on Mainnet or Testnet.

'Mainnet' | 'Testnet' 
2

signer

An instance of EvmSigner (e.g. ViemSigner) used to sign transactions.

3

rpcUrls (optional)

Override default RPCs by providing custom URLs per chain.

When not provided, the SDK uses Viem’s default RPCs.

You can specify URLs for only some chains, the SDK will use your provided RPCs where available and fall back to defaults elsewhere. For each chain, the same RPC will be used for both read and write operations.

Example

import { ViemSigner } from "@stable-io/sdk";
import { privateKeyToAccount } from "viem/accounts";

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",
  },
});

Last updated

Was this helpful?