@omegax/protocol-sdk 0.5.0 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -4
- package/dist/claims.js +38 -43
- package/dist/internal/protocol/all.d.ts +283 -0
- package/dist/internal/protocol/all.js +7202 -0
- package/dist/internal/protocol/builders.d.ts +1 -0
- package/dist/internal/protocol/builders.js +1 -0
- package/dist/internal/protocol/client.d.ts +1 -0
- package/dist/internal/protocol/client.js +1 -0
- package/dist/internal/protocol/constants.d.ts +1 -0
- package/dist/internal/protocol/constants.js +1 -0
- package/dist/internal/protocol/decoders.d.ts +1 -0
- package/dist/internal/protocol/decoders.js +1 -0
- package/dist/internal/protocol/fetchers.d.ts +1 -0
- package/dist/internal/protocol/fetchers.js +1 -0
- package/dist/internal/protocol/shared.d.ts +1 -0
- package/dist/internal/protocol/shared.js +1 -0
- package/dist/internal/protocol-seeds/all.d.ts +265 -0
- package/dist/internal/protocol-seeds/all.js +455 -0
- package/dist/internal/protocol-seeds/claims.d.ts +1 -0
- package/dist/internal/protocol-seeds/claims.js +1 -0
- package/dist/internal/protocol-seeds/core.d.ts +1 -0
- package/dist/internal/protocol-seeds/core.js +1 -0
- package/dist/internal/protocol-seeds/liquidity.d.ts +1 -0
- package/dist/internal/protocol-seeds/liquidity.js +1 -0
- package/dist/internal/protocol-seeds/oracle.d.ts +1 -0
- package/dist/internal/protocol-seeds/oracle.js +1 -0
- package/dist/internal/protocol-seeds/policy.d.ts +1 -0
- package/dist/internal/protocol-seeds/policy.js +1 -0
- package/dist/internal/reward-claim.d.ts +17 -0
- package/dist/internal/reward-claim.js +27 -0
- package/dist/internal/rpc.d.ts +15 -0
- package/dist/internal/rpc.js +26 -0
- package/dist/internal/types/all.d.ts +1952 -0
- package/dist/internal/types/all.js +1 -0
- package/dist/internal/types/builders.d.ts +1 -0
- package/dist/internal/types/builders.js +1 -0
- package/dist/internal/types/claims.d.ts +1 -0
- package/dist/internal/types/claims.js +1 -0
- package/dist/internal/types/oracle.d.ts +1 -0
- package/dist/internal/types/oracle.js +1 -0
- package/dist/internal/types/protocol.d.ts +1 -0
- package/dist/internal/types/protocol.js +1 -0
- package/dist/internal/types/rpc.d.ts +1 -0
- package/dist/internal/types/rpc.js +1 -0
- package/dist/oracle.js +3 -2
- package/dist/protocol.d.ts +3 -13
- package/dist/protocol.js +3 -6422
- package/dist/protocol_seeds.d.ts +1 -265
- package/dist/protocol_seeds.js +1 -443
- package/dist/rpc.js +13 -28
- package/dist/transactions.js +11 -6
- package/dist/types.d.ts +1 -1946
- package/dist/types.js +1 -1
- package/package.json +15 -6
package/README.md
CHANGED
|
@@ -61,7 +61,11 @@ npm install @omegax/protocol-sdk
|
|
|
61
61
|
### 1) Create clients
|
|
62
62
|
|
|
63
63
|
```ts
|
|
64
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
createConnection,
|
|
66
|
+
createProtocolClient,
|
|
67
|
+
createRpcClient,
|
|
68
|
+
} from '@omegax/protocol-sdk';
|
|
65
69
|
|
|
66
70
|
const connection = createConnection({
|
|
67
71
|
network: 'devnet',
|
|
@@ -77,7 +81,7 @@ const rpc = createRpcClient(connection);
|
|
|
77
81
|
### 2) Build an unsigned reward-claim transaction
|
|
78
82
|
|
|
79
83
|
```ts
|
|
80
|
-
const tx = protocol.buildSubmitRewardClaimTx
|
|
84
|
+
const tx = protocol.buildSubmitRewardClaimTx({
|
|
81
85
|
claimant: '<claimant-pubkey>',
|
|
82
86
|
poolAddress: '<pool-pubkey>',
|
|
83
87
|
member: '<member-pubkey>',
|
|
@@ -183,6 +187,9 @@ For the normal local workspace layout, this reads from:
|
|
|
183
187
|
Run the full local compatibility gate before pushing SDK changes that may affect protocol behavior:
|
|
184
188
|
|
|
185
189
|
```bash
|
|
190
|
+
npm run typecheck
|
|
191
|
+
npm run lint
|
|
192
|
+
npm run format:check
|
|
186
193
|
npm run verify:protocol:local
|
|
187
194
|
```
|
|
188
195
|
|
|
@@ -204,12 +211,15 @@ npm run sdk:check
|
|
|
204
211
|
|
|
205
212
|
Latest fixture sync metadata:
|
|
206
213
|
|
|
207
|
-
- Source commit: `
|
|
208
|
-
- Fixture SHA-256: `
|
|
214
|
+
- Source commit: `eb6c94226f034233d0eb6990e7feddcf7bf80642`
|
|
215
|
+
- Fixture SHA-256: `1001bdd4a979f115a9589e1dd309676776aad90672a1aeae0ab63863a466cfb2`
|
|
209
216
|
|
|
210
217
|
## Development commands
|
|
211
218
|
|
|
212
219
|
```bash
|
|
220
|
+
npm run typecheck
|
|
221
|
+
npm run lint
|
|
222
|
+
npm run format:check
|
|
213
223
|
npm run build
|
|
214
224
|
npm test
|
|
215
225
|
npm pack --dry-run
|
package/dist/claims.js
CHANGED
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
import nacl from 'tweetnacl';
|
|
2
2
|
import { PublicKey, SystemProgram, Transaction, TransactionInstruction, } from '@solana/web3.js';
|
|
3
|
-
import {
|
|
3
|
+
import { fromHex } from './utils.js';
|
|
4
4
|
import { decodeSolanaTransaction, solanaTransactionFirstSignature, solanaTransactionIntentMessageBytes, solanaTransactionMessageBytes, solanaTransactionRequiredSigner, solanaTransactionSignerSignature, } from './transactions.js';
|
|
5
5
|
import { deriveClaimPda, deriveConfigPda, deriveOutcomeAggregatePda, derivePoolCompliancePolicyPda, derivePoolOraclePolicyPda, derivePoolTreasuryReservePda, derivePoolTermsPda, deriveMembershipPda, ZERO_PUBKEY, } from './protocol_seeds.js';
|
|
6
|
-
|
|
6
|
+
import { encodeSubmitRewardClaimPayload, validateRewardClaimOptionalAccounts, } from './internal/reward-claim.js';
|
|
7
7
|
function bytesEqual(left, right) {
|
|
8
|
-
return left.length === right.length &&
|
|
9
|
-
|
|
10
|
-
function validateRewardClaimOptionalAccounts(params) {
|
|
11
|
-
const providedCount = [
|
|
12
|
-
params.poolAssetVault,
|
|
13
|
-
params.poolVaultTokenAccount,
|
|
14
|
-
params.recipientTokenAccount,
|
|
15
|
-
].filter((value) => typeof value === 'string' && value.length > 0).length;
|
|
16
|
-
if (providedCount !== 0 && providedCount !== 3) {
|
|
17
|
-
throw new Error('poolAssetVault, poolVaultTokenAccount, and recipientTokenAccount must be provided together');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function serializeSubmitRewardClaimPayload(params) {
|
|
21
|
-
const cycleHash = fromHex(params.cycleHashHex, 32);
|
|
22
|
-
const ruleHash = fromHex(params.ruleHashHex, 32);
|
|
23
|
-
const intentHash = fromHex(params.intentHashHex, 32);
|
|
24
|
-
return Buffer.concat([
|
|
25
|
-
SUBMIT_REWARD_CLAIM_DISCRIMINATOR,
|
|
26
|
-
new PublicKey(params.member).toBuffer(),
|
|
27
|
-
Buffer.from(cycleHash),
|
|
28
|
-
Buffer.from(ruleHash),
|
|
29
|
-
Buffer.from(intentHash),
|
|
30
|
-
encodeU64Le(params.payoutAmount),
|
|
31
|
-
new PublicKey(params.recipient).toBuffer(),
|
|
32
|
-
]);
|
|
8
|
+
return (left.length === right.length &&
|
|
9
|
+
left.every((value, index) => value === right[index]));
|
|
33
10
|
}
|
|
34
11
|
export function buildUnsignedRewardClaimTx(params) {
|
|
35
12
|
validateRewardClaimOptionalAccounts(params);
|
|
@@ -110,13 +87,29 @@ export function buildUnsignedRewardClaimTx(params) {
|
|
|
110
87
|
isSigner: false,
|
|
111
88
|
isWritable: params.cohortSettlementRoot != null,
|
|
112
89
|
},
|
|
113
|
-
{
|
|
90
|
+
{
|
|
91
|
+
pubkey: new PublicKey(params.recipientSystemAccount),
|
|
92
|
+
isSigner: false,
|
|
93
|
+
isWritable: true,
|
|
94
|
+
},
|
|
114
95
|
{ pubkey: claimDelegateAccount, isSigner: false, isWritable: false },
|
|
115
96
|
{ pubkey: poolAssetVaultAccount, isSigner: false, isWritable: false },
|
|
116
|
-
{
|
|
117
|
-
|
|
97
|
+
{
|
|
98
|
+
pubkey: poolVaultTokenAccount,
|
|
99
|
+
isSigner: false,
|
|
100
|
+
isWritable: params.poolVaultTokenAccount != null,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
pubkey: recipientTokenAccount,
|
|
104
|
+
isSigner: false,
|
|
105
|
+
isWritable: params.recipientTokenAccount != null,
|
|
106
|
+
},
|
|
118
107
|
{ pubkey: claimRecordPda, isSigner: false, isWritable: true },
|
|
119
|
-
{
|
|
108
|
+
{
|
|
109
|
+
pubkey: new PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'),
|
|
110
|
+
isSigner: false,
|
|
111
|
+
isWritable: false,
|
|
112
|
+
},
|
|
120
113
|
{ pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
|
|
121
114
|
{
|
|
122
115
|
pubkey: params.includePoolCompliancePolicy
|
|
@@ -129,7 +122,7 @@ export function buildUnsignedRewardClaimTx(params) {
|
|
|
129
122
|
const instruction = new TransactionInstruction({
|
|
130
123
|
keys,
|
|
131
124
|
programId,
|
|
132
|
-
data:
|
|
125
|
+
data: encodeSubmitRewardClaimPayload(params),
|
|
133
126
|
});
|
|
134
127
|
const tx = new Transaction({
|
|
135
128
|
recentBlockhash: params.recentBlockhash,
|
|
@@ -157,7 +150,8 @@ export function validateSignedClaimTx(params) {
|
|
|
157
150
|
signer: null,
|
|
158
151
|
};
|
|
159
152
|
}
|
|
160
|
-
if (typeof params.expectedUnsignedTxBase64 === 'string' &&
|
|
153
|
+
if (typeof params.expectedUnsignedTxBase64 === 'string' &&
|
|
154
|
+
params.expectedUnsignedTxBase64.length > 0) {
|
|
161
155
|
try {
|
|
162
156
|
const expectedUnsignedTx = decodeSolanaTransaction(params.expectedUnsignedTxBase64);
|
|
163
157
|
const signedMessageBytes = solanaTransactionMessageBytes(tx);
|
|
@@ -248,23 +242,24 @@ export function normalizeClaimSimulationFailure(params) {
|
|
|
248
242
|
? params.err
|
|
249
243
|
: JSON.stringify(params.err));
|
|
250
244
|
const haystack = `${logsText}\n${errText}`;
|
|
251
|
-
if (haystack.includes('insufficientpoolliquidity')
|
|
252
|
-
|
|
253
|
-
|
|
245
|
+
if (haystack.includes('insufficientpoolliquidity') ||
|
|
246
|
+
haystack.includes('insufficient funds') ||
|
|
247
|
+
haystack.includes('insufficient lamports')) {
|
|
254
248
|
return {
|
|
255
249
|
code: 'simulation_failed_insufficient_funds',
|
|
256
250
|
message: 'Pool does not have sufficient liquidity for this claim.',
|
|
257
251
|
};
|
|
258
252
|
}
|
|
259
|
-
if (haystack.includes('poolnotactive') ||
|
|
253
|
+
if (haystack.includes('poolnotactive') ||
|
|
254
|
+
haystack.includes('pool is not active')) {
|
|
260
255
|
return {
|
|
261
256
|
code: 'simulation_failed_pool_paused',
|
|
262
257
|
message: 'Pool is paused or not active for claims.',
|
|
263
258
|
};
|
|
264
259
|
}
|
|
265
|
-
if (haystack.includes('membershipnotactive')
|
|
266
|
-
|
|
267
|
-
|
|
260
|
+
if (haystack.includes('membershipnotactive') ||
|
|
261
|
+
haystack.includes('membership member mismatch') ||
|
|
262
|
+
haystack.includes('membership')) {
|
|
268
263
|
return {
|
|
269
264
|
code: 'simulation_failed_membership_invalid',
|
|
270
265
|
message: 'Membership is not active for this pool.',
|
|
@@ -278,9 +273,9 @@ export function normalizeClaimSimulationFailure(params) {
|
|
|
278
273
|
export function normalizeClaimRpcFailure(error) {
|
|
279
274
|
const message = error instanceof Error ? error.message : String(error);
|
|
280
275
|
const normalized = lower(message);
|
|
281
|
-
if (normalized.includes('timeout')
|
|
282
|
-
|
|
283
|
-
|
|
276
|
+
if (normalized.includes('timeout') ||
|
|
277
|
+
normalized.includes('timed out') ||
|
|
278
|
+
normalized.includes('blockhash not found')) {
|
|
284
279
|
return {
|
|
285
280
|
code: 'rpc_timeout',
|
|
286
281
|
message: message || 'RPC timeout while submitting claim transaction.',
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { AddressLookupTableAccount, Connection, PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
2
|
+
import type { BuildAttestPremiumPaidOffchainTxParams, BuildActivateCycleWithQuoteSolTxParams, BuildActivateCycleWithQuoteSplTxParams, BuildApproveCoverageClaimTxParams, BuildAttachCoverageClaimDecisionSupportTxParams, BuildCancelPoolLiquidityRedemptionTxParams, BuildClaimApprovedCoveragePayoutTxParams, BuildCloseCoverageClaimTxParams, BuildCloseOutcomeSchemaTxParams, BuildClaimOracleTxParams, BuildCreatePoolTxParams, BuildDenyCoverageClaimTxParams, BuildDepositPoolLiquiditySolTxParams, BuildDepositPoolLiquiditySplTxParams, BuildEnrollMemberInvitePermitTxParams, BuildEnrollMemberOpenTxParams, BuildEnrollMemberTokenGateTxParams, BuildFailPoolLiquidityRedemptionTxParams, BuildFinalizeCohortSettlementRootTxParams, BuildFulfillPoolLiquidityRedemptionSolTxParams, BuildFulfillPoolLiquidityRedemptionSplTxParams, BuildFinalizeUnstakeTxParams, BuildFundPoolSolTxParams, BuildFundPoolSplTxParams, BuildInitializePoolLiquiditySolTxParams, BuildInitializePoolLiquiditySplTxParams, BuildInitializeProtocolTxParams, BuildIssuePolicyPositionTxParams, BuildMintPolicyNftTxParams, BuildOpenCycleOutcomeDisputeTxParams, BuildPayCoverageClaimTxParams, BuildPayPremiumSolTxParams, BuildPayPremiumSplTxParams, BuildCreatePolicySeriesTxParams, BuildRegisterPoolCapitalClassTxParams, BuildUpsertPolicySeriesPaymentOptionTxParams, BuildRedeemPoolLiquiditySolTxParams, BuildRedeemPoolLiquiditySplTxParams, BuildRegisterInviteIssuerTxParams, BuildRegisterOutcomeSchemaTxParams, BuildRegisterOracleTxParams, BuildBackfillSchemaDependencyLedgerTxParams, BuildRequestPoolLiquidityRedemptionTxParams, BuildRequestUnstakeTxParams, BuildResolveCycleOutcomeDisputeTxParams, BuildReviewCoverageClaimTxParams, BuildRotateGovernanceAuthorityTxParams, BuildSchedulePoolLiquidityRedemptionTxParams, BuildSetClaimDelegateTxParams, BuildSetPoolAutomationPolicyTxParams, BuildSetPoolCompliancePolicyTxParams, BuildSetPoolOraclePolicyTxParams, BuildSetPoolOraclePermissionsTxParams, BuildSetPoolOracleTxParams, BuildSetPoolControlAuthoritiesTxParams, BuildSetPoolLiquidityEnabledTxParams, BuildSetPoolTermsHashTxParams, BuildSetPoolRiskControlsTxParams, BuildSetPoolStatusTxParams, BuildSetProtocolParamsTxParams, BuildSetPoolCoverageReserveFloorTxParams, BuildSettleCycleCommitmentSolTxParams, BuildSettleCycleCommitmentTxParams, BuildSettleCoverageClaimTxParams, BuildSlashOracleTxParams, BuildStakeOracleTxParams, BuildSubmitCoverageClaimTxParams, BuildSubscribePolicySeriesTxParams, BuildSubmitRewardClaimTxParams, BuildUpdatePolicySeriesTxParams, BuildUpdateOracleProfileTxParams, BuildVerifyOutcomeSchemaTxParams, BuildUpdateOracleMetadataTxParams, BuildSetPoolOutcomeRuleTxParams, BuildSubmitOutcomeAttestationVoteTxParams, BuildFinalizeCycleOutcomeTxParams, BuildWithdrawPoolTreasurySolTxParams, BuildWithdrawPoolTreasurySplTxParams, BuildWithdrawPoolOracleFeeSolTxParams, BuildWithdrawPoolOracleFeeSplTxParams, BuildWithdrawProtocolFeeSolTxParams, BuildWithdrawProtocolFeeSplTxParams, ProtocolClaimRecordAccount, ProtocolClaimDelegateAuthorizationAccount, ProtocolClient, ProtocolCoverageClaimRecordAccount, ProtocolPolicyPositionNftAccount, ProtocolPolicySeriesAccount, ProtocolPolicySeriesPaymentOptionAccount, ProtocolCohortSettlementRootAccount, ProtocolCycleQuoteReplayAccount, ProtocolAttestationVoteAccount, ProtocolConfigAccount, ProtocolPolicyPositionAccount, ProtocolCycleOutcomeAccount, ProtocolCycleOutcomeAggregateAccount, ProtocolInviteIssuerRegistryEntryAccount, ProtocolMembershipRecordAccount, ProtocolEnrollmentPermitReplayAccount, ProtocolOracleProfileAccount, ProtocolOracleStakePositionAccount, ProtocolOracleRegistryEntryAccount, ProtocolPoolAccount, ProtocolPoolAssetVaultAccount, ProtocolPoolAutomationPolicyAccount, ProtocolPoolCapitalClassAccount, ProtocolPoolCompliancePolicyAccount, ProtocolPoolControlAuthorityAccount, ProtocolPoolLiquidityConfigAccount, ProtocolPoolOracleFeeVaultAccount, ProtocolPoolOraclePermissionSetAccount, ProtocolPoolOraclePolicyAccount, ProtocolPoolRedemptionRequestAccount, ProtocolPoolRiskConfigAccount, ProtocolPoolTreasuryReserveAccount, ProtocolFeeVaultAccount, ProtocolPoolTermsAccount, ProtocolPoolOracleApprovalAccount, ProtocolPoolOutcomeRuleAccount, ProtocolPremiumLedgerAccount, ProtocolPremiumAttestationReplayAccount, ProtocolOutcomeSchemaRegistryEntryAccount, ProtocolSchemaDependencyLedgerAccount, ProtocolCycleQuoteFields, ProtocolMemberCycleAccount } from '../../types.js';
|
|
3
|
+
export declare const PROTOCOL_PROGRAM_ID = "Bn6eixac1QEEVErGBvBjxAd6pgB9e2q4XHvAkinQ5y1B";
|
|
4
|
+
export declare function buildCycleQuoteMessage(fields: ProtocolCycleQuoteFields): Buffer;
|
|
5
|
+
export declare function buildCycleQuoteHash(input: ProtocolCycleQuoteFields | Uint8Array): Buffer;
|
|
6
|
+
export declare function buildCycleQuoteSignatureMessage(input: ProtocolCycleQuoteFields | Uint8Array): Buffer;
|
|
7
|
+
export declare function compileTransactionToV0(transaction: Transaction, lookupTableAccounts: AddressLookupTableAccount[]): VersionedTransaction;
|
|
8
|
+
export declare function decodePoolAccount(address: string, data: Buffer): ProtocolPoolAccount;
|
|
9
|
+
export declare function decodeOracleRegistryEntryAccount(address: string, data: Buffer): ProtocolOracleRegistryEntryAccount;
|
|
10
|
+
export declare function decodeOracleProfileAccount(address: string, data: Buffer): ProtocolOracleProfileAccount;
|
|
11
|
+
export declare function decodePoolOracleApprovalAccount(address: string, data: Buffer): ProtocolPoolOracleApprovalAccount;
|
|
12
|
+
export declare function decodeMembershipRecordAccount(address: string, data: Buffer): ProtocolMembershipRecordAccount;
|
|
13
|
+
export declare function decodeCycleOutcomeAccount(address: string, data: Buffer): ProtocolCycleOutcomeAccount;
|
|
14
|
+
export declare function decodeCycleOutcomeAggregateAccount(address: string, data: Buffer): ProtocolCycleOutcomeAggregateAccount;
|
|
15
|
+
export declare function decodeProtocolConfigAccount(address: string, data: Buffer): ProtocolConfigAccount;
|
|
16
|
+
export declare function decodeOracleStakePositionAccount(address: string, data: Buffer): ProtocolOracleStakePositionAccount;
|
|
17
|
+
export declare function decodePoolOraclePolicyAccount(address: string, data: Buffer): ProtocolPoolOraclePolicyAccount;
|
|
18
|
+
export declare function decodePoolTermsAccount(address: string, data: Buffer): ProtocolPoolTermsAccount;
|
|
19
|
+
export declare function decodePoolAssetVaultAccount(address: string, data: Buffer): ProtocolPoolAssetVaultAccount;
|
|
20
|
+
export declare function decodePoolLiquidityConfigAccount(address: string, data: Buffer): ProtocolPoolLiquidityConfigAccount;
|
|
21
|
+
export declare function decodePoolRiskConfigAccount(address: string, data: Buffer): ProtocolPoolRiskConfigAccount;
|
|
22
|
+
export declare function decodePoolCapitalClassAccount(address: string, data: Buffer): ProtocolPoolCapitalClassAccount;
|
|
23
|
+
export declare function decodePoolCompliancePolicyAccount(address: string, data: Buffer): ProtocolPoolCompliancePolicyAccount;
|
|
24
|
+
export declare function decodePoolControlAuthorityAccount(address: string, data: Buffer): ProtocolPoolControlAuthorityAccount;
|
|
25
|
+
export declare function decodePoolAutomationPolicyAccount(address: string, data: Buffer): ProtocolPoolAutomationPolicyAccount;
|
|
26
|
+
export declare function decodeProtocolFeeVaultAccount(address: string, data: Buffer): ProtocolFeeVaultAccount;
|
|
27
|
+
export declare function decodePoolOracleFeeVaultAccount(address: string, data: Buffer): ProtocolPoolOracleFeeVaultAccount;
|
|
28
|
+
export declare function decodePoolOraclePermissionSetAccount(address: string, data: Buffer): ProtocolPoolOraclePermissionSetAccount;
|
|
29
|
+
export declare function decodeMemberCycleAccount(address: string, data: Buffer): ProtocolMemberCycleAccount;
|
|
30
|
+
export declare function decodeCycleQuoteReplayAccount(address: string, data: Buffer): ProtocolCycleQuoteReplayAccount;
|
|
31
|
+
export declare function decodePoolTreasuryReserveAccount(address: string, data: Buffer): ProtocolPoolTreasuryReserveAccount;
|
|
32
|
+
export declare function decodeCohortSettlementRootAccount(address: string, data: Buffer): ProtocolCohortSettlementRootAccount;
|
|
33
|
+
export declare function decodeOutcomeSchemaAccount(address: string, data: Buffer): ProtocolOutcomeSchemaRegistryEntryAccount;
|
|
34
|
+
export declare function decodeSchemaDependencyLedgerAccount(address: string, data: Buffer): ProtocolSchemaDependencyLedgerAccount;
|
|
35
|
+
export declare function decodePoolOutcomeRuleAccount(address: string, data: Buffer): ProtocolPoolOutcomeRuleAccount;
|
|
36
|
+
export declare function decodeInviteIssuerAccount(address: string, data: Buffer): ProtocolInviteIssuerRegistryEntryAccount;
|
|
37
|
+
export declare function decodeEnrollmentPermitReplayAccount(address: string, data: Buffer): ProtocolEnrollmentPermitReplayAccount;
|
|
38
|
+
export declare function decodeAttestationVoteAccount(address: string, data: Buffer): ProtocolAttestationVoteAccount;
|
|
39
|
+
export declare function decodeClaimDelegateAccount(address: string, data: Buffer): ProtocolClaimDelegateAuthorizationAccount;
|
|
40
|
+
export declare function decodePolicyPositionAccount(address: string, data: Buffer): ProtocolPolicyPositionAccount;
|
|
41
|
+
export declare function decodePremiumLedgerAccount(address: string, data: Buffer): ProtocolPremiumLedgerAccount;
|
|
42
|
+
export declare function decodeClaimRecordAccount(address: string, data: Buffer): ProtocolClaimRecordAccount;
|
|
43
|
+
export declare function decodePolicySeriesAccount(address: string, data: Buffer): ProtocolPolicySeriesAccount;
|
|
44
|
+
export declare function decodePolicySeriesPaymentOptionAccount(address: string, data: Buffer): ProtocolPolicySeriesPaymentOptionAccount;
|
|
45
|
+
export declare function decodePolicyPositionNftAccount(address: string, data: Buffer): ProtocolPolicyPositionNftAccount;
|
|
46
|
+
export declare function decodePremiumAttestationReplayAccount(address: string, data: Buffer): ProtocolPremiumAttestationReplayAccount;
|
|
47
|
+
export declare function decodeCoverageClaimRecordAccount(address: string, data: Buffer): ProtocolCoverageClaimRecordAccount;
|
|
48
|
+
export declare function decodePoolRedemptionRequestAccount(address: string, data: Buffer): ProtocolPoolRedemptionRequestAccount;
|
|
49
|
+
export declare function createProtocolBuilders(connection: Connection, programId: PublicKey): {
|
|
50
|
+
buildSubmitOutcomeAttestationVoteTx(params: BuildSubmitOutcomeAttestationVoteTxParams): Transaction;
|
|
51
|
+
buildFinalizeCycleOutcomeTx(params: BuildFinalizeCycleOutcomeTxParams): Transaction;
|
|
52
|
+
buildOpenCycleOutcomeDisputeTx(params: BuildOpenCycleOutcomeDisputeTxParams): Transaction;
|
|
53
|
+
buildResolveCycleOutcomeDisputeTx(params: BuildResolveCycleOutcomeDisputeTxParams): Transaction;
|
|
54
|
+
buildInitializeProtocolTx(params: BuildInitializeProtocolTxParams): Transaction;
|
|
55
|
+
buildSetProtocolParamsTx(params: BuildSetProtocolParamsTxParams): Transaction;
|
|
56
|
+
buildRotateGovernanceAuthorityTx(params: BuildRotateGovernanceAuthorityTxParams): Transaction;
|
|
57
|
+
buildRegisterOracleTx(params: BuildRegisterOracleTxParams): Transaction;
|
|
58
|
+
buildClaimOracleTx(params: BuildClaimOracleTxParams): Transaction;
|
|
59
|
+
buildUpdateOracleProfileTx(params: BuildUpdateOracleProfileTxParams): Transaction;
|
|
60
|
+
buildUpdateOracleMetadataTx(params: BuildUpdateOracleMetadataTxParams): Transaction;
|
|
61
|
+
buildStakeOracleTx(params: BuildStakeOracleTxParams): Transaction;
|
|
62
|
+
buildRequestUnstakeTx(params: BuildRequestUnstakeTxParams): Transaction;
|
|
63
|
+
buildFinalizeUnstakeTx(params: BuildFinalizeUnstakeTxParams): Transaction;
|
|
64
|
+
buildSlashOracleTx(params: BuildSlashOracleTxParams): Transaction;
|
|
65
|
+
buildCreatePoolTx(params: BuildCreatePoolTxParams): Transaction;
|
|
66
|
+
buildSetPoolStatusTx(params: BuildSetPoolStatusTxParams): Transaction;
|
|
67
|
+
buildSetPoolOracleTx(params: BuildSetPoolOracleTxParams): Transaction;
|
|
68
|
+
buildSetPoolOraclePolicyTx(params: BuildSetPoolOraclePolicyTxParams): Transaction;
|
|
69
|
+
buildSetPoolRiskControlsTx(params: BuildSetPoolRiskControlsTxParams): Transaction;
|
|
70
|
+
buildSetPoolCompliancePolicyTx(params: BuildSetPoolCompliancePolicyTxParams): Transaction;
|
|
71
|
+
buildSetPoolControlAuthoritiesTx(params: BuildSetPoolControlAuthoritiesTxParams): Transaction;
|
|
72
|
+
buildSetPoolAutomationPolicyTx(params: BuildSetPoolAutomationPolicyTxParams): Transaction;
|
|
73
|
+
buildSetPoolOraclePermissionsTx(params: BuildSetPoolOraclePermissionsTxParams): Transaction;
|
|
74
|
+
buildSetPoolCoverageReserveFloorTx(params: BuildSetPoolCoverageReserveFloorTxParams): Transaction;
|
|
75
|
+
buildSetPoolTermsHashTx(params: BuildSetPoolTermsHashTxParams): Transaction;
|
|
76
|
+
buildRegisterOutcomeSchemaTx(params: BuildRegisterOutcomeSchemaTxParams): Transaction;
|
|
77
|
+
buildVerifyOutcomeSchemaTx(params: BuildVerifyOutcomeSchemaTxParams): Transaction;
|
|
78
|
+
buildBackfillSchemaDependencyLedgerTx(params: BuildBackfillSchemaDependencyLedgerTxParams): Transaction;
|
|
79
|
+
buildCloseOutcomeSchemaTx(params: BuildCloseOutcomeSchemaTxParams): Transaction;
|
|
80
|
+
buildSetPolicySeriesOutcomeRuleTx(params: BuildSetPoolOutcomeRuleTxParams): Transaction;
|
|
81
|
+
buildRegisterInviteIssuerTx(params: BuildRegisterInviteIssuerTxParams): Transaction;
|
|
82
|
+
buildEnrollMemberOpenTx(params: BuildEnrollMemberOpenTxParams): Transaction;
|
|
83
|
+
buildEnrollMemberTokenGateTx(params: BuildEnrollMemberTokenGateTxParams): Transaction;
|
|
84
|
+
buildEnrollMemberInvitePermitTx(params: BuildEnrollMemberInvitePermitTxParams): Transaction;
|
|
85
|
+
buildSetClaimDelegateTx(params: BuildSetClaimDelegateTxParams): Transaction;
|
|
86
|
+
buildFundPoolSolTx(params: BuildFundPoolSolTxParams): Transaction;
|
|
87
|
+
buildFundPoolSplTx(params: BuildFundPoolSplTxParams): Transaction;
|
|
88
|
+
buildInitializePoolLiquiditySolTx(params: BuildInitializePoolLiquiditySolTxParams): Transaction;
|
|
89
|
+
buildInitializePoolLiquiditySplTx(params: BuildInitializePoolLiquiditySplTxParams): Transaction;
|
|
90
|
+
buildSetPoolLiquidityEnabledTx(params: BuildSetPoolLiquidityEnabledTxParams): Transaction;
|
|
91
|
+
buildRegisterPoolCapitalClassTx(params: BuildRegisterPoolCapitalClassTxParams): Transaction;
|
|
92
|
+
buildDepositPoolLiquiditySolTx(params: BuildDepositPoolLiquiditySolTxParams): Transaction;
|
|
93
|
+
buildDepositPoolLiquiditySplTx(params: BuildDepositPoolLiquiditySplTxParams): Transaction;
|
|
94
|
+
buildRedeemPoolLiquiditySolTx(params: BuildRedeemPoolLiquiditySolTxParams): Transaction;
|
|
95
|
+
buildRedeemPoolLiquiditySplTx(params: BuildRedeemPoolLiquiditySplTxParams): Transaction;
|
|
96
|
+
buildRequestPoolLiquidityRedemptionTx(params: BuildRequestPoolLiquidityRedemptionTxParams): Transaction;
|
|
97
|
+
buildSchedulePoolLiquidityRedemptionTx(params: BuildSchedulePoolLiquidityRedemptionTxParams): Transaction;
|
|
98
|
+
buildCancelPoolLiquidityRedemptionTx(params: BuildCancelPoolLiquidityRedemptionTxParams): Transaction;
|
|
99
|
+
buildFailPoolLiquidityRedemptionTx(params: BuildFailPoolLiquidityRedemptionTxParams): Transaction;
|
|
100
|
+
buildFulfillPoolLiquidityRedemptionSolTx(params: BuildFulfillPoolLiquidityRedemptionSolTxParams): Transaction;
|
|
101
|
+
buildFulfillPoolLiquidityRedemptionSplTx(params: BuildFulfillPoolLiquidityRedemptionSplTxParams): Transaction;
|
|
102
|
+
buildSubmitRewardClaimTx(params: BuildSubmitRewardClaimTxParams): Transaction;
|
|
103
|
+
buildCreatePolicySeriesTx(params: BuildCreatePolicySeriesTxParams): Transaction;
|
|
104
|
+
buildUpsertPolicySeriesPaymentOptionTx(params: BuildUpsertPolicySeriesPaymentOptionTxParams): Transaction;
|
|
105
|
+
buildUpdatePolicySeriesTx(params: BuildUpdatePolicySeriesTxParams): Transaction;
|
|
106
|
+
buildSubscribePolicySeriesTx(params: BuildSubscribePolicySeriesTxParams): Transaction;
|
|
107
|
+
buildIssuePolicyPositionTx(params: BuildIssuePolicyPositionTxParams): Transaction;
|
|
108
|
+
buildMintPolicyNftTx(params: BuildMintPolicyNftTxParams): Transaction;
|
|
109
|
+
buildPayPremiumSolTx(params: BuildPayPremiumSolTxParams): Transaction;
|
|
110
|
+
buildPayPremiumSplTx(params: BuildPayPremiumSplTxParams): Transaction;
|
|
111
|
+
buildAttestPremiumPaidOffchainTx(params: BuildAttestPremiumPaidOffchainTxParams): Transaction;
|
|
112
|
+
buildSubmitCoverageClaimTx(params: BuildSubmitCoverageClaimTxParams): Transaction;
|
|
113
|
+
buildReviewCoverageClaimTx(params: BuildReviewCoverageClaimTxParams): Transaction;
|
|
114
|
+
buildAttachCoverageClaimDecisionSupportTx(params: BuildAttachCoverageClaimDecisionSupportTxParams): Transaction;
|
|
115
|
+
buildApproveCoverageClaimTx(params: BuildApproveCoverageClaimTxParams): Transaction;
|
|
116
|
+
buildDenyCoverageClaimTx(params: BuildDenyCoverageClaimTxParams): Transaction;
|
|
117
|
+
buildPayCoverageClaimTx(params: BuildPayCoverageClaimTxParams): Transaction;
|
|
118
|
+
buildClaimApprovedCoveragePayoutTx(params: BuildClaimApprovedCoveragePayoutTxParams): Transaction;
|
|
119
|
+
buildCloseCoverageClaimTx(params: BuildCloseCoverageClaimTxParams): Transaction;
|
|
120
|
+
buildSettleCoverageClaimTx(params: BuildSettleCoverageClaimTxParams): Transaction;
|
|
121
|
+
buildActivateCycleWithQuoteSolTx(params: BuildActivateCycleWithQuoteSolTxParams): Transaction;
|
|
122
|
+
buildActivateCycleWithQuoteSplTx(params: BuildActivateCycleWithQuoteSplTxParams): Transaction;
|
|
123
|
+
buildSettleCycleCommitmentTx(params: BuildSettleCycleCommitmentTxParams): Transaction;
|
|
124
|
+
buildSettleCycleCommitmentSolTx(params: BuildSettleCycleCommitmentSolTxParams): Transaction;
|
|
125
|
+
buildFinalizeCohortSettlementRootTx(params: BuildFinalizeCohortSettlementRootTxParams): Transaction;
|
|
126
|
+
buildWithdrawPoolTreasurySplTx(params: BuildWithdrawPoolTreasurySplTxParams): Transaction;
|
|
127
|
+
buildWithdrawPoolTreasurySolTx(params: BuildWithdrawPoolTreasurySolTxParams): Transaction;
|
|
128
|
+
buildWithdrawProtocolFeeSplTx(params: BuildWithdrawProtocolFeeSplTxParams): Transaction;
|
|
129
|
+
buildWithdrawProtocolFeeSolTx(params: BuildWithdrawProtocolFeeSolTxParams): Transaction;
|
|
130
|
+
buildWithdrawPoolOracleFeeSplTx(params: BuildWithdrawPoolOracleFeeSplTxParams): Transaction;
|
|
131
|
+
buildWithdrawPoolOracleFeeSolTx(params: BuildWithdrawPoolOracleFeeSolTxParams): Transaction;
|
|
132
|
+
};
|
|
133
|
+
export declare function createProtocolFetchers(connection: Connection, programId: PublicKey): {
|
|
134
|
+
fetchProtocolConfig(): Promise<ProtocolConfigAccount | null>;
|
|
135
|
+
fetchPool(poolAddress: string): Promise<ProtocolPoolAccount | null>;
|
|
136
|
+
fetchOracleRegistryEntry(oracle: string): Promise<ProtocolOracleRegistryEntryAccount | null>;
|
|
137
|
+
fetchPoolOracleApproval(params: {
|
|
138
|
+
poolAddress: string;
|
|
139
|
+
oracle: string;
|
|
140
|
+
}): Promise<ProtocolPoolOracleApprovalAccount | null>;
|
|
141
|
+
fetchMembershipRecord(params: {
|
|
142
|
+
poolAddress: string;
|
|
143
|
+
member: string;
|
|
144
|
+
}): Promise<ProtocolMembershipRecordAccount | null>;
|
|
145
|
+
fetchCycleOutcomeAggregate(params: {
|
|
146
|
+
poolAddress: string;
|
|
147
|
+
seriesRefHashHex: string;
|
|
148
|
+
member: string;
|
|
149
|
+
cycleHashHex: string;
|
|
150
|
+
ruleHashHex: string;
|
|
151
|
+
}): Promise<ProtocolCycleOutcomeAggregateAccount | null>;
|
|
152
|
+
fetchOracleProfile(oracle: string): Promise<ProtocolOracleProfileAccount | null>;
|
|
153
|
+
fetchOracleStakePosition(params: {
|
|
154
|
+
oracle: string;
|
|
155
|
+
staker: string;
|
|
156
|
+
}): Promise<ProtocolOracleStakePositionAccount | null>;
|
|
157
|
+
fetchPoolOraclePolicy(poolAddress: string): Promise<ProtocolPoolOraclePolicyAccount | null>;
|
|
158
|
+
fetchPoolTerms(poolAddress: string): Promise<ProtocolPoolTermsAccount | null>;
|
|
159
|
+
fetchPoolAssetVault(params: {
|
|
160
|
+
poolAddress: string;
|
|
161
|
+
payoutMint: string;
|
|
162
|
+
}): Promise<ProtocolPoolAssetVaultAccount | null>;
|
|
163
|
+
fetchPoolLiquidityConfig(poolAddress: string): Promise<ProtocolPoolLiquidityConfigAccount | null>;
|
|
164
|
+
fetchPoolRiskConfig(poolAddress: string): Promise<ProtocolPoolRiskConfigAccount | null>;
|
|
165
|
+
fetchPoolCapitalClass(params: {
|
|
166
|
+
poolAddress: string;
|
|
167
|
+
shareMint: string;
|
|
168
|
+
}): Promise<ProtocolPoolCapitalClassAccount | null>;
|
|
169
|
+
fetchPoolCompliancePolicy(poolAddress: string): Promise<ProtocolPoolCompliancePolicyAccount | null>;
|
|
170
|
+
fetchPoolControlAuthority(poolAddress: string): Promise<ProtocolPoolControlAuthorityAccount | null>;
|
|
171
|
+
fetchPoolAutomationPolicy(poolAddress: string): Promise<ProtocolPoolAutomationPolicyAccount | null>;
|
|
172
|
+
fetchProtocolFeeVault(paymentMint: string): Promise<ProtocolFeeVaultAccount | null>;
|
|
173
|
+
fetchPoolOracleFeeVault(params: {
|
|
174
|
+
poolAddress: string;
|
|
175
|
+
oracle: string;
|
|
176
|
+
paymentMint: string;
|
|
177
|
+
}): Promise<ProtocolPoolOracleFeeVaultAccount | null>;
|
|
178
|
+
fetchPoolOraclePermissionSet(params: {
|
|
179
|
+
poolAddress: string;
|
|
180
|
+
oracle: string;
|
|
181
|
+
}): Promise<ProtocolPoolOraclePermissionSetAccount | null>;
|
|
182
|
+
fetchOutcomeSchema(schemaKeyHashHex: string): Promise<ProtocolOutcomeSchemaRegistryEntryAccount | null>;
|
|
183
|
+
fetchSchemaDependencyLedger(schemaKeyHashHex: string): Promise<ProtocolSchemaDependencyLedgerAccount | null>;
|
|
184
|
+
fetchPoolOutcomeRule(params: {
|
|
185
|
+
poolAddress: string;
|
|
186
|
+
seriesRefHashHex: string;
|
|
187
|
+
ruleHashHex: string;
|
|
188
|
+
}): Promise<ProtocolPoolOutcomeRuleAccount | null>;
|
|
189
|
+
fetchInviteIssuer(issuer: string): Promise<ProtocolInviteIssuerRegistryEntryAccount | null>;
|
|
190
|
+
fetchEnrollmentPermitReplay(params: {
|
|
191
|
+
poolAddress: string;
|
|
192
|
+
member: string;
|
|
193
|
+
nonceHashHex: string;
|
|
194
|
+
}): Promise<ProtocolEnrollmentPermitReplayAccount | null>;
|
|
195
|
+
fetchAttestationVote(params: {
|
|
196
|
+
poolAddress: string;
|
|
197
|
+
seriesRefHashHex: string;
|
|
198
|
+
member: string;
|
|
199
|
+
cycleHashHex: string;
|
|
200
|
+
ruleHashHex: string;
|
|
201
|
+
oracle: string;
|
|
202
|
+
}): Promise<ProtocolAttestationVoteAccount | null>;
|
|
203
|
+
fetchClaimDelegate(params: {
|
|
204
|
+
poolAddress: string;
|
|
205
|
+
member: string;
|
|
206
|
+
}): Promise<ProtocolClaimDelegateAuthorizationAccount | null>;
|
|
207
|
+
fetchClaimRecord(params: {
|
|
208
|
+
poolAddress: string;
|
|
209
|
+
seriesRefHashHex: string;
|
|
210
|
+
member: string;
|
|
211
|
+
cycleHashHex: string;
|
|
212
|
+
ruleHashHex: string;
|
|
213
|
+
}): Promise<ProtocolClaimRecordAccount | null>;
|
|
214
|
+
fetchPolicySeries(params: {
|
|
215
|
+
poolAddress: string;
|
|
216
|
+
seriesRefHashHex: string;
|
|
217
|
+
}): Promise<ProtocolPolicySeriesAccount | null>;
|
|
218
|
+
fetchPolicySeriesPaymentOption(params: {
|
|
219
|
+
poolAddress: string;
|
|
220
|
+
seriesRefHashHex: string;
|
|
221
|
+
paymentMint: string;
|
|
222
|
+
}): Promise<ProtocolPolicySeriesPaymentOptionAccount | null>;
|
|
223
|
+
fetchPolicyPosition(params: {
|
|
224
|
+
poolAddress: string;
|
|
225
|
+
seriesRefHashHex: string;
|
|
226
|
+
member: string;
|
|
227
|
+
}): Promise<ProtocolPolicyPositionAccount | null>;
|
|
228
|
+
fetchPolicyPositionNft(params: {
|
|
229
|
+
poolAddress: string;
|
|
230
|
+
seriesRefHashHex: string;
|
|
231
|
+
member: string;
|
|
232
|
+
}): Promise<ProtocolPolicyPositionNftAccount | null>;
|
|
233
|
+
fetchPremiumLedger(params: {
|
|
234
|
+
poolAddress: string;
|
|
235
|
+
seriesRefHashHex: string;
|
|
236
|
+
member: string;
|
|
237
|
+
}): Promise<ProtocolPremiumLedgerAccount | null>;
|
|
238
|
+
fetchPremiumAttestationReplay(params: {
|
|
239
|
+
poolAddress: string;
|
|
240
|
+
seriesRefHashHex: string;
|
|
241
|
+
member: string;
|
|
242
|
+
replayHashHex: string;
|
|
243
|
+
}): Promise<ProtocolPremiumAttestationReplayAccount | null>;
|
|
244
|
+
fetchMemberCycle(params: {
|
|
245
|
+
poolAddress: string;
|
|
246
|
+
seriesRefHashHex: string;
|
|
247
|
+
member: string;
|
|
248
|
+
periodIndex: bigint | number;
|
|
249
|
+
}): Promise<ProtocolMemberCycleAccount | null>;
|
|
250
|
+
fetchMemberCycleByAddress(address: string): Promise<ProtocolMemberCycleAccount | null>;
|
|
251
|
+
fetchCycleQuoteReplay(params: {
|
|
252
|
+
poolAddress: string;
|
|
253
|
+
seriesRefHashHex: string;
|
|
254
|
+
member: string;
|
|
255
|
+
nonceHashHex: string;
|
|
256
|
+
}): Promise<ProtocolCycleQuoteReplayAccount | null>;
|
|
257
|
+
fetchPoolTreasuryReserve(params: {
|
|
258
|
+
poolAddress: string;
|
|
259
|
+
paymentMint: string;
|
|
260
|
+
}): Promise<ProtocolPoolTreasuryReserveAccount | null>;
|
|
261
|
+
fetchRedemptionRequest(params: {
|
|
262
|
+
poolAddress: string;
|
|
263
|
+
redeemer: string;
|
|
264
|
+
requestHashHex: string;
|
|
265
|
+
}): Promise<ProtocolPoolRedemptionRequestAccount | null>;
|
|
266
|
+
fetchCohortSettlementRoot(params: {
|
|
267
|
+
poolAddress: string;
|
|
268
|
+
seriesRefHashHex: string;
|
|
269
|
+
cohortHashHex: string;
|
|
270
|
+
}): Promise<ProtocolCohortSettlementRootAccount | null>;
|
|
271
|
+
fetchCoverageClaimRecord(params: {
|
|
272
|
+
poolAddress: string;
|
|
273
|
+
seriesRefHashHex: string;
|
|
274
|
+
member: string;
|
|
275
|
+
intentHashHex: string;
|
|
276
|
+
}): Promise<ProtocolCoverageClaimRecordAccount | null>;
|
|
277
|
+
};
|
|
278
|
+
export declare function createProtocolClient(connection: Connection, programIdInput: string): ProtocolClient;
|
|
279
|
+
export declare function derivePoolAddress(params: {
|
|
280
|
+
programId: string;
|
|
281
|
+
authority: string;
|
|
282
|
+
poolId: string;
|
|
283
|
+
}): string;
|