Quickstart
Submit your first settlement obligation on devnet in five minutes.
1. Install the SDK
# TypeScript
npm i @orrery/sdk
# Rust (private registry during beta - your invite includes the git URL)
# Cargo.toml: orrery = { git = "https://git.orrerysim.com/sdk/orrery-rs" }
Packages are published to a private registry during beta. Your access invite includes the registry token.
2. Authenticate
All requests use a bearer API key scoped to your devnet organisation. Create one in the partner portal and export it:
export ORRERY_API_KEY="sk_devnet_..."
3. Create an obligation
import { Orrery } from "@orrery/sdk";
const o = new Orrery({ apiKey: process.env.ORRERY_API_KEY });
const obligation = await o.obligations.create({
legDeliver: { asset: "BTC", amount: "2.5", to: "cpty_8f31" },
legPay: { asset: "USDC", amount: "162500", to: "self" },
window: "next",
});
console.log(obligation.id, obligation.status); // ob_... "pending"
4. Watch it settle
const settled = await o.obligations.waitForSettlement(obligation.id);
console.log(settled.status); // "settled" | "expired"
Next: core concepts and the REST reference.