@omegax/protocol-sdk 0.4.4 → 0.5.0
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/NOTICE +5 -0
- package/README.md +74 -16
- package/dist/claims.d.ts +1 -2
- package/dist/claims.js +71 -131
- package/dist/protocol.js +3133 -1245
- package/dist/protocol_seeds.d.ts +78 -33
- package/dist/protocol_seeds.js +171 -52
- package/dist/rpc.js +65 -5
- package/dist/transactions.d.ts +1 -0
- package/dist/transactions.js +17 -0
- package/dist/types.d.ts +837 -315
- package/package.json +10 -3
package/dist/protocol_seeds.d.ts
CHANGED
|
@@ -6,32 +6,38 @@ export declare const SEED_ORACLE_PROFILE = "oracle_profile";
|
|
|
6
6
|
export declare const SEED_POOL_ORACLE = "pool_oracle";
|
|
7
7
|
export declare const SEED_MEMBERSHIP = "membership";
|
|
8
8
|
export declare const SEED_CYCLE = "cycle";
|
|
9
|
-
export declare const SEED_CYCLE_WINDOW = "cycle_window";
|
|
10
|
-
export declare const SEED_REPLAY = "replay";
|
|
11
9
|
export declare const SEED_CLAIM = "claim";
|
|
12
|
-
export declare const SEED_CONFIG_V2 = "config_v2";
|
|
13
10
|
export declare const SEED_ORACLE_STAKE = "oracle_stake";
|
|
14
11
|
export declare const SEED_POOL_ORACLE_POLICY = "pool_oracle_policy";
|
|
15
12
|
export declare const SEED_POOL_TERMS = "pool_terms";
|
|
16
13
|
export declare const SEED_POOL_ASSET_VAULT = "pool_asset_vault";
|
|
14
|
+
export declare const SEED_POOL_RISK_CONFIG = "pool_risk_config";
|
|
15
|
+
export declare const SEED_POOL_CAPITAL_CLASS = "pool_capital_class";
|
|
16
|
+
export declare const SEED_POLICY_SERIES = "policy_series";
|
|
17
|
+
export declare const SEED_POLICY_SERIES_PAYMENT_OPTION = "policy_series_payment_option";
|
|
18
|
+
export declare const SEED_POLICY_POSITION = "policy_position";
|
|
19
|
+
export declare const SEED_POLICY_POSITION_NFT = "policy_position_nft";
|
|
20
|
+
export declare const SEED_POOL_COMPLIANCE_POLICY = "pool_compliance_policy";
|
|
21
|
+
export declare const SEED_POOL_CONTROL_AUTHORITY = "pool_control_authority";
|
|
22
|
+
export declare const SEED_POOL_AUTOMATION_POLICY = "pool_automation_policy";
|
|
23
|
+
export declare const SEED_POOL_LIQUIDITY_CONFIG = "pool_liquidity_config";
|
|
17
24
|
export declare const SEED_POOL_ORACLE_PERMISSIONS = "pool_oracle_permissions";
|
|
18
25
|
export declare const SEED_MEMBER_CYCLE = "member_cycle";
|
|
19
26
|
export declare const SEED_CYCLE_QUOTE_REPLAY = "cycle_quote_replay";
|
|
20
27
|
export declare const SEED_POOL_TREASURY_RESERVE = "pool_treasury_reserve";
|
|
28
|
+
export declare const SEED_POOL_SHARE_MINT = "pool_share_mint";
|
|
29
|
+
export declare const SEED_REDEMPTION_REQUEST = "redemption_request";
|
|
30
|
+
export declare const SEED_COHORT_SETTLEMENT_ROOT = "cohort_settlement_root";
|
|
21
31
|
export declare const SEED_PROTOCOL_FEE_VAULT = "protocol_fee_vault";
|
|
22
32
|
export declare const SEED_POOL_ORACLE_FEE_VAULT = "pool_oracle_fee_vault";
|
|
23
33
|
export declare const SEED_SCHEMA = "schema";
|
|
34
|
+
export declare const SEED_SCHEMA_DEPENDENCY = "schema_dependency";
|
|
24
35
|
export declare const SEED_POOL_RULE = "pool_rule";
|
|
25
36
|
export declare const SEED_INVITE_ISSUER = "invite_issuer";
|
|
26
37
|
export declare const SEED_ENROLLMENT_REPLAY = "enrollment_replay";
|
|
27
38
|
export declare const SEED_ATTESTATION_VOTE = "attestation_vote";
|
|
28
39
|
export declare const SEED_OUTCOME_AGGREGATE = "outcome_agg";
|
|
29
40
|
export declare const SEED_CLAIM_DELEGATE = "claim_delegate";
|
|
30
|
-
export declare const SEED_CLAIM_V2 = "claim_v2";
|
|
31
|
-
export declare const SEED_COVERAGE_POLICY = "coverage_policy";
|
|
32
|
-
export declare const SEED_COVERAGE_NFT = "coverage_nft";
|
|
33
|
-
export declare const SEED_COVERAGE_PRODUCT = "coverage_product";
|
|
34
|
-
export declare const SEED_COVERAGE_PRODUCT_PAYMENT_OPTION = "coverage_product_payment_option";
|
|
35
41
|
export declare const SEED_PREMIUM_LEDGER = "premium_ledger";
|
|
36
42
|
export declare const SEED_PREMIUM_REPLAY = "premium_replay";
|
|
37
43
|
export declare const SEED_COVERAGE_CLAIM = "coverage_claim";
|
|
@@ -67,23 +73,14 @@ export declare function deriveCycleOutcomePda(params: {
|
|
|
67
73
|
member: string | PublicKey;
|
|
68
74
|
cycleHash: Uint8Array;
|
|
69
75
|
}): [PublicKey, number];
|
|
70
|
-
export declare function deriveCycleWindowPda(params: {
|
|
71
|
-
programId: string | PublicKey;
|
|
72
|
-
poolAddress: string | PublicKey;
|
|
73
|
-
cycleHash: Uint8Array;
|
|
74
|
-
}): [PublicKey, number];
|
|
75
|
-
export declare function deriveReplayPda(params: {
|
|
76
|
-
programId: string | PublicKey;
|
|
77
|
-
poolAddress: string | PublicKey;
|
|
78
|
-
replayHash: Uint8Array;
|
|
79
|
-
}): [PublicKey, number];
|
|
80
76
|
export declare function deriveClaimPda(params: {
|
|
81
77
|
programId: string | PublicKey;
|
|
82
78
|
poolAddress: string | PublicKey;
|
|
79
|
+
seriesRefHash: Uint8Array;
|
|
83
80
|
member: string | PublicKey;
|
|
84
81
|
cycleHash: Uint8Array;
|
|
82
|
+
ruleHash: Uint8Array;
|
|
85
83
|
}): [PublicKey, number];
|
|
86
|
-
export declare function deriveConfigV2Pda(programId: string | PublicKey): [PublicKey, number];
|
|
87
84
|
export declare function deriveOracleStakePda(params: {
|
|
88
85
|
programId: string | PublicKey;
|
|
89
86
|
oracle: string | PublicKey;
|
|
@@ -102,11 +99,30 @@ export declare function derivePoolAssetVaultPda(params: {
|
|
|
102
99
|
poolAddress: string | PublicKey;
|
|
103
100
|
payoutMint: string | PublicKey;
|
|
104
101
|
}): [PublicKey, number];
|
|
105
|
-
export declare function
|
|
102
|
+
export declare function derivePoolRiskConfigPda(params: {
|
|
103
|
+
programId: string | PublicKey;
|
|
104
|
+
poolAddress: string | PublicKey;
|
|
105
|
+
}): [PublicKey, number];
|
|
106
|
+
export declare function derivePoolLiquidityConfigPda(params: {
|
|
107
|
+
programId: string | PublicKey;
|
|
108
|
+
poolAddress: string | PublicKey;
|
|
109
|
+
}): [PublicKey, number];
|
|
110
|
+
export declare function derivePoolCapitalClassPda(params: {
|
|
111
|
+
programId: string | PublicKey;
|
|
112
|
+
poolAddress: string | PublicKey;
|
|
113
|
+
shareMint: string | PublicKey;
|
|
114
|
+
}): [PublicKey, number];
|
|
115
|
+
export declare function derivePoolCompliancePolicyPda(params: {
|
|
116
|
+
programId: string | PublicKey;
|
|
117
|
+
poolAddress: string | PublicKey;
|
|
118
|
+
}): [PublicKey, number];
|
|
119
|
+
export declare function derivePoolControlAuthorityPda(params: {
|
|
120
|
+
programId: string | PublicKey;
|
|
121
|
+
poolAddress: string | PublicKey;
|
|
122
|
+
}): [PublicKey, number];
|
|
123
|
+
export declare function derivePoolAutomationPolicyPda(params: {
|
|
106
124
|
programId: string | PublicKey;
|
|
107
125
|
poolAddress: string | PublicKey;
|
|
108
|
-
productIdHash: Uint8Array;
|
|
109
|
-
paymentMint: string | PublicKey;
|
|
110
126
|
}): [PublicKey, number];
|
|
111
127
|
export declare function derivePoolOraclePermissionSetPda(params: {
|
|
112
128
|
programId: string | PublicKey;
|
|
@@ -116,12 +132,14 @@ export declare function derivePoolOraclePermissionSetPda(params: {
|
|
|
116
132
|
export declare function deriveMemberCyclePda(params: {
|
|
117
133
|
programId: string | PublicKey;
|
|
118
134
|
poolAddress: string | PublicKey;
|
|
135
|
+
seriesRefHash: Uint8Array;
|
|
119
136
|
member: string | PublicKey;
|
|
120
137
|
periodIndex: bigint | number;
|
|
121
138
|
}): [PublicKey, number];
|
|
122
139
|
export declare function deriveCycleQuoteReplayPda(params: {
|
|
123
140
|
programId: string | PublicKey;
|
|
124
141
|
poolAddress: string | PublicKey;
|
|
142
|
+
seriesRefHash: Uint8Array;
|
|
125
143
|
member: string | PublicKey;
|
|
126
144
|
nonceHash: Uint8Array;
|
|
127
145
|
}): [PublicKey, number];
|
|
@@ -130,6 +148,22 @@ export declare function derivePoolTreasuryReservePda(params: {
|
|
|
130
148
|
poolAddress: string | PublicKey;
|
|
131
149
|
paymentMint: string | PublicKey;
|
|
132
150
|
}): [PublicKey, number];
|
|
151
|
+
export declare function derivePoolShareMintPda(params: {
|
|
152
|
+
programId: string | PublicKey;
|
|
153
|
+
poolAddress: string | PublicKey;
|
|
154
|
+
}): [PublicKey, number];
|
|
155
|
+
export declare function deriveRedemptionRequestPda(params: {
|
|
156
|
+
programId: string | PublicKey;
|
|
157
|
+
poolAddress: string | PublicKey;
|
|
158
|
+
redeemer: string | PublicKey;
|
|
159
|
+
requestHash: Uint8Array;
|
|
160
|
+
}): [PublicKey, number];
|
|
161
|
+
export declare function deriveCohortSettlementRootPda(params: {
|
|
162
|
+
programId: string | PublicKey;
|
|
163
|
+
poolAddress: string | PublicKey;
|
|
164
|
+
seriesRefHash: Uint8Array;
|
|
165
|
+
cohortHash: Uint8Array;
|
|
166
|
+
}): [PublicKey, number];
|
|
133
167
|
export declare function deriveProtocolFeeVaultPda(params: {
|
|
134
168
|
programId: string | PublicKey;
|
|
135
169
|
paymentMint: string | PublicKey;
|
|
@@ -144,9 +178,14 @@ export declare function deriveSchemaPda(params: {
|
|
|
144
178
|
programId: string | PublicKey;
|
|
145
179
|
schemaKeyHash: Uint8Array;
|
|
146
180
|
}): [PublicKey, number];
|
|
181
|
+
export declare function deriveSchemaDependencyPda(params: {
|
|
182
|
+
programId: string | PublicKey;
|
|
183
|
+
schemaKeyHash: Uint8Array;
|
|
184
|
+
}): [PublicKey, number];
|
|
147
185
|
export declare function derivePoolRulePda(params: {
|
|
148
186
|
programId: string | PublicKey;
|
|
149
187
|
poolAddress: string | PublicKey;
|
|
188
|
+
seriesRefHash: Uint8Array;
|
|
150
189
|
ruleHash: Uint8Array;
|
|
151
190
|
}): [PublicKey, number];
|
|
152
191
|
export declare function deriveInviteIssuerPda(params: {
|
|
@@ -162,6 +201,7 @@ export declare function deriveEnrollmentReplayPda(params: {
|
|
|
162
201
|
export declare function deriveAttestationVotePda(params: {
|
|
163
202
|
programId: string | PublicKey;
|
|
164
203
|
poolAddress: string | PublicKey;
|
|
204
|
+
seriesRefHash: Uint8Array;
|
|
165
205
|
member: string | PublicKey;
|
|
166
206
|
cycleHash: Uint8Array;
|
|
167
207
|
ruleHash: Uint8Array;
|
|
@@ -172,49 +212,54 @@ export declare function deriveClaimDelegatePda(params: {
|
|
|
172
212
|
poolAddress: string | PublicKey;
|
|
173
213
|
member: string | PublicKey;
|
|
174
214
|
}): [PublicKey, number];
|
|
175
|
-
export declare function deriveClaimV2Pda(params: {
|
|
176
|
-
programId: string | PublicKey;
|
|
177
|
-
poolAddress: string | PublicKey;
|
|
178
|
-
member: string | PublicKey;
|
|
179
|
-
cycleHash: Uint8Array;
|
|
180
|
-
ruleHash: Uint8Array;
|
|
181
|
-
}): [PublicKey, number];
|
|
182
215
|
export declare function deriveOutcomeAggregatePda(params: {
|
|
183
216
|
programId: string | PublicKey;
|
|
184
217
|
poolAddress: string | PublicKey;
|
|
218
|
+
seriesRefHash: Uint8Array;
|
|
185
219
|
member: string | PublicKey;
|
|
186
220
|
cycleHash: Uint8Array;
|
|
187
221
|
ruleHash: Uint8Array;
|
|
188
222
|
}): [PublicKey, number];
|
|
189
|
-
export declare function
|
|
223
|
+
export declare function derivePolicyPositionPda(params: {
|
|
190
224
|
programId: string | PublicKey;
|
|
191
225
|
poolAddress: string | PublicKey;
|
|
226
|
+
seriesRefHash: Uint8Array;
|
|
192
227
|
member: string | PublicKey;
|
|
193
228
|
}): [PublicKey, number];
|
|
194
|
-
export declare function
|
|
229
|
+
export declare function derivePolicySeriesPda(params: {
|
|
195
230
|
programId: string | PublicKey;
|
|
196
231
|
poolAddress: string | PublicKey;
|
|
197
|
-
|
|
232
|
+
seriesRefHash: Uint8Array;
|
|
198
233
|
}): [PublicKey, number];
|
|
199
|
-
export declare function
|
|
234
|
+
export declare function derivePolicyPositionNftPda(params: {
|
|
200
235
|
programId: string | PublicKey;
|
|
201
236
|
poolAddress: string | PublicKey;
|
|
237
|
+
seriesRefHash: Uint8Array;
|
|
202
238
|
member: string | PublicKey;
|
|
203
239
|
}): [PublicKey, number];
|
|
204
240
|
export declare function derivePremiumLedgerPda(params: {
|
|
205
241
|
programId: string | PublicKey;
|
|
206
242
|
poolAddress: string | PublicKey;
|
|
243
|
+
seriesRefHash: Uint8Array;
|
|
207
244
|
member: string | PublicKey;
|
|
208
245
|
}): [PublicKey, number];
|
|
209
246
|
export declare function derivePremiumReplayPda(params: {
|
|
210
247
|
programId: string | PublicKey;
|
|
211
248
|
poolAddress: string | PublicKey;
|
|
249
|
+
seriesRefHash: Uint8Array;
|
|
212
250
|
member: string | PublicKey;
|
|
213
251
|
replayHash: Uint8Array;
|
|
214
252
|
}): [PublicKey, number];
|
|
253
|
+
export declare function derivePolicySeriesPaymentOptionPda(params: {
|
|
254
|
+
programId: string | PublicKey;
|
|
255
|
+
poolAddress: string | PublicKey;
|
|
256
|
+
seriesRefHash: Uint8Array;
|
|
257
|
+
paymentMint: string | PublicKey;
|
|
258
|
+
}): [PublicKey, number];
|
|
215
259
|
export declare function deriveCoverageClaimPda(params: {
|
|
216
260
|
programId: string | PublicKey;
|
|
217
261
|
poolAddress: string | PublicKey;
|
|
262
|
+
seriesRefHash: Uint8Array;
|
|
218
263
|
member: string | PublicKey;
|
|
219
264
|
intentHash: Uint8Array;
|
|
220
265
|
}): [PublicKey, number];
|
package/dist/protocol_seeds.js
CHANGED
|
@@ -6,32 +6,38 @@ export const SEED_ORACLE_PROFILE = 'oracle_profile';
|
|
|
6
6
|
export const SEED_POOL_ORACLE = 'pool_oracle';
|
|
7
7
|
export const SEED_MEMBERSHIP = 'membership';
|
|
8
8
|
export const SEED_CYCLE = 'cycle';
|
|
9
|
-
export const SEED_CYCLE_WINDOW = 'cycle_window';
|
|
10
|
-
export const SEED_REPLAY = 'replay';
|
|
11
9
|
export const SEED_CLAIM = 'claim';
|
|
12
|
-
export const SEED_CONFIG_V2 = 'config_v2';
|
|
13
10
|
export const SEED_ORACLE_STAKE = 'oracle_stake';
|
|
14
11
|
export const SEED_POOL_ORACLE_POLICY = 'pool_oracle_policy';
|
|
15
12
|
export const SEED_POOL_TERMS = 'pool_terms';
|
|
16
13
|
export const SEED_POOL_ASSET_VAULT = 'pool_asset_vault';
|
|
14
|
+
export const SEED_POOL_RISK_CONFIG = 'pool_risk_config';
|
|
15
|
+
export const SEED_POOL_CAPITAL_CLASS = 'pool_capital_class';
|
|
16
|
+
export const SEED_POLICY_SERIES = 'policy_series';
|
|
17
|
+
export const SEED_POLICY_SERIES_PAYMENT_OPTION = 'policy_series_payment_option';
|
|
18
|
+
export const SEED_POLICY_POSITION = 'policy_position';
|
|
19
|
+
export const SEED_POLICY_POSITION_NFT = 'policy_position_nft';
|
|
20
|
+
export const SEED_POOL_COMPLIANCE_POLICY = 'pool_compliance_policy';
|
|
21
|
+
export const SEED_POOL_CONTROL_AUTHORITY = 'pool_control_authority';
|
|
22
|
+
export const SEED_POOL_AUTOMATION_POLICY = 'pool_automation_policy';
|
|
23
|
+
export const SEED_POOL_LIQUIDITY_CONFIG = 'pool_liquidity_config';
|
|
17
24
|
export const SEED_POOL_ORACLE_PERMISSIONS = 'pool_oracle_permissions';
|
|
18
25
|
export const SEED_MEMBER_CYCLE = 'member_cycle';
|
|
19
26
|
export const SEED_CYCLE_QUOTE_REPLAY = 'cycle_quote_replay';
|
|
20
27
|
export const SEED_POOL_TREASURY_RESERVE = 'pool_treasury_reserve';
|
|
28
|
+
export const SEED_POOL_SHARE_MINT = 'pool_share_mint';
|
|
29
|
+
export const SEED_REDEMPTION_REQUEST = 'redemption_request';
|
|
30
|
+
export const SEED_COHORT_SETTLEMENT_ROOT = 'cohort_settlement_root';
|
|
21
31
|
export const SEED_PROTOCOL_FEE_VAULT = 'protocol_fee_vault';
|
|
22
32
|
export const SEED_POOL_ORACLE_FEE_VAULT = 'pool_oracle_fee_vault';
|
|
23
33
|
export const SEED_SCHEMA = 'schema';
|
|
34
|
+
export const SEED_SCHEMA_DEPENDENCY = 'schema_dependency';
|
|
24
35
|
export const SEED_POOL_RULE = 'pool_rule';
|
|
25
36
|
export const SEED_INVITE_ISSUER = 'invite_issuer';
|
|
26
37
|
export const SEED_ENROLLMENT_REPLAY = 'enrollment_replay';
|
|
27
38
|
export const SEED_ATTESTATION_VOTE = 'attestation_vote';
|
|
28
39
|
export const SEED_OUTCOME_AGGREGATE = 'outcome_agg';
|
|
29
40
|
export const SEED_CLAIM_DELEGATE = 'claim_delegate';
|
|
30
|
-
export const SEED_CLAIM_V2 = 'claim_v2';
|
|
31
|
-
export const SEED_COVERAGE_POLICY = 'coverage_policy';
|
|
32
|
-
export const SEED_COVERAGE_NFT = 'coverage_nft';
|
|
33
|
-
export const SEED_COVERAGE_PRODUCT = 'coverage_product';
|
|
34
|
-
export const SEED_COVERAGE_PRODUCT_PAYMENT_OPTION = 'coverage_product_payment_option';
|
|
35
41
|
export const SEED_PREMIUM_LEDGER = 'premium_ledger';
|
|
36
42
|
export const SEED_PREMIUM_REPLAY = 'premium_replay';
|
|
37
43
|
export const SEED_COVERAGE_CLAIM = 'coverage_claim';
|
|
@@ -86,35 +92,25 @@ export function deriveCycleOutcomePda(params) {
|
|
|
86
92
|
Buffer.from(params.cycleHash),
|
|
87
93
|
], program);
|
|
88
94
|
}
|
|
89
|
-
export function deriveCycleWindowPda(params) {
|
|
90
|
-
const program = asPubkey(params.programId);
|
|
91
|
-
const pool = asPubkey(params.poolAddress);
|
|
92
|
-
return PublicKey.findProgramAddressSync([
|
|
93
|
-
Buffer.from(SEED_CYCLE_WINDOW),
|
|
94
|
-
pool.toBuffer(),
|
|
95
|
-
Buffer.from(params.cycleHash),
|
|
96
|
-
], program);
|
|
97
|
-
}
|
|
98
|
-
export function deriveReplayPda(params) {
|
|
99
|
-
const program = asPubkey(params.programId);
|
|
100
|
-
const pool = asPubkey(params.poolAddress);
|
|
101
|
-
return PublicKey.findProgramAddressSync([Buffer.from(SEED_REPLAY), pool.toBuffer(), Buffer.from(params.replayHash)], program);
|
|
102
|
-
}
|
|
103
95
|
export function deriveClaimPda(params) {
|
|
96
|
+
if (params.seriesRefHash.length !== 32) {
|
|
97
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
98
|
+
}
|
|
99
|
+
if (params.ruleHash.length !== 32) {
|
|
100
|
+
throw new Error('ruleHash must be exactly 32 bytes');
|
|
101
|
+
}
|
|
104
102
|
const program = asPubkey(params.programId);
|
|
105
103
|
const pool = asPubkey(params.poolAddress);
|
|
106
104
|
const member = asPubkey(params.member);
|
|
107
105
|
return PublicKey.findProgramAddressSync([
|
|
108
106
|
Buffer.from(SEED_CLAIM),
|
|
109
107
|
pool.toBuffer(),
|
|
108
|
+
Buffer.from(params.seriesRefHash),
|
|
110
109
|
member.toBuffer(),
|
|
111
110
|
Buffer.from(params.cycleHash),
|
|
111
|
+
Buffer.from(params.ruleHash),
|
|
112
112
|
], program);
|
|
113
113
|
}
|
|
114
|
-
export function deriveConfigV2Pda(programId) {
|
|
115
|
-
const program = asPubkey(programId);
|
|
116
|
-
return PublicKey.findProgramAddressSync([Buffer.from(SEED_CONFIG_V2)], program);
|
|
117
|
-
}
|
|
118
114
|
export function deriveOracleStakePda(params) {
|
|
119
115
|
const program = asPubkey(params.programId);
|
|
120
116
|
const oracle = asPubkey(params.oracle);
|
|
@@ -137,16 +133,36 @@ export function derivePoolAssetVaultPda(params) {
|
|
|
137
133
|
const mint = asPubkey(params.payoutMint);
|
|
138
134
|
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_ASSET_VAULT), pool.toBuffer(), mint.toBuffer()], program);
|
|
139
135
|
}
|
|
140
|
-
export function
|
|
136
|
+
export function derivePoolRiskConfigPda(params) {
|
|
141
137
|
const program = asPubkey(params.programId);
|
|
142
138
|
const pool = asPubkey(params.poolAddress);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
139
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_RISK_CONFIG), pool.toBuffer()], program);
|
|
140
|
+
}
|
|
141
|
+
export function derivePoolLiquidityConfigPda(params) {
|
|
142
|
+
const program = asPubkey(params.programId);
|
|
143
|
+
const pool = asPubkey(params.poolAddress);
|
|
144
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_LIQUIDITY_CONFIG), pool.toBuffer()], program);
|
|
145
|
+
}
|
|
146
|
+
export function derivePoolCapitalClassPda(params) {
|
|
147
|
+
const program = asPubkey(params.programId);
|
|
148
|
+
const pool = asPubkey(params.poolAddress);
|
|
149
|
+
const shareMint = asPubkey(params.shareMint);
|
|
150
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_CAPITAL_CLASS), pool.toBuffer(), shareMint.toBuffer()], program);
|
|
151
|
+
}
|
|
152
|
+
export function derivePoolCompliancePolicyPda(params) {
|
|
153
|
+
const program = asPubkey(params.programId);
|
|
154
|
+
const pool = asPubkey(params.poolAddress);
|
|
155
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_COMPLIANCE_POLICY), pool.toBuffer()], program);
|
|
156
|
+
}
|
|
157
|
+
export function derivePoolControlAuthorityPda(params) {
|
|
158
|
+
const program = asPubkey(params.programId);
|
|
159
|
+
const pool = asPubkey(params.poolAddress);
|
|
160
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_CONTROL_AUTHORITY), pool.toBuffer()], program);
|
|
161
|
+
}
|
|
162
|
+
export function derivePoolAutomationPolicyPda(params) {
|
|
163
|
+
const program = asPubkey(params.programId);
|
|
164
|
+
const pool = asPubkey(params.poolAddress);
|
|
165
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_AUTOMATION_POLICY), pool.toBuffer()], program);
|
|
150
166
|
}
|
|
151
167
|
function encodeU64Seed(value) {
|
|
152
168
|
const out = Buffer.alloc(8);
|
|
@@ -160,23 +176,31 @@ export function derivePoolOraclePermissionSetPda(params) {
|
|
|
160
176
|
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_ORACLE_PERMISSIONS), pool.toBuffer(), oracle.toBuffer()], program);
|
|
161
177
|
}
|
|
162
178
|
export function deriveMemberCyclePda(params) {
|
|
179
|
+
if (params.seriesRefHash.length !== 32) {
|
|
180
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
181
|
+
}
|
|
163
182
|
const program = asPubkey(params.programId);
|
|
164
183
|
const pool = asPubkey(params.poolAddress);
|
|
165
184
|
const member = asPubkey(params.member);
|
|
166
185
|
return PublicKey.findProgramAddressSync([
|
|
167
186
|
Buffer.from(SEED_MEMBER_CYCLE),
|
|
168
187
|
pool.toBuffer(),
|
|
188
|
+
Buffer.from(params.seriesRefHash),
|
|
169
189
|
member.toBuffer(),
|
|
170
190
|
encodeU64Seed(params.periodIndex),
|
|
171
191
|
], program);
|
|
172
192
|
}
|
|
173
193
|
export function deriveCycleQuoteReplayPda(params) {
|
|
194
|
+
if (params.seriesRefHash.length !== 32) {
|
|
195
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
196
|
+
}
|
|
174
197
|
const program = asPubkey(params.programId);
|
|
175
198
|
const pool = asPubkey(params.poolAddress);
|
|
176
199
|
const member = asPubkey(params.member);
|
|
177
200
|
return PublicKey.findProgramAddressSync([
|
|
178
201
|
Buffer.from(SEED_CYCLE_QUOTE_REPLAY),
|
|
179
202
|
pool.toBuffer(),
|
|
203
|
+
Buffer.from(params.seriesRefHash),
|
|
180
204
|
member.toBuffer(),
|
|
181
205
|
Buffer.from(params.nonceHash),
|
|
182
206
|
], program);
|
|
@@ -191,6 +215,38 @@ export function derivePoolTreasuryReservePda(params) {
|
|
|
191
215
|
paymentMint.toBuffer(),
|
|
192
216
|
], program);
|
|
193
217
|
}
|
|
218
|
+
export function derivePoolShareMintPda(params) {
|
|
219
|
+
const program = asPubkey(params.programId);
|
|
220
|
+
const pool = asPubkey(params.poolAddress);
|
|
221
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POOL_SHARE_MINT), pool.toBuffer()], program);
|
|
222
|
+
}
|
|
223
|
+
export function deriveRedemptionRequestPda(params) {
|
|
224
|
+
if (params.requestHash.length !== 32) {
|
|
225
|
+
throw new Error('requestHash must be exactly 32 bytes');
|
|
226
|
+
}
|
|
227
|
+
const program = asPubkey(params.programId);
|
|
228
|
+
const pool = asPubkey(params.poolAddress);
|
|
229
|
+
const redeemer = asPubkey(params.redeemer);
|
|
230
|
+
return PublicKey.findProgramAddressSync([
|
|
231
|
+
Buffer.from(SEED_REDEMPTION_REQUEST),
|
|
232
|
+
pool.toBuffer(),
|
|
233
|
+
redeemer.toBuffer(),
|
|
234
|
+
Buffer.from(params.requestHash),
|
|
235
|
+
], program);
|
|
236
|
+
}
|
|
237
|
+
export function deriveCohortSettlementRootPda(params) {
|
|
238
|
+
if (params.seriesRefHash.length !== 32) {
|
|
239
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
240
|
+
}
|
|
241
|
+
const program = asPubkey(params.programId);
|
|
242
|
+
const pool = asPubkey(params.poolAddress);
|
|
243
|
+
return PublicKey.findProgramAddressSync([
|
|
244
|
+
Buffer.from(SEED_COHORT_SETTLEMENT_ROOT),
|
|
245
|
+
pool.toBuffer(),
|
|
246
|
+
Buffer.from(params.seriesRefHash),
|
|
247
|
+
Buffer.from(params.cohortHash),
|
|
248
|
+
], program);
|
|
249
|
+
}
|
|
194
250
|
export function deriveProtocolFeeVaultPda(params) {
|
|
195
251
|
const program = asPubkey(params.programId);
|
|
196
252
|
const paymentMint = asPubkey(params.paymentMint);
|
|
@@ -212,10 +268,28 @@ export function deriveSchemaPda(params) {
|
|
|
212
268
|
const program = asPubkey(params.programId);
|
|
213
269
|
return PublicKey.findProgramAddressSync([Buffer.from(SEED_SCHEMA), Buffer.from(params.schemaKeyHash)], program);
|
|
214
270
|
}
|
|
271
|
+
export function deriveSchemaDependencyPda(params) {
|
|
272
|
+
if (params.schemaKeyHash.length !== 32) {
|
|
273
|
+
throw new Error('schemaKeyHash must be 32 bytes');
|
|
274
|
+
}
|
|
275
|
+
const program = asPubkey(params.programId);
|
|
276
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_SCHEMA_DEPENDENCY), Buffer.from(params.schemaKeyHash)], program);
|
|
277
|
+
}
|
|
215
278
|
export function derivePoolRulePda(params) {
|
|
279
|
+
if (params.seriesRefHash.length !== 32) {
|
|
280
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
281
|
+
}
|
|
282
|
+
if (params.ruleHash.length !== 32) {
|
|
283
|
+
throw new Error('ruleHash must be exactly 32 bytes');
|
|
284
|
+
}
|
|
216
285
|
const program = asPubkey(params.programId);
|
|
217
286
|
const pool = asPubkey(params.poolAddress);
|
|
218
|
-
return PublicKey.findProgramAddressSync([
|
|
287
|
+
return PublicKey.findProgramAddressSync([
|
|
288
|
+
Buffer.from(SEED_POOL_RULE),
|
|
289
|
+
pool.toBuffer(),
|
|
290
|
+
Buffer.from(params.seriesRefHash),
|
|
291
|
+
Buffer.from(params.ruleHash),
|
|
292
|
+
], program);
|
|
219
293
|
}
|
|
220
294
|
export function deriveInviteIssuerPda(params) {
|
|
221
295
|
const program = asPubkey(params.programId);
|
|
@@ -234,6 +308,9 @@ export function deriveEnrollmentReplayPda(params) {
|
|
|
234
308
|
], program);
|
|
235
309
|
}
|
|
236
310
|
export function deriveAttestationVotePda(params) {
|
|
311
|
+
if (params.seriesRefHash.length !== 32) {
|
|
312
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
313
|
+
}
|
|
237
314
|
const program = asPubkey(params.programId);
|
|
238
315
|
const pool = asPubkey(params.poolAddress);
|
|
239
316
|
const member = asPubkey(params.member);
|
|
@@ -241,6 +318,7 @@ export function deriveAttestationVotePda(params) {
|
|
|
241
318
|
return PublicKey.findProgramAddressSync([
|
|
242
319
|
Buffer.from(SEED_ATTESTATION_VOTE),
|
|
243
320
|
pool.toBuffer(),
|
|
321
|
+
Buffer.from(params.seriesRefHash),
|
|
244
322
|
member.toBuffer(),
|
|
245
323
|
Buffer.from(params.cycleHash),
|
|
246
324
|
Buffer.from(params.ruleHash),
|
|
@@ -253,71 +331,112 @@ export function deriveClaimDelegatePda(params) {
|
|
|
253
331
|
const member = asPubkey(params.member);
|
|
254
332
|
return PublicKey.findProgramAddressSync([Buffer.from(SEED_CLAIM_DELEGATE), pool.toBuffer(), member.toBuffer()], program);
|
|
255
333
|
}
|
|
256
|
-
export function
|
|
334
|
+
export function deriveOutcomeAggregatePda(params) {
|
|
335
|
+
if (params.seriesRefHash.length !== 32) {
|
|
336
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
337
|
+
}
|
|
257
338
|
const program = asPubkey(params.programId);
|
|
258
339
|
const pool = asPubkey(params.poolAddress);
|
|
259
340
|
const member = asPubkey(params.member);
|
|
260
341
|
return PublicKey.findProgramAddressSync([
|
|
261
|
-
Buffer.from(
|
|
342
|
+
Buffer.from(SEED_OUTCOME_AGGREGATE),
|
|
262
343
|
pool.toBuffer(),
|
|
344
|
+
Buffer.from(params.seriesRefHash),
|
|
263
345
|
member.toBuffer(),
|
|
264
346
|
Buffer.from(params.cycleHash),
|
|
265
347
|
Buffer.from(params.ruleHash),
|
|
266
348
|
], program);
|
|
267
349
|
}
|
|
268
|
-
export function
|
|
350
|
+
export function derivePolicyPositionPda(params) {
|
|
351
|
+
if (params.seriesRefHash.length !== 32) {
|
|
352
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
353
|
+
}
|
|
269
354
|
const program = asPubkey(params.programId);
|
|
270
355
|
const pool = asPubkey(params.poolAddress);
|
|
271
356
|
const member = asPubkey(params.member);
|
|
272
357
|
return PublicKey.findProgramAddressSync([
|
|
273
|
-
Buffer.from(
|
|
358
|
+
Buffer.from(SEED_POLICY_POSITION),
|
|
274
359
|
pool.toBuffer(),
|
|
360
|
+
Buffer.from(params.seriesRefHash),
|
|
275
361
|
member.toBuffer(),
|
|
276
|
-
Buffer.from(params.cycleHash),
|
|
277
|
-
Buffer.from(params.ruleHash),
|
|
278
362
|
], program);
|
|
279
363
|
}
|
|
280
|
-
export function
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return PublicKey.findProgramAddressSync([Buffer.from(SEED_COVERAGE_POLICY), pool.toBuffer(), member.toBuffer()], program);
|
|
285
|
-
}
|
|
286
|
-
export function deriveCoverageProductPda(params) {
|
|
364
|
+
export function derivePolicySeriesPda(params) {
|
|
365
|
+
if (params.seriesRefHash.length !== 32) {
|
|
366
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
367
|
+
}
|
|
287
368
|
const program = asPubkey(params.programId);
|
|
288
369
|
const pool = asPubkey(params.poolAddress);
|
|
289
|
-
return PublicKey.findProgramAddressSync([Buffer.from(
|
|
370
|
+
return PublicKey.findProgramAddressSync([Buffer.from(SEED_POLICY_SERIES), pool.toBuffer(), Buffer.from(params.seriesRefHash)], program);
|
|
290
371
|
}
|
|
291
|
-
export function
|
|
372
|
+
export function derivePolicyPositionNftPda(params) {
|
|
373
|
+
if (params.seriesRefHash.length !== 32) {
|
|
374
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
375
|
+
}
|
|
292
376
|
const program = asPubkey(params.programId);
|
|
293
377
|
const pool = asPubkey(params.poolAddress);
|
|
294
378
|
const member = asPubkey(params.member);
|
|
295
|
-
return PublicKey.findProgramAddressSync([
|
|
379
|
+
return PublicKey.findProgramAddressSync([
|
|
380
|
+
Buffer.from(SEED_POLICY_POSITION_NFT),
|
|
381
|
+
pool.toBuffer(),
|
|
382
|
+
Buffer.from(params.seriesRefHash),
|
|
383
|
+
member.toBuffer(),
|
|
384
|
+
], program);
|
|
296
385
|
}
|
|
297
386
|
export function derivePremiumLedgerPda(params) {
|
|
387
|
+
if (params.seriesRefHash.length !== 32) {
|
|
388
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
389
|
+
}
|
|
298
390
|
const program = asPubkey(params.programId);
|
|
299
391
|
const pool = asPubkey(params.poolAddress);
|
|
300
392
|
const member = asPubkey(params.member);
|
|
301
|
-
return PublicKey.findProgramAddressSync([
|
|
393
|
+
return PublicKey.findProgramAddressSync([
|
|
394
|
+
Buffer.from(SEED_PREMIUM_LEDGER),
|
|
395
|
+
pool.toBuffer(),
|
|
396
|
+
Buffer.from(params.seriesRefHash),
|
|
397
|
+
member.toBuffer(),
|
|
398
|
+
], program);
|
|
302
399
|
}
|
|
303
400
|
export function derivePremiumReplayPda(params) {
|
|
401
|
+
if (params.seriesRefHash.length !== 32) {
|
|
402
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
403
|
+
}
|
|
304
404
|
const program = asPubkey(params.programId);
|
|
305
405
|
const pool = asPubkey(params.poolAddress);
|
|
306
406
|
const member = asPubkey(params.member);
|
|
307
407
|
return PublicKey.findProgramAddressSync([
|
|
308
408
|
Buffer.from(SEED_PREMIUM_REPLAY),
|
|
309
409
|
pool.toBuffer(),
|
|
410
|
+
Buffer.from(params.seriesRefHash),
|
|
310
411
|
member.toBuffer(),
|
|
311
412
|
Buffer.from(params.replayHash),
|
|
312
413
|
], program);
|
|
313
414
|
}
|
|
415
|
+
export function derivePolicySeriesPaymentOptionPda(params) {
|
|
416
|
+
if (params.seriesRefHash.length !== 32) {
|
|
417
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
418
|
+
}
|
|
419
|
+
const program = asPubkey(params.programId);
|
|
420
|
+
const pool = asPubkey(params.poolAddress);
|
|
421
|
+
const paymentMint = asPubkey(params.paymentMint);
|
|
422
|
+
return PublicKey.findProgramAddressSync([
|
|
423
|
+
Buffer.from(SEED_POLICY_SERIES_PAYMENT_OPTION),
|
|
424
|
+
pool.toBuffer(),
|
|
425
|
+
Buffer.from(params.seriesRefHash),
|
|
426
|
+
paymentMint.toBuffer(),
|
|
427
|
+
], program);
|
|
428
|
+
}
|
|
314
429
|
export function deriveCoverageClaimPda(params) {
|
|
430
|
+
if (params.seriesRefHash.length !== 32) {
|
|
431
|
+
throw new Error('seriesRefHash must be exactly 32 bytes');
|
|
432
|
+
}
|
|
315
433
|
const program = asPubkey(params.programId);
|
|
316
434
|
const pool = asPubkey(params.poolAddress);
|
|
317
435
|
const member = asPubkey(params.member);
|
|
318
436
|
return PublicKey.findProgramAddressSync([
|
|
319
437
|
Buffer.from(SEED_COVERAGE_CLAIM),
|
|
320
438
|
pool.toBuffer(),
|
|
439
|
+
Buffer.from(params.seriesRefHash),
|
|
321
440
|
member.toBuffer(),
|
|
322
441
|
Buffer.from(params.intentHash),
|
|
323
442
|
], program);
|