Skip to main content

SDK Getting Started

This guide gets you from install to a usable OmegaX client on Solana devnet beta, then points you into the right builder path.

Start here if

Use this page when you want the shortest path from package install to a working client, then into the builder lane that matches your product.

Current target

Public builder integrations should target Solana devnet beta. Genesis Protect has a bounded mainnet launch target, but the public SDK journey remains devnet-first unless OmegaX announces otherwise.

Prerequisites

  • Node.js >=20
  • ESM runtime
  • A Solana RPC endpoint
  • The OmegaX programId for your target cluster

Public integrations should target devnet beta until mainnet is announced.

Install

npm install @omegax/protocol-sdk
npm install --save-dev tsx

10-minute devnet smoke

Run this first before choosing a deeper workflow. It proves your package install, ESM runtime, RPC endpoint, network metadata, client creation, and public instruction list are all wired correctly.

Create devnet-smoke.ts in your integration project:

import {
PROTOCOL_PROGRAM_ID,
createConnection,
createProtocolClient,
createRpcClient,
getOmegaXNetworkInfo,
listProtocolInstructionNames,
} from '@omegax/protocol-sdk';

const network = 'devnet' as const;
const networkInfo = getOmegaXNetworkInfo(network);
const rpcUrl = process.env.SOLANA_RPC_URL ?? networkInfo.defaultRpcUrl;
const programId = process.env.OMEGAX_PROGRAM_ID ?? PROTOCOL_PROGRAM_ID;

const connection = createConnection({
network,
rpcUrl,
commitment: 'confirmed',
});

const protocol = createProtocolClient(connection, programId);
const rpc = createRpcClient(connection);
const latestBlockhash = await rpc.getRecentBlockhash();
const instructions = listProtocolInstructionNames();

console.log(
JSON.stringify(
{
network,
rpcUrl,
programId: String(programId),
protocolClientReady: Boolean(protocol),
latestBlockhash,
instructionCount: instructions.length,
firstInstructions: instructions.slice(0, 8),
},
null,
2,
),
);

Run it:

npx tsx devnet-smoke.ts

Expected output shape:

{
"network": "devnet",
"rpcUrl": "https://api.devnet.solana.com",
"programId": "...",
"protocolClientReady": true,
"latestBlockhash": {
"blockhash": "...",
"lastValidBlockHeight": 123
},
"instructionCount": 40,
"firstInstructions": [
"initializeProtocolGovernance",
"setProtocolEmergencyPause"
]
}

The exact blockhash, program ID, instruction count, and first instruction names can change with the public release surface. The smoke is healthy when it reaches devnet, creates clients, and prints a non-empty instruction list.

FailureLikely causeFix
SyntaxError: Cannot use import statement outside a moduleThe script is not running in an ESM-aware TypeScript runner.Use npx tsx devnet-smoke.ts or configure your project as ESM.
RPC timeout or network errorThe selected Solana RPC endpoint is slow, blocked, or unavailable.Set SOLANA_RPC_URL to a healthy devnet endpoint and retry.
Missing or unexpected accounts later in the flowOMEGAX_PROGRAM_ID and the RPC cluster do not match.Keep public integrations on devnet beta unless OmegaX announces otherwise.
Unsupported Node APIsRuntime is older than the SDK baseline.Use Node.js >=20.

Choose your builder path

If you are building...Start with...Then read...
Oracle and event producersRegister operators, configure pool policy, and package compatible outcome or claim-case attestations.Event Production
Health / wallet / app surfacesRead member, claim, and payout state, then build enrollment or claim flows.SDK Workflows
Sponsor and capital integrationsLaunch reserve domains, plans, funding lines, pools, classes, and allocations on the canonical surface.Current Program Surface

Create clients

import {
PROTOCOL_PROGRAM_ID,
createConnection,
createProtocolClient,
createRpcClient,
getOmegaXNetworkInfo,
} from '@omegax/protocol-sdk';

const network =
(process.env.OMEGAX_NETWORK as 'devnet' | 'mainnet' | undefined) ?? 'devnet';
const networkInfo = getOmegaXNetworkInfo(network);

const connection = createConnection({
network,
rpcUrl: process.env.SOLANA_RPC_URL ?? networkInfo.defaultRpcUrl,
commitment: 'confirmed',
});

const programId = process.env.OMEGAX_PROGRAM_ID ?? PROTOCOL_PROGRAM_ID;
const protocol = createProtocolClient(connection, programId);
const rpc = createRpcClient(connection);

Inspect the current public surface

Use the SDK to inspect the current contract shape before choosing builders.

import { listProtocolInstructionNames } from '@omegax/protocol-sdk';

const instructions = listProtocolInstructionNames();

Build, sign, and broadcast

Choose the workflow-specific build...Tx(...), pass the required args, accounts, and a fresh recentBlockhash, then sign and broadcast it from your app or signer stack.

const signedTx = await wallet.signTransaction(tx);
const signedTxBase64 = Buffer.from(signedTx.serialize()).toString('base64');
const result = await rpc.broadcastSignedTx({
signedTxBase64,
commitment: 'confirmed',
});

Simulate before broadcast when you want preflight detail:

const signedTxBase64 = Buffer.from(tx.serialize()).toString('base64');
const simulation = await rpc.simulateSignedTx({
signedTxBase64,
sigVerify: true,
});

Path A: Oracle and event producers

Start here when your service needs to turn private or messy inputs into OmegaX-compatible outcome events.

Relevant builders and helpers:

  • buildRegisterOracleTx(...)
  • buildClaimOracleTx(...)
  • buildUpdateOracleProfileTx(...)
  • buildSetPoolOracleTx(...)
  • buildSetPoolOraclePermissionsTx(...)
  • buildSetPoolOraclePolicyTx(...)
  • buildAttestClaimCaseTx(...)
  • createOracleSignerFromEnv(...)
  • createOracleSignerFromKmsAdapter(...)
  • attestOutcome(...)

Continue with:

Path B: Health / wallet / app builders

Start here when your product needs to show users what they hold, what happened, and what can be paid.

Relevant builders and helpers:

  • buildOpenMemberPositionTx(...)
  • buildOpenClaimCaseTx(...)
  • buildAttachClaimEvidenceRefTx(...)
  • buildMemberReadModel(...)
  • describeEligibilityStatus(...)
  • describeClaimStatus(...)
  • describeObligationStatus(...)

Continue with:

Path C: Sponsor and capital integrators

Start here when you need settlement boundaries, sponsor programs, or LP capital flows on the canonical model.

Reserve-moving builders require real token rails. Create the domain vault through the protocol so it initializes the canonical SPL vault token account, provide source and vault token accounts for funding or deposits, and let redemption payout amounts be derived by the protocol instead of supplying asset amounts from the client.

Example: derive canonical addresses for a sponsor-side deployment:

import {
deriveProtocolGovernancePda,
deriveReserveDomainPda,
deriveHealthPlanPda,
} from '@omegax/protocol-sdk';

const protocolGovernance = deriveProtocolGovernancePda(programId).toBase58();
const reserveDomain = deriveReserveDomainPda({
domainId: 'open-usdc-domain',
programId,
}).toBase58();
const healthPlan = deriveHealthPlanPda({
reserveDomain,
planId: 'builder-demo-plan',
programId,
}).toBase58();

Relevant builders and helpers:

  • buildInitializeProtocolGovernanceTx(...)
  • buildCreateReserveDomainTx(...)
  • buildCreateDomainAssetVaultTx(...)
  • buildCreateHealthPlanTx(...)
  • buildCreatePolicySeriesTx(...)
  • buildOpenFundingLineTx(...)
  • buildCreateLiquidityPoolTx(...)
  • buildCreateCapitalClassTx(...)
  • buildCreateAllocationPositionTx(...)
  • recomputeReserveBalanceSheet(...)

Continue with:

Next steps

  • Use SDK Workflows to map your builder path to the right canonical builders and readers.
  • Use API Reference to inspect the exported reader, helper, and builder surface in detail.
  • Use Release Notes to confirm the current SDK version and newly added modules.
  • Use Troubleshooting when parity or reserve behavior looks wrong.