northstar-eva-sdk 0.10.0 → 0.11.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/dist/cjs/northstar-eva-sdk.js +1574 -263
- package/dist/northstar-eva-sdk.d.ts +673 -73
- package/dist/northstar-eva-sdk.js +1573 -262
- package/package.json +14 -3
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.NorthstarEva = exports.EVA_IDL = exports.userTokenAccount = exports.trenchTokenVault = exports.tokenMintPda = exports.agentPda = exports.trenchPda = exports.globalStatePda = exports.withdrawalSinkPda = exports.depositReceiptPda = exports.delegationRecordPda = exports.feeVaultPda = exports.sessionPda = exports.encodeUndelegate = exports.encodeDelegate = exports.encodeDepositFee = exports.encodeCloseSession = exports.encodeOpenSession = exports.NETWORKS = exports.TOKEN_DECIMALS = exports.INITIAL_TOKEN_SUPPLY = exports.DEFAULT_EVA_PROGRAM_ID = exports.DEFAULT_PORTAL_PROGRAM_ID = exports.SESSION_OFFSETS = exports.SESSION_DISCRIMINATOR = exports.SESSION_LEN = exports.TRENCH_LEN = exports.TRENCH_OFFSETS = exports.BASIS_POINTS = exports.FEE_RATE_BPS = void 0;
|
|
36
|
+
exports.NorthstarEva = exports.EVA_IDL = exports.userTokenAccount = exports.trenchTokenVault = exports.tokenMintPda = exports.agentPda = exports.trenchPda = exports.globalStatePda = exports.withdrawalSinkPda = exports.depositReceiptPda = exports.delegationRecordPda = exports.feeVaultPda = exports.sessionPda = exports.encodeUndelegate = exports.encodeDelegate = exports.encodeDepositFee = exports.encodeCloseSession = exports.encodeOpenSession = exports.NETWORKS = exports.TOKEN_DECIMALS = exports.INITIAL_TOKEN_SUPPLY = exports.DEFAULT_EVA_PROGRAM_ID = exports.DEFAULT_PORTAL_PROGRAM_ID = exports.SESSION_OFFSETS = exports.SESSION_DISCRIMINATOR = exports.SESSION_LEN = exports.GLOBAL_STATE_LEN = exports.TRENCH_LEN = exports.TRENCH_OFFSETS = exports.BASIS_POINTS = exports.FEE_RATE_BPS = void 0;
|
|
37
37
|
exports.getBuyPrice = getBuyPrice;
|
|
38
38
|
exports.applyBuy = applyBuy;
|
|
39
39
|
exports.getSellPrice = getSellPrice;
|
|
@@ -67,119 +67,438 @@ const __EVA_IDL__ = {
|
|
|
67
67
|
"address": "CQru6EauVg2UwepFCvY5qWuqCPEWYC4ta43wBbkFYtmo",
|
|
68
68
|
"metadata": {
|
|
69
69
|
"name": "eva_arena",
|
|
70
|
-
"version": "0.1.
|
|
70
|
+
"version": "0.1.8",
|
|
71
71
|
"spec": "0.1.0",
|
|
72
72
|
"description": "Created with Anchor"
|
|
73
73
|
},
|
|
74
74
|
"instructions": [
|
|
75
75
|
{
|
|
76
76
|
"name": "buy",
|
|
77
|
-
"discriminator": [
|
|
77
|
+
"discriminator": [
|
|
78
|
+
102,
|
|
79
|
+
6,
|
|
80
|
+
61,
|
|
81
|
+
18,
|
|
82
|
+
1,
|
|
83
|
+
218,
|
|
84
|
+
235,
|
|
85
|
+
234
|
|
86
|
+
],
|
|
78
87
|
"accounts": [
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
{
|
|
89
|
+
"name": "trench",
|
|
90
|
+
"writable": true
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "global_state",
|
|
94
|
+
"writable": true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "fee_recipient",
|
|
98
|
+
"writable": true
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "user",
|
|
102
|
+
"writable": true,
|
|
103
|
+
"signer": true
|
|
104
|
+
},
|
|
83
105
|
{
|
|
84
106
|
"name": "trench_token_vault",
|
|
85
|
-
"docs": [
|
|
107
|
+
"docs": [
|
|
108
|
+
"Vault holding trench's tokens (ATA owned by trench)"
|
|
109
|
+
],
|
|
86
110
|
"writable": true,
|
|
87
111
|
"pda": {
|
|
88
112
|
"seeds": [
|
|
89
|
-
{
|
|
90
|
-
|
|
91
|
-
|
|
113
|
+
{
|
|
114
|
+
"kind": "account",
|
|
115
|
+
"path": "trench"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"kind": "const",
|
|
119
|
+
"value": [
|
|
120
|
+
6,
|
|
121
|
+
221,
|
|
122
|
+
246,
|
|
123
|
+
225,
|
|
124
|
+
215,
|
|
125
|
+
101,
|
|
126
|
+
161,
|
|
127
|
+
147,
|
|
128
|
+
217,
|
|
129
|
+
203,
|
|
130
|
+
225,
|
|
131
|
+
70,
|
|
132
|
+
206,
|
|
133
|
+
235,
|
|
134
|
+
121,
|
|
135
|
+
172,
|
|
136
|
+
28,
|
|
137
|
+
180,
|
|
138
|
+
133,
|
|
139
|
+
237,
|
|
140
|
+
95,
|
|
141
|
+
91,
|
|
142
|
+
55,
|
|
143
|
+
145,
|
|
144
|
+
58,
|
|
145
|
+
140,
|
|
146
|
+
245,
|
|
147
|
+
133,
|
|
148
|
+
126,
|
|
149
|
+
255,
|
|
150
|
+
0,
|
|
151
|
+
169
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"kind": "account",
|
|
156
|
+
"path": "trench.token_mint",
|
|
157
|
+
"account": "Trench"
|
|
158
|
+
}
|
|
92
159
|
],
|
|
93
160
|
"program": {
|
|
94
161
|
"kind": "const",
|
|
95
|
-
"value": [
|
|
162
|
+
"value": [
|
|
163
|
+
140,
|
|
164
|
+
151,
|
|
165
|
+
37,
|
|
166
|
+
143,
|
|
167
|
+
78,
|
|
168
|
+
36,
|
|
169
|
+
137,
|
|
170
|
+
241,
|
|
171
|
+
187,
|
|
172
|
+
61,
|
|
173
|
+
16,
|
|
174
|
+
41,
|
|
175
|
+
20,
|
|
176
|
+
142,
|
|
177
|
+
13,
|
|
178
|
+
131,
|
|
179
|
+
11,
|
|
180
|
+
90,
|
|
181
|
+
19,
|
|
182
|
+
153,
|
|
183
|
+
218,
|
|
184
|
+
255,
|
|
185
|
+
16,
|
|
186
|
+
132,
|
|
187
|
+
4,
|
|
188
|
+
142,
|
|
189
|
+
123,
|
|
190
|
+
216,
|
|
191
|
+
219,
|
|
192
|
+
233,
|
|
193
|
+
248,
|
|
194
|
+
89
|
|
195
|
+
]
|
|
96
196
|
}
|
|
97
197
|
}
|
|
98
198
|
},
|
|
99
|
-
{
|
|
100
|
-
|
|
101
|
-
|
|
199
|
+
{
|
|
200
|
+
"name": "user_token_account",
|
|
201
|
+
"docs": [
|
|
202
|
+
"User's token account (must match trench's token mint)"
|
|
203
|
+
],
|
|
204
|
+
"writable": true
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "system_program",
|
|
208
|
+
"address": "11111111111111111111111111111111"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "token_program",
|
|
212
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
213
|
+
}
|
|
102
214
|
],
|
|
103
215
|
"args": [
|
|
104
|
-
{
|
|
105
|
-
|
|
216
|
+
{
|
|
217
|
+
"name": "sol_pay_with_fee",
|
|
218
|
+
"type": "u64"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "think_id",
|
|
222
|
+
"type": "u64"
|
|
223
|
+
}
|
|
106
224
|
]
|
|
107
225
|
},
|
|
108
226
|
{
|
|
109
227
|
"name": "claim_tokens",
|
|
110
|
-
"discriminator": [
|
|
228
|
+
"discriminator": [
|
|
229
|
+
108,
|
|
230
|
+
216,
|
|
231
|
+
210,
|
|
232
|
+
231,
|
|
233
|
+
0,
|
|
234
|
+
212,
|
|
235
|
+
42,
|
|
236
|
+
64
|
|
237
|
+
],
|
|
111
238
|
"accounts": [
|
|
112
239
|
{
|
|
113
240
|
"name": "global_state",
|
|
114
|
-
"pda": {
|
|
241
|
+
"pda": {
|
|
242
|
+
"seeds": [
|
|
243
|
+
{
|
|
244
|
+
"kind": "const",
|
|
245
|
+
"value": [
|
|
246
|
+
103,
|
|
247
|
+
108,
|
|
248
|
+
111,
|
|
249
|
+
98,
|
|
250
|
+
97,
|
|
251
|
+
108
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "trench",
|
|
259
|
+
"writable": true
|
|
115
260
|
},
|
|
116
|
-
{ "name": "trench", "writable": true },
|
|
117
261
|
{
|
|
118
262
|
"name": "agent",
|
|
119
263
|
"writable": true,
|
|
120
264
|
"pda": {
|
|
121
265
|
"seeds": [
|
|
122
|
-
{
|
|
123
|
-
|
|
124
|
-
|
|
266
|
+
{
|
|
267
|
+
"kind": "const",
|
|
268
|
+
"value": [
|
|
269
|
+
97,
|
|
270
|
+
103,
|
|
271
|
+
101,
|
|
272
|
+
110,
|
|
273
|
+
116
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"kind": "account",
|
|
278
|
+
"path": "trench"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"kind": "account",
|
|
282
|
+
"path": "user"
|
|
283
|
+
}
|
|
125
284
|
]
|
|
126
285
|
}
|
|
127
286
|
},
|
|
128
|
-
{
|
|
129
|
-
|
|
287
|
+
{
|
|
288
|
+
"name": "user"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "back_authority",
|
|
292
|
+
"docs": [
|
|
293
|
+
"back_authority who can claim tokens for user"
|
|
294
|
+
],
|
|
295
|
+
"writable": true,
|
|
296
|
+
"signer": true
|
|
297
|
+
},
|
|
130
298
|
{
|
|
131
299
|
"name": "trench_token_vault",
|
|
132
300
|
"writable": true,
|
|
133
301
|
"pda": {
|
|
134
302
|
"seeds": [
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
|
|
303
|
+
{
|
|
304
|
+
"kind": "account",
|
|
305
|
+
"path": "trench"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"kind": "const",
|
|
309
|
+
"value": [
|
|
310
|
+
6,
|
|
311
|
+
221,
|
|
312
|
+
246,
|
|
313
|
+
225,
|
|
314
|
+
215,
|
|
315
|
+
101,
|
|
316
|
+
161,
|
|
317
|
+
147,
|
|
318
|
+
217,
|
|
319
|
+
203,
|
|
320
|
+
225,
|
|
321
|
+
70,
|
|
322
|
+
206,
|
|
323
|
+
235,
|
|
324
|
+
121,
|
|
325
|
+
172,
|
|
326
|
+
28,
|
|
327
|
+
180,
|
|
328
|
+
133,
|
|
329
|
+
237,
|
|
330
|
+
95,
|
|
331
|
+
91,
|
|
332
|
+
55,
|
|
333
|
+
145,
|
|
334
|
+
58,
|
|
335
|
+
140,
|
|
336
|
+
245,
|
|
337
|
+
133,
|
|
338
|
+
126,
|
|
339
|
+
255,
|
|
340
|
+
0,
|
|
341
|
+
169
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"kind": "account",
|
|
346
|
+
"path": "trench.token_mint",
|
|
347
|
+
"account": "Trench"
|
|
348
|
+
}
|
|
138
349
|
],
|
|
139
350
|
"program": {
|
|
140
351
|
"kind": "const",
|
|
141
|
-
"value": [
|
|
352
|
+
"value": [
|
|
353
|
+
140,
|
|
354
|
+
151,
|
|
355
|
+
37,
|
|
356
|
+
143,
|
|
357
|
+
78,
|
|
358
|
+
36,
|
|
359
|
+
137,
|
|
360
|
+
241,
|
|
361
|
+
187,
|
|
362
|
+
61,
|
|
363
|
+
16,
|
|
364
|
+
41,
|
|
365
|
+
20,
|
|
366
|
+
142,
|
|
367
|
+
13,
|
|
368
|
+
131,
|
|
369
|
+
11,
|
|
370
|
+
90,
|
|
371
|
+
19,
|
|
372
|
+
153,
|
|
373
|
+
218,
|
|
374
|
+
255,
|
|
375
|
+
16,
|
|
376
|
+
132,
|
|
377
|
+
4,
|
|
378
|
+
142,
|
|
379
|
+
123,
|
|
380
|
+
216,
|
|
381
|
+
219,
|
|
382
|
+
233,
|
|
383
|
+
248,
|
|
384
|
+
89
|
|
385
|
+
]
|
|
142
386
|
}
|
|
143
387
|
}
|
|
144
388
|
},
|
|
145
|
-
{
|
|
146
|
-
|
|
389
|
+
{
|
|
390
|
+
"name": "user_token_account",
|
|
391
|
+
"writable": true
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "token_program",
|
|
395
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
396
|
+
}
|
|
147
397
|
],
|
|
148
398
|
"args": []
|
|
149
399
|
},
|
|
150
400
|
{
|
|
151
401
|
"name": "close_pool",
|
|
152
|
-
"discriminator": [
|
|
402
|
+
"discriminator": [
|
|
403
|
+
140,
|
|
404
|
+
189,
|
|
405
|
+
209,
|
|
406
|
+
23,
|
|
407
|
+
239,
|
|
408
|
+
62,
|
|
409
|
+
239,
|
|
410
|
+
11
|
|
411
|
+
],
|
|
153
412
|
"accounts": [
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{
|
|
413
|
+
{
|
|
414
|
+
"name": "trench",
|
|
415
|
+
"writable": true
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "global_state",
|
|
419
|
+
"writable": true
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"name": "fee_recipient",
|
|
423
|
+
"writable": true
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "back_authority",
|
|
427
|
+
"writable": true,
|
|
428
|
+
"signer": true
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"name": "system_program",
|
|
432
|
+
"address": "11111111111111111111111111111111"
|
|
433
|
+
}
|
|
159
434
|
],
|
|
160
435
|
"args": []
|
|
161
436
|
},
|
|
162
437
|
{
|
|
163
438
|
"name": "close_trench",
|
|
164
|
-
"discriminator": [
|
|
439
|
+
"discriminator": [
|
|
440
|
+
249,
|
|
441
|
+
176,
|
|
442
|
+
185,
|
|
443
|
+
73,
|
|
444
|
+
24,
|
|
445
|
+
59,
|
|
446
|
+
234,
|
|
447
|
+
84
|
|
448
|
+
],
|
|
165
449
|
"accounts": [
|
|
166
|
-
{
|
|
167
|
-
|
|
450
|
+
{
|
|
451
|
+
"name": "trench",
|
|
452
|
+
"writable": true
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "creator",
|
|
456
|
+
"writable": true,
|
|
457
|
+
"signer": true,
|
|
458
|
+
"relations": [
|
|
459
|
+
"trench"
|
|
460
|
+
]
|
|
461
|
+
}
|
|
168
462
|
],
|
|
169
463
|
"args": []
|
|
170
464
|
},
|
|
171
465
|
{
|
|
172
466
|
"name": "create_trench",
|
|
173
|
-
"discriminator": [
|
|
467
|
+
"discriminator": [
|
|
468
|
+
66,
|
|
469
|
+
74,
|
|
470
|
+
73,
|
|
471
|
+
171,
|
|
472
|
+
206,
|
|
473
|
+
39,
|
|
474
|
+
116,
|
|
475
|
+
230
|
|
476
|
+
],
|
|
174
477
|
"accounts": [
|
|
175
|
-
{
|
|
478
|
+
{
|
|
479
|
+
"name": "global_state",
|
|
480
|
+
"writable": true
|
|
481
|
+
},
|
|
176
482
|
{
|
|
177
483
|
"name": "trench",
|
|
178
484
|
"writable": true,
|
|
179
485
|
"pda": {
|
|
180
486
|
"seeds": [
|
|
181
|
-
{
|
|
182
|
-
|
|
487
|
+
{
|
|
488
|
+
"kind": "const",
|
|
489
|
+
"value": [
|
|
490
|
+
116,
|
|
491
|
+
114,
|
|
492
|
+
101,
|
|
493
|
+
110,
|
|
494
|
+
99,
|
|
495
|
+
104
|
|
496
|
+
]
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"kind": "arg",
|
|
500
|
+
"path": "id"
|
|
501
|
+
}
|
|
183
502
|
]
|
|
184
503
|
}
|
|
185
504
|
},
|
|
@@ -188,8 +507,19 @@ const __EVA_IDL__ = {
|
|
|
188
507
|
"writable": true,
|
|
189
508
|
"pda": {
|
|
190
509
|
"seeds": [
|
|
191
|
-
{
|
|
192
|
-
|
|
510
|
+
{
|
|
511
|
+
"kind": "const",
|
|
512
|
+
"value": [
|
|
513
|
+
109,
|
|
514
|
+
105,
|
|
515
|
+
110,
|
|
516
|
+
116
|
|
517
|
+
]
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"kind": "account",
|
|
521
|
+
"path": "trench"
|
|
522
|
+
}
|
|
193
523
|
]
|
|
194
524
|
}
|
|
195
525
|
},
|
|
@@ -198,204 +528,870 @@ const __EVA_IDL__ = {
|
|
|
198
528
|
"writable": true,
|
|
199
529
|
"pda": {
|
|
200
530
|
"seeds": [
|
|
201
|
-
{
|
|
202
|
-
|
|
203
|
-
|
|
531
|
+
{
|
|
532
|
+
"kind": "account",
|
|
533
|
+
"path": "trench"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"kind": "const",
|
|
537
|
+
"value": [
|
|
538
|
+
6,
|
|
539
|
+
221,
|
|
540
|
+
246,
|
|
541
|
+
225,
|
|
542
|
+
215,
|
|
543
|
+
101,
|
|
544
|
+
161,
|
|
545
|
+
147,
|
|
546
|
+
217,
|
|
547
|
+
203,
|
|
548
|
+
225,
|
|
549
|
+
70,
|
|
550
|
+
206,
|
|
551
|
+
235,
|
|
552
|
+
121,
|
|
553
|
+
172,
|
|
554
|
+
28,
|
|
555
|
+
180,
|
|
556
|
+
133,
|
|
557
|
+
237,
|
|
558
|
+
95,
|
|
559
|
+
91,
|
|
560
|
+
55,
|
|
561
|
+
145,
|
|
562
|
+
58,
|
|
563
|
+
140,
|
|
564
|
+
245,
|
|
565
|
+
133,
|
|
566
|
+
126,
|
|
567
|
+
255,
|
|
568
|
+
0,
|
|
569
|
+
169
|
|
570
|
+
]
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"kind": "account",
|
|
574
|
+
"path": "token_mint"
|
|
575
|
+
}
|
|
204
576
|
],
|
|
205
577
|
"program": {
|
|
206
578
|
"kind": "const",
|
|
207
|
-
"value": [
|
|
579
|
+
"value": [
|
|
580
|
+
140,
|
|
581
|
+
151,
|
|
582
|
+
37,
|
|
583
|
+
143,
|
|
584
|
+
78,
|
|
585
|
+
36,
|
|
586
|
+
137,
|
|
587
|
+
241,
|
|
588
|
+
187,
|
|
589
|
+
61,
|
|
590
|
+
16,
|
|
591
|
+
41,
|
|
592
|
+
20,
|
|
593
|
+
142,
|
|
594
|
+
13,
|
|
595
|
+
131,
|
|
596
|
+
11,
|
|
597
|
+
90,
|
|
598
|
+
19,
|
|
599
|
+
153,
|
|
600
|
+
218,
|
|
601
|
+
255,
|
|
602
|
+
16,
|
|
603
|
+
132,
|
|
604
|
+
4,
|
|
605
|
+
142,
|
|
606
|
+
123,
|
|
607
|
+
216,
|
|
608
|
+
219,
|
|
609
|
+
233,
|
|
610
|
+
248,
|
|
611
|
+
89
|
|
612
|
+
]
|
|
208
613
|
}
|
|
209
614
|
}
|
|
210
615
|
},
|
|
211
|
-
{
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
616
|
+
{
|
|
617
|
+
"name": "creator",
|
|
618
|
+
"writable": true,
|
|
619
|
+
"signer": true
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"name": "system_program",
|
|
623
|
+
"address": "11111111111111111111111111111111"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"name": "token_program",
|
|
627
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "associated_token_program",
|
|
631
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"name": "rent",
|
|
635
|
+
"address": "SysvarRent111111111111111111111111111111111"
|
|
636
|
+
}
|
|
216
637
|
],
|
|
217
638
|
"args": [
|
|
218
|
-
{
|
|
219
|
-
|
|
639
|
+
{
|
|
640
|
+
"name": "id",
|
|
641
|
+
"type": "u64"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"name": "initial_virtual_token_reserves",
|
|
645
|
+
"type": "u64"
|
|
646
|
+
}
|
|
220
647
|
]
|
|
221
648
|
},
|
|
222
649
|
{
|
|
223
650
|
"name": "deposit",
|
|
224
|
-
"discriminator": [
|
|
651
|
+
"discriminator": [
|
|
652
|
+
242,
|
|
653
|
+
35,
|
|
654
|
+
198,
|
|
655
|
+
137,
|
|
656
|
+
82,
|
|
657
|
+
225,
|
|
658
|
+
242,
|
|
659
|
+
182
|
|
660
|
+
],
|
|
225
661
|
"accounts": [
|
|
226
|
-
{
|
|
662
|
+
{
|
|
663
|
+
"name": "trench",
|
|
664
|
+
"writable": true
|
|
665
|
+
},
|
|
227
666
|
{
|
|
228
667
|
"name": "agent",
|
|
229
668
|
"writable": true,
|
|
230
669
|
"pda": {
|
|
231
670
|
"seeds": [
|
|
232
|
-
{
|
|
233
|
-
|
|
234
|
-
|
|
671
|
+
{
|
|
672
|
+
"kind": "const",
|
|
673
|
+
"value": [
|
|
674
|
+
97,
|
|
675
|
+
103,
|
|
676
|
+
101,
|
|
677
|
+
110,
|
|
678
|
+
116
|
|
679
|
+
]
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
"kind": "account",
|
|
683
|
+
"path": "trench"
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"kind": "account",
|
|
687
|
+
"path": "user"
|
|
688
|
+
}
|
|
235
689
|
]
|
|
236
690
|
}
|
|
237
691
|
},
|
|
238
|
-
{
|
|
239
|
-
|
|
692
|
+
{
|
|
693
|
+
"name": "user",
|
|
694
|
+
"writable": true,
|
|
695
|
+
"signer": true
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"name": "system_program",
|
|
699
|
+
"address": "11111111111111111111111111111111"
|
|
700
|
+
}
|
|
240
701
|
],
|
|
241
702
|
"args": [
|
|
242
|
-
{
|
|
243
|
-
|
|
703
|
+
{
|
|
704
|
+
"name": "amount",
|
|
705
|
+
"type": "u64"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"name": "think_id",
|
|
709
|
+
"type": "u64"
|
|
710
|
+
}
|
|
244
711
|
]
|
|
245
712
|
},
|
|
246
713
|
{
|
|
247
714
|
"name": "distribute_prize",
|
|
248
|
-
"discriminator": [
|
|
715
|
+
"discriminator": [
|
|
716
|
+
153,
|
|
717
|
+
175,
|
|
718
|
+
67,
|
|
719
|
+
111,
|
|
720
|
+
205,
|
|
721
|
+
207,
|
|
722
|
+
106,
|
|
723
|
+
15
|
|
724
|
+
],
|
|
249
725
|
"accounts": [
|
|
250
|
-
{
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
{
|
|
726
|
+
{
|
|
727
|
+
"name": "trench",
|
|
728
|
+
"writable": true
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"name": "global_state",
|
|
732
|
+
"writable": true
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
"name": "fee_recipient",
|
|
736
|
+
"writable": true
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
"name": "back_authority",
|
|
740
|
+
"writable": true,
|
|
741
|
+
"signer": true
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"name": "system_program",
|
|
745
|
+
"address": "11111111111111111111111111111111"
|
|
746
|
+
}
|
|
255
747
|
],
|
|
256
748
|
"args": [
|
|
257
|
-
{
|
|
258
|
-
|
|
749
|
+
{
|
|
750
|
+
"name": "winners",
|
|
751
|
+
"type": {
|
|
752
|
+
"vec": "pubkey"
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"name": "amounts",
|
|
757
|
+
"type": {
|
|
758
|
+
"vec": "u64"
|
|
759
|
+
}
|
|
760
|
+
}
|
|
259
761
|
]
|
|
260
762
|
},
|
|
261
763
|
{
|
|
262
764
|
"name": "finalize",
|
|
263
|
-
"discriminator": [
|
|
765
|
+
"discriminator": [
|
|
766
|
+
171,
|
|
767
|
+
61,
|
|
768
|
+
218,
|
|
769
|
+
56,
|
|
770
|
+
127,
|
|
771
|
+
115,
|
|
772
|
+
12,
|
|
773
|
+
217
|
|
774
|
+
],
|
|
264
775
|
"accounts": [
|
|
265
|
-
{
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
{
|
|
270
|
-
|
|
271
|
-
|
|
776
|
+
{
|
|
777
|
+
"name": "trench",
|
|
778
|
+
"writable": true
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"name": "global_state",
|
|
782
|
+
"writable": true
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
"name": "fee_recipient",
|
|
786
|
+
"writable": true
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"name": "back_authority",
|
|
790
|
+
"writable": true,
|
|
791
|
+
"signer": true
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"name": "system_program",
|
|
795
|
+
"address": "11111111111111111111111111111111"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"name": "token_program",
|
|
799
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"name": "rent",
|
|
803
|
+
"address": "SysvarRent111111111111111111111111111111111"
|
|
804
|
+
}
|
|
272
805
|
],
|
|
273
806
|
"args": []
|
|
274
807
|
},
|
|
275
808
|
{
|
|
276
809
|
"name": "initialize",
|
|
277
|
-
"discriminator": [
|
|
810
|
+
"discriminator": [
|
|
811
|
+
175,
|
|
812
|
+
175,
|
|
813
|
+
109,
|
|
814
|
+
31,
|
|
815
|
+
13,
|
|
816
|
+
152,
|
|
817
|
+
155,
|
|
818
|
+
237
|
|
819
|
+
],
|
|
278
820
|
"accounts": [
|
|
279
821
|
{
|
|
280
822
|
"name": "global_state",
|
|
281
823
|
"writable": true,
|
|
282
|
-
"pda": {
|
|
824
|
+
"pda": {
|
|
825
|
+
"seeds": [
|
|
826
|
+
{
|
|
827
|
+
"kind": "const",
|
|
828
|
+
"value": [
|
|
829
|
+
103,
|
|
830
|
+
108,
|
|
831
|
+
111,
|
|
832
|
+
98,
|
|
833
|
+
97,
|
|
834
|
+
108
|
|
835
|
+
]
|
|
836
|
+
}
|
|
837
|
+
]
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"name": "admin",
|
|
842
|
+
"writable": true,
|
|
843
|
+
"signer": true
|
|
283
844
|
},
|
|
284
|
-
{
|
|
285
|
-
|
|
845
|
+
{
|
|
846
|
+
"name": "system_program",
|
|
847
|
+
"address": "11111111111111111111111111111111"
|
|
848
|
+
}
|
|
286
849
|
],
|
|
287
850
|
"args": [
|
|
288
|
-
{
|
|
289
|
-
|
|
851
|
+
{
|
|
852
|
+
"name": "bidding_duration",
|
|
853
|
+
"type": "u64"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"name": "trading_duration",
|
|
857
|
+
"type": "u64"
|
|
858
|
+
}
|
|
290
859
|
]
|
|
291
860
|
},
|
|
292
861
|
{
|
|
293
862
|
"name": "sell",
|
|
294
|
-
"discriminator": [
|
|
863
|
+
"discriminator": [
|
|
864
|
+
51,
|
|
865
|
+
230,
|
|
866
|
+
133,
|
|
867
|
+
164,
|
|
868
|
+
1,
|
|
869
|
+
127,
|
|
870
|
+
131,
|
|
871
|
+
173
|
|
872
|
+
],
|
|
295
873
|
"accounts": [
|
|
296
|
-
{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
874
|
+
{
|
|
875
|
+
"name": "trench",
|
|
876
|
+
"writable": true
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"name": "global_state",
|
|
880
|
+
"writable": true
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
"name": "fee_recipient",
|
|
884
|
+
"writable": true
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"name": "user",
|
|
888
|
+
"writable": true,
|
|
889
|
+
"signer": true
|
|
890
|
+
},
|
|
300
891
|
{
|
|
301
892
|
"name": "trench_token_vault",
|
|
302
|
-
"docs": [
|
|
893
|
+
"docs": [
|
|
894
|
+
"Vault holding trench's tokens (ATA owned by trench)"
|
|
895
|
+
],
|
|
303
896
|
"writable": true,
|
|
304
897
|
"pda": {
|
|
305
898
|
"seeds": [
|
|
306
|
-
{
|
|
307
|
-
|
|
308
|
-
|
|
899
|
+
{
|
|
900
|
+
"kind": "account",
|
|
901
|
+
"path": "trench"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"kind": "const",
|
|
905
|
+
"value": [
|
|
906
|
+
6,
|
|
907
|
+
221,
|
|
908
|
+
246,
|
|
909
|
+
225,
|
|
910
|
+
215,
|
|
911
|
+
101,
|
|
912
|
+
161,
|
|
913
|
+
147,
|
|
914
|
+
217,
|
|
915
|
+
203,
|
|
916
|
+
225,
|
|
917
|
+
70,
|
|
918
|
+
206,
|
|
919
|
+
235,
|
|
920
|
+
121,
|
|
921
|
+
172,
|
|
922
|
+
28,
|
|
923
|
+
180,
|
|
924
|
+
133,
|
|
925
|
+
237,
|
|
926
|
+
95,
|
|
927
|
+
91,
|
|
928
|
+
55,
|
|
929
|
+
145,
|
|
930
|
+
58,
|
|
931
|
+
140,
|
|
932
|
+
245,
|
|
933
|
+
133,
|
|
934
|
+
126,
|
|
935
|
+
255,
|
|
936
|
+
0,
|
|
937
|
+
169
|
|
938
|
+
]
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"kind": "account",
|
|
942
|
+
"path": "trench.token_mint",
|
|
943
|
+
"account": "Trench"
|
|
944
|
+
}
|
|
309
945
|
],
|
|
310
946
|
"program": {
|
|
311
947
|
"kind": "const",
|
|
312
|
-
"value": [
|
|
948
|
+
"value": [
|
|
949
|
+
140,
|
|
950
|
+
151,
|
|
951
|
+
37,
|
|
952
|
+
143,
|
|
953
|
+
78,
|
|
954
|
+
36,
|
|
955
|
+
137,
|
|
956
|
+
241,
|
|
957
|
+
187,
|
|
958
|
+
61,
|
|
959
|
+
16,
|
|
960
|
+
41,
|
|
961
|
+
20,
|
|
962
|
+
142,
|
|
963
|
+
13,
|
|
964
|
+
131,
|
|
965
|
+
11,
|
|
966
|
+
90,
|
|
967
|
+
19,
|
|
968
|
+
153,
|
|
969
|
+
218,
|
|
970
|
+
255,
|
|
971
|
+
16,
|
|
972
|
+
132,
|
|
973
|
+
4,
|
|
974
|
+
142,
|
|
975
|
+
123,
|
|
976
|
+
216,
|
|
977
|
+
219,
|
|
978
|
+
233,
|
|
979
|
+
248,
|
|
980
|
+
89
|
|
981
|
+
]
|
|
313
982
|
}
|
|
314
983
|
}
|
|
315
984
|
},
|
|
316
|
-
{
|
|
317
|
-
|
|
985
|
+
{
|
|
986
|
+
"name": "user_token_account",
|
|
987
|
+
"docs": [
|
|
988
|
+
"User's token account (must match trench's token mint)"
|
|
989
|
+
],
|
|
990
|
+
"writable": true
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
"name": "token_program",
|
|
994
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
995
|
+
}
|
|
318
996
|
],
|
|
319
997
|
"args": [
|
|
320
|
-
{
|
|
321
|
-
|
|
322
|
-
|
|
998
|
+
{
|
|
999
|
+
"name": "amount_in",
|
|
1000
|
+
"type": "u64"
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
"name": "min_sol_output",
|
|
1004
|
+
"type": "u64"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"name": "think_id",
|
|
1008
|
+
"type": "u64"
|
|
1009
|
+
}
|
|
323
1010
|
]
|
|
324
1011
|
},
|
|
325
1012
|
{
|
|
326
1013
|
"name": "update_config",
|
|
327
|
-
"discriminator": [
|
|
1014
|
+
"discriminator": [
|
|
1015
|
+
29,
|
|
1016
|
+
158,
|
|
1017
|
+
252,
|
|
1018
|
+
191,
|
|
1019
|
+
10,
|
|
1020
|
+
83,
|
|
1021
|
+
219,
|
|
1022
|
+
99
|
|
1023
|
+
],
|
|
328
1024
|
"accounts": [
|
|
329
1025
|
{
|
|
330
1026
|
"name": "global_state",
|
|
331
1027
|
"writable": true,
|
|
332
|
-
"pda": {
|
|
1028
|
+
"pda": {
|
|
1029
|
+
"seeds": [
|
|
1030
|
+
{
|
|
1031
|
+
"kind": "const",
|
|
1032
|
+
"value": [
|
|
1033
|
+
103,
|
|
1034
|
+
108,
|
|
1035
|
+
111,
|
|
1036
|
+
98,
|
|
1037
|
+
97,
|
|
1038
|
+
108
|
|
1039
|
+
]
|
|
1040
|
+
}
|
|
1041
|
+
]
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
"name": "admin",
|
|
1046
|
+
"writable": true,
|
|
1047
|
+
"signer": true
|
|
333
1048
|
},
|
|
334
|
-
{
|
|
1049
|
+
{
|
|
1050
|
+
"name": "system_program",
|
|
1051
|
+
"address": "11111111111111111111111111111111"
|
|
1052
|
+
}
|
|
335
1053
|
],
|
|
336
1054
|
"args": [
|
|
337
|
-
{
|
|
338
|
-
|
|
339
|
-
|
|
1055
|
+
{
|
|
1056
|
+
"name": "bidding_duration",
|
|
1057
|
+
"type": "u64"
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
"name": "trading_duration",
|
|
1061
|
+
"type": "u64"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"name": "fee_recipient",
|
|
1065
|
+
"type": "pubkey"
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
"name": "back_authority",
|
|
1069
|
+
"type": "pubkey"
|
|
1070
|
+
}
|
|
340
1071
|
]
|
|
341
1072
|
},
|
|
342
1073
|
{
|
|
343
1074
|
"name": "withdraw",
|
|
344
|
-
"discriminator": [
|
|
1075
|
+
"discriminator": [
|
|
1076
|
+
183,
|
|
1077
|
+
18,
|
|
1078
|
+
70,
|
|
1079
|
+
156,
|
|
1080
|
+
148,
|
|
1081
|
+
109,
|
|
1082
|
+
161,
|
|
1083
|
+
34
|
|
1084
|
+
],
|
|
345
1085
|
"accounts": [
|
|
346
|
-
{
|
|
1086
|
+
{
|
|
1087
|
+
"name": "trench",
|
|
1088
|
+
"writable": true
|
|
1089
|
+
},
|
|
347
1090
|
{
|
|
348
1091
|
"name": "agent",
|
|
349
1092
|
"writable": true,
|
|
350
1093
|
"pda": {
|
|
351
1094
|
"seeds": [
|
|
352
|
-
{
|
|
353
|
-
|
|
354
|
-
|
|
1095
|
+
{
|
|
1096
|
+
"kind": "const",
|
|
1097
|
+
"value": [
|
|
1098
|
+
97,
|
|
1099
|
+
103,
|
|
1100
|
+
101,
|
|
1101
|
+
110,
|
|
1102
|
+
116
|
|
1103
|
+
]
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
"kind": "account",
|
|
1107
|
+
"path": "trench"
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
"kind": "account",
|
|
1111
|
+
"path": "user"
|
|
1112
|
+
}
|
|
355
1113
|
]
|
|
356
1114
|
}
|
|
357
1115
|
},
|
|
358
|
-
{
|
|
359
|
-
|
|
1116
|
+
{
|
|
1117
|
+
"name": "user",
|
|
1118
|
+
"writable": true,
|
|
1119
|
+
"signer": true
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"name": "system_program",
|
|
1123
|
+
"address": "11111111111111111111111111111111"
|
|
1124
|
+
}
|
|
360
1125
|
],
|
|
361
1126
|
"args": [
|
|
362
|
-
{
|
|
363
|
-
|
|
1127
|
+
{
|
|
1128
|
+
"name": "amount",
|
|
1129
|
+
"type": "u64"
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
"name": "think_id",
|
|
1133
|
+
"type": "u64"
|
|
1134
|
+
}
|
|
364
1135
|
]
|
|
365
1136
|
}
|
|
366
1137
|
],
|
|
367
1138
|
"accounts": [
|
|
368
|
-
{
|
|
369
|
-
|
|
370
|
-
|
|
1139
|
+
{
|
|
1140
|
+
"name": "Agent",
|
|
1141
|
+
"discriminator": [
|
|
1142
|
+
47,
|
|
1143
|
+
166,
|
|
1144
|
+
112,
|
|
1145
|
+
147,
|
|
1146
|
+
155,
|
|
1147
|
+
197,
|
|
1148
|
+
86,
|
|
1149
|
+
7
|
|
1150
|
+
]
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
"name": "GlobalState",
|
|
1154
|
+
"discriminator": [
|
|
1155
|
+
163,
|
|
1156
|
+
46,
|
|
1157
|
+
74,
|
|
1158
|
+
168,
|
|
1159
|
+
216,
|
|
1160
|
+
123,
|
|
1161
|
+
133,
|
|
1162
|
+
98
|
|
1163
|
+
]
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
"name": "Trench",
|
|
1167
|
+
"discriminator": [
|
|
1168
|
+
70,
|
|
1169
|
+
8,
|
|
1170
|
+
211,
|
|
1171
|
+
194,
|
|
1172
|
+
255,
|
|
1173
|
+
64,
|
|
1174
|
+
8,
|
|
1175
|
+
102
|
|
1176
|
+
]
|
|
1177
|
+
}
|
|
371
1178
|
],
|
|
372
1179
|
"events": [
|
|
373
|
-
{
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
1180
|
+
{
|
|
1181
|
+
"name": "BuyEvent",
|
|
1182
|
+
"discriminator": [
|
|
1183
|
+
103,
|
|
1184
|
+
244,
|
|
1185
|
+
82,
|
|
1186
|
+
31,
|
|
1187
|
+
44,
|
|
1188
|
+
245,
|
|
1189
|
+
119,
|
|
1190
|
+
119
|
|
1191
|
+
]
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
"name": "ClaimTokensEvent",
|
|
1195
|
+
"discriminator": [
|
|
1196
|
+
71,
|
|
1197
|
+
156,
|
|
1198
|
+
103,
|
|
1199
|
+
32,
|
|
1200
|
+
16,
|
|
1201
|
+
211,
|
|
1202
|
+
150,
|
|
1203
|
+
191
|
|
1204
|
+
]
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
"name": "ClosePoolEvent",
|
|
1208
|
+
"discriminator": [
|
|
1209
|
+
242,
|
|
1210
|
+
151,
|
|
1211
|
+
109,
|
|
1212
|
+
158,
|
|
1213
|
+
250,
|
|
1214
|
+
231,
|
|
1215
|
+
235,
|
|
1216
|
+
140
|
|
1217
|
+
]
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
"name": "CloseTrenchEvent",
|
|
1221
|
+
"discriminator": [
|
|
1222
|
+
81,
|
|
1223
|
+
249,
|
|
1224
|
+
10,
|
|
1225
|
+
69,
|
|
1226
|
+
147,
|
|
1227
|
+
183,
|
|
1228
|
+
102,
|
|
1229
|
+
136
|
|
1230
|
+
]
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
"name": "CreateTrenchEvent",
|
|
1234
|
+
"discriminator": [
|
|
1235
|
+
24,
|
|
1236
|
+
172,
|
|
1237
|
+
85,
|
|
1238
|
+
31,
|
|
1239
|
+
101,
|
|
1240
|
+
75,
|
|
1241
|
+
32,
|
|
1242
|
+
122
|
|
1243
|
+
]
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"name": "DepositEvent",
|
|
1247
|
+
"discriminator": [
|
|
1248
|
+
120,
|
|
1249
|
+
248,
|
|
1250
|
+
61,
|
|
1251
|
+
83,
|
|
1252
|
+
31,
|
|
1253
|
+
142,
|
|
1254
|
+
107,
|
|
1255
|
+
144
|
|
1256
|
+
]
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
"name": "DistributePrizeEvent",
|
|
1260
|
+
"discriminator": [
|
|
1261
|
+
10,
|
|
1262
|
+
83,
|
|
1263
|
+
171,
|
|
1264
|
+
140,
|
|
1265
|
+
12,
|
|
1266
|
+
201,
|
|
1267
|
+
34,
|
|
1268
|
+
128
|
|
1269
|
+
]
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
"name": "FinalizeEvent",
|
|
1273
|
+
"discriminator": [
|
|
1274
|
+
115,
|
|
1275
|
+
140,
|
|
1276
|
+
131,
|
|
1277
|
+
4,
|
|
1278
|
+
181,
|
|
1279
|
+
52,
|
|
1280
|
+
170,
|
|
1281
|
+
148
|
|
1282
|
+
]
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
"name": "InitializeEvent",
|
|
1286
|
+
"discriminator": [
|
|
1287
|
+
206,
|
|
1288
|
+
175,
|
|
1289
|
+
169,
|
|
1290
|
+
208,
|
|
1291
|
+
241,
|
|
1292
|
+
210,
|
|
1293
|
+
35,
|
|
1294
|
+
221
|
|
1295
|
+
]
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
"name": "SellEvent",
|
|
1299
|
+
"discriminator": [
|
|
1300
|
+
62,
|
|
1301
|
+
47,
|
|
1302
|
+
55,
|
|
1303
|
+
10,
|
|
1304
|
+
165,
|
|
1305
|
+
3,
|
|
1306
|
+
220,
|
|
1307
|
+
42
|
|
1308
|
+
]
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
"name": "WithdrawEvent",
|
|
1312
|
+
"discriminator": [
|
|
1313
|
+
22,
|
|
1314
|
+
9,
|
|
1315
|
+
133,
|
|
1316
|
+
26,
|
|
1317
|
+
160,
|
|
1318
|
+
44,
|
|
1319
|
+
71,
|
|
1320
|
+
192
|
|
1321
|
+
]
|
|
1322
|
+
}
|
|
384
1323
|
],
|
|
385
1324
|
"errors": [
|
|
386
|
-
{
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
{
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
{
|
|
397
|
-
|
|
398
|
-
|
|
1325
|
+
{
|
|
1326
|
+
"code": 6000,
|
|
1327
|
+
"name": "NotBiddingPhase",
|
|
1328
|
+
"msg": "Trench is not in bidding phase"
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
"code": 6001,
|
|
1332
|
+
"name": "NotTradingPhase",
|
|
1333
|
+
"msg": "Trench is not in trading phase"
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
"code": 6002,
|
|
1337
|
+
"name": "InsufficientFunds",
|
|
1338
|
+
"msg": "Insufficient funds"
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
"code": 6003,
|
|
1342
|
+
"name": "SlippageExceeded",
|
|
1343
|
+
"msg": "Slippage tolerance exceeded"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
"code": 6004,
|
|
1347
|
+
"name": "Overflow",
|
|
1348
|
+
"msg": "Calculation overflow"
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
"code": 6005,
|
|
1352
|
+
"name": "InvalidAmount",
|
|
1353
|
+
"msg": "Invalid amount"
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
"code": 6006,
|
|
1357
|
+
"name": "Unauthorized",
|
|
1358
|
+
"msg": "Unauthorized access"
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
"code": 6007,
|
|
1362
|
+
"name": "MathOverflow",
|
|
1363
|
+
"msg": "Math operation overflow"
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
"code": 6008,
|
|
1367
|
+
"name": "InvalidStatus",
|
|
1368
|
+
"msg": "Invalid status"
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
"code": 6009,
|
|
1372
|
+
"name": "AlreadyClaimed",
|
|
1373
|
+
"msg": "Tokens already claimed"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
"code": 6010,
|
|
1377
|
+
"name": "TradingPhaseNotEnded",
|
|
1378
|
+
"msg": "Trading phase not ended"
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
"code": 6011,
|
|
1382
|
+
"name": "NoLiquidity",
|
|
1383
|
+
"msg": "No liquidity available"
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
"code": 6012,
|
|
1387
|
+
"name": "InvalidTrenchId",
|
|
1388
|
+
"msg": "Invalid trench id"
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
"code": 6013,
|
|
1392
|
+
"name": "WinnerAccountMissing",
|
|
1393
|
+
"msg": "Winner pubkey not found in remaining_accounts"
|
|
1394
|
+
}
|
|
399
1395
|
],
|
|
400
1396
|
"types": [
|
|
401
1397
|
{
|
|
@@ -403,12 +1399,30 @@ const __EVA_IDL__ = {
|
|
|
403
1399
|
"type": {
|
|
404
1400
|
"kind": "struct",
|
|
405
1401
|
"fields": [
|
|
406
|
-
{
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
{
|
|
411
|
-
|
|
1402
|
+
{
|
|
1403
|
+
"name": "authority",
|
|
1404
|
+
"type": "pubkey"
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
"name": "trench",
|
|
1408
|
+
"type": "pubkey"
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
"name": "deposited_sol",
|
|
1412
|
+
"type": "u64"
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
"name": "token_balance",
|
|
1416
|
+
"type": "u64"
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
"name": "is_claimed",
|
|
1420
|
+
"type": "bool"
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
"name": "bump",
|
|
1424
|
+
"type": "u8"
|
|
1425
|
+
}
|
|
412
1426
|
]
|
|
413
1427
|
}
|
|
414
1428
|
},
|
|
@@ -417,17 +1431,50 @@ const __EVA_IDL__ = {
|
|
|
417
1431
|
"type": {
|
|
418
1432
|
"kind": "struct",
|
|
419
1433
|
"fields": [
|
|
420
|
-
{
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
{
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
{
|
|
429
|
-
|
|
430
|
-
|
|
1434
|
+
{
|
|
1435
|
+
"name": "trench",
|
|
1436
|
+
"type": "pubkey"
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
"name": "user",
|
|
1440
|
+
"type": "pubkey"
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
"name": "sol_amount",
|
|
1444
|
+
"type": "u64"
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
"name": "token_amount",
|
|
1448
|
+
"type": "u64"
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
"name": "trench_balance",
|
|
1452
|
+
"type": "u64"
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
"name": "think_id",
|
|
1456
|
+
"type": "u64"
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
"name": "timestamp",
|
|
1460
|
+
"type": "i64"
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"name": "pre_virtual_sol_reserves",
|
|
1464
|
+
"type": "u64"
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
"name": "pre_virtual_token_reserves",
|
|
1468
|
+
"type": "u64"
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
"name": "pre_real_sol_reserves",
|
|
1472
|
+
"type": "u64"
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
"name": "pre_real_token_reserves",
|
|
1476
|
+
"type": "u64"
|
|
1477
|
+
}
|
|
431
1478
|
]
|
|
432
1479
|
}
|
|
433
1480
|
},
|
|
@@ -436,10 +1483,22 @@ const __EVA_IDL__ = {
|
|
|
436
1483
|
"type": {
|
|
437
1484
|
"kind": "struct",
|
|
438
1485
|
"fields": [
|
|
439
|
-
{
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
1486
|
+
{
|
|
1487
|
+
"name": "trench",
|
|
1488
|
+
"type": "pubkey"
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
"name": "user",
|
|
1492
|
+
"type": "pubkey"
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
"name": "amount",
|
|
1496
|
+
"type": "u64"
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
"name": "timestamp",
|
|
1500
|
+
"type": "i64"
|
|
1501
|
+
}
|
|
443
1502
|
]
|
|
444
1503
|
}
|
|
445
1504
|
},
|
|
@@ -448,9 +1507,18 @@ const __EVA_IDL__ = {
|
|
|
448
1507
|
"type": {
|
|
449
1508
|
"kind": "struct",
|
|
450
1509
|
"fields": [
|
|
451
|
-
{
|
|
452
|
-
|
|
453
|
-
|
|
1510
|
+
{
|
|
1511
|
+
"name": "trench",
|
|
1512
|
+
"type": "pubkey"
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
"name": "sol_removed",
|
|
1516
|
+
"type": "u64"
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"name": "timestamp",
|
|
1520
|
+
"type": "i64"
|
|
1521
|
+
}
|
|
454
1522
|
]
|
|
455
1523
|
}
|
|
456
1524
|
},
|
|
@@ -459,11 +1527,26 @@ const __EVA_IDL__ = {
|
|
|
459
1527
|
"type": {
|
|
460
1528
|
"kind": "struct",
|
|
461
1529
|
"fields": [
|
|
462
|
-
{
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
{
|
|
1530
|
+
{
|
|
1531
|
+
"name": "trench",
|
|
1532
|
+
"type": "pubkey"
|
|
1533
|
+
},
|
|
1534
|
+
{
|
|
1535
|
+
"name": "creator",
|
|
1536
|
+
"type": "pubkey"
|
|
1537
|
+
},
|
|
1538
|
+
{
|
|
1539
|
+
"name": "id",
|
|
1540
|
+
"type": "u64"
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
"name": "refund_lamports",
|
|
1544
|
+
"type": "u64"
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
"name": "timestamp",
|
|
1548
|
+
"type": "i64"
|
|
1549
|
+
}
|
|
467
1550
|
]
|
|
468
1551
|
}
|
|
469
1552
|
},
|
|
@@ -472,10 +1555,22 @@ const __EVA_IDL__ = {
|
|
|
472
1555
|
"type": {
|
|
473
1556
|
"kind": "struct",
|
|
474
1557
|
"fields": [
|
|
475
|
-
{
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
1558
|
+
{
|
|
1559
|
+
"name": "trench",
|
|
1560
|
+
"type": "pubkey"
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
"name": "creator",
|
|
1564
|
+
"type": "pubkey"
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
"name": "id",
|
|
1568
|
+
"type": "u64"
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
"name": "timestamp",
|
|
1572
|
+
"type": "i64"
|
|
1573
|
+
}
|
|
479
1574
|
]
|
|
480
1575
|
}
|
|
481
1576
|
},
|
|
@@ -484,14 +1579,38 @@ const __EVA_IDL__ = {
|
|
|
484
1579
|
"type": {
|
|
485
1580
|
"kind": "struct",
|
|
486
1581
|
"fields": [
|
|
487
|
-
{
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
{
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
1582
|
+
{
|
|
1583
|
+
"name": "trench",
|
|
1584
|
+
"type": "pubkey"
|
|
1585
|
+
},
|
|
1586
|
+
{
|
|
1587
|
+
"name": "user",
|
|
1588
|
+
"type": "pubkey"
|
|
1589
|
+
},
|
|
1590
|
+
{
|
|
1591
|
+
"name": "amount",
|
|
1592
|
+
"type": "u64"
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
"name": "user_deposited",
|
|
1596
|
+
"type": "u64"
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
"name": "total_deposited",
|
|
1600
|
+
"type": "u64"
|
|
1601
|
+
},
|
|
1602
|
+
{
|
|
1603
|
+
"name": "trench_balance",
|
|
1604
|
+
"type": "u64"
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"name": "timestamp",
|
|
1608
|
+
"type": "i64"
|
|
1609
|
+
},
|
|
1610
|
+
{
|
|
1611
|
+
"name": "think_id",
|
|
1612
|
+
"type": "u64"
|
|
1613
|
+
}
|
|
495
1614
|
]
|
|
496
1615
|
}
|
|
497
1616
|
},
|
|
@@ -500,11 +1619,30 @@ const __EVA_IDL__ = {
|
|
|
500
1619
|
"type": {
|
|
501
1620
|
"kind": "struct",
|
|
502
1621
|
"fields": [
|
|
503
|
-
{
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
{
|
|
1622
|
+
{
|
|
1623
|
+
"name": "trench",
|
|
1624
|
+
"type": "pubkey"
|
|
1625
|
+
},
|
|
1626
|
+
{
|
|
1627
|
+
"name": "winners",
|
|
1628
|
+
"type": {
|
|
1629
|
+
"vec": "pubkey"
|
|
1630
|
+
}
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
"name": "amounts",
|
|
1634
|
+
"type": {
|
|
1635
|
+
"vec": "u64"
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1638
|
+
{
|
|
1639
|
+
"name": "total_winners",
|
|
1640
|
+
"type": "u64"
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
"name": "timestamp",
|
|
1644
|
+
"type": "i64"
|
|
1645
|
+
}
|
|
508
1646
|
]
|
|
509
1647
|
}
|
|
510
1648
|
},
|
|
@@ -513,10 +1651,22 @@ const __EVA_IDL__ = {
|
|
|
513
1651
|
"type": {
|
|
514
1652
|
"kind": "struct",
|
|
515
1653
|
"fields": [
|
|
516
|
-
{
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
1654
|
+
{
|
|
1655
|
+
"name": "trench",
|
|
1656
|
+
"type": "pubkey"
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
"name": "sol_for_lp",
|
|
1660
|
+
"type": "u64"
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
"name": "tokens_for_lp",
|
|
1664
|
+
"type": "u64"
|
|
1665
|
+
},
|
|
1666
|
+
{
|
|
1667
|
+
"name": "timestamp",
|
|
1668
|
+
"type": "i64"
|
|
1669
|
+
}
|
|
520
1670
|
]
|
|
521
1671
|
}
|
|
522
1672
|
},
|
|
@@ -525,11 +1675,30 @@ const __EVA_IDL__ = {
|
|
|
525
1675
|
"type": {
|
|
526
1676
|
"kind": "struct",
|
|
527
1677
|
"fields": [
|
|
528
|
-
{
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
{
|
|
1678
|
+
{
|
|
1679
|
+
"name": "admin",
|
|
1680
|
+
"type": "pubkey"
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
"name": "fee_recipient",
|
|
1684
|
+
"type": "pubkey"
|
|
1685
|
+
},
|
|
1686
|
+
{
|
|
1687
|
+
"name": "back_authority",
|
|
1688
|
+
"type": "pubkey"
|
|
1689
|
+
},
|
|
1690
|
+
{
|
|
1691
|
+
"name": "total_trenches",
|
|
1692
|
+
"type": "u64"
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
"name": "bidding_duration",
|
|
1696
|
+
"type": "u64"
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
"name": "trading_duration",
|
|
1700
|
+
"type": "u64"
|
|
1701
|
+
}
|
|
533
1702
|
]
|
|
534
1703
|
}
|
|
535
1704
|
},
|
|
@@ -538,8 +1707,14 @@ const __EVA_IDL__ = {
|
|
|
538
1707
|
"type": {
|
|
539
1708
|
"kind": "struct",
|
|
540
1709
|
"fields": [
|
|
541
|
-
{
|
|
542
|
-
|
|
1710
|
+
{
|
|
1711
|
+
"name": "admin",
|
|
1712
|
+
"type": "pubkey"
|
|
1713
|
+
},
|
|
1714
|
+
{
|
|
1715
|
+
"name": "timestamp",
|
|
1716
|
+
"type": "i64"
|
|
1717
|
+
}
|
|
543
1718
|
]
|
|
544
1719
|
}
|
|
545
1720
|
},
|
|
@@ -548,17 +1723,50 @@ const __EVA_IDL__ = {
|
|
|
548
1723
|
"type": {
|
|
549
1724
|
"kind": "struct",
|
|
550
1725
|
"fields": [
|
|
551
|
-
{
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
{
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
{
|
|
560
|
-
|
|
561
|
-
|
|
1726
|
+
{
|
|
1727
|
+
"name": "trench",
|
|
1728
|
+
"type": "pubkey"
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
"name": "user",
|
|
1732
|
+
"type": "pubkey"
|
|
1733
|
+
},
|
|
1734
|
+
{
|
|
1735
|
+
"name": "sol_amount",
|
|
1736
|
+
"type": "u64"
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
"name": "token_amount",
|
|
1740
|
+
"type": "u64"
|
|
1741
|
+
},
|
|
1742
|
+
{
|
|
1743
|
+
"name": "trench_balance",
|
|
1744
|
+
"type": "u64"
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
"name": "think_id",
|
|
1748
|
+
"type": "u64"
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
"name": "timestamp",
|
|
1752
|
+
"type": "i64"
|
|
1753
|
+
},
|
|
1754
|
+
{
|
|
1755
|
+
"name": "pre_virtual_sol_reserves",
|
|
1756
|
+
"type": "u64"
|
|
1757
|
+
},
|
|
1758
|
+
{
|
|
1759
|
+
"name": "pre_virtual_token_reserves",
|
|
1760
|
+
"type": "u64"
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
"name": "pre_real_sol_reserves",
|
|
1764
|
+
"type": "u64"
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
"name": "pre_real_token_reserves",
|
|
1768
|
+
"type": "u64"
|
|
1769
|
+
}
|
|
562
1770
|
]
|
|
563
1771
|
}
|
|
564
1772
|
},
|
|
@@ -567,23 +1775,78 @@ const __EVA_IDL__ = {
|
|
|
567
1775
|
"type": {
|
|
568
1776
|
"kind": "struct",
|
|
569
1777
|
"fields": [
|
|
570
|
-
{
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
{
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
{
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
{
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
1778
|
+
{
|
|
1779
|
+
"name": "id",
|
|
1780
|
+
"type": "u64"
|
|
1781
|
+
},
|
|
1782
|
+
{
|
|
1783
|
+
"name": "creator",
|
|
1784
|
+
"type": "pubkey"
|
|
1785
|
+
},
|
|
1786
|
+
{
|
|
1787
|
+
"name": "authority",
|
|
1788
|
+
"type": "pubkey"
|
|
1789
|
+
},
|
|
1790
|
+
{
|
|
1791
|
+
"name": "status",
|
|
1792
|
+
"type": {
|
|
1793
|
+
"defined": {
|
|
1794
|
+
"name": "TrenchStatus"
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
},
|
|
1798
|
+
{
|
|
1799
|
+
"name": "total_deposited_sol",
|
|
1800
|
+
"type": "u64"
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
"name": "virtual_sol_reserves",
|
|
1804
|
+
"type": "u128"
|
|
1805
|
+
},
|
|
1806
|
+
{
|
|
1807
|
+
"name": "virtual_token_reserves",
|
|
1808
|
+
"type": "u128"
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
"name": "real_sol_reserves",
|
|
1812
|
+
"type": "u128"
|
|
1813
|
+
},
|
|
1814
|
+
{
|
|
1815
|
+
"name": "real_token_reserves",
|
|
1816
|
+
"type": "u128"
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
"name": "initial_virtual_token_reserves",
|
|
1820
|
+
"type": "u128"
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
"name": "bidding_start_block",
|
|
1824
|
+
"type": "u64"
|
|
1825
|
+
},
|
|
1826
|
+
{
|
|
1827
|
+
"name": "bidding_end_block",
|
|
1828
|
+
"type": "u64"
|
|
1829
|
+
},
|
|
1830
|
+
{
|
|
1831
|
+
"name": "trading_end_block",
|
|
1832
|
+
"type": "u64"
|
|
1833
|
+
},
|
|
1834
|
+
{
|
|
1835
|
+
"name": "token_mint",
|
|
1836
|
+
"type": "pubkey"
|
|
1837
|
+
},
|
|
1838
|
+
{
|
|
1839
|
+
"name": "start_time",
|
|
1840
|
+
"type": "i64"
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
"name": "prize_pool_reserves",
|
|
1844
|
+
"type": "u64"
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
"name": "bump",
|
|
1848
|
+
"type": "u8"
|
|
1849
|
+
}
|
|
587
1850
|
]
|
|
588
1851
|
}
|
|
589
1852
|
},
|
|
@@ -592,9 +1855,15 @@ const __EVA_IDL__ = {
|
|
|
592
1855
|
"type": {
|
|
593
1856
|
"kind": "enum",
|
|
594
1857
|
"variants": [
|
|
595
|
-
{
|
|
596
|
-
|
|
597
|
-
|
|
1858
|
+
{
|
|
1859
|
+
"name": "Bidding"
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
"name": "Trading"
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
"name": "Ended"
|
|
1866
|
+
}
|
|
598
1867
|
]
|
|
599
1868
|
}
|
|
600
1869
|
},
|
|
@@ -603,14 +1872,38 @@ const __EVA_IDL__ = {
|
|
|
603
1872
|
"type": {
|
|
604
1873
|
"kind": "struct",
|
|
605
1874
|
"fields": [
|
|
606
|
-
{
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
{
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
1875
|
+
{
|
|
1876
|
+
"name": "trench",
|
|
1877
|
+
"type": "pubkey"
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
"name": "user",
|
|
1881
|
+
"type": "pubkey"
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
"name": "amount",
|
|
1885
|
+
"type": "u64"
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
"name": "user_deposited",
|
|
1889
|
+
"type": "u64"
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
"name": "total_deposited",
|
|
1893
|
+
"type": "u64"
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
"name": "trench_balance",
|
|
1897
|
+
"type": "u64"
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
"name": "timestamp",
|
|
1901
|
+
"type": "i64"
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
"name": "think_id",
|
|
1905
|
+
"type": "u64"
|
|
1906
|
+
}
|
|
614
1907
|
]
|
|
615
1908
|
}
|
|
616
1909
|
}
|
|
@@ -773,15 +2066,21 @@ function decodeTrench(data) {
|
|
|
773
2066
|
bump: data[exports.TRENCH_OFFSETS.bump],
|
|
774
2067
|
};
|
|
775
2068
|
}
|
|
2069
|
+
// ---- GlobalState (state.rs, eva ≥0.1.7): disc(8) admin(32) fee_recipient(32) back_authority(32) total_trenches(u64) bidding_duration(u64) trading_duration(u64) ----
|
|
2070
|
+
// `back_authority` (added in v0.1.7/0.1.8) signs the admin-gated game ops (finalize / close_pool /
|
|
2071
|
+
// claim_tokens / distribute_prize); `admin` still signs initialize / update_config. Its 32 bytes sit
|
|
2072
|
+
// between fee_recipient and total_trenches, shifting the three u64s by 32.
|
|
2073
|
+
exports.GLOBAL_STATE_LEN = 128; // 8 + 32*3 + 8*3
|
|
776
2074
|
function decodeGlobalState(data) {
|
|
777
|
-
if (data.length <
|
|
778
|
-
throw new Error(`GlobalState data too short: ${data.length} <
|
|
2075
|
+
if (data.length < exports.GLOBAL_STATE_LEN)
|
|
2076
|
+
throw new Error(`GlobalState data too short: ${data.length} < ${exports.GLOBAL_STATE_LEN}`);
|
|
779
2077
|
return {
|
|
780
2078
|
admin: data.slice(8, 40),
|
|
781
2079
|
feeRecipient: data.slice(40, 72),
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
2080
|
+
backAuthority: data.slice(72, 104),
|
|
2081
|
+
totalTrenches: uLE(data, 104, 8),
|
|
2082
|
+
biddingDuration: uLE(data, 112, 8),
|
|
2083
|
+
tradingDuration: uLE(data, 120, 8),
|
|
785
2084
|
};
|
|
786
2085
|
}
|
|
787
2086
|
// ---- Portal Session (portal/src/state.rs struct Session; Borsh, LEN 219, discriminator 1) ----
|
|
@@ -1042,7 +2341,7 @@ function loadBundledIdl() {
|
|
|
1042
2341
|
return __EVA_IDL__;
|
|
1043
2342
|
}
|
|
1044
2343
|
/**
|
|
1045
|
-
* The eva Anchor IDL (v0.1.
|
|
2344
|
+
* The eva Anchor IDL (v0.1.8), exported as a typed constant so you can build your own `Program`
|
|
1046
2345
|
* with full types:
|
|
1047
2346
|
* `new anchor.Program<EvaArena>(EVA_IDL, provider)` // then NorthstarEva.create({ program, provider, l1Endpoint })
|
|
1048
2347
|
* The {@link EvaArena} type (the generated camelCase TS IDL) is also exported. The runtime value
|
|
@@ -1374,10 +2673,10 @@ class NorthstarEva {
|
|
|
1374
2673
|
buildDepositIx(p) {
|
|
1375
2674
|
return this.methods.deposit(this.bn(p.lamports), this.bn(p.thinkId ?? 0n)).accounts({ trench: this.trenchPda(p.trenchId), user: p.user ?? this.payer }).instruction();
|
|
1376
2675
|
}
|
|
1377
|
-
/** eva finalize instruction (ER). Reads global for feeRecipient; does NOT wait for the bidding window. */
|
|
2676
|
+
/** eva finalize instruction (ER, back_authority). Reads global for feeRecipient; does NOT wait for the bidding window. `backAuthority` (the signer) defaults to the SDK signer. */
|
|
1378
2677
|
async buildFinalizeIx(p) {
|
|
1379
2678
|
const g = await this.requireGlobal();
|
|
1380
|
-
return this.methods.finalize().accounts({ trench: this.trenchPda(p.trenchId), globalState: this.globalStatePda(), feeRecipient: new web3_js_1.PublicKey(g.feeRecipient),
|
|
2679
|
+
return this.methods.finalize().accounts({ trench: this.trenchPda(p.trenchId), globalState: this.globalStatePda(), feeRecipient: new web3_js_1.PublicKey(g.feeRecipient), backAuthority: p.backAuthority ?? this.payer }).instruction();
|
|
1381
2680
|
}
|
|
1382
2681
|
/** ATA-create instruction (ER) for a user's trench token account (idempotent). */
|
|
1383
2682
|
buildUserAtaIx(p) {
|
|
@@ -1396,19 +2695,24 @@ class NorthstarEva {
|
|
|
1396
2695
|
const user = p.user ?? this.payer;
|
|
1397
2696
|
return this.methods.sell(this.bn(p.tokenAmount), this.bn(p.minSolOutput ?? 0n), this.bn(p.thinkId ?? 0n)).accounts({ trench: this.trenchPda(p.trenchId), globalState: this.globalStatePda(), feeRecipient: new web3_js_1.PublicKey(g.feeRecipient), user, trenchTokenVault: this.trenchVault(p.trenchId), userTokenAccount: this.userAta(p.trenchId, user), tokenProgram: spl_token_1.TOKEN_PROGRAM_ID }).instruction();
|
|
1398
2697
|
}
|
|
1399
|
-
/**
|
|
1400
|
-
|
|
1401
|
-
|
|
2698
|
+
/**
|
|
2699
|
+
* eva updateConfig instruction (ER, admin) — change bidding/trading durations, fee recipient, and
|
|
2700
|
+
* the `back_authority` (eva ≥0.1.7). Still **admin**-signed. `backAuthority` defaults to the CURRENT
|
|
2701
|
+
* on-chain value (read from global) so callers that only change durations/fee don't reset it.
|
|
2702
|
+
*/
|
|
2703
|
+
async buildUpdateConfigIx(p) {
|
|
2704
|
+
const backAuthority = p.backAuthority ?? new web3_js_1.PublicKey((await this.requireGlobal()).backAuthority);
|
|
2705
|
+
return this.methods.updateConfig(this.bn(p.biddingDuration), this.bn(p.tradingDuration), p.feeRecipient, backAuthority).accounts({ globalState: this.globalStatePda(), admin: this.payer }).instruction();
|
|
1402
2706
|
}
|
|
1403
2707
|
/** eva withdraw instruction (ER) — withdraw a bid deposit from a trench (inverse of {@link buildDepositIx}). NOT the Portal SOL bridge ({@link buildWithdrawFeeFromErIx}). */
|
|
1404
2708
|
buildWithdrawIx(p) {
|
|
1405
2709
|
const user = p.user ?? this.payer;
|
|
1406
2710
|
return this.methods.withdraw(this.bn(p.amount), this.bn(p.thinkId ?? 0n)).accounts({ trench: this.trenchPda(p.trenchId), agent: this.agentPda(p.trenchId, user), user }).instruction();
|
|
1407
2711
|
}
|
|
1408
|
-
/** eva closePool instruction (ER,
|
|
2712
|
+
/** eva closePool instruction (ER, back_authority) — close a finished trench's pool. `backAuthority` (the signer) defaults to the SDK signer. */
|
|
1409
2713
|
async buildClosePoolIx(p) {
|
|
1410
2714
|
const g = await this.requireGlobal();
|
|
1411
|
-
return this.methods.closePool().accounts({ trench: this.trenchPda(p.trenchId), globalState: this.globalStatePda(), feeRecipient: new web3_js_1.PublicKey(g.feeRecipient),
|
|
2715
|
+
return this.methods.closePool().accounts({ trench: this.trenchPda(p.trenchId), globalState: this.globalStatePda(), feeRecipient: new web3_js_1.PublicKey(g.feeRecipient), backAuthority: p.backAuthority ?? this.payer }).instruction();
|
|
1412
2716
|
}
|
|
1413
2717
|
/**
|
|
1414
2718
|
* eva closeTrench instruction (ER) — close an **Ended** trench (post close_pool + distribute_prize),
|
|
@@ -1418,15 +2722,22 @@ class NorthstarEva {
|
|
|
1418
2722
|
buildCloseTrenchIx(p) {
|
|
1419
2723
|
return this.methods.closeTrench().accounts({ trench: this.trenchPda(p.trenchId), creator: p.creator ?? this.payer }).instruction();
|
|
1420
2724
|
}
|
|
1421
|
-
/** eva claimTokens instruction (ER,
|
|
2725
|
+
/** eva claimTokens instruction (ER, back_authority) — release `user`'s tokens from the trench vault to their ATA. `backAuthority` (the signer) defaults to the SDK signer. */
|
|
1422
2726
|
buildClaimTokensIx(p) {
|
|
1423
2727
|
const user = p.user ?? this.payer;
|
|
1424
|
-
return this.methods.claimTokens().accounts({ globalState: this.globalStatePda(), trench: this.trenchPda(p.trenchId), agent: this.agentPda(p.trenchId, user), user,
|
|
2728
|
+
return this.methods.claimTokens().accounts({ globalState: this.globalStatePda(), trench: this.trenchPda(p.trenchId), agent: this.agentPda(p.trenchId, user), user, backAuthority: p.backAuthority ?? this.payer, trenchTokenVault: this.trenchVault(p.trenchId), userTokenAccount: this.userAta(p.trenchId, user), tokenProgram: spl_token_1.TOKEN_PROGRAM_ID }).instruction();
|
|
1425
2729
|
}
|
|
1426
|
-
/** eva distributePrize instruction (ER,
|
|
2730
|
+
/** eva distributePrize instruction (ER, back_authority) — pay out the prize pool to `winners` by `amounts` (lamports). `backAuthority` (the signer) defaults to the SDK signer. */
|
|
1427
2731
|
async buildDistributePrizeIx(p) {
|
|
2732
|
+
if (p.winners.length !== p.amounts.length)
|
|
2733
|
+
throw new Error(`distributePrize: winners (${p.winners.length}) and amounts (${p.amounts.length}) must be the same length`);
|
|
1428
2734
|
const g = await this.requireGlobal();
|
|
1429
|
-
|
|
2735
|
+
// The program pays each winner by finding its account in remaining_accounts, so EACH winner must
|
|
2736
|
+
// be appended as a writable account — otherwise it fails with WinnerAccountMissing (6013).
|
|
2737
|
+
return this.methods.distributePrize(p.winners, p.amounts.map((a) => this.bn(a)))
|
|
2738
|
+
.accounts({ trench: this.trenchPda(p.trenchId), globalState: this.globalStatePda(), feeRecipient: new web3_js_1.PublicKey(g.feeRecipient), backAuthority: p.backAuthority ?? this.payer })
|
|
2739
|
+
.remainingAccounts(p.winners.map((w) => ({ pubkey: w, isWritable: true, isSigner: false })))
|
|
2740
|
+
.instruction();
|
|
1430
2741
|
}
|
|
1431
2742
|
/**
|
|
1432
2743
|
* Bundle instruction(s) into an UNSIGNED `Transaction` (feePayer + recent blockhash set) for the
|
|
@@ -1616,7 +2927,7 @@ class NorthstarEva {
|
|
|
1616
2927
|
async deposit(p) {
|
|
1617
2928
|
return this.sendEva(await this.buildDepositIx(p), "deposit");
|
|
1618
2929
|
}
|
|
1619
|
-
/** finalize — waits for the ER slot to pass biddingEndBlock, then seeds the AMM. */
|
|
2930
|
+
/** finalize — waits for the ER slot to pass biddingEndBlock, then seeds the AMM. Signed by the back_authority (defaults to the SDK signer). */
|
|
1620
2931
|
async finalize(p) {
|
|
1621
2932
|
const t = await this.getTrench(p.trenchId, "er", 10);
|
|
1622
2933
|
if (t)
|
|
@@ -1640,7 +2951,7 @@ class NorthstarEva {
|
|
|
1640
2951
|
const signature = await this.sendEva(await this.buildSellIx(p), "sell");
|
|
1641
2952
|
return { signature, trench: (await this.getTrench(p.trenchId, "er", 5)), userTokens: await this.getUserTokenBalance(p.trenchId) };
|
|
1642
2953
|
}
|
|
1643
|
-
/** eva updateConfig (ER, admin) — set bidding/trading durations
|
|
2954
|
+
/** eva updateConfig (ER, admin) — set bidding/trading durations, fee recipient + back_authority on the global config. `backAuthority` defaults to the current on-chain value. */
|
|
1644
2955
|
async updateConfig(p) {
|
|
1645
2956
|
return this.sendEva(await this.buildUpdateConfigIx(p), "updateConfig");
|
|
1646
2957
|
}
|
|
@@ -1648,7 +2959,7 @@ class NorthstarEva {
|
|
|
1648
2959
|
async withdraw(p) {
|
|
1649
2960
|
return this.sendEva(await this.buildWithdrawIx(p), "withdraw");
|
|
1650
2961
|
}
|
|
1651
|
-
/** eva closePool (ER,
|
|
2962
|
+
/** eva closePool (ER, back_authority) — close a finished trench's pool. Signed by the back_authority (defaults to the SDK signer). */
|
|
1652
2963
|
async closePool(p) {
|
|
1653
2964
|
return this.sendEva(await this.buildClosePoolIx(p), "closePool");
|
|
1654
2965
|
}
|
|
@@ -1656,11 +2967,11 @@ class NorthstarEva {
|
|
|
1656
2967
|
async closeTrench(p) {
|
|
1657
2968
|
return this.sendEva(await this.buildCloseTrenchIx(p), "closeTrench");
|
|
1658
2969
|
}
|
|
1659
|
-
/** eva claimTokens (ER,
|
|
2970
|
+
/** eva claimTokens (ER, back_authority) — release `user`'s tokens from the trench vault to their ATA. Signed by the back_authority (defaults to the SDK signer). */
|
|
1660
2971
|
async claimTokens(p) {
|
|
1661
2972
|
return this.sendEva(await this.buildClaimTokensIx(p), "claimTokens");
|
|
1662
2973
|
}
|
|
1663
|
-
/** eva distributePrize (ER,
|
|
2974
|
+
/** eva distributePrize (ER, back_authority) — pay the prize pool to `winners` by `amounts` (lamports). Signed by the back_authority (defaults to the SDK signer). */
|
|
1664
2975
|
async distributePrize(p) {
|
|
1665
2976
|
return this.sendEva(await this.buildDistributePrizeIx(p), "distributePrize");
|
|
1666
2977
|
}
|