API Reference: @omegax/protocol-sdk
This page documents the public SDK surface shipped in 0.8.9.
Use SDK Top APIs first if you are choosing an integration path. Use generated API markdown for generated symbol-level markdown.
Core runtime entrypoints
createConnection(...)getOmegaXNetworkInfo(...)OMEGAX_NETWORKScreateRpcClient(...)createSafeProtocolClient(...)createProtocolClient(...)getProtocolIdl()listProtocolInstructionNames()listProtocolInstructionAccounts(...)listProtocolAccountNames()accountExists(...)decodeProtocolAccount(...)buildProtocolInstruction(...)buildProtocolTransaction(...)compileTransactionToV0(...)preflightClassicTokenAccount(...)
Typed SDK errors:
Available from the root package and @omegax/protocol-sdk/errors.
See SDK Error Catalog for likely causes and fixes.
OmegaXErrorOmegaXConfigErrorOmegaXInvalidPublicKeyErrorOmegaXProgramMismatchErrorOmegaXAccountNotFoundErrorOmegaXAccountOwnerMismatchErrorOmegaXTokenAccountPreflightErrorOmegaXInstructionBuildErrorOmegaXTransactionDecodeErrorOmegaXRpcError
Safe-client public types:
SafeProtocolClientOptionsSafeProtocolClientSafeFundSponsorBudgetTxParamsSafeRecordPremiumPaymentTxParamsSafeDepositIntoCapitalClassTxParamsSafeRequestRedemptionTxParamsSafeProcessRedemptionQueueTxParamsSafeSettleObligationTxParamsSafeSettleClaimCaseTxParamsSafeSettleClaimCaseSelectedAssetTxParamsSafeRegisterOracleTxParamsSafeAttestClaimCaseTxParams
RPC client
Returned by createRpcClient(...).
getRecentBlockhash()broadcastSignedTx(...)simulateSignedTx(...)getSignatureStatus(...)
simulateSignedTx(...) verifies signatures by default. If an RPC rejects the
signature-verifying simulation argument combination, the SDK fails closed unless
the caller explicitly passes allowSigVerifyFallback: true. Results include
sigVerifyRequested, sigVerifyUsed, signatureVerified, and
verificationDowngraded so intake services can reject unverified preflight
results.
Canonical instruction builders
Product and operator flows should start with createSafeProtocolClient(...).
Raw generated builders are returned by createProtocolClient(...).
Use createSafeProtocolClient(...) for product and operator flows. It wraps the
checked convenience builders, pins the canonical program ID by default, and
preflights classic SPL token custody accounts when a Connection is available.
The safe layer covers claim and settlement flows plus sponsor funding, premium
payments, LP deposits, redemption requests, redemption queue processing, and
protocol/pool/oracle fee-withdrawal builders.
Safe settlement calls additionally require recipientOwnerAddress so the SDK
can preflight the payout token-account owner, not only the vault and mint.
buildProtocolInstruction(...), buildProtocolTransaction(...), and the raw
dynamic builders remain advanced APIs for protocol engineering and tests; they
reject permissive numeric coercion and fixed-array length drift before Borsh
encoding.
Governance and scoped controls
buildInitializeProtocolGovernanceTx(...)buildRotateProtocolGovernanceAuthorityTx(...)buildAcceptProtocolGovernanceAuthorityTx(...)buildCancelProtocolGovernanceAuthorityTransferTx(...)buildSetProtocolEmergencyPauseTx(...)buildCreateReserveDomainTx(...)buildUpdateReserveDomainControlsTx(...)buildCreateDomainAssetVaultTx(...)buildConfigureReserveAssetRailTx(...)buildPublishReserveAssetRailPriceTx(...)buildInitProtocolFeeVaultTx(...)buildWithdrawProtocolFeeSolTx(...)buildWithdrawProtocolFeeSplTx(...)buildCreateHealthPlanTx(...)buildUpdateHealthPlanControlsTx(...)buildCreatePolicySeriesTx(...)buildInitializeSeriesReserveLedgerTx(...)buildVersionPolicySeriesTx(...)buildOpenMemberPositionTx(...)buildUpdateMemberEligibilityTx(...)buildAuthorizeClaimRecipientTx(...)
Plan-side funding and obligations
buildOpenFundingLineTx(...)buildFundSponsorBudgetTx(...)buildRecordPremiumPaymentTx(...)buildCreateObligationTx(...)buildReserveObligationTx(...)buildSettleObligationTx(...)buildReleaseReserveTx(...)
Claim-case lifecycle
buildOpenClaimCaseTx(...)buildAttachClaimEvidenceRefTx(...)buildAdjudicateClaimCaseTx(...)buildSettleClaimCaseTx(...)buildSettleClaimCaseSelectedAssetTx(...)buildAttestClaimCaseTx(...)
LP capital and class lifecycle
buildCreateLiquidityPoolTx(...)buildInitPoolTreasuryVaultTx(...)buildWithdrawPoolTreasurySolTx(...)buildWithdrawPoolTreasurySplTx(...)buildCreateCapitalClassTx(...)buildUpdateCapitalClassControlsTx(...)buildDepositIntoCapitalClassTx(...)buildUpdateLpPositionCredentialingTx(...)buildRequestRedemptionTx(...)buildProcessRedemptionQueueTx(...)
Allocation and impairment
buildCreateAllocationPositionTx(...)buildUpdateAllocationCapsTx(...)buildAllocateCapitalTx(...)buildDeallocateCapitalTx(...)buildMarkImpairmentTx(...)
Oracle and schema registry
buildRegisterOracleTx(...)buildClaimOracleTx(...)buildUpdateOracleProfileTx(...)buildSetPoolOracleTx(...)buildSetPoolOraclePermissionsTx(...)buildSetPoolOraclePolicyTx(...)buildInitPoolOracleFeeVaultTx(...)buildWithdrawPoolOracleFeeSolTx(...)buildWithdrawPoolOracleFeeSplTx(...)buildRegisterOutcomeSchemaTx(...)buildVerifyOutcomeSchemaTx(...)buildBackfillSchemaDependencyLedgerTx(...)buildCloseOutcomeSchemaTx(...)
Every instruction also exposes a sibling build...Instruction(...) helper.
Custody-sensitive builders now mirror the on-chain custody requirements directly. buildCreateDomainAssetVaultTx(...) derives the protocol-owned domain_asset_vault_token PDA, while sponsor funding, premium payments, obligation settlement, LP capital deposits, and redemption processing require source or recipient token accounts, the canonical vault token account, asset mint, and token program accounts. LP allocation reserve/release/settle/impairment helpers require pool class ledger, allocation position, and allocation ledger scope together rather than accepting partial optional account sets.
Canonical account readers
Returned by createProtocolClient(...).
fetchProtocolGovernance(...)fetchReserveDomain(...)fetchDomainAssetVault(...)fetchDomainAssetLedger(...)fetchReserveAssetRail(...)fetchHealthPlan(...)fetchPlanReserveLedger(...)fetchPolicySeries(...)fetchSeriesReserveLedger(...)fetchMemberPosition(...)fetchMembershipAnchorSeat(...)fetchFundingLine(...)fetchFundingLineLedger(...)fetchClaimCase(...)fetchClaimAttestation(...)fetchObligation(...)fetchLiquidityPool(...)fetchCapitalClass(...)fetchPoolClassLedger(...)fetchLPPosition(...)fetchAllocationPosition(...)fetchAllocationLedger(...)fetchOracleProfile(...)fetchPoolOracleApproval(...)fetchPoolOracleFeeVault(...)fetchPoolOraclePolicy(...)fetchPoolOraclePermissionSet(...)fetchPoolTreasuryVault(...)fetchProtocolFeeVault(...)fetchOutcomeSchema(...)fetchSchemaDependencyLedger(...)
PDA helpers
Available from the root package and @omegax/protocol-sdk/protocol_seeds.
getProgramId()toPublicKey(...)normalizeAddress(...)utf8ByteLength(...)isSeedIdSafe(...)assertSeedId(...)deriveProtocolGovernancePda(...)deriveReserveDomainPda(...)deriveDomainAssetVaultPda(...)deriveDomainAssetVaultTokenAccountPda(...)deriveDomainAssetLedgerPda(...)deriveReserveAssetRailPda(...)deriveHealthPlanPda(...)derivePlanReserveLedgerPda(...)derivePolicySeriesPda(...)deriveSeriesReserveLedgerPda(...)deriveMemberPositionPda(...)deriveMembershipAnchorSeatPda(...)deriveFundingLinePda(...)deriveFundingLineLedgerPda(...)deriveClaimCasePda(...)deriveClaimAttestationPda(...)deriveObligationPda(...)deriveLiquidityPoolPda(...)deriveCapitalClassPda(...)derivePoolClassLedgerPda(...)deriveLpPositionPda(...)deriveAllocationPositionPda(...)deriveAllocationLedgerPda(...)deriveOracleProfilePda(...)derivePoolOracleApprovalPda(...)derivePoolOracleFeeVaultPda(...)derivePoolOraclePolicyPda(...)derivePoolOraclePermissionSetPda(...)derivePoolTreasuryVaultPda(...)deriveProtocolFeeVaultPda(...)deriveOutcomeSchemaPda(...)deriveSchemaDependencyLedgerPda(...)
Seed constants:
SEED_PROTOCOL_GOVERNANCESEED_RESERVE_DOMAINSEED_DOMAIN_ASSET_VAULTSEED_DOMAIN_ASSET_VAULT_TOKENSEED_DOMAIN_ASSET_LEDGERSEED_RESERVE_ASSET_RAILSEED_HEALTH_PLANSEED_PLAN_RESERVE_LEDGERSEED_POLICY_SERIESSEED_SERIES_RESERVE_LEDGERSEED_MEMBER_POSITIONSEED_MEMBERSHIP_ANCHOR_SEATSEED_FUNDING_LINESEED_FUNDING_LINE_LEDGERSEED_CLAIM_CASESEED_CLAIM_ATTESTATIONSEED_OBLIGATIONSEED_LIQUIDITY_POOLSEED_CAPITAL_CLASSSEED_POOL_CLASS_LEDGERSEED_LP_POSITIONSEED_ALLOCATION_POSITIONSEED_ALLOCATION_LEDGERSEED_ORACLE_PROFILESEED_POOL_ORACLE_APPROVALSEED_POOL_ORACLE_FEE_VAULTSEED_POOL_ORACLE_POLICYSEED_POOL_ORACLE_PERMISSION_SETSEED_POOL_TREASURY_VAULTSEED_PROTOCOL_FEE_VAULTSEED_OUTCOME_SCHEMASEED_SCHEMA_DEPENDENCY_LEDGERZERO_PUBKEYZERO_PUBKEY_KEYMAX_ID_SEED_BYTES
Reserve-model helpers
Available from the root package and @omegax/protocol-sdk/protocol_models.
toBigIntAmount(...)recomputeReserveBalanceSheet(...)sumReserveBalanceSheets(...)buildSponsorReadModel(...)buildCapitalReadModel(...)buildMemberReadModel(...)bpsRatio(...)shortenAddress(...)
Status and labeling helpers:
describeSeriesMode(...)describeSeriesStatus(...)describeFundingLineType(...)describeEligibilityStatus(...)describeClaimStatus(...)describeObligationStatus(...)describeCapitalRestriction(...)
Constants:
SERIES_MODE_REWARDSERIES_MODE_PROTECTIONSERIES_MODE_REIMBURSEMENTSERIES_MODE_PARAMETRICSERIES_MODE_OTHERSERIES_STATUS_DRAFTSERIES_STATUS_ACTIVESERIES_STATUS_PAUSEDSERIES_STATUS_CLOSEDFUNDING_LINE_TYPE_SPONSOR_BUDGETFUNDING_LINE_TYPE_PREMIUM_INCOMEFUNDING_LINE_TYPE_LIQUIDITY_POOL_ALLOCATIONFUNDING_LINE_TYPE_BACKSTOPFUNDING_LINE_TYPE_SUBSIDYFUNDING_LINE_STATUS_OPENFUNDING_LINE_STATUS_PAUSEDFUNDING_LINE_STATUS_CLOSEDRESERVE_ASSET_ROLE_PRIMARY_STABLERESERVE_ASSET_ROLE_SECONDARY_STABLERESERVE_ASSET_ROLE_VOLATILE_COLLATERALRESERVE_ASSET_ROLE_TREASURY_LAST_RESORTRESERVE_ORACLE_SOURCE_NONERESERVE_ORACLE_SOURCE_CHAINLINK_DATA_STREAMRESERVE_ORACLE_SOURCE_CHAINLINK_DATA_FEEDRESERVE_ORACLE_SOURCE_GOVERNANCE_ATTESTEDELIGIBILITY_PENDINGELIGIBILITY_ELIGIBLEELIGIBILITY_PAUSEDELIGIBILITY_CLOSEDMEMBERSHIP_MODE_OPENMEMBERSHIP_MODE_TOKEN_GATEMEMBERSHIP_MODE_INVITE_ONLYMEMBERSHIP_GATE_KIND_OPENMEMBERSHIP_GATE_KIND_INVITE_ONLYMEMBERSHIP_GATE_KIND_NFT_ANCHORMEMBERSHIP_GATE_KIND_STAKE_ANCHORMEMBERSHIP_GATE_KIND_FUNGIBLE_SNAPSHOTMEMBERSHIP_PROOF_MODE_OPENMEMBERSHIP_PROOF_MODE_TOKEN_GATEMEMBERSHIP_PROOF_MODE_INVITE_PERMITCLAIM_INTAKE_OPENCLAIM_INTAKE_UNDER_REVIEWCLAIM_INTAKE_APPROVEDCLAIM_INTAKE_DENIEDCLAIM_INTAKE_SETTLEDCLAIM_INTAKE_CLOSEDCLAIM_ATTESTATION_DECISION_SUPPORT_APPROVECLAIM_ATTESTATION_DECISION_SUPPORT_DENYCLAIM_ATTESTATION_DECISION_REQUEST_REVIEWCLAIM_ATTESTATION_DECISION_ABSTAINPOOL_ORACLE_PERMISSION_ATTEST_CLAIMOBLIGATION_STATUS_PROPOSEDOBLIGATION_STATUS_RESERVEDOBLIGATION_STATUS_CLAIMABLE_PAYABLEOBLIGATION_STATUS_SETTLEDOBLIGATION_STATUS_CANCELEDOBLIGATION_STATUS_IMPAIREDOBLIGATION_STATUS_RECOVEREDOBLIGATION_DELIVERY_MODE_CLAIMABLEOBLIGATION_DELIVERY_MODE_PAYABLEREDEMPTION_POLICY_OPENREDEMPTION_POLICY_QUEUE_ONLYREDEMPTION_POLICY_PAUSEDCAPITAL_CLASS_RESTRICTION_OPENCAPITAL_CLASS_RESTRICTION_RESTRICTEDCAPITAL_CLASS_RESTRICTION_WRAPPER_ONLYLP_QUEUE_STATUS_NONELP_QUEUE_STATUS_PENDINGLP_QUEUE_STATUS_PROCESSEDPAUSE_FLAG_PROTOCOL_EMERGENCYPAUSE_FLAG_DOMAIN_RAILSPAUSE_FLAG_PLAN_OPERATIONSPAUSE_FLAG_CLAIM_INTAKEPAUSE_FLAG_CAPITAL_SUBSCRIPTIONSPAUSE_FLAG_REDEMPTION_QUEUE_ONLYPAUSE_FLAG_ORACLE_FINALITY_HOLDPAUSE_FLAG_ALLOCATION_FREEZEORACLE_TYPE_LABORACLE_TYPE_HOSPITAL_CLINICORACLE_TYPE_HEALTH_APPORACLE_TYPE_WEARABLE_DATA_PROVIDERORACLE_TYPE_OTHERSCHEMA_FAMILY_KERNELSCHEMA_FAMILY_CLINICALSCHEMA_FAMILY_CLAIMS_CODINGSCHEMA_VISIBILITY_PUBLICSCHEMA_VISIBILITY_PRIVATESCHEMA_VISIBILITY_RESTRICTEDNATIVE_SOL_MINT
Claims helpers
Available from the root package and @omegax/protocol-sdk/claims.
normalizeClaimSimulationFailure(...)normalizeClaimRpcFailure(...)validateSignedClaimTx(...)
validateSignedClaimTx(...) requires a trusted
expectedUnsignedTxBase64 from the service that created the intent, and fails
closed when the signed transaction does not match it. Claim intents should
include intentId, nonce, expiresAtIso, requiredSigner, and
unsignedTxBase64, but submitted intent bytes are metadata only; do not use them
as the expected transaction source. The validator rejects stale intents, wrong
nonces, wrong signers, malformed transactions, and message tampering.
Recent-blockhash refresh is allowed only when every non-blockhash byte still
matches, and requireExactMessage: true disables even that for high-risk
operator flows.
The claims module also re-exports:
describeClaimStatus(...)describeObligationStatus(...)- claim intake status constants
- obligation status constants
Oracle helpers
Available from the root package and @omegax/protocol-sdk/oracle.
createOracleSignerFromEnv(...)createOracleSignerFromKmsAdapter(...)attestOutcome(...)attestProtocolOutcome(...)verifyOracleAttestation(...)verifyProtocolOracleAttestation(...)
Use attestProtocolOutcome(...) for settlement-grade protocol evidence. Its
context binds the evidence to network, program ID, health plan, funding line,
claim case, optional pool allocation scope, schema key hash, audience, nonce,
issue time, as-of time, and expiry. Generic attestOutcome(...) remains
available for telemetry and non-settlement event packaging. Use
verifyProtocolOracleAttestation(...) when settlement code needs signature
validity plus trusted expected verifier identity, expected
program/network/account, audience, nonce, and expiry
checks. Optional policy/pool/class/allocation scope is rejected unless it is
explicitly expected or allowUnexpectedOptionalScope is set for
telemetry-style wildcard matching.
Shared utilities
Available from the root package and @omegax/protocol-sdk/utils.
stableStringify(...)sha256Hex(...)sha256Bytes(...)toIsoString(...)nowIso()newId(...)anchorDiscriminator(...)encodeU64Le(...)encodeI64Le(...)encodeU32Le(...)encodeU16Le(...)encodeString(...)readU32Le(...)readU16Le(...)readU64Le(...)readI64Le(...)readString(...)toHex(...)fromHex(...)hashStringTo32(...)
Transaction helpers
Available from the root package and @omegax/protocol-sdk/transactions.
decodeSolanaTransaction(...)serializeSolanaTransaction(...)serializeSolanaTransactionBase64(...)solanaTransactionMessageBytes(...)solanaTransactionIntentMessageBytes(...)solanaTransactionMessageBase64(...)solanaTransactionRequiredSigner(...)solanaTransactionFirstSignature(...)solanaTransactionSignerSignature(...)