@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.
@@ -0,0 +1,414 @@
1
+ /**
2
+ * Program IDL in camelCase format in order to be used in JS/TS.
3
+ *
4
+ * Note that this is only a type helper and is not the actual IDL. The original
5
+ * IDL can be found at `target/idl/overcast_settlement_physical.json`.
6
+ */
7
+ export type OvercastSettlementPhysical = {
8
+ address: "2Nd6fQknNSfrDApARY8km19qp41yS8yk59RRPrnHHKnB";
9
+ metadata: {
10
+ name: "overcastSettlementPhysical";
11
+ version: "0.1.0";
12
+ spec: "0.1.0";
13
+ description: "Physical-settlement layer for Overcast options";
14
+ };
15
+ instructions: [
16
+ {
17
+ name: "canBorrow";
18
+ discriminator: [23, 180, 16, 136, 86, 168, 84, 152];
19
+ accounts: [
20
+ {
21
+ name: "config";
22
+ }
23
+ ];
24
+ args: [
25
+ {
26
+ name: "option";
27
+ type: {
28
+ defined: {
29
+ name: "marketOption";
30
+ };
31
+ };
32
+ },
33
+ {
34
+ name: "borrower";
35
+ type: "pubkey";
36
+ },
37
+ {
38
+ name: "borrowAmount";
39
+ type: "u64";
40
+ },
41
+ {
42
+ name: "collateralReceiver";
43
+ type: "pubkey";
44
+ },
45
+ {
46
+ name: "metadata";
47
+ type: "bytes";
48
+ }
49
+ ];
50
+ },
51
+ {
52
+ name: "canExercise";
53
+ discriminator: [114, 239, 61, 62, 83, 204, 139, 83];
54
+ accounts: [
55
+ {
56
+ name: "config";
57
+ }
58
+ ];
59
+ args: [
60
+ {
61
+ name: "option";
62
+ type: {
63
+ defined: {
64
+ name: "marketOption";
65
+ };
66
+ };
67
+ },
68
+ {
69
+ name: "exerciseAmount";
70
+ type: "u64";
71
+ },
72
+ {
73
+ name: "metadata";
74
+ type: "bytes";
75
+ }
76
+ ];
77
+ returns: {
78
+ defined: {
79
+ name: "exerciseResolution";
80
+ };
81
+ };
82
+ },
83
+ {
84
+ name: "canMatch";
85
+ discriminator: [223, 238, 7, 233, 72, 137, 146, 135];
86
+ accounts: [
87
+ {
88
+ name: "config";
89
+ }
90
+ ];
91
+ args: [
92
+ {
93
+ name: "option";
94
+ type: {
95
+ defined: {
96
+ name: "marketOption";
97
+ };
98
+ };
99
+ }
100
+ ];
101
+ },
102
+ {
103
+ name: "canRedeem";
104
+ docs: [
105
+ "Physical-settlement redeem resolution — the payout math (pro-rata against",
106
+ "the live claim supply and escrow balances) lives in the [`SettlementLayer`]",
107
+ "impl in `crate::layer` and is shared, settlement-agnostic logic."
108
+ ];
109
+ discriminator: [88, 241, 152, 58, 50, 172, 234, 99];
110
+ accounts: [
111
+ {
112
+ name: "config";
113
+ }
114
+ ];
115
+ args: [
116
+ {
117
+ name: "option";
118
+ type: {
119
+ defined: {
120
+ name: "marketOption";
121
+ };
122
+ };
123
+ },
124
+ {
125
+ name: "redeemAmount";
126
+ type: "u64";
127
+ },
128
+ {
129
+ name: "claimSupply";
130
+ type: "u64";
131
+ },
132
+ {
133
+ name: "collateralBalance";
134
+ type: "u64";
135
+ },
136
+ {
137
+ name: "settlementBalance";
138
+ type: "u64";
139
+ },
140
+ {
141
+ name: "metadata";
142
+ type: "bytes";
143
+ }
144
+ ];
145
+ returns: {
146
+ defined: {
147
+ name: "redeemResolution";
148
+ };
149
+ };
150
+ },
151
+ {
152
+ name: "initializeConfig";
153
+ discriminator: [208, 127, 21, 1, 194, 190, 196, 70];
154
+ accounts: [
155
+ {
156
+ name: "authority";
157
+ writable: true;
158
+ signer: true;
159
+ },
160
+ {
161
+ name: "config";
162
+ writable: true;
163
+ pda: {
164
+ seeds: [
165
+ {
166
+ kind: "const";
167
+ value: [
168
+ 115,
169
+ 101,
170
+ 116,
171
+ 116,
172
+ 108,
173
+ 101,
174
+ 109,
175
+ 101,
176
+ 110,
177
+ 116,
178
+ 45,
179
+ 99,
180
+ 111,
181
+ 110,
182
+ 102,
183
+ 105,
184
+ 103
185
+ ];
186
+ }
187
+ ];
188
+ };
189
+ },
190
+ {
191
+ name: "systemProgram";
192
+ address: "11111111111111111111111111111111";
193
+ }
194
+ ];
195
+ args: [];
196
+ }
197
+ ];
198
+ accounts: [
199
+ {
200
+ name: "settlementConfig";
201
+ discriminator: [205, 26, 40, 112, 76, 134, 3, 14];
202
+ }
203
+ ];
204
+ errors: [
205
+ {
206
+ code: 6000;
207
+ name: "invalidCollateralAmount";
208
+ msg: "Collateral amount must be non-zero";
209
+ },
210
+ {
211
+ code: 6001;
212
+ name: "exerciseAmountTooLarge";
213
+ msg: "Exercise amount exceeds available collateral";
214
+ },
215
+ {
216
+ code: 6002;
217
+ name: "arithmeticOverflow";
218
+ msg: "Arithmetic overflow computing settlement";
219
+ },
220
+ {
221
+ code: 6003;
222
+ name: "borrowNotSupported";
223
+ msg: "This settlement layer does not permit borrowing collateral";
224
+ }
225
+ ];
226
+ types: [
227
+ {
228
+ name: "exerciseResolution";
229
+ docs: [
230
+ "A settlement layer returns this from `can_exercise` to instruct core how to",
231
+ "move escrowed funds. Core owns custody of all option assets; layers are pure",
232
+ "decision modules."
233
+ ];
234
+ type: {
235
+ kind: "struct";
236
+ fields: [
237
+ {
238
+ name: "collateralToTaker";
239
+ docs: [
240
+ "Collateral asset moved from option escrow to maker escrow (e.g. cashless leftover)."
241
+ ];
242
+ type: "u64";
243
+ },
244
+ {
245
+ name: "settlementFromTaker";
246
+ docs: [
247
+ "Settlement asset pulled from taker to maker. Zero for cashless settlement."
248
+ ];
249
+ type: "u64";
250
+ }
251
+ ];
252
+ };
253
+ },
254
+ {
255
+ name: "marketOption";
256
+ docs: [
257
+ "A live option, as passed to a settlement layer / hook. Mirrors",
258
+ "`overcast_core::state::MarketOption` byte-for-byte."
259
+ ];
260
+ type: {
261
+ kind: "struct";
262
+ fields: [
263
+ {
264
+ name: "details";
265
+ type: {
266
+ defined: {
267
+ name: "optionDetails";
268
+ };
269
+ };
270
+ },
271
+ {
272
+ name: "taker";
273
+ type: "pubkey";
274
+ },
275
+ {
276
+ name: "maker";
277
+ type: "pubkey";
278
+ },
279
+ {
280
+ name: "settlementOffer";
281
+ type: "pubkey";
282
+ },
283
+ {
284
+ name: "collateralOffer";
285
+ type: "pubkey";
286
+ },
287
+ {
288
+ name: "borrowedCollateral";
289
+ docs: [
290
+ "Collateral currently out on loan via `borrow_collateral` and not yet",
291
+ "returned via `repay_collateral`."
292
+ ];
293
+ type: "u64";
294
+ }
295
+ ];
296
+ };
297
+ },
298
+ {
299
+ name: "optionDetails";
300
+ docs: [
301
+ "The economic terms of an option, as seen by a settlement layer / hook.",
302
+ "",
303
+ "Mirrors `overcast_core::state::OptionDetails` byte-for-byte — core owns the",
304
+ "on-chain account representation, this is the shared interface view."
305
+ ];
306
+ type: {
307
+ kind: "struct";
308
+ fields: [
309
+ {
310
+ name: "domain";
311
+ type: "u32";
312
+ },
313
+ {
314
+ name: "startTimestamp";
315
+ type: "i64";
316
+ },
317
+ {
318
+ name: "endTimestamp";
319
+ type: "i64";
320
+ },
321
+ {
322
+ name: "premiumAsset";
323
+ type: "pubkey";
324
+ },
325
+ {
326
+ name: "premiumAmount";
327
+ type: "u64";
328
+ },
329
+ {
330
+ name: "collateralAsset";
331
+ type: "pubkey";
332
+ },
333
+ {
334
+ name: "collateralAmount";
335
+ type: "u64";
336
+ },
337
+ {
338
+ name: "settlementAsset";
339
+ type: "pubkey";
340
+ },
341
+ {
342
+ name: "settlementAmount";
343
+ type: "u64";
344
+ },
345
+ {
346
+ name: "settlementLayer";
347
+ type: "pubkey";
348
+ },
349
+ {
350
+ name: "borrowAllowed";
351
+ docs: [
352
+ "Opt-in flag: if false, `borrow_collateral` is hard-rejected by core",
353
+ "regardless of what the settlement layer says. If true, the layer is",
354
+ "CPI'd and can still refuse."
355
+ ];
356
+ type: "bool";
357
+ }
358
+ ];
359
+ };
360
+ },
361
+ {
362
+ name: "redeemResolution";
363
+ docs: [
364
+ "A settlement layer returns this from `can_redeem` to instruct core how much",
365
+ "of each escrow to release to the maker. The redemption analogue of",
366
+ "[`ExerciseResolution`]: redemption only ever unwinds the two escrows back to",
367
+ "the maker, so the taker-facing fields are dropped."
368
+ ];
369
+ type: {
370
+ kind: "struct";
371
+ fields: [
372
+ {
373
+ name: "collateralToMaker";
374
+ docs: [
375
+ "Collateral asset released from the option escrow to the maker."
376
+ ];
377
+ type: "u64";
378
+ },
379
+ {
380
+ name: "settlementToMaker";
381
+ docs: [
382
+ "Settlement asset released from the option escrow to the maker."
383
+ ];
384
+ type: "u64";
385
+ }
386
+ ];
387
+ };
388
+ },
389
+ {
390
+ name: "settlementConfig";
391
+ docs: [
392
+ "Per-instance config for the physical-settlement layer. Stub layout — the",
393
+ "physical layer is parameter-free, but the PDA must exist so options can bind",
394
+ "to a specific config (and, transitively, to this program as the owner)."
395
+ ];
396
+ type: {
397
+ kind: "struct";
398
+ fields: [
399
+ {
400
+ name: "bump";
401
+ type: "u8";
402
+ }
403
+ ];
404
+ };
405
+ }
406
+ ];
407
+ constants: [
408
+ {
409
+ name: "settlementConfigSeed";
410
+ type: "bytes";
411
+ value: "[115, 101, 116, 116, 108, 101, 109, 101, 110, 116, 45, 99, 111, 110, 102, 105, 103]";
412
+ }
413
+ ];
414
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });