@omegax/protocol-sdk
v0.8.9
Published
TypeScript SDK for the canonical OmegaX health capital markets protocol surface on Solana devnet.
Maintainers
Readme
@omegax/protocol-sdk
Build health apps, oracle services, and outcome-triggered settlement flows on Solana devnet beta with the canonical OmegaX Protocol SDK.
@omegax/protocol-sdk gives builders unsigned transaction builders, readers, PDA helpers, reserve-aware read models, and oracle attestation helpers for the current public OmegaX surface.
What you can build today
- oracle and event-production services that register operators, manage policy, and emit compatible outcome and claim-case attestations
- health apps, wallets, and agents that read member, claim, obligation, and payout state
- sponsor and capital integrations that create plans, funding lines, pools, classes, allocations, and redemptions
Who should use it
- oracle and event producers
- health / wallet / app builders
- sponsor, treasury, and capital integrators
Choose your path
Oracle and event producers
Use the protocol registry builders plus @omegax/protocol-sdk/oracle to register oracles, manage pool policy, and package attestations.
Start with:
/docs/GETTING_STARTED.md/docs/WORKFLOWS.md- Oracle Event Production
Health / wallet / app builders
Use reader helpers and member / claim builders to power user-facing views and outcome-driven product flows.
Start with:
/docs/GETTING_STARTED.md/docs/WORKFLOWS.md/docs/API_REFERENCE.md
Sponsor and capital integrators
Use reserve-domain, plan, capital, allocation, and queue builders to launch or manage sponsor and LP lanes on the canonical model.
Start with:
/docs/WORKFLOWS.md/docs/API_REFERENCE.md/docs/TROUBLESHOOTING.md
Install
npm install @omegax/protocol-sdkRuntime basics
- Node.js
>=20 - ESM-only package
- Protocol builders are unsigned
programIdmust be configured explicitly in runtime integrations- Public integrations should stay on devnet until OmegaX announces mainnet availability
Quickstart
Create clients once, then branch into the workflow that matches your product.
import {
PROTOCOL_PROGRAM_ID,
createConnection,
createSafeProtocolClient,
createRpcClient,
getOmegaXNetworkInfo,
listProtocolInstructionNames,
} 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 = createSafeProtocolClient(connection, { programId });
const rpc = createRpcClient(connection);
const instructions = listProtocolInstructionNames();From there:
- oracle and event producers usually move into
buildRegisterOracleTx(...),buildClaimOracleTx(...),buildSetPoolOraclePolicyTx(...),buildAttestClaimCaseTx(...), andattestOutcome(...) - health and wallet builders usually move into member / claim reads plus
buildOpenMemberPositionTx(...)andbuildOpenClaimCaseTx(...) - sponsor and capital integrators usually move into safe reserve-domain, plan, pool, class, allocation, and redemption builders from
/docs/WORKFLOWS.md
First success smoke
Run the smoke before choosing a deeper workflow. It verifies package imports, network metadata, safe client creation, deterministic PDA derivation, and the public protocol surface without requiring funded signers or a live transaction.
npm run example:smokeFor a clean external project, copy the same pattern from
examples/devnet-smoke.ts.
Public surface coverage
This package exposes the live canonical object model:
- protocol governance and scoped controls
- reserve domains, domain asset vaults, reserve asset rails, and fee vaults
- health plans and policy series
- member positions and membership anchors
- funding lines, obligations, claim cases, and reserve-backed payouts
- liquidity pools, capital classes, LP positions, and allocation positions
- oracle profiles, pool oracle approvals, oracle policies, permission sets, and claim attestations
- outcome schemas and schema dependency ledgers
- reserve-aware read models for sponsors, members, and capital providers
- RPC helpers for unsigned transaction submission flows
Release status
- SDK release target:
0.8.9 - Protocol surface target:
omegax-protocolcommit763c7da - Current public network target: Solana devnet beta
- Public docs: docs.omegax.health
Release notes
0.8.9hardensvalidateSignedClaimTx(...)so claim intake must compare signed transactions against the service's trustedexpectedUnsignedTxBase64, not client-submitted intent bytes.0.8.8refreshes generated bindings for the 62-instruction / 31-account local protocol surface, removes the retired commitment-campaign API from current exports, adds governance authority accept/cancel builders, updates reserve-asset rail confidence inputs, adds direct plus selected-asset claim-case settlement helpers, and reflects inactive pool/allocation guard errors.0.8.7adds the full onboarding DX pass: documentedprotocol_models,transactions, anderrorssubpath exports, named safe-client types, runnable smoke/app/oracle examples, a tracked external consumer dogfood fixture, generated API markdown, and packed consumer smokes in CI.0.8.5refreshes generated bindings for the 67-instruction / 35-account protocol surface, adds reserve asset rail and commitment PDA helpers, exports canonical commitment/reserve/membership/oracle/schema constants, expandsbuildAttestClaimCaseTx(...), and hardens claim intents, oracle attestations, program targeting, strict encoding, and release gates.0.8.4refreshes generated bindings for the post-fee-vault hardening surface, derives protocol-owned domain vault token accounts, adds fee-vault PDA helpers, binds client builders and optional account placeholders to the configured program id, fixes membership-anchor PDA derivation, and hardens signed simulation fallback behavior.0.8.3refreshes generated bindings foromegax-protocol v0.3.1, requires concrete domain vault token accounts, and reflects custody-aware inflows plus NAV-derived redemptions.0.8.2keeps invite-only member enrollment builders aligned with the protocol account metas by preserving the optional invite-authority signer.0.8.1refreshes generated bindings and protocol parity for the latest linked-claim and obligation-settlement hardening on the publicv0.3.0surface.0.8.0adds full parity for the current oracle and schema registry surface, plus a first-class oracle attestation helper module for service-side signing flows.- The package now exports
@omegax/protocol-sdk/oraclealongside the root exports so oracle workers can use a narrower import surface when they only need attestation helpers. - Canonical protocol builders, readers, seeds, generated bindings, and local surface verification are aligned to the current
omegax-protocolmainsurface.
Documentation map
/docs/INDEX.mdfor the maintainer and builder reading order/docs/GETTING_STARTED.mdfor installation, client setup, and choosing the right builder path/docs/WORKFLOWS.mdfor oracle, app, sponsor, and capital flows on the canonical surface/docs/TOP_APIS.mdfor the shortest public API list by builder lane/docs/RECIPES.mdfor Node, Next.js, oracle worker, and read-only frontend snippets/docs/ERROR_CATALOG.mdfor stable SDK error codes and fixes/docs/API_REFERENCE.mdfor the exported package surface/docs/generated/api/README.mdfor generated symbol-level API markdown/docs/TROUBLESHOOTING.mdfor common failure modes and remediation/docs/RELEASE_NOTES.mdfor versioned SDK release notes/docs/RELEASE.mdfor the release checklist/docs/DOCS_SYNC_WORKFLOW.mdfor SDK to portal sync rules/docs/CROSS_REPO_RELEASE_ORDER.mdfor the coordinated protocol + docs + SDK publish order
Canonical module map
- Root package: connection helpers, RPC helpers, protocol builders, PDA helpers, reserve-model helpers, shared types
@omegax/protocol-sdk/protocol: IDL-backed builder and reader helpers such ascreateSafeProtocolClient(...),createProtocolClient(...),listProtocolInstructionNames(...),decodeProtocolAccount(...), andcompileTransactionToV0(...)@omegax/protocol-sdk/errors: typed SDK errors such asOmegaXProgramMismatchError,OmegaXAccountNotFoundError, andOmegaXRpcError@omegax/protocol-sdk/protocol_seeds: deterministic PDA helpers such asderiveReserveDomainPda(...),deriveReserveAssetRailPda(...),deriveHealthPlanPda(...),deriveFundingLinePda(...),deriveClaimCasePda(...), andderiveCapitalClassPda(...)@omegax/protocol-sdk/protocol_models: constants and read-model helpers such asrecomputeReserveBalanceSheet(...),buildSponsorReadModel(...),buildCapitalReadModel(...), andbuildMemberReadModel(...)@omegax/protocol-sdk/claims: claim validation and obligation failure helpers such asvalidateSignedClaimTx(...)andnormalizeClaimSimulationFailure(...)@omegax/protocol-sdk/oracle: oracle attestation helpers such ascreateOracleSignerFromEnv(...),createOracleSignerFromKmsAdapter(...),attestOutcome(...),attestProtocolOutcome(...),verifyOracleAttestation(...), andverifyProtocolOracleAttestation(...), alongside the root-levelbuildAttestClaimCaseTx(...)helper for on-chain claim-case attestations@omegax/protocol-sdk/rpc:createConnection(...),createRpcClient(...), and network metadata helpers@omegax/protocol-sdk/transactions: transaction serialization and signer-inspection helpers such asserializeSolanaTransactionBase64(...),decodeSolanaTransaction(...), andsolanaTransactionMessageBase64(...)@omegax/protocol-sdk/utils: hashing, binary encoding, and misc utilities@omegax/protocol-sdk/types: generated protocol contract types plus SDK RPC and failure types
CLI
npx @omegax/protocol-sdk doctor
npx @omegax/protocol-sdk scaffold node-backend --out omegax-provider-backend
npx @omegax/protocol-sdk scaffold next-route --out omegax-health-route
npx @omegax/protocol-sdk scaffold oracle-worker --out omegax-oracle-workerThe CLI is no-signature by default. It does not require funded wallets, private keys, or live transaction submission for first success.
What the SDK is for
- Sponsors and operators can build reserve-domain, reserve-rail, health-plan, policy-series, funding-line, obligation, and claim-case settlement transactions directly.
- Capital providers can derive capital-class and allocation addresses, inspect ledgers, and build deposit and redemption flows against canonical pool and class objects.
- Wallet apps and members can inspect plan participation, obligations, claim state, and payout history with the read-model helpers.
- Oracle operators can register profiles, configure pool policy, attest claim cases on-chain, and use a narrower attestation helper surface for outcome packaging.
- External integrators can enumerate the live instruction and account surface with
listProtocolInstructionNames(...)andlistProtocolAccountNames(...). - Product flows should use
createSafeProtocolClient(...)or the checked convenience builders. The safe client now covers sponsor funding, premium intake, claim-case settlement, LP deposits/redemptions, redemption processing, obligation settlement, and fee/treasury withdrawals. RawbuildProtocolInstruction(...)andbuildProtocolTransaction(...)remain advanced escape hatches and enforce strict argument encoding. - Safe settlement calls require
recipientOwnerAddressalongside the custody accounts so the SDK can preflight payout token-account mint and owner before users sign.
What the SDK does not do
- It does not keep pool-first compatibility aliases.
- It does not hide settlement-critical accounting in offchain helpers.
- It does not invent a second protocol surface for wrappers or regulated participation.
- It does not sign transactions on your behalf.
Local verification
npm ci
npm run typecheck
npm run lint
npm run format:check
npm run build
npm test
npm run docs:api:check
npm run docs:check
npm run docs:sync:check:strict
npm run examples:check
npm run dogfood:consumer
npm run cli:check
npm run templates:check
npm run dx:smoke
npm run verify:release
npm run security:secrets
npm run security:install-scripts
npm run security:package
npm run audit:prod
npm run verify:protocol:localTo refresh checked-in protocol artifacts from a sibling omegax-protocol workspace:
npm run generate:protocol-bindingsRelease coordination
This package is released only when all three surfaces agree:
omegax-protocolomegax-docsomegax-sdk
Use /docs/CROSS_REPO_RELEASE_ORDER.md and /docs/OMEGAX_DOCS_SYNC.json to keep that publish train honest.
