@0block.io/sdk 0.1.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.
@@ -0,0 +1,740 @@
1
+ // Vendored from the tenant-wrapper build of nyx-solana-dex-router (target/idl/zeroblock_tenant_wrapper.json).
2
+ // The instruction layout is identical for every tenant wrapper deployment; the program
3
+ // address is per-tenant and intentionally stripped — pass wrapperProgramId at init.
4
+ // tenant_authority is not an account: the wrapper_config PDA signs the router CPI.
5
+ export const TENANT_WRAPPER_IDL = {
6
+ "address": "11111111111111111111111111111111",
7
+ "metadata": {
8
+ "name": "zeroblock_tenant_wrapper",
9
+ "version": "0.1.0",
10
+ "spec": "0.1.0",
11
+ "description": "0block Tenant Wrapper"
12
+ },
13
+ "instructions": [
14
+ {
15
+ "name": "init_wrapper",
16
+ "discriminator": [
17
+ 34,
18
+ 94,
19
+ 220,
20
+ 178,
21
+ 229,
22
+ 27,
23
+ 138,
24
+ 119
25
+ ],
26
+ "accounts": [
27
+ {
28
+ "name": "admin",
29
+ "writable": true,
30
+ "signer": true
31
+ },
32
+ {
33
+ "name": "wrapper_config",
34
+ "writable": true,
35
+ "pda": {
36
+ "seeds": [
37
+ {
38
+ "kind": "const",
39
+ "value": [
40
+ 116,
41
+ 101,
42
+ 110,
43
+ 97,
44
+ 110,
45
+ 116,
46
+ 95,
47
+ 119,
48
+ 114,
49
+ 97,
50
+ 112,
51
+ 112,
52
+ 101,
53
+ 114,
54
+ 95,
55
+ 99,
56
+ 111,
57
+ 110,
58
+ 102,
59
+ 105,
60
+ 103
61
+ ]
62
+ }
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "name": "system_program",
68
+ "address": "11111111111111111111111111111111"
69
+ }
70
+ ],
71
+ "args": [
72
+ {
73
+ "name": "fee_bps",
74
+ "type": "u16"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "name": "set_admin",
80
+ "discriminator": [
81
+ 251,
82
+ 163,
83
+ 0,
84
+ 52,
85
+ 91,
86
+ 194,
87
+ 187,
88
+ 92
89
+ ],
90
+ "accounts": [
91
+ {
92
+ "name": "admin",
93
+ "signer": true,
94
+ "relations": [
95
+ "wrapper_config"
96
+ ]
97
+ },
98
+ {
99
+ "name": "wrapper_config",
100
+ "writable": true,
101
+ "pda": {
102
+ "seeds": [
103
+ {
104
+ "kind": "const",
105
+ "value": [
106
+ 116,
107
+ 101,
108
+ 110,
109
+ 97,
110
+ 110,
111
+ 116,
112
+ 95,
113
+ 119,
114
+ 114,
115
+ 97,
116
+ 112,
117
+ 112,
118
+ 101,
119
+ 114,
120
+ 95,
121
+ 99,
122
+ 111,
123
+ 110,
124
+ 102,
125
+ 105,
126
+ 103
127
+ ]
128
+ }
129
+ ]
130
+ }
131
+ }
132
+ ],
133
+ "args": [
134
+ {
135
+ "name": "new_admin",
136
+ "type": "pubkey"
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ "name": "set_fee_bps",
142
+ "discriminator": [
143
+ 2,
144
+ 161,
145
+ 245,
146
+ 141,
147
+ 111,
148
+ 32,
149
+ 39,
150
+ 198
151
+ ],
152
+ "accounts": [
153
+ {
154
+ "name": "admin",
155
+ "signer": true,
156
+ "relations": [
157
+ "wrapper_config"
158
+ ]
159
+ },
160
+ {
161
+ "name": "wrapper_config",
162
+ "writable": true,
163
+ "pda": {
164
+ "seeds": [
165
+ {
166
+ "kind": "const",
167
+ "value": [
168
+ 116,
169
+ 101,
170
+ 110,
171
+ 97,
172
+ 110,
173
+ 116,
174
+ 95,
175
+ 119,
176
+ 114,
177
+ 97,
178
+ 112,
179
+ 112,
180
+ 101,
181
+ 114,
182
+ 95,
183
+ 99,
184
+ 111,
185
+ 110,
186
+ 102,
187
+ 105,
188
+ 103
189
+ ]
190
+ }
191
+ ]
192
+ }
193
+ }
194
+ ],
195
+ "args": [
196
+ {
197
+ "name": "fee_bps",
198
+ "type": "u16"
199
+ }
200
+ ]
201
+ },
202
+ {
203
+ "name": "swap",
204
+ "discriminator": [
205
+ 248,
206
+ 198,
207
+ 158,
208
+ 145,
209
+ 225,
210
+ 117,
211
+ 135,
212
+ 200
213
+ ],
214
+ "accounts": [
215
+ {
216
+ "name": "payer",
217
+ "docs": [
218
+ "User paying tx fees and commissions."
219
+ ],
220
+ "writable": true,
221
+ "signer": true
222
+ },
223
+ {
224
+ "name": "wrapper_config",
225
+ "pda": {
226
+ "seeds": [
227
+ {
228
+ "kind": "const",
229
+ "value": [
230
+ 116,
231
+ 101,
232
+ 110,
233
+ 97,
234
+ 110,
235
+ 116,
236
+ 95,
237
+ 119,
238
+ 114,
239
+ 97,
240
+ 112,
241
+ 112,
242
+ 101,
243
+ 114,
244
+ 95,
245
+ 99,
246
+ 111,
247
+ 110,
248
+ 102,
249
+ 105,
250
+ 103
251
+ ]
252
+ }
253
+ ]
254
+ }
255
+ },
256
+ {
257
+ "name": "router_program",
258
+ "docs": [
259
+ "Router program (hard-checked by address)"
260
+ ],
261
+ "address": "zeroRxfemoQCz6JT7RyShjuuRCN7VZof1WSekfXhmEn"
262
+ },
263
+ {
264
+ "name": "source_token_account",
265
+ "docs": [
266
+ "SOURCE token account (authority = payer)"
267
+ ],
268
+ "writable": true
269
+ },
270
+ {
271
+ "name": "destination_token_account",
272
+ "docs": [
273
+ "DESTINATION token account (receives the swap output)"
274
+ ],
275
+ "writable": true
276
+ },
277
+ {
278
+ "name": "source_mint"
279
+ },
280
+ {
281
+ "name": "destination_mint"
282
+ },
283
+ {
284
+ "name": "global_cfg",
285
+ "docs": [
286
+ "Global config (router PDA)"
287
+ ]
288
+ },
289
+ {
290
+ "name": "tenant_cfg",
291
+ "docs": [
292
+ "Tenant config (router PDA)"
293
+ ]
294
+ },
295
+ {
296
+ "name": "zeroblock_sol_vault",
297
+ "docs": [
298
+ "0BLOCK fee authority (owns 0BLOCK fee token accounts)"
299
+ ],
300
+ "writable": true
301
+ },
302
+ {
303
+ "name": "tenant_sol_vault",
304
+ "docs": [
305
+ "Tenant fee authority (owns tenant fee token accounts)"
306
+ ],
307
+ "writable": true
308
+ },
309
+ {
310
+ "name": "zeroblock_fee_token_account",
311
+ "docs": [
312
+ "0BLOCK fee token account for the fee mint (authority = zeroblock_sol_vault)."
313
+ ],
314
+ "writable": true
315
+ },
316
+ {
317
+ "name": "tenant_fee_token_account",
318
+ "docs": [
319
+ "Tenant fee token account for the fee mint (authority = tenant_sol_vault)."
320
+ ],
321
+ "writable": true
322
+ },
323
+ {
324
+ "name": "source_token_program",
325
+ "optional": true
326
+ },
327
+ {
328
+ "name": "destination_token_program",
329
+ "optional": true
330
+ },
331
+ {
332
+ "name": "associated_token_program",
333
+ "optional": true,
334
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
335
+ },
336
+ {
337
+ "name": "system_program",
338
+ "optional": true,
339
+ "address": "11111111111111111111111111111111"
340
+ },
341
+ {
342
+ "name": "ix_sysvar",
343
+ "docs": [
344
+ "Instructions sysvar for router wrapper enforcement"
345
+ ],
346
+ "address": "Sysvar1nstructions1111111111111111111111111"
347
+ }
348
+ ],
349
+ "args": [
350
+ {
351
+ "name": "args",
352
+ "type": {
353
+ "defined": {
354
+ "name": "SwapArgs"
355
+ }
356
+ }
357
+ },
358
+ {
359
+ "name": "order_id",
360
+ "type": "u128"
361
+ }
362
+ ]
363
+ }
364
+ ],
365
+ "accounts": [
366
+ {
367
+ "name": "TenantWrapperConfig",
368
+ "discriminator": [
369
+ 221,
370
+ 67,
371
+ 69,
372
+ 41,
373
+ 128,
374
+ 45,
375
+ 34,
376
+ 31
377
+ ]
378
+ }
379
+ ],
380
+ "errors": [
381
+ {
382
+ "code": 6000,
383
+ "name": "InvalidFeeBps",
384
+ "msg": "Fee bps must be <= 10_000"
385
+ },
386
+ {
387
+ "code": 6001,
388
+ "name": "InvalidAdmin",
389
+ "msg": "Admin cannot be the default pubkey"
390
+ }
391
+ ],
392
+ "types": [
393
+ {
394
+ "name": "Dex",
395
+ "docs": [
396
+ "Which DEX / adapter to call for each hop."
397
+ ],
398
+ "type": {
399
+ "kind": "enum",
400
+ "variants": [
401
+ {
402
+ "name": "SplTokenSwap"
403
+ },
404
+ {
405
+ "name": "StableSwap"
406
+ },
407
+ {
408
+ "name": "Whirlpool"
409
+ },
410
+ {
411
+ "name": "MeteoraDynamicpool"
412
+ },
413
+ {
414
+ "name": "RaydiumSwap"
415
+ },
416
+ {
417
+ "name": "RaydiumStableSwap"
418
+ },
419
+ {
420
+ "name": "RaydiumClmmSwap"
421
+ },
422
+ {
423
+ "name": "AldrinExchangeV1"
424
+ },
425
+ {
426
+ "name": "AldrinExchangeV2"
427
+ },
428
+ {
429
+ "name": "LifinityV1"
430
+ },
431
+ {
432
+ "name": "LifinityV2"
433
+ },
434
+ {
435
+ "name": "RaydiumClmmSwapV2"
436
+ },
437
+ {
438
+ "name": "FluxBeam"
439
+ },
440
+ {
441
+ "name": "MeteoraDlmm"
442
+ },
443
+ {
444
+ "name": "RaydiumCpmmSwap"
445
+ },
446
+ {
447
+ "name": "OpenBookV2"
448
+ },
449
+ {
450
+ "name": "WhirlpoolV2"
451
+ },
452
+ {
453
+ "name": "Phoenix"
454
+ },
455
+ {
456
+ "name": "ObricV2"
457
+ },
458
+ {
459
+ "name": "SanctumAddLiq"
460
+ },
461
+ {
462
+ "name": "SanctumRemoveLiq"
463
+ },
464
+ {
465
+ "name": "SanctumNonWsolSwap"
466
+ },
467
+ {
468
+ "name": "SanctumWsolSwap"
469
+ },
470
+ {
471
+ "name": "PumpfunBuy"
472
+ },
473
+ {
474
+ "name": "PumpfunSell"
475
+ },
476
+ {
477
+ "name": "StabbleSwap"
478
+ },
479
+ {
480
+ "name": "SanctumRouter"
481
+ },
482
+ {
483
+ "name": "MeteoraVaultDeposit"
484
+ },
485
+ {
486
+ "name": "MeteoraVaultWithdraw"
487
+ },
488
+ {
489
+ "name": "Saros"
490
+ },
491
+ {
492
+ "name": "MeteoraLst"
493
+ },
494
+ {
495
+ "name": "Solfi"
496
+ },
497
+ {
498
+ "name": "QualiaSwap"
499
+ },
500
+ {
501
+ "name": "Zerofi"
502
+ },
503
+ {
504
+ "name": "PumpfunammBuy"
505
+ },
506
+ {
507
+ "name": "PumpfunammSell"
508
+ },
509
+ {
510
+ "name": "Virtuals"
511
+ },
512
+ {
513
+ "name": "VertigoBuy"
514
+ },
515
+ {
516
+ "name": "VertigoSell"
517
+ },
518
+ {
519
+ "name": "PerpetualsAddLiq"
520
+ },
521
+ {
522
+ "name": "PerpetualsRemoveLiq"
523
+ },
524
+ {
525
+ "name": "PerpetualsSwap"
526
+ },
527
+ {
528
+ "name": "RaydiumLaunchpad"
529
+ },
530
+ {
531
+ "name": "LetsBonkFun"
532
+ },
533
+ {
534
+ "name": "Woofi"
535
+ },
536
+ {
537
+ "name": "MeteoraDbc"
538
+ },
539
+ {
540
+ "name": "MeteoraDlmmSwap2"
541
+ },
542
+ {
543
+ "name": "MeteoraDAMMV2"
544
+ },
545
+ {
546
+ "name": "Gavel"
547
+ },
548
+ {
549
+ "name": "BoopfunBuy"
550
+ },
551
+ {
552
+ "name": "BoopfunSell"
553
+ },
554
+ {
555
+ "name": "MeteoraDbc2"
556
+ },
557
+ {
558
+ "name": "GooseFX"
559
+ },
560
+ {
561
+ "name": "Dooar"
562
+ },
563
+ {
564
+ "name": "Numeraire"
565
+ },
566
+ {
567
+ "name": "SaberDecimalWrapperDeposit"
568
+ },
569
+ {
570
+ "name": "SaberDecimalWrapperWithdraw"
571
+ },
572
+ {
573
+ "name": "SarosDlmm"
574
+ },
575
+ {
576
+ "name": "OneDexSwap"
577
+ },
578
+ {
579
+ "name": "Manifest"
580
+ },
581
+ {
582
+ "name": "ByrealClmm"
583
+ },
584
+ {
585
+ "name": "PancakeSwapV3Swap"
586
+ },
587
+ {
588
+ "name": "PancakeSwapV3SwapV2"
589
+ },
590
+ {
591
+ "name": "Tessera"
592
+ },
593
+ {
594
+ "name": "SolRfq"
595
+ }
596
+ ]
597
+ }
598
+ },
599
+ {
600
+ "name": "Route",
601
+ "type": {
602
+ "kind": "struct",
603
+ "fields": [
604
+ {
605
+ "name": "dexes",
606
+ "type": {
607
+ "vec": {
608
+ "defined": {
609
+ "name": "Dex"
610
+ }
611
+ }
612
+ }
613
+ },
614
+ {
615
+ "name": "weights",
616
+ "type": "bytes"
617
+ }
618
+ ]
619
+ }
620
+ },
621
+ {
622
+ "name": "Slippage",
623
+ "type": {
624
+ "kind": "enum",
625
+ "variants": [
626
+ {
627
+ "name": "Bps",
628
+ "fields": [
629
+ {
630
+ "name": "bps",
631
+ "type": "u16"
632
+ },
633
+ {
634
+ "name": "expect_amount_out",
635
+ "type": "u64"
636
+ }
637
+ ]
638
+ },
639
+ {
640
+ "name": "MinOut",
641
+ "fields": [
642
+ "u64"
643
+ ]
644
+ }
645
+ ]
646
+ }
647
+ },
648
+ {
649
+ "name": "SwapArgs",
650
+ "type": {
651
+ "kind": "struct",
652
+ "fields": [
653
+ {
654
+ "name": "amount_in",
655
+ "type": "u64"
656
+ },
657
+ {
658
+ "name": "min_return",
659
+ "type": "u64"
660
+ },
661
+ {
662
+ "name": "amounts",
663
+ "type": {
664
+ "vec": "u64"
665
+ }
666
+ },
667
+ {
668
+ "name": "routes",
669
+ "type": {
670
+ "vec": {
671
+ "vec": {
672
+ "defined": {
673
+ "name": "Route"
674
+ }
675
+ }
676
+ }
677
+ }
678
+ },
679
+ {
680
+ "name": "options",
681
+ "type": {
682
+ "option": {
683
+ "defined": {
684
+ "name": "SwapOptions"
685
+ }
686
+ }
687
+ }
688
+ }
689
+ ]
690
+ }
691
+ },
692
+ {
693
+ "name": "SwapOptions",
694
+ "type": {
695
+ "kind": "struct",
696
+ "fields": [
697
+ {
698
+ "name": "slippage",
699
+ "type": {
700
+ "option": {
701
+ "defined": {
702
+ "name": "Slippage"
703
+ }
704
+ }
705
+ }
706
+ }
707
+ ]
708
+ }
709
+ },
710
+ {
711
+ "name": "TenantWrapperConfig",
712
+ "type": {
713
+ "kind": "struct",
714
+ "fields": [
715
+ {
716
+ "name": "bump",
717
+ "type": "u8"
718
+ },
719
+ {
720
+ "name": "admin",
721
+ "type": "pubkey"
722
+ },
723
+ {
724
+ "name": "fee_bps",
725
+ "type": "u16"
726
+ },
727
+ {
728
+ "name": "_reserved",
729
+ "type": {
730
+ "array": [
731
+ "u8",
732
+ 64
733
+ ]
734
+ }
735
+ }
736
+ ]
737
+ }
738
+ }
739
+ ]
740
+ };