@overcast-xyz/solana-program 0.1.1
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/LICENSE +201 -0
- package/dist/idl.d.ts +52 -0
- package/dist/idl.js +58 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +29 -0
- package/dist/overcast_core.d.ts +4388 -0
- package/dist/overcast_core.js +2 -0
- package/dist/overcast_core.json +3630 -0
- package/dist/overcast_fee_hook.d.ts +533 -0
- package/dist/overcast_fee_hook.js +2 -0
- package/dist/overcast_fee_hook.json +447 -0
- package/dist/overcast_settlement_oracle_gated.d.ts +578 -0
- package/dist/overcast_settlement_oracle_gated.js +2 -0
- package/dist/overcast_settlement_oracle_gated.json +572 -0
- package/dist/overcast_settlement_physical.d.ts +414 -0
- package/dist/overcast_settlement_physical.js +2 -0
- package/dist/overcast_settlement_physical.json +393 -0
- package/dist/pda.d.ts +129 -0
- package/dist/pda.js +191 -0
- package/package.json +41 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "2Nd6fQknNSfrDApARY8km19qp41yS8yk59RRPrnHHKnB",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"name": "overcast_settlement_physical",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"spec": "0.1.0",
|
|
7
|
+
"description": "Physical-settlement layer for Overcast options"
|
|
8
|
+
},
|
|
9
|
+
"instructions": [
|
|
10
|
+
{
|
|
11
|
+
"name": "can_borrow",
|
|
12
|
+
"discriminator": [23, 180, 16, 136, 86, 168, 84, 152],
|
|
13
|
+
"accounts": [
|
|
14
|
+
{
|
|
15
|
+
"name": "config"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"args": [
|
|
19
|
+
{
|
|
20
|
+
"name": "option",
|
|
21
|
+
"type": {
|
|
22
|
+
"defined": {
|
|
23
|
+
"name": "MarketOption"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "borrower",
|
|
29
|
+
"type": "pubkey"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "borrow_amount",
|
|
33
|
+
"type": "u64"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "collateral_receiver",
|
|
37
|
+
"type": "pubkey"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "metadata",
|
|
41
|
+
"type": "bytes"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "can_exercise",
|
|
47
|
+
"discriminator": [114, 239, 61, 62, 83, 204, 139, 83],
|
|
48
|
+
"accounts": [
|
|
49
|
+
{
|
|
50
|
+
"name": "config"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"args": [
|
|
54
|
+
{
|
|
55
|
+
"name": "option",
|
|
56
|
+
"type": {
|
|
57
|
+
"defined": {
|
|
58
|
+
"name": "MarketOption"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "exercise_amount",
|
|
64
|
+
"type": "u64"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "metadata",
|
|
68
|
+
"type": "bytes"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"returns": {
|
|
72
|
+
"defined": {
|
|
73
|
+
"name": "ExerciseResolution"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "can_match",
|
|
79
|
+
"discriminator": [223, 238, 7, 233, 72, 137, 146, 135],
|
|
80
|
+
"accounts": [
|
|
81
|
+
{
|
|
82
|
+
"name": "config"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"args": [
|
|
86
|
+
{
|
|
87
|
+
"name": "option",
|
|
88
|
+
"type": {
|
|
89
|
+
"defined": {
|
|
90
|
+
"name": "MarketOption"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "can_redeem",
|
|
98
|
+
"docs": [
|
|
99
|
+
"Physical-settlement redeem resolution — the payout math (pro-rata against",
|
|
100
|
+
"the live claim supply and escrow balances) lives in the [`SettlementLayer`]",
|
|
101
|
+
"impl in `crate::layer` and is shared, settlement-agnostic logic."
|
|
102
|
+
],
|
|
103
|
+
"discriminator": [88, 241, 152, 58, 50, 172, 234, 99],
|
|
104
|
+
"accounts": [
|
|
105
|
+
{
|
|
106
|
+
"name": "config"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"args": [
|
|
110
|
+
{
|
|
111
|
+
"name": "option",
|
|
112
|
+
"type": {
|
|
113
|
+
"defined": {
|
|
114
|
+
"name": "MarketOption"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "redeem_amount",
|
|
120
|
+
"type": "u64"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "claim_supply",
|
|
124
|
+
"type": "u64"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "collateral_balance",
|
|
128
|
+
"type": "u64"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "settlement_balance",
|
|
132
|
+
"type": "u64"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "metadata",
|
|
136
|
+
"type": "bytes"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"returns": {
|
|
140
|
+
"defined": {
|
|
141
|
+
"name": "RedeemResolution"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "initialize_config",
|
|
147
|
+
"discriminator": [208, 127, 21, 1, 194, 190, 196, 70],
|
|
148
|
+
"accounts": [
|
|
149
|
+
{
|
|
150
|
+
"name": "authority",
|
|
151
|
+
"writable": true,
|
|
152
|
+
"signer": true
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "config",
|
|
156
|
+
"writable": true,
|
|
157
|
+
"pda": {
|
|
158
|
+
"seeds": [
|
|
159
|
+
{
|
|
160
|
+
"kind": "const",
|
|
161
|
+
"value": [
|
|
162
|
+
115, 101, 116, 116, 108, 101, 109, 101, 110, 116, 45, 99, 111,
|
|
163
|
+
110, 102, 105, 103
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"name": "system_program",
|
|
171
|
+
"address": "11111111111111111111111111111111"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"args": []
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"accounts": [
|
|
178
|
+
{
|
|
179
|
+
"name": "SettlementConfig",
|
|
180
|
+
"discriminator": [205, 26, 40, 112, 76, 134, 3, 14]
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"errors": [
|
|
184
|
+
{
|
|
185
|
+
"code": 6000,
|
|
186
|
+
"name": "InvalidCollateralAmount",
|
|
187
|
+
"msg": "Collateral amount must be non-zero"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"code": 6001,
|
|
191
|
+
"name": "ExerciseAmountTooLarge",
|
|
192
|
+
"msg": "Exercise amount exceeds available collateral"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"code": 6002,
|
|
196
|
+
"name": "ArithmeticOverflow",
|
|
197
|
+
"msg": "Arithmetic overflow computing settlement"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"code": 6003,
|
|
201
|
+
"name": "BorrowNotSupported",
|
|
202
|
+
"msg": "This settlement layer does not permit borrowing collateral"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"types": [
|
|
206
|
+
{
|
|
207
|
+
"name": "ExerciseResolution",
|
|
208
|
+
"docs": [
|
|
209
|
+
"A settlement layer returns this from `can_exercise` to instruct core how to",
|
|
210
|
+
"move escrowed funds. Core owns custody of all option assets; layers are pure",
|
|
211
|
+
"decision modules."
|
|
212
|
+
],
|
|
213
|
+
"type": {
|
|
214
|
+
"kind": "struct",
|
|
215
|
+
"fields": [
|
|
216
|
+
{
|
|
217
|
+
"name": "collateral_to_taker",
|
|
218
|
+
"docs": [
|
|
219
|
+
"Collateral asset moved from option escrow to maker escrow (e.g. cashless leftover)."
|
|
220
|
+
],
|
|
221
|
+
"type": "u64"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "settlement_from_taker",
|
|
225
|
+
"docs": [
|
|
226
|
+
"Settlement asset pulled from taker to maker. Zero for cashless settlement."
|
|
227
|
+
],
|
|
228
|
+
"type": "u64"
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "MarketOption",
|
|
235
|
+
"docs": [
|
|
236
|
+
"A live option, as passed to a settlement layer / hook. Mirrors",
|
|
237
|
+
"`overcast_core::state::MarketOption` byte-for-byte."
|
|
238
|
+
],
|
|
239
|
+
"type": {
|
|
240
|
+
"kind": "struct",
|
|
241
|
+
"fields": [
|
|
242
|
+
{
|
|
243
|
+
"name": "details",
|
|
244
|
+
"type": {
|
|
245
|
+
"defined": {
|
|
246
|
+
"name": "OptionDetails"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "taker",
|
|
252
|
+
"type": "pubkey"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "maker",
|
|
256
|
+
"type": "pubkey"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "settlement_offer",
|
|
260
|
+
"type": "pubkey"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "collateral_offer",
|
|
264
|
+
"type": "pubkey"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "borrowed_collateral",
|
|
268
|
+
"docs": [
|
|
269
|
+
"Collateral currently out on loan via `borrow_collateral` and not yet",
|
|
270
|
+
"returned via `repay_collateral`."
|
|
271
|
+
],
|
|
272
|
+
"type": "u64"
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "OptionDetails",
|
|
279
|
+
"docs": [
|
|
280
|
+
"The economic terms of an option, as seen by a settlement layer / hook.",
|
|
281
|
+
"",
|
|
282
|
+
"Mirrors `overcast_core::state::OptionDetails` byte-for-byte — core owns the",
|
|
283
|
+
"on-chain account representation, this is the shared interface view."
|
|
284
|
+
],
|
|
285
|
+
"type": {
|
|
286
|
+
"kind": "struct",
|
|
287
|
+
"fields": [
|
|
288
|
+
{
|
|
289
|
+
"name": "domain",
|
|
290
|
+
"type": "u32"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "start_timestamp",
|
|
294
|
+
"type": "i64"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "end_timestamp",
|
|
298
|
+
"type": "i64"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "premium_asset",
|
|
302
|
+
"type": "pubkey"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"name": "premium_amount",
|
|
306
|
+
"type": "u64"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"name": "collateral_asset",
|
|
310
|
+
"type": "pubkey"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "collateral_amount",
|
|
314
|
+
"type": "u64"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "settlement_asset",
|
|
318
|
+
"type": "pubkey"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "settlement_amount",
|
|
322
|
+
"type": "u64"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"name": "settlement_layer",
|
|
326
|
+
"type": "pubkey"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"name": "borrow_allowed",
|
|
330
|
+
"docs": [
|
|
331
|
+
"Opt-in flag: if false, `borrow_collateral` is hard-rejected by core",
|
|
332
|
+
"regardless of what the settlement layer says. If true, the layer is",
|
|
333
|
+
"CPI'd and can still refuse."
|
|
334
|
+
],
|
|
335
|
+
"type": "bool"
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "RedeemResolution",
|
|
342
|
+
"docs": [
|
|
343
|
+
"A settlement layer returns this from `can_redeem` to instruct core how much",
|
|
344
|
+
"of each escrow to release to the maker. The redemption analogue of",
|
|
345
|
+
"[`ExerciseResolution`]: redemption only ever unwinds the two escrows back to",
|
|
346
|
+
"the maker, so the taker-facing fields are dropped."
|
|
347
|
+
],
|
|
348
|
+
"type": {
|
|
349
|
+
"kind": "struct",
|
|
350
|
+
"fields": [
|
|
351
|
+
{
|
|
352
|
+
"name": "collateral_to_maker",
|
|
353
|
+
"docs": [
|
|
354
|
+
"Collateral asset released from the option escrow to the maker."
|
|
355
|
+
],
|
|
356
|
+
"type": "u64"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "settlement_to_maker",
|
|
360
|
+
"docs": [
|
|
361
|
+
"Settlement asset released from the option escrow to the maker."
|
|
362
|
+
],
|
|
363
|
+
"type": "u64"
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"name": "SettlementConfig",
|
|
370
|
+
"docs": [
|
|
371
|
+
"Per-instance config for the physical-settlement layer. Stub layout — the",
|
|
372
|
+
"physical layer is parameter-free, but the PDA must exist so options can bind",
|
|
373
|
+
"to a specific config (and, transitively, to this program as the owner)."
|
|
374
|
+
],
|
|
375
|
+
"type": {
|
|
376
|
+
"kind": "struct",
|
|
377
|
+
"fields": [
|
|
378
|
+
{
|
|
379
|
+
"name": "bump",
|
|
380
|
+
"type": "u8"
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
],
|
|
386
|
+
"constants": [
|
|
387
|
+
{
|
|
388
|
+
"name": "SETTLEMENT_CONFIG_SEED",
|
|
389
|
+
"type": "bytes",
|
|
390
|
+
"value": "[115, 101, 116, 116, 108, 101, 109, 101, 110, 116, 45, 99, 111, 110, 102, 105, 103]"
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
}
|
package/dist/pda.d.ts
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Program } from "@anchor-lang/core";
|
|
2
|
+
import { PublicKey } from "@solana/web3.js";
|
|
3
|
+
import type { OvercastCore } from "./overcast_core";
|
|
4
|
+
/**
|
|
5
|
+
* Program Derived Address (PDA) helpers.
|
|
6
|
+
*
|
|
7
|
+
* Seeds are kept in one place so that callers stay in sync with the on-chain
|
|
8
|
+
* program (see `programs/overcast-core/src/constants.rs`). When a new PDA is
|
|
9
|
+
* added to the program, add its seed and a matching derivation helper here so
|
|
10
|
+
* every consumer derives addresses the same way.
|
|
11
|
+
*/
|
|
12
|
+
/** Seed for the singleton protocol state account. */
|
|
13
|
+
export declare const PROTOCOL_STATE_SEED: Buffer<ArrayBuffer>;
|
|
14
|
+
export declare const PROTOCOL_ESCROW_SEED: Buffer<ArrayBuffer>;
|
|
15
|
+
/**
|
|
16
|
+
* Single offer PDA seed. Collateral (maker) and settlement (taker) offers were
|
|
17
|
+
* merged into one content-addressed `Offer`, so both now share this seed; the
|
|
18
|
+
* offer's `id` (which folds in its `side`) is what keeps the two disjoint.
|
|
19
|
+
*/
|
|
20
|
+
export declare const OFFER_SEED: Buffer<ArrayBuffer>;
|
|
21
|
+
/** Per-offer escrow seed — holds the locked collateral (maker) or premium (taker). */
|
|
22
|
+
export declare const OFFER_ESCROW_SEED: Buffer<ArrayBuffer>;
|
|
23
|
+
/**
|
|
24
|
+
* Seed for the physical-settlement layer's config PDA. Lives in the separate
|
|
25
|
+
* `overcast_settlement_physical` program, so its `get*Pda` helper below takes
|
|
26
|
+
* that layer's program id rather than the core program id.
|
|
27
|
+
* Mirrors `SETTLEMENT_CONFIG_SEED` in the layer's `constants.rs`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SETTLEMENT_CONFIG_SEED: Buffer<ArrayBuffer>;
|
|
30
|
+
/**
|
|
31
|
+
* Seed for the protocol-fee hook's config PDA. Lives in the separate
|
|
32
|
+
* `overcast_fee_hook` program, so its `get*Pda` helper below takes that
|
|
33
|
+
* program's id rather than the core program id. Mirrors `STATIC_PROTOCOL_FEE`
|
|
34
|
+
* in the hook's `constants.rs`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const STATIC_PROTOCOL_FEE_SEED: Buffer<ArrayBuffer>;
|
|
37
|
+
export declare const OPTION_SEED: Buffer<ArrayBuffer>;
|
|
38
|
+
export declare const OPTION_COLLATERAL_ESCROW_SEED: Buffer<ArrayBuffer>;
|
|
39
|
+
/** Seed for the option's escrow that collects settlement paid on exercise. */
|
|
40
|
+
export declare const OPTION_SETTLEMENT_ESCROW_SEED: Buffer<ArrayBuffer>;
|
|
41
|
+
export declare const MINT_EXERCISE_SEED: Buffer<ArrayBuffer>;
|
|
42
|
+
export declare const MINT_COLLATERAL_RETURN_SEED: Buffer<ArrayBuffer>;
|
|
43
|
+
/** Seed for the record binding a delegated signing key to its owner. */
|
|
44
|
+
export declare const SIGNING_KEY_SEED: Buffer<ArrayBuffer>;
|
|
45
|
+
/** Seed for the replay guard consumed when a signed operation executes. */
|
|
46
|
+
export declare const USED_OPERATION_SEED: Buffer<ArrayBuffer>;
|
|
47
|
+
/** Singleton protocol state PDA. Mirrors `seeds = [PROTOCOL_STATE_SEED]`. */
|
|
48
|
+
export declare function getProtocolStatePda(programId: PublicKey): [PublicKey, number];
|
|
49
|
+
/**
|
|
50
|
+
* Per-user, per-mint vault token account owned by the protocol — the
|
|
51
|
+
* `user_token_account` in deposit / withdraw.
|
|
52
|
+
*
|
|
53
|
+
* Mirrors: `seeds = [PROTOCOL_ESCROW_SEED, user, mint]`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getProtocolEscrowAccountPda(programId: PublicKey, user: PublicKey, mint: PublicKey): [PublicKey, number];
|
|
56
|
+
/**
|
|
57
|
+
* Physical-settlement layer config PDA.
|
|
58
|
+
*
|
|
59
|
+
* Mirrors: `seeds = [SETTLEMENT_CONFIG_SEED, authority, salt]` in the layer.
|
|
60
|
+
* The derived address is what callers put into
|
|
61
|
+
* `option_details.settlement_layer`; the `physicalProgramId` is what they pass
|
|
62
|
+
* as `settlement_program` to `accept_offer` / `exercise_option`.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getSettlementConfigPda(physicalProgramId: PublicKey): [PublicKey, number];
|
|
65
|
+
/**
|
|
66
|
+
* Protocol-fee hook config PDA.
|
|
67
|
+
*
|
|
68
|
+
* Mirrors: `seeds = [STATIC_PROTOCOL_FEE, config.salt]` in the hook. The
|
|
69
|
+
* derived address is the `ProtocolFee` account callers point
|
|
70
|
+
* `ProtocolState.option_creation_hook` at (and pass as `hook_config` to
|
|
71
|
+
* `accept_offer`); `feeHookProgramId` is what they pass as `hook_program`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function getProtocolFeePda(feeHookProgramId: PublicKey, salt: PublicKey): [PublicKey, number];
|
|
74
|
+
/** Mirrors: `seeds = [OFFER_SEED, offer_id]` */
|
|
75
|
+
export declare function getOfferPda(programId: PublicKey, id: Buffer): [PublicKey, number];
|
|
76
|
+
/** Mirrors: `seeds = [OFFER_ESCROW_SEED, offer_id]` */
|
|
77
|
+
export declare function getOfferEscrowPda(programId: PublicKey, id: Buffer): [PublicKey, number];
|
|
78
|
+
/** Mirrors: `seeds = [OPTION_SEED, collateral_offer_id, settlement_offer_id]` */
|
|
79
|
+
export declare function getOptionPda(programId: PublicKey, collateralOfferId: Buffer, settlementOfferId: Buffer): [PublicKey, number];
|
|
80
|
+
/** Mirrors: `seeds = [OPTION_COLLATERAL_ESCROW_SEED, collateral_offer_id, settlement_offer_id]` */
|
|
81
|
+
export declare function getOptionCollateralEscrowPda(programId: PublicKey, collateralOfferId: Buffer, settlementOfferId: Buffer): [PublicKey, number];
|
|
82
|
+
/** Mirrors: `seeds = [OPTION_SETTLEMENT_ESCROW_SEED, collateral_offer_id, settlement_offer_id]` */
|
|
83
|
+
export declare function getOptionSettlementEscrowPda(programId: PublicKey, collateralOfferId: Buffer, settlementOfferId: Buffer): [PublicKey, number];
|
|
84
|
+
/** Mirrors: `seeds = [MINT_EXERCISE_SEED, collateral_offer_id, settlement_offer_id]` */
|
|
85
|
+
export declare function getMintExercisePda(programId: PublicKey, collateralOfferId: Buffer, settlementOfferId: Buffer): [PublicKey, number];
|
|
86
|
+
/** Mirrors: `seeds = [MINT_COLLATERAL_RETURN_SEED, collateral_offer_id, settlement_offer_id]` */
|
|
87
|
+
export declare function getMintCollateralReturnPda(programId: PublicKey, collateralOfferId: Buffer, settlementOfferId: Buffer): [PublicKey, number];
|
|
88
|
+
/**
|
|
89
|
+
* Record proving `owner` authorized `key` to sign operations on its behalf.
|
|
90
|
+
*
|
|
91
|
+
* Mirrors: `seeds = [SIGNING_KEY_SEED, owner, key]` in `add_signing_key.rs`.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getSigningKeyDelegationPda(programId: PublicKey, owner: PublicKey, key: PublicKey): [PublicKey, number];
|
|
94
|
+
/**
|
|
95
|
+
* Replay guard for a signed operation: created when the operation is consumed,
|
|
96
|
+
* so the same (signer, nonce) pair can never execute twice.
|
|
97
|
+
*
|
|
98
|
+
* Mirrors: `seeds = [USED_OPERATION_SEED, signer, nonce]` in `operation.rs`,
|
|
99
|
+
* where `signer` is the account the operation acts for (offer maker / option
|
|
100
|
+
* taker), not the transaction submitter.
|
|
101
|
+
*/
|
|
102
|
+
export declare function getUsedOperationPda(programId: PublicKey, signer: PublicKey, nonce: Buffer | Uint8Array): [PublicKey, number];
|
|
103
|
+
/** The `Offer` value passed to `make_offer` (fields: salt, creator, optionDetails, expiry, side). */
|
|
104
|
+
export type OfferInput = Parameters<Program<OvercastCore>["methods"]["makeOffer"]>[0];
|
|
105
|
+
/**
|
|
106
|
+
* Derives an offer's account and escrow PDAs from its pre-computed 32-byte
|
|
107
|
+
* content-addressed `id` (see `HashId::id()` on-chain). Works for both sides —
|
|
108
|
+
* the `side` is already baked into `id`.
|
|
109
|
+
*/
|
|
110
|
+
export declare function deriveOfferPdas(program: Program<OvercastCore>, id: Buffer): {
|
|
111
|
+
offer: PublicKey;
|
|
112
|
+
escrow: PublicKey;
|
|
113
|
+
};
|
|
114
|
+
/** Mirrors `OracleKind` in the oracle-gated layer's `state.rs`. */
|
|
115
|
+
export declare const ORACLE_KIND: {
|
|
116
|
+
readonly Pyth: 0;
|
|
117
|
+
};
|
|
118
|
+
export type OracleKindByte = (typeof ORACLE_KIND)[keyof typeof ORACLE_KIND];
|
|
119
|
+
/**
|
|
120
|
+
* Oracle-gated settlement layer config PDA.
|
|
121
|
+
*
|
|
122
|
+
* Mirrors: `seeds = [SETTLEMENT_CONFIG_SEED, coll_mint, sett_mint,
|
|
123
|
+
* coll_oracle_kind_byte, coll_oracle_id,
|
|
124
|
+
* sett_oracle_kind_byte, sett_oracle_id]`.
|
|
125
|
+
*
|
|
126
|
+
* The full binding is baked into the address, so the pubkey alone is enough
|
|
127
|
+
* to verify what (mints, oracles) this config covers.
|
|
128
|
+
*/
|
|
129
|
+
export declare function getOracleSettlementConfigPda(oracleGatedProgramId: PublicKey, collMint: PublicKey, settMint: PublicKey, collOracleKind: OracleKindByte, collOracleId: Uint8Array, settOracleKind: OracleKindByte, settOracleId: Uint8Array): [PublicKey, number];
|