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.
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?