InviaInvia
App
SDK/Installation

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.js
npm install @invia-app/sdk @solana/web3.js
yarn 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),
});
Devnet vs mainnet

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

ModulePurpose
InviaClientHigh-level client bundling on-chain + REST
InviaProgramClientInstruction builders + account decoder
InviaApiClientTyped REST wrapper
pickPriceAndScale / totalFromPriceSub-unit pricing helpers
parseTokenAmount / fmtTokenAmountDecimal-aware amount conversion
signSendConfirmPrivy-shaped wallet sign + submit + confirm helper

Read Quickstart next, or jump to Reading offers.