@omegax/protocol-sdk 0.4.2 → 0.4.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/dist/protocol.d.ts +2 -1
- package/dist/protocol.js +1064 -3
- package/dist/protocol_seeds.d.ts +38 -0
- package/dist/protocol_seeds.js +66 -0
- package/dist/types.d.ts +267 -1
- package/package.json +1 -1
package/dist/protocol_seeds.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ export declare const SEED_ORACLE_STAKE = "oracle_stake";
|
|
|
14
14
|
export declare const SEED_POOL_ORACLE_POLICY = "pool_oracle_policy";
|
|
15
15
|
export declare const SEED_POOL_TERMS = "pool_terms";
|
|
16
16
|
export declare const SEED_POOL_ASSET_VAULT = "pool_asset_vault";
|
|
17
|
+
export declare const SEED_POOL_ORACLE_PERMISSIONS = "pool_oracle_permissions";
|
|
18
|
+
export declare const SEED_MEMBER_CYCLE = "member_cycle";
|
|
19
|
+
export declare const SEED_CYCLE_QUOTE_REPLAY = "cycle_quote_replay";
|
|
20
|
+
export declare const SEED_POOL_TREASURY_RESERVE = "pool_treasury_reserve";
|
|
21
|
+
export declare const SEED_PROTOCOL_FEE_VAULT = "protocol_fee_vault";
|
|
22
|
+
export declare const SEED_POOL_ORACLE_FEE_VAULT = "pool_oracle_fee_vault";
|
|
17
23
|
export declare const SEED_SCHEMA = "schema";
|
|
18
24
|
export declare const SEED_POOL_RULE = "pool_rule";
|
|
19
25
|
export declare const SEED_INVITE_ISSUER = "invite_issuer";
|
|
@@ -95,6 +101,38 @@ export declare function derivePoolAssetVaultPda(params: {
|
|
|
95
101
|
poolAddress: string | PublicKey;
|
|
96
102
|
payoutMint: string | PublicKey;
|
|
97
103
|
}): [PublicKey, number];
|
|
104
|
+
export declare function derivePoolOraclePermissionSetPda(params: {
|
|
105
|
+
programId: string | PublicKey;
|
|
106
|
+
poolAddress: string | PublicKey;
|
|
107
|
+
oracle: string | PublicKey;
|
|
108
|
+
}): [PublicKey, number];
|
|
109
|
+
export declare function deriveMemberCyclePda(params: {
|
|
110
|
+
programId: string | PublicKey;
|
|
111
|
+
poolAddress: string | PublicKey;
|
|
112
|
+
member: string | PublicKey;
|
|
113
|
+
periodIndex: bigint | number;
|
|
114
|
+
}): [PublicKey, number];
|
|
115
|
+
export declare function deriveCycleQuoteReplayPda(params: {
|
|
116
|
+
programId: string | PublicKey;
|
|
117
|
+
poolAddress: string | PublicKey;
|
|
118
|
+
member: string | PublicKey;
|
|
119
|
+
nonceHash: Uint8Array;
|
|
120
|
+
}): [PublicKey, number];
|
|
121
|
+
export declare function derivePoolTreasuryReservePda(params: {
|
|
122
|
+
programId: string | PublicKey;
|
|
123
|
+
poolAddress: string | PublicKey;
|
|
124
|
+
paymentMint: string | PublicKey;
|
|
125
|
+
}): [PublicKey, number];
|
|
126
|
+
export declare function deriveProtocolFeeVaultPda(params: {
|
|
127
|
+
programId: string | PublicKey;
|
|
128
|
+
paymentMint: string | PublicKey;
|
|
129
|
+
}): [PublicKey, number];
|
|
130
|
+
export declare function derivePoolOracleFeeVaultPda(params: {
|
|
131
|
+
programId: string | PublicKey;
|
|
132
|
+
poolAddress: string | PublicKey;
|
|
133
|
+
oracle: string | PublicKey;
|
|
134
|
+
paymentMint: string | PublicKey;
|
|
135
|
+
}): [PublicKey, number];
|
|
98
136
|
export declare function deriveSchemaPda(params: {
|
|
99
137
|
programId: string | PublicKey;
|
|
100
138
|
schemaKeyHash: Uint8Array;
|
package/dist/protocol_seeds.js
CHANGED
|
@@ -14,6 +14,12 @@ export const SEED_ORACLE_STAKE = 'oracle_stake';
|
|
|
14
14
|
export const SEED_POOL_ORACLE_POLICY = 'pool_oracle_policy';
|
|
15
15
|
export const SEED_POOL_TERMS = 'pool_terms';
|
|
16
16
|
export const SEED_POOL_ASSET_VAULT = 'pool_asset_vault';
|
|
17
|
+
export const SEED_POOL_ORACLE_PERMISSIONS = 'pool_oracle_permissions';
|
|
18
|
+
export const SEED_MEMBER_CYCLE = 'member_cycle';
|
|
19
|
+
export const SEED_CYCLE_QUOTE_REPLAY = 'cycle_quote_replay';
|
|
20
|
+
export const SEED_POOL_TREASURY_RESERVE = 'pool_treasury_reserve';
|
|
21
|
+
export const SEED_PROTOCOL_FEE_VAULT = 'protocol_fee_vault';
|
|
22
|
+
export const SEED_POOL_ORACLE_FEE_VAULT = 'pool_oracle_fee_vault';
|
|
17
23
|
export const SEED_SCHEMA = 'schema';
|
|
18
24
|
export const SEED_POOL_RULE = 'pool_rule';
|
|
19
25
|
export const SEED_INVITE_ISSUER = 'invite_issuer';
|
|
@@ -130,6 +136,66 @@ export function derivePoolAssetVaultPda(params) {
|
|
|
130
136
|
const mint = asPubkey(params.payoutMint);
|
|
131
137
|
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_ASSET_VAULT), pool.toBuffer(), mint.toBuffer()], program);
|
|
132
138
|
}
|
|
139
|
+
function encodeU64Seed(value) {
|
|
140
|
+
const out = Buffer.alloc(8);
|
|
141
|
+
out.writeBigUInt64LE(typeof value === 'bigint' ? value : BigInt(value));
|
|
142
|
+
return out;
|
|
143
|
+
}
|
|
144
|
+
export function derivePoolOraclePermissionSetPda(params) {
|
|
145
|
+
const program = asPubkey(params.programId);
|
|
146
|
+
const pool = asPubkey(params.poolAddress);
|
|
147
|
+
const oracle = asPubkey(params.oracle);
|
|
148
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_ORACLE_PERMISSIONS), pool.toBuffer(), oracle.toBuffer()], program);
|
|
149
|
+
}
|
|
150
|
+
export function deriveMemberCyclePda(params) {
|
|
151
|
+
const program = asPubkey(params.programId);
|
|
152
|
+
const pool = asPubkey(params.poolAddress);
|
|
153
|
+
const member = asPubkey(params.member);
|
|
154
|
+
return PublicKey.findProgramAddressSync([
|
|
155
|
+
Buffer.from(SEED_MEMBER_CYCLE),
|
|
156
|
+
pool.toBuffer(),
|
|
157
|
+
member.toBuffer(),
|
|
158
|
+
encodeU64Seed(params.periodIndex),
|
|
159
|
+
], program);
|
|
160
|
+
}
|
|
161
|
+
export function deriveCycleQuoteReplayPda(params) {
|
|
162
|
+
const program = asPubkey(params.programId);
|
|
163
|
+
const pool = asPubkey(params.poolAddress);
|
|
164
|
+
const member = asPubkey(params.member);
|
|
165
|
+
return PublicKey.findProgramAddressSync([
|
|
166
|
+
Buffer.from(SEED_CYCLE_QUOTE_REPLAY),
|
|
167
|
+
pool.toBuffer(),
|
|
168
|
+
member.toBuffer(),
|
|
169
|
+
Buffer.from(params.nonceHash),
|
|
170
|
+
], program);
|
|
171
|
+
}
|
|
172
|
+
export function derivePoolTreasuryReservePda(params) {
|
|
173
|
+
const program = asPubkey(params.programId);
|
|
174
|
+
const pool = asPubkey(params.poolAddress);
|
|
175
|
+
const paymentMint = asPubkey(params.paymentMint);
|
|
176
|
+
return PublicKey.findProgramAddressSync([
|
|
177
|
+
Buffer.from(SEED_POOL_TREASURY_RESERVE),
|
|
178
|
+
pool.toBuffer(),
|
|
179
|
+
paymentMint.toBuffer(),
|
|
180
|
+
], program);
|
|
181
|
+
}
|
|
182
|
+
export function deriveProtocolFeeVaultPda(params) {
|
|
183
|
+
const program = asPubkey(params.programId);
|
|
184
|
+
const paymentMint = asPubkey(params.paymentMint);
|
|
185
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_PROTOCOL_FEE_VAULT), paymentMint.toBuffer()], program);
|
|
186
|
+
}
|
|
187
|
+
export function derivePoolOracleFeeVaultPda(params) {
|
|
188
|
+
const program = asPubkey(params.programId);
|
|
189
|
+
const pool = asPubkey(params.poolAddress);
|
|
190
|
+
const oracle = asPubkey(params.oracle);
|
|
191
|
+
const paymentMint = asPubkey(params.paymentMint);
|
|
192
|
+
return PublicKey.findProgramAddressSync([
|
|
193
|
+
Buffer.from(SEED_POOL_ORACLE_FEE_VAULT),
|
|
194
|
+
pool.toBuffer(),
|
|
195
|
+
oracle.toBuffer(),
|
|
196
|
+
paymentMint.toBuffer(),
|
|
197
|
+
], program);
|
|
198
|
+
}
|
|
133
199
|
export function deriveSchemaPda(params) {
|
|
134
200
|
const program = asPubkey(params.programId);
|
|
135
201
|
return PublicKey.findProgramAddressSync([Buffer.from(SEED_SCHEMA), Buffer.from(params.schemaKeyHash)], program);
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PublicKey, Connection, Transaction } from '@solana/web3.js';
|
|
2
2
|
export type ClaimLifecycleStatus = 'prepared' | 'submitted' | 'confirmed' | 'failed' | 'expired';
|
|
3
|
-
export type ClaimFailureCode = 'invalid_claimant_wallet' | 'wallet_mismatch' | 'pool_not_found' | 'pool_not_active' | 'membership_not_active' | 'claim_window_not_set' | 'claim_window_not_open' | 'claim_window_closed' | 'no_passing_outcomes' | 'intent_expired' | 'intent_message_mismatch' | 'required_signer_mismatch' | 'simulation_failed_insufficient_funds' | 'simulation_failed_pool_paused' | 'simulation_failed_membership_invalid' | 'simulation_failed_unknown' | 'rpc_rejected' | 'rpc_timeout' | 'already_claimed' | 'unknown';
|
|
3
|
+
export type ClaimFailureCode = 'invalid_claimant_wallet' | 'wallet_mismatch' | 'pool_not_found' | 'pool_not_active' | 'membership_not_active' | 'claim_window_not_set' | 'claim_window_not_open' | 'claim_window_closed' | 'no_passing_outcomes' | 'seeker_rule_misconfigured' | 'seeker_commitment_disabled' | 'intent_expired' | 'intent_message_mismatch' | 'required_signer_mismatch' | 'simulation_failed_insufficient_funds' | 'simulation_failed_pool_paused' | 'simulation_failed_membership_invalid' | 'simulation_failed_unknown' | 'rpc_rejected' | 'rpc_timeout' | 'already_claimed' | 'unknown';
|
|
4
4
|
export interface ClaimFailureDetail {
|
|
5
5
|
code: ClaimFailureCode;
|
|
6
6
|
message: string;
|
|
@@ -25,6 +25,8 @@ export interface RewardSummary {
|
|
|
25
25
|
claimableRaw: string;
|
|
26
26
|
claimableUi: string;
|
|
27
27
|
status: 'eligible' | 'not_eligible' | 'pending' | 'claimed' | 'failed';
|
|
28
|
+
errorCode?: string | null;
|
|
29
|
+
errorMessage?: string | null;
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
export interface ClaimIntent {
|
|
@@ -348,6 +350,164 @@ export interface BuildSubmitClaimTxParams {
|
|
|
348
350
|
recentBlockhash: string;
|
|
349
351
|
programId: string;
|
|
350
352
|
}
|
|
353
|
+
export interface ProtocolCycleQuoteFields {
|
|
354
|
+
poolAddress: string;
|
|
355
|
+
member: string;
|
|
356
|
+
productIdHashHex: string;
|
|
357
|
+
paymentMint: string;
|
|
358
|
+
premiumAmountRaw: bigint;
|
|
359
|
+
canonicalPremiumAmount: bigint;
|
|
360
|
+
periodIndex: bigint;
|
|
361
|
+
commitmentEnabled: boolean;
|
|
362
|
+
bondAmountRaw: bigint;
|
|
363
|
+
shieldFeeRaw: bigint;
|
|
364
|
+
protocolFeeRaw: bigint;
|
|
365
|
+
oracleFeeRaw: bigint;
|
|
366
|
+
netPoolPremiumRaw: bigint;
|
|
367
|
+
totalAmountRaw: bigint;
|
|
368
|
+
includedShieldCount: number;
|
|
369
|
+
thresholdBps: number;
|
|
370
|
+
expiresAtTs: bigint;
|
|
371
|
+
nonceHashHex: string;
|
|
372
|
+
quoteMetaHashHex: string;
|
|
373
|
+
}
|
|
374
|
+
export interface BuildActivateCycleWithQuoteSolTxParams {
|
|
375
|
+
payer: string;
|
|
376
|
+
member: string;
|
|
377
|
+
poolAddress: string;
|
|
378
|
+
oracle: string;
|
|
379
|
+
productIdHashHex: string;
|
|
380
|
+
premiumAmountRaw: bigint;
|
|
381
|
+
canonicalPremiumAmount: bigint;
|
|
382
|
+
periodIndex: bigint;
|
|
383
|
+
commitmentEnabled: boolean;
|
|
384
|
+
bondAmountRaw: bigint;
|
|
385
|
+
shieldFeeRaw: bigint;
|
|
386
|
+
protocolFeeRaw: bigint;
|
|
387
|
+
oracleFeeRaw: bigint;
|
|
388
|
+
netPoolPremiumRaw: bigint;
|
|
389
|
+
totalAmountRaw: bigint;
|
|
390
|
+
includedShieldCount: number;
|
|
391
|
+
thresholdBps: number;
|
|
392
|
+
expiresAtTs: bigint;
|
|
393
|
+
nonceHashHex: string;
|
|
394
|
+
quoteMetaHashHex: string;
|
|
395
|
+
quoteMessage: Uint8Array;
|
|
396
|
+
oracleSecretKey: Uint8Array;
|
|
397
|
+
recentBlockhash: string;
|
|
398
|
+
programId: string;
|
|
399
|
+
}
|
|
400
|
+
export interface BuildActivateCycleWithQuoteSplTxParams {
|
|
401
|
+
payer: string;
|
|
402
|
+
member: string;
|
|
403
|
+
poolAddress: string;
|
|
404
|
+
oracle: string;
|
|
405
|
+
productIdHashHex: string;
|
|
406
|
+
paymentMint: string;
|
|
407
|
+
premiumAmountRaw: bigint;
|
|
408
|
+
canonicalPremiumAmount: bigint;
|
|
409
|
+
periodIndex: bigint;
|
|
410
|
+
commitmentEnabled: boolean;
|
|
411
|
+
bondAmountRaw: bigint;
|
|
412
|
+
shieldFeeRaw: bigint;
|
|
413
|
+
protocolFeeRaw: bigint;
|
|
414
|
+
oracleFeeRaw: bigint;
|
|
415
|
+
netPoolPremiumRaw: bigint;
|
|
416
|
+
totalAmountRaw: bigint;
|
|
417
|
+
includedShieldCount: number;
|
|
418
|
+
thresholdBps: number;
|
|
419
|
+
expiresAtTs: bigint;
|
|
420
|
+
nonceHashHex: string;
|
|
421
|
+
quoteMetaHashHex: string;
|
|
422
|
+
quoteMessage: Uint8Array;
|
|
423
|
+
oracleSecretKey: Uint8Array;
|
|
424
|
+
recentBlockhash: string;
|
|
425
|
+
programId: string;
|
|
426
|
+
}
|
|
427
|
+
export interface BuildSettleCycleCommitmentTxParams {
|
|
428
|
+
payer: string;
|
|
429
|
+
oracle: string;
|
|
430
|
+
member: string;
|
|
431
|
+
poolAddress: string;
|
|
432
|
+
productIdHashHex: string;
|
|
433
|
+
paymentMint: string;
|
|
434
|
+
periodIndex: bigint;
|
|
435
|
+
passed: boolean;
|
|
436
|
+
shieldConsumed: boolean;
|
|
437
|
+
recentBlockhash: string;
|
|
438
|
+
programId: string;
|
|
439
|
+
}
|
|
440
|
+
export interface BuildSettleCycleCommitmentSolTxParams {
|
|
441
|
+
payer: string;
|
|
442
|
+
oracle: string;
|
|
443
|
+
member: string;
|
|
444
|
+
poolAddress: string;
|
|
445
|
+
productIdHashHex: string;
|
|
446
|
+
periodIndex: bigint;
|
|
447
|
+
passed: boolean;
|
|
448
|
+
shieldConsumed: boolean;
|
|
449
|
+
recentBlockhash: string;
|
|
450
|
+
programId: string;
|
|
451
|
+
}
|
|
452
|
+
export interface BuildWithdrawPoolTreasurySplTxParams {
|
|
453
|
+
payer: string;
|
|
454
|
+
oracle: string;
|
|
455
|
+
poolAddress: string;
|
|
456
|
+
paymentMint: string;
|
|
457
|
+
amount: bigint;
|
|
458
|
+
recipientTokenAccount: string;
|
|
459
|
+
recentBlockhash: string;
|
|
460
|
+
programId: string;
|
|
461
|
+
}
|
|
462
|
+
export interface BuildWithdrawPoolTreasurySolTxParams {
|
|
463
|
+
payer: string;
|
|
464
|
+
oracle: string;
|
|
465
|
+
poolAddress: string;
|
|
466
|
+
amount: bigint;
|
|
467
|
+
recipientSystemAccount: string;
|
|
468
|
+
recentBlockhash: string;
|
|
469
|
+
programId: string;
|
|
470
|
+
}
|
|
471
|
+
export interface BuildSetPoolCoverageReserveFloorTxParams {
|
|
472
|
+
authority: string;
|
|
473
|
+
poolAddress: string;
|
|
474
|
+
paymentMint: string;
|
|
475
|
+
amount: bigint;
|
|
476
|
+
recentBlockhash: string;
|
|
477
|
+
programId: string;
|
|
478
|
+
}
|
|
479
|
+
export interface BuildWithdrawProtocolFeeSplTxParams {
|
|
480
|
+
governanceAuthority: string;
|
|
481
|
+
paymentMint: string;
|
|
482
|
+
amount: bigint;
|
|
483
|
+
recipientTokenAccount: string;
|
|
484
|
+
recentBlockhash: string;
|
|
485
|
+
programId: string;
|
|
486
|
+
}
|
|
487
|
+
export interface BuildWithdrawProtocolFeeSolTxParams {
|
|
488
|
+
governanceAuthority: string;
|
|
489
|
+
amount: bigint;
|
|
490
|
+
recipientSystemAccount: string;
|
|
491
|
+
recentBlockhash: string;
|
|
492
|
+
programId: string;
|
|
493
|
+
}
|
|
494
|
+
export interface BuildWithdrawPoolOracleFeeSplTxParams {
|
|
495
|
+
oracle: string;
|
|
496
|
+
poolAddress: string;
|
|
497
|
+
paymentMint: string;
|
|
498
|
+
amount: bigint;
|
|
499
|
+
recipientTokenAccount: string;
|
|
500
|
+
recentBlockhash: string;
|
|
501
|
+
programId: string;
|
|
502
|
+
}
|
|
503
|
+
export interface BuildWithdrawPoolOracleFeeSolTxParams {
|
|
504
|
+
oracle: string;
|
|
505
|
+
poolAddress: string;
|
|
506
|
+
amount: bigint;
|
|
507
|
+
recipientSystemAccount: string;
|
|
508
|
+
recentBlockhash: string;
|
|
509
|
+
programId: string;
|
|
510
|
+
}
|
|
351
511
|
export interface ProtocolClient {
|
|
352
512
|
connection: Connection;
|
|
353
513
|
programId: PublicKey;
|
|
@@ -363,6 +523,17 @@ export interface ProtocolClient {
|
|
|
363
523
|
buildRevokeMemberTx?: (params: BuildRevokeMemberTxParams) => Transaction;
|
|
364
524
|
buildSubmitOutcomeAttestationTx?: (params: BuildSubmitOutcomeAttestationTxParams) => Transaction;
|
|
365
525
|
buildSubmitClaimTx?: (params: BuildSubmitClaimTxParams) => Transaction;
|
|
526
|
+
buildActivateCycleWithQuoteSolTx?: (params: BuildActivateCycleWithQuoteSolTxParams) => Transaction;
|
|
527
|
+
buildActivateCycleWithQuoteSplTx?: (params: BuildActivateCycleWithQuoteSplTxParams) => Transaction;
|
|
528
|
+
buildSettleCycleCommitmentTx?: (params: BuildSettleCycleCommitmentTxParams) => Transaction;
|
|
529
|
+
buildSettleCycleCommitmentSolTx?: (params: BuildSettleCycleCommitmentSolTxParams) => Transaction;
|
|
530
|
+
buildWithdrawPoolTreasurySplTx?: (params: BuildWithdrawPoolTreasurySplTxParams) => Transaction;
|
|
531
|
+
buildWithdrawPoolTreasurySolTx?: (params: BuildWithdrawPoolTreasurySolTxParams) => Transaction;
|
|
532
|
+
buildSetPoolCoverageReserveFloorTx?: (params: BuildSetPoolCoverageReserveFloorTxParams) => Transaction;
|
|
533
|
+
buildWithdrawProtocolFeeSplTx?: (params: BuildWithdrawProtocolFeeSplTxParams) => Transaction;
|
|
534
|
+
buildWithdrawProtocolFeeSolTx?: (params: BuildWithdrawProtocolFeeSolTxParams) => Transaction;
|
|
535
|
+
buildWithdrawPoolOracleFeeSplTx?: (params: BuildWithdrawPoolOracleFeeSplTxParams) => Transaction;
|
|
536
|
+
buildWithdrawPoolOracleFeeSolTx?: (params: BuildWithdrawPoolOracleFeeSolTxParams) => Transaction;
|
|
366
537
|
fetchProtocolConfig?: () => Promise<ProtocolConfigAccount | null>;
|
|
367
538
|
fetchPool?: (poolAddress: string) => Promise<ProtocolPoolAccount | null>;
|
|
368
539
|
fetchOracleRegistryEntry?: (oracle: string) => Promise<ProtocolOracleRegistryEntryAccount | null>;
|
|
@@ -439,6 +610,16 @@ export interface ProtocolClient {
|
|
|
439
610
|
poolAddress: string;
|
|
440
611
|
payoutMint: string;
|
|
441
612
|
}) => Promise<ProtocolPoolAssetVaultAccount | null>;
|
|
613
|
+
fetchProtocolFeeVault?: (paymentMint: string) => Promise<ProtocolFeeVaultAccount | null>;
|
|
614
|
+
fetchPoolOracleFeeVault?: (params: {
|
|
615
|
+
poolAddress: string;
|
|
616
|
+
oracle: string;
|
|
617
|
+
paymentMint: string;
|
|
618
|
+
}) => Promise<ProtocolPoolOracleFeeVaultAccount | null>;
|
|
619
|
+
fetchPoolOraclePermissionSet?: (params: {
|
|
620
|
+
poolAddress: string;
|
|
621
|
+
oracle: string;
|
|
622
|
+
}) => Promise<ProtocolPoolOraclePermissionSetAccount | null>;
|
|
442
623
|
fetchOutcomeSchema?: (schemaKeyHashHex: string) => Promise<ProtocolOutcomeSchemaRegistryEntryAccount | null>;
|
|
443
624
|
fetchPoolOutcomeRule?: (params: {
|
|
444
625
|
poolAddress: string;
|
|
@@ -485,6 +666,20 @@ export interface ProtocolClient {
|
|
|
485
666
|
poolAddress: string;
|
|
486
667
|
member: string;
|
|
487
668
|
}) => Promise<ProtocolCoveragePolicyPositionNftAccount | null>;
|
|
669
|
+
fetchMemberCycle?: (params: {
|
|
670
|
+
poolAddress: string;
|
|
671
|
+
member: string;
|
|
672
|
+
periodIndex: bigint | number;
|
|
673
|
+
}) => Promise<ProtocolMemberCycleAccount | null>;
|
|
674
|
+
fetchCycleQuoteReplay?: (params: {
|
|
675
|
+
poolAddress: string;
|
|
676
|
+
member: string;
|
|
677
|
+
nonceHashHex: string;
|
|
678
|
+
}) => Promise<ProtocolCycleQuoteReplayAccount | null>;
|
|
679
|
+
fetchPoolTreasuryReserve?: (params: {
|
|
680
|
+
poolAddress: string;
|
|
681
|
+
paymentMint: string;
|
|
682
|
+
}) => Promise<ProtocolPoolTreasuryReserveAccount | null>;
|
|
488
683
|
fetchPremiumLedger?: (params: {
|
|
489
684
|
poolAddress: string;
|
|
490
685
|
member: string;
|
|
@@ -532,6 +727,7 @@ export interface ProtocolPoolOraclePolicyAccount {
|
|
|
532
727
|
quorumM: number;
|
|
533
728
|
quorumN: number;
|
|
534
729
|
requireVerifiedSchema: boolean;
|
|
730
|
+
oracleFeeBps: number;
|
|
535
731
|
allowDelegateClaim: boolean;
|
|
536
732
|
bump: number;
|
|
537
733
|
}
|
|
@@ -555,6 +751,71 @@ export interface ProtocolPoolAssetVaultAccount {
|
|
|
555
751
|
active: boolean;
|
|
556
752
|
bump: number;
|
|
557
753
|
}
|
|
754
|
+
export interface ProtocolFeeVaultAccount {
|
|
755
|
+
address: string;
|
|
756
|
+
paymentMint: string;
|
|
757
|
+
bump: number;
|
|
758
|
+
}
|
|
759
|
+
export interface ProtocolPoolOracleFeeVaultAccount {
|
|
760
|
+
address: string;
|
|
761
|
+
pool: string;
|
|
762
|
+
oracle: string;
|
|
763
|
+
paymentMint: string;
|
|
764
|
+
bump: number;
|
|
765
|
+
}
|
|
766
|
+
export interface ProtocolPoolOraclePermissionSetAccount {
|
|
767
|
+
address: string;
|
|
768
|
+
pool: string;
|
|
769
|
+
oracle: string;
|
|
770
|
+
permissions: number;
|
|
771
|
+
bump: number;
|
|
772
|
+
}
|
|
773
|
+
export type ProtocolMemberCycleStatus = 'active' | 'settled' | 'unknown';
|
|
774
|
+
export interface ProtocolMemberCycleAccount {
|
|
775
|
+
address: string;
|
|
776
|
+
pool: string;
|
|
777
|
+
member: string;
|
|
778
|
+
productIdHashHex: string;
|
|
779
|
+
periodIndex: bigint;
|
|
780
|
+
paymentMint: string;
|
|
781
|
+
premiumAmountRaw: bigint;
|
|
782
|
+
bondAmountRaw: bigint;
|
|
783
|
+
shieldFeeRaw: bigint;
|
|
784
|
+
protocolFeeRaw: bigint;
|
|
785
|
+
oracleFeeRaw: bigint;
|
|
786
|
+
netPoolPremiumRaw: bigint;
|
|
787
|
+
totalAmountRaw: bigint;
|
|
788
|
+
canonicalPremiumAmount: bigint;
|
|
789
|
+
commitmentEnabled: boolean;
|
|
790
|
+
thresholdBps: number;
|
|
791
|
+
includedShieldCount: number;
|
|
792
|
+
shieldConsumed: boolean;
|
|
793
|
+
statusCode: number;
|
|
794
|
+
status: ProtocolMemberCycleStatus;
|
|
795
|
+
passed: boolean;
|
|
796
|
+
activatedAt: number;
|
|
797
|
+
settledAt: number;
|
|
798
|
+
quoteHashHex: string;
|
|
799
|
+
bump: number;
|
|
800
|
+
}
|
|
801
|
+
export interface ProtocolCycleQuoteReplayAccount {
|
|
802
|
+
address: string;
|
|
803
|
+
pool: string;
|
|
804
|
+
member: string;
|
|
805
|
+
nonceHashHex: string;
|
|
806
|
+
quoteHashHex: string;
|
|
807
|
+
createdAt: number;
|
|
808
|
+
bump: number;
|
|
809
|
+
}
|
|
810
|
+
export interface ProtocolPoolTreasuryReserveAccount {
|
|
811
|
+
address: string;
|
|
812
|
+
pool: string;
|
|
813
|
+
paymentMint: string;
|
|
814
|
+
reservedRefundAmount: bigint;
|
|
815
|
+
reservedRewardAmount: bigint;
|
|
816
|
+
manualCoverageReserveAmount: bigint;
|
|
817
|
+
bump: number;
|
|
818
|
+
}
|
|
558
819
|
export interface ProtocolOutcomeSchemaRegistryEntryAccount {
|
|
559
820
|
address: string;
|
|
560
821
|
schemaKeyHashHex: string;
|
|
@@ -599,6 +860,7 @@ export interface ProtocolCycleOutcomeAggregateAccount {
|
|
|
599
860
|
finalized: boolean;
|
|
600
861
|
passed: boolean;
|
|
601
862
|
claimed: boolean;
|
|
863
|
+
rewardLiabilityReserved: boolean;
|
|
602
864
|
latestAsOfTs: number;
|
|
603
865
|
bump: number;
|
|
604
866
|
}
|
|
@@ -844,6 +1106,7 @@ export interface BuildSetPoolOraclePolicyTxParams {
|
|
|
844
1106
|
quorumM: number;
|
|
845
1107
|
quorumN: number;
|
|
846
1108
|
requireVerifiedSchema: boolean;
|
|
1109
|
+
oracleFeeBps: number;
|
|
847
1110
|
allowDelegateClaim: boolean;
|
|
848
1111
|
recentBlockhash: string;
|
|
849
1112
|
programId: string;
|
|
@@ -954,6 +1217,7 @@ export interface BuildSubmitOutcomeAttestationVoteTxParams {
|
|
|
954
1217
|
cycleId: string;
|
|
955
1218
|
ruleHashHex: string;
|
|
956
1219
|
schemaKeyHashHex: string;
|
|
1220
|
+
payoutMint: string;
|
|
957
1221
|
attestationDigestHex: string;
|
|
958
1222
|
observedValueHashHex: string;
|
|
959
1223
|
asOfTs: number;
|
|
@@ -966,6 +1230,7 @@ export interface BuildFinalizeCycleOutcomeTxParams {
|
|
|
966
1230
|
member: string;
|
|
967
1231
|
cycleId: string;
|
|
968
1232
|
ruleHashHex: string;
|
|
1233
|
+
payoutMint: string;
|
|
969
1234
|
recentBlockhash: string;
|
|
970
1235
|
payer: string;
|
|
971
1236
|
programId: string;
|
|
@@ -978,6 +1243,7 @@ export interface BuildSubmitRewardClaimTxParams {
|
|
|
978
1243
|
ruleHashHex: string;
|
|
979
1244
|
intentHashHex: string;
|
|
980
1245
|
payoutAmount: bigint;
|
|
1246
|
+
payoutMint: string;
|
|
981
1247
|
recipient: string;
|
|
982
1248
|
recipientSystemAccount: string;
|
|
983
1249
|
claimDelegate?: string;
|