@theliem/xmarket-sdk 1.0.12
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 +1 -0
- package/dist/clob_exchange-ATSH42KC.json +1859 -0
- package/dist/conditional_tokens-3O5V46N5.json +2215 -0
- package/dist/hook-THBRGUM6.json +481 -0
- package/dist/index.d.mts +818 -0
- package/dist/index.d.ts +818 -0
- package/dist/index.js +1860 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1797 -0
- package/dist/index.mjs.map +1 -0
- package/dist/oracle-FZJJIJGI.json +694 -0
- package/dist/question_market-CB6ZUZ5E.json +1465 -0
- package/package.json +65 -0
- package/src/idls/clob_exchange.json +1859 -0
- package/src/idls/conditional_tokens.json +2215 -0
- package/src/idls/hook.json +481 -0
- package/src/idls/oracle.json +694 -0
- package/src/idls/question_market.json +1465 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "F7y5MfW8d5kqR25QHDhUQ9LrKCiZUZVF6Pdnw15q5zZW",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"name": "hook",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"spec": "0.1.0",
|
|
7
|
+
"description": "Transfer Hook program for YES/NO Token-2022 prediction market mints"
|
|
8
|
+
},
|
|
9
|
+
"instructions": [
|
|
10
|
+
{
|
|
11
|
+
"name": "add_to_whitelist",
|
|
12
|
+
"docs": [
|
|
13
|
+
"Add a program to the transfer whitelist."
|
|
14
|
+
],
|
|
15
|
+
"discriminator": [
|
|
16
|
+
157,
|
|
17
|
+
211,
|
|
18
|
+
52,
|
|
19
|
+
54,
|
|
20
|
+
144,
|
|
21
|
+
81,
|
|
22
|
+
5,
|
|
23
|
+
55
|
|
24
|
+
],
|
|
25
|
+
"accounts": [
|
|
26
|
+
{
|
|
27
|
+
"name": "owner",
|
|
28
|
+
"signer": true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "hook_config",
|
|
32
|
+
"writable": true,
|
|
33
|
+
"pda": {
|
|
34
|
+
"seeds": [
|
|
35
|
+
{
|
|
36
|
+
"kind": "const",
|
|
37
|
+
"value": [
|
|
38
|
+
104,
|
|
39
|
+
111,
|
|
40
|
+
111,
|
|
41
|
+
107,
|
|
42
|
+
95,
|
|
43
|
+
99,
|
|
44
|
+
111,
|
|
45
|
+
110,
|
|
46
|
+
102,
|
|
47
|
+
105,
|
|
48
|
+
103
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"args": [
|
|
56
|
+
{
|
|
57
|
+
"name": "program",
|
|
58
|
+
"type": "pubkey"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "execute",
|
|
64
|
+
"docs": [
|
|
65
|
+
"Transfer hook execute \u2014 invoked by Token-2022 on every YES/NO transfer.",
|
|
66
|
+
"Validates the transfer against the whitelist.",
|
|
67
|
+
"Discriminator matches the SPL transfer-hook-interface:execute standard."
|
|
68
|
+
],
|
|
69
|
+
"discriminator": [
|
|
70
|
+
105,
|
|
71
|
+
37,
|
|
72
|
+
101,
|
|
73
|
+
197,
|
|
74
|
+
75,
|
|
75
|
+
251,
|
|
76
|
+
102,
|
|
77
|
+
26
|
|
78
|
+
],
|
|
79
|
+
"accounts": [
|
|
80
|
+
{
|
|
81
|
+
"name": "source_token",
|
|
82
|
+
"docs": [
|
|
83
|
+
"Source token account (tokens leaving)"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "mint",
|
|
88
|
+
"docs": [
|
|
89
|
+
"The Token-2022 mint"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "destination_token",
|
|
94
|
+
"docs": [
|
|
95
|
+
"Destination token account (tokens arriving)"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "owner",
|
|
100
|
+
"docs": [
|
|
101
|
+
"The authority that authorized this transfer (signer of the transfer)"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "extra_account_meta_list"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "hook_config",
|
|
109
|
+
"docs": [
|
|
110
|
+
"HookConfig \u2014 extra account registered in the meta list"
|
|
111
|
+
],
|
|
112
|
+
"pda": {
|
|
113
|
+
"seeds": [
|
|
114
|
+
{
|
|
115
|
+
"kind": "const",
|
|
116
|
+
"value": [
|
|
117
|
+
104,
|
|
118
|
+
111,
|
|
119
|
+
111,
|
|
120
|
+
107,
|
|
121
|
+
95,
|
|
122
|
+
99,
|
|
123
|
+
111,
|
|
124
|
+
110,
|
|
125
|
+
102,
|
|
126
|
+
105,
|
|
127
|
+
103
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"args": [
|
|
135
|
+
{
|
|
136
|
+
"name": "amount",
|
|
137
|
+
"type": "u64"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "freeze_whitelist",
|
|
143
|
+
"docs": [
|
|
144
|
+
"Permanently freeze the whitelist."
|
|
145
|
+
],
|
|
146
|
+
"discriminator": [
|
|
147
|
+
248,
|
|
148
|
+
112,
|
|
149
|
+
12,
|
|
150
|
+
150,
|
|
151
|
+
175,
|
|
152
|
+
238,
|
|
153
|
+
38,
|
|
154
|
+
184
|
|
155
|
+
],
|
|
156
|
+
"accounts": [
|
|
157
|
+
{
|
|
158
|
+
"name": "owner",
|
|
159
|
+
"signer": true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "hook_config",
|
|
163
|
+
"writable": true,
|
|
164
|
+
"pda": {
|
|
165
|
+
"seeds": [
|
|
166
|
+
{
|
|
167
|
+
"kind": "const",
|
|
168
|
+
"value": [
|
|
169
|
+
104,
|
|
170
|
+
111,
|
|
171
|
+
111,
|
|
172
|
+
107,
|
|
173
|
+
95,
|
|
174
|
+
99,
|
|
175
|
+
111,
|
|
176
|
+
110,
|
|
177
|
+
102,
|
|
178
|
+
105,
|
|
179
|
+
103
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"args": []
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "initialize_extra_account_meta_list",
|
|
190
|
+
"docs": [
|
|
191
|
+
"Register extra account metas for a specific YES or NO mint.",
|
|
192
|
+
"Must be called for each mint after it is created by CTF.prepare_condition."
|
|
193
|
+
],
|
|
194
|
+
"discriminator": [
|
|
195
|
+
92,
|
|
196
|
+
197,
|
|
197
|
+
174,
|
|
198
|
+
197,
|
|
199
|
+
41,
|
|
200
|
+
124,
|
|
201
|
+
19,
|
|
202
|
+
3
|
|
203
|
+
],
|
|
204
|
+
"accounts": [
|
|
205
|
+
{
|
|
206
|
+
"name": "payer",
|
|
207
|
+
"writable": true,
|
|
208
|
+
"signer": true
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "extra_account_meta_list",
|
|
212
|
+
"writable": true,
|
|
213
|
+
"pda": {
|
|
214
|
+
"seeds": [
|
|
215
|
+
{
|
|
216
|
+
"kind": "const",
|
|
217
|
+
"value": [
|
|
218
|
+
101,
|
|
219
|
+
120,
|
|
220
|
+
116,
|
|
221
|
+
114,
|
|
222
|
+
97,
|
|
223
|
+
45,
|
|
224
|
+
97,
|
|
225
|
+
99,
|
|
226
|
+
99,
|
|
227
|
+
111,
|
|
228
|
+
117,
|
|
229
|
+
110,
|
|
230
|
+
116,
|
|
231
|
+
45,
|
|
232
|
+
109,
|
|
233
|
+
101,
|
|
234
|
+
116,
|
|
235
|
+
97,
|
|
236
|
+
115
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"kind": "account",
|
|
241
|
+
"path": "mint"
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "mint",
|
|
248
|
+
"docs": [
|
|
249
|
+
"The Token-2022 mint this hook applies to (YES or NO mint)"
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "hook_config",
|
|
254
|
+
"docs": [
|
|
255
|
+
"HookConfig \u2014 needed as extra account during execute"
|
|
256
|
+
],
|
|
257
|
+
"pda": {
|
|
258
|
+
"seeds": [
|
|
259
|
+
{
|
|
260
|
+
"kind": "const",
|
|
261
|
+
"value": [
|
|
262
|
+
104,
|
|
263
|
+
111,
|
|
264
|
+
111,
|
|
265
|
+
107,
|
|
266
|
+
95,
|
|
267
|
+
99,
|
|
268
|
+
111,
|
|
269
|
+
110,
|
|
270
|
+
102,
|
|
271
|
+
105,
|
|
272
|
+
103
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "token_program",
|
|
280
|
+
"address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"name": "system_program",
|
|
284
|
+
"address": "11111111111111111111111111111111"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"args": []
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"name": "initialize_hook_config",
|
|
291
|
+
"docs": [
|
|
292
|
+
"Initialize the global hook config with an initial whitelist.",
|
|
293
|
+
"Called once by admin after deployment."
|
|
294
|
+
],
|
|
295
|
+
"discriminator": [
|
|
296
|
+
144,
|
|
297
|
+
239,
|
|
298
|
+
17,
|
|
299
|
+
85,
|
|
300
|
+
228,
|
|
301
|
+
48,
|
|
302
|
+
54,
|
|
303
|
+
43
|
|
304
|
+
],
|
|
305
|
+
"accounts": [
|
|
306
|
+
{
|
|
307
|
+
"name": "owner",
|
|
308
|
+
"writable": true,
|
|
309
|
+
"signer": true
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"name": "hook_config",
|
|
313
|
+
"writable": true,
|
|
314
|
+
"pda": {
|
|
315
|
+
"seeds": [
|
|
316
|
+
{
|
|
317
|
+
"kind": "const",
|
|
318
|
+
"value": [
|
|
319
|
+
104,
|
|
320
|
+
111,
|
|
321
|
+
111,
|
|
322
|
+
107,
|
|
323
|
+
95,
|
|
324
|
+
99,
|
|
325
|
+
111,
|
|
326
|
+
110,
|
|
327
|
+
102,
|
|
328
|
+
105,
|
|
329
|
+
103
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "system_program",
|
|
337
|
+
"address": "11111111111111111111111111111111"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"args": [
|
|
341
|
+
{
|
|
342
|
+
"name": "initial_whitelist",
|
|
343
|
+
"type": {
|
|
344
|
+
"vec": "pubkey"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "remove_from_whitelist",
|
|
351
|
+
"docs": [
|
|
352
|
+
"Remove a program from the transfer whitelist."
|
|
353
|
+
],
|
|
354
|
+
"discriminator": [
|
|
355
|
+
7,
|
|
356
|
+
144,
|
|
357
|
+
216,
|
|
358
|
+
239,
|
|
359
|
+
243,
|
|
360
|
+
236,
|
|
361
|
+
193,
|
|
362
|
+
235
|
|
363
|
+
],
|
|
364
|
+
"accounts": [
|
|
365
|
+
{
|
|
366
|
+
"name": "owner",
|
|
367
|
+
"signer": true
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "hook_config",
|
|
371
|
+
"writable": true,
|
|
372
|
+
"pda": {
|
|
373
|
+
"seeds": [
|
|
374
|
+
{
|
|
375
|
+
"kind": "const",
|
|
376
|
+
"value": [
|
|
377
|
+
104,
|
|
378
|
+
111,
|
|
379
|
+
111,
|
|
380
|
+
107,
|
|
381
|
+
95,
|
|
382
|
+
99,
|
|
383
|
+
111,
|
|
384
|
+
110,
|
|
385
|
+
102,
|
|
386
|
+
105,
|
|
387
|
+
103
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
"args": [
|
|
395
|
+
{
|
|
396
|
+
"name": "program",
|
|
397
|
+
"type": "pubkey"
|
|
398
|
+
}
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
],
|
|
402
|
+
"accounts": [
|
|
403
|
+
{
|
|
404
|
+
"name": "HookConfig",
|
|
405
|
+
"discriminator": [
|
|
406
|
+
137,
|
|
407
|
+
155,
|
|
408
|
+
101,
|
|
409
|
+
95,
|
|
410
|
+
138,
|
|
411
|
+
72,
|
|
412
|
+
8,
|
|
413
|
+
182
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"types": [
|
|
418
|
+
{
|
|
419
|
+
"name": "HookConfig",
|
|
420
|
+
"docs": [
|
|
421
|
+
"Global config for the Hook program.",
|
|
422
|
+
"Stores the whitelist of programs allowed to transfer YES/NO Token-2022 tokens."
|
|
423
|
+
],
|
|
424
|
+
"type": {
|
|
425
|
+
"kind": "struct",
|
|
426
|
+
"fields": [
|
|
427
|
+
{
|
|
428
|
+
"name": "version",
|
|
429
|
+
"type": "u8"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"name": "owner",
|
|
433
|
+
"docs": [
|
|
434
|
+
"Owner who can update the whitelist"
|
|
435
|
+
],
|
|
436
|
+
"type": "pubkey"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"name": "whitelist",
|
|
440
|
+
"docs": [
|
|
441
|
+
"Programs allowed to initiate or receive YES/NO token transfers."
|
|
442
|
+
],
|
|
443
|
+
"type": {
|
|
444
|
+
"array": [
|
|
445
|
+
"pubkey",
|
|
446
|
+
10
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"name": "whitelist_len",
|
|
452
|
+
"type": "u8"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "is_frozen",
|
|
456
|
+
"docs": [
|
|
457
|
+
"If true, whitelist can no longer be modified (locked forever)"
|
|
458
|
+
],
|
|
459
|
+
"type": "bool"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"name": "bump",
|
|
463
|
+
"docs": [
|
|
464
|
+
"Bump for this PDA"
|
|
465
|
+
],
|
|
466
|
+
"type": "u8"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"name": "_reserved",
|
|
470
|
+
"type": {
|
|
471
|
+
"array": [
|
|
472
|
+
"u8",
|
|
473
|
+
64
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
]
|
|
481
|
+
}
|