Installation
@invia-app/sdk is the official TypeScript client for the Invia OTC escrow
program. It bundles instruction builders, account decoders, helper math, and a
typed wrapper around the public REST API.
Install
pnpm add @invia-app/sdk @solana/web3.jsnpm install @invia-app/sdk @solana/web3.jsyarn add @invia-app/sdk @solana/web3.js@solana/web3.js is a peer dependency. Anchor is not required at runtime,
because all instructions and account layouts are encoded by hand inside the SDK.
Environment
The SDK targets Node 20+ and any modern browser runtime that exposes the
standard fetch, Buffer, and crypto.getRandomValues globals. In Cloudflare
Workers and edge runtimes you may need to inject a fetch implementation:
import { InviaApiClient } from "@invia-app/sdk";
const api = new InviaApiClient({
baseUrl: "https://api.invia.markets",
fetch: globalThis.fetch.bind(globalThis),
});Pre-launch the program is deployed on Solana devnet at
C9YABXJdHpiz4gjDuVrmCV7Qhq7uGGLNcdDnKu5UBiUV. The mainnet program ID will be
locked at the D0 deploy and exported as PROGRAM_ID from the SDK.
What is shipped
| Module | Purpose |
|---|---|
InviaClient | High-level client bundling on-chain + REST |
InviaProgramClient | Instruction builders + account decoder |
InviaApiClient | Typed REST wrapper |
pickPriceAndScale / totalFromPrice | Sub-unit pricing helpers |
parseTokenAmount / fmtTokenAmount | Decimal-aware amount conversion |
signSendConfirm | Privy-shaped wallet sign + submit + confirm helper |
Read Quickstart next, or jump to Reading offers.