OctazeOctaze Docs

SDK

The @octaze/sdk TypeScript client.

@octaze/sdk is a thin, typed wrapper over the Octaze REST API.

npm install @octaze/sdk
import { Octaze } from "@octaze/sdk";
const octaze = new Octaze({ apiKey: process.env.OCTAZE_API_KEY! });
OptionDefaultDescription
apiKeyRequired. Your Octaze API key.
baseUrlhttps://app.octaze.devOverride for self-hosted / staging.

testnets

const net = await octaze.testnets.create({ name: "dev", network: "mainnet" });
await octaze.testnets.list();
await octaze.testnets.get(net.id);
await octaze.testnets.delete(net.id);

faucet

await octaze.faucet.sol(net.id, address, 10);
await octaze.faucet.token(net.id, address, USDC_MINT, 5000, 6, "USDC");

tx

transaction arguments are base64-encoded. send expects a signed transaction.

const sim = await octaze.tx.simulate(net.id, base64Tx);   // { logs, unitsConsumed, err }
const { signature } = await octaze.tx.send(net.id, signedTx);
const txs = await octaze.tx.list(net.id);
const { tx, trace } = await octaze.tx.trace(net.id, signature);

connection

A drop-in @solana/web3.js connection on the fork:

const connection = await octaze.connection(net.id);

Errors

Failed requests throw OctazeError with a .status:

import { OctazeError } from "@octaze/sdk";
try { await octaze.testnets.get("nope"); }
catch (e) { if (e instanceof OctazeError) console.error(e.status, e.message); }

On this page