A client library for interacting with the stellar-router contracts from JS/TS.
npm install stellar-router-sdk
import { RouterClient } from "stellar-router-sdk";
const client = new RouterClient({ network: "testnet", coreContractId: "C...", keypair: Keypair.fromSecret("S..."), });
const address = await client.resolve("oracle"); await client.registerRoute("oracle", "C...", { description: "Price feed" });
- resolve(name) → Promise
- registerRoute(name, address, metadata?) → Promise
- updateRoute(name, newAddress) → Promise
- removeRoute(name) → Promise
- setRoutePaused(name, paused) → Promise
- setPaused(paused) → Promise
- getRoute(name) → Promise<RouteEntry | null>
- totalRouted() → Promise
All methods throw RouterSdkError with a .code (e.g. "RouteNotFound") on failure.
npm version patch && npm publish