nado-protocol 0.1.0__py3-none-any.whl

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.
Files changed (78) hide show
  1. nado_protocol/__init__.py +0 -0
  2. nado_protocol/client/__init__.py +200 -0
  3. nado_protocol/client/apis/__init__.py +26 -0
  4. nado_protocol/client/apis/base.py +42 -0
  5. nado_protocol/client/apis/market/__init__.py +23 -0
  6. nado_protocol/client/apis/market/execute.py +192 -0
  7. nado_protocol/client/apis/market/query.py +310 -0
  8. nado_protocol/client/apis/perp/__init__.py +18 -0
  9. nado_protocol/client/apis/perp/query.py +30 -0
  10. nado_protocol/client/apis/rewards/__init__.py +6 -0
  11. nado_protocol/client/apis/rewards/execute.py +131 -0
  12. nado_protocol/client/apis/rewards/query.py +12 -0
  13. nado_protocol/client/apis/spot/__init__.py +23 -0
  14. nado_protocol/client/apis/spot/base.py +32 -0
  15. nado_protocol/client/apis/spot/execute.py +117 -0
  16. nado_protocol/client/apis/spot/query.py +79 -0
  17. nado_protocol/client/apis/subaccount/__init__.py +24 -0
  18. nado_protocol/client/apis/subaccount/execute.py +54 -0
  19. nado_protocol/client/apis/subaccount/query.py +145 -0
  20. nado_protocol/client/context.py +90 -0
  21. nado_protocol/contracts/__init__.py +377 -0
  22. nado_protocol/contracts/abis/Endpoint.json +636 -0
  23. nado_protocol/contracts/abis/FQuerier.json +1909 -0
  24. nado_protocol/contracts/abis/IClearinghouse.json +876 -0
  25. nado_protocol/contracts/abis/IERC20.json +185 -0
  26. nado_protocol/contracts/abis/IEndpoint.json +250 -0
  27. nado_protocol/contracts/abis/IFoundationRewardsAirdrop.json +76 -0
  28. nado_protocol/contracts/abis/IOffchainBook.json +536 -0
  29. nado_protocol/contracts/abis/IPerpEngine.json +931 -0
  30. nado_protocol/contracts/abis/IProductEngine.json +352 -0
  31. nado_protocol/contracts/abis/ISpotEngine.json +813 -0
  32. nado_protocol/contracts/abis/IStaking.json +288 -0
  33. nado_protocol/contracts/abis/IVrtxAirdrop.json +138 -0
  34. nado_protocol/contracts/abis/MockERC20.json +311 -0
  35. nado_protocol/contracts/deployments/deployment.test.json +18 -0
  36. nado_protocol/contracts/eip712/__init__.py +16 -0
  37. nado_protocol/contracts/eip712/domain.py +36 -0
  38. nado_protocol/contracts/eip712/sign.py +79 -0
  39. nado_protocol/contracts/eip712/types.py +154 -0
  40. nado_protocol/contracts/loader.py +55 -0
  41. nado_protocol/contracts/types.py +141 -0
  42. nado_protocol/engine_client/__init__.py +35 -0
  43. nado_protocol/engine_client/execute.py +416 -0
  44. nado_protocol/engine_client/query.py +481 -0
  45. nado_protocol/engine_client/types/__init__.py +113 -0
  46. nado_protocol/engine_client/types/execute.py +680 -0
  47. nado_protocol/engine_client/types/models.py +247 -0
  48. nado_protocol/engine_client/types/query.py +516 -0
  49. nado_protocol/engine_client/types/stream.py +6 -0
  50. nado_protocol/indexer_client/__init__.py +28 -0
  51. nado_protocol/indexer_client/query.py +466 -0
  52. nado_protocol/indexer_client/types/__init__.py +122 -0
  53. nado_protocol/indexer_client/types/models.py +364 -0
  54. nado_protocol/indexer_client/types/query.py +819 -0
  55. nado_protocol/trigger_client/__init__.py +17 -0
  56. nado_protocol/trigger_client/execute.py +118 -0
  57. nado_protocol/trigger_client/query.py +61 -0
  58. nado_protocol/trigger_client/types/__init__.py +7 -0
  59. nado_protocol/trigger_client/types/execute.py +89 -0
  60. nado_protocol/trigger_client/types/models.py +44 -0
  61. nado_protocol/trigger_client/types/query.py +77 -0
  62. nado_protocol/utils/__init__.py +37 -0
  63. nado_protocol/utils/backend.py +111 -0
  64. nado_protocol/utils/bytes32.py +159 -0
  65. nado_protocol/utils/enum.py +6 -0
  66. nado_protocol/utils/exceptions.py +58 -0
  67. nado_protocol/utils/execute.py +403 -0
  68. nado_protocol/utils/expiration.py +45 -0
  69. nado_protocol/utils/interest.py +66 -0
  70. nado_protocol/utils/math.py +67 -0
  71. nado_protocol/utils/model.py +79 -0
  72. nado_protocol/utils/nonce.py +33 -0
  73. nado_protocol/utils/subaccount.py +18 -0
  74. nado_protocol/utils/time.py +21 -0
  75. nado_protocol-0.1.0.dist-info/METADATA +157 -0
  76. nado_protocol-0.1.0.dist-info/RECORD +78 -0
  77. nado_protocol-0.1.0.dist-info/WHEEL +4 -0
  78. nado_protocol-0.1.0.dist-info/entry_points.txt +11 -0
@@ -0,0 +1,636 @@
1
+ [
2
+ {
3
+ "anonymous": false,
4
+ "inputs": [
5
+ {
6
+ "indexed": false,
7
+ "internalType": "uint8",
8
+ "name": "version",
9
+ "type": "uint8"
10
+ }
11
+ ],
12
+ "name": "Initialized",
13
+ "type": "event"
14
+ },
15
+ {
16
+ "anonymous": false,
17
+ "inputs": [
18
+ {
19
+ "indexed": true,
20
+ "internalType": "address",
21
+ "name": "previousOwner",
22
+ "type": "address"
23
+ },
24
+ {
25
+ "indexed": true,
26
+ "internalType": "address",
27
+ "name": "newOwner",
28
+ "type": "address"
29
+ }
30
+ ],
31
+ "name": "OwnershipTransferred",
32
+ "type": "event"
33
+ },
34
+ {
35
+ "anonymous": false,
36
+ "inputs": [],
37
+ "name": "SubmitTransactions",
38
+ "type": "event"
39
+ },
40
+ {
41
+ "inputs": [],
42
+ "name": "clearinghouse",
43
+ "outputs": [
44
+ {
45
+ "internalType": "contract IClearinghouse",
46
+ "name": "",
47
+ "type": "address"
48
+ }
49
+ ],
50
+ "stateMutability": "view",
51
+ "type": "function"
52
+ },
53
+ {
54
+ "inputs": [
55
+ {
56
+ "internalType": "bytes12",
57
+ "name": "subaccountName",
58
+ "type": "bytes12"
59
+ },
60
+ {
61
+ "internalType": "uint32",
62
+ "name": "productId",
63
+ "type": "uint32"
64
+ },
65
+ {
66
+ "internalType": "uint128",
67
+ "name": "amount",
68
+ "type": "uint128"
69
+ }
70
+ ],
71
+ "name": "depositCollateral",
72
+ "outputs": [],
73
+ "stateMutability": "nonpayable",
74
+ "type": "function"
75
+ },
76
+ {
77
+ "inputs": [
78
+ {
79
+ "internalType": "bytes32",
80
+ "name": "subaccount",
81
+ "type": "bytes32"
82
+ },
83
+ {
84
+ "internalType": "uint32",
85
+ "name": "productId",
86
+ "type": "uint32"
87
+ },
88
+ {
89
+ "internalType": "uint128",
90
+ "name": "amount",
91
+ "type": "uint128"
92
+ },
93
+ {
94
+ "internalType": "string",
95
+ "name": "referralCode",
96
+ "type": "string"
97
+ }
98
+ ],
99
+ "name": "depositCollateralWithReferral",
100
+ "outputs": [],
101
+ "stateMutability": "nonpayable",
102
+ "type": "function"
103
+ },
104
+ {
105
+ "inputs": [
106
+ {
107
+ "internalType": "bytes12",
108
+ "name": "subaccountName",
109
+ "type": "bytes12"
110
+ },
111
+ {
112
+ "internalType": "uint32",
113
+ "name": "productId",
114
+ "type": "uint32"
115
+ },
116
+ {
117
+ "internalType": "uint128",
118
+ "name": "amount",
119
+ "type": "uint128"
120
+ },
121
+ {
122
+ "internalType": "string",
123
+ "name": "referralCode",
124
+ "type": "string"
125
+ }
126
+ ],
127
+ "name": "depositCollateralWithReferral",
128
+ "outputs": [],
129
+ "stateMutability": "nonpayable",
130
+ "type": "function"
131
+ },
132
+ {
133
+ "inputs": [
134
+ {
135
+ "internalType": "uint32",
136
+ "name": "count",
137
+ "type": "uint32"
138
+ }
139
+ ],
140
+ "name": "executeSlowModeTransactions",
141
+ "outputs": [],
142
+ "stateMutability": "nonpayable",
143
+ "type": "function"
144
+ },
145
+ {
146
+ "inputs": [
147
+ {
148
+ "internalType": "uint32",
149
+ "name": "productId",
150
+ "type": "uint32"
151
+ }
152
+ ],
153
+ "name": "getBook",
154
+ "outputs": [
155
+ {
156
+ "internalType": "address",
157
+ "name": "",
158
+ "type": "address"
159
+ }
160
+ ],
161
+ "stateMutability": "view",
162
+ "type": "function"
163
+ },
164
+ {
165
+ "inputs": [
166
+ {
167
+ "internalType": "address",
168
+ "name": "sender",
169
+ "type": "address"
170
+ }
171
+ ],
172
+ "name": "getNonce",
173
+ "outputs": [
174
+ {
175
+ "internalType": "uint64",
176
+ "name": "",
177
+ "type": "uint64"
178
+ }
179
+ ],
180
+ "stateMutability": "view",
181
+ "type": "function"
182
+ },
183
+ {
184
+ "inputs": [
185
+ {
186
+ "internalType": "uint32",
187
+ "name": "productId",
188
+ "type": "uint32"
189
+ }
190
+ ],
191
+ "name": "getPriceX18",
192
+ "outputs": [
193
+ {
194
+ "internalType": "int128",
195
+ "name": "priceX18",
196
+ "type": "int128"
197
+ }
198
+ ],
199
+ "stateMutability": "view",
200
+ "type": "function"
201
+ },
202
+ {
203
+ "inputs": [
204
+ {
205
+ "internalType": "uint32",
206
+ "name": "healthGroup",
207
+ "type": "uint32"
208
+ }
209
+ ],
210
+ "name": "getPricesX18",
211
+ "outputs": [
212
+ {
213
+ "components": [
214
+ {
215
+ "internalType": "int128",
216
+ "name": "spotPriceX18",
217
+ "type": "int128"
218
+ },
219
+ {
220
+ "internalType": "int128",
221
+ "name": "perpPriceX18",
222
+ "type": "int128"
223
+ }
224
+ ],
225
+ "internalType": "struct IEndpoint.Prices",
226
+ "name": "",
227
+ "type": "tuple"
228
+ }
229
+ ],
230
+ "stateMutability": "view",
231
+ "type": "function"
232
+ },
233
+ {
234
+ "inputs": [],
235
+ "name": "getSequencer",
236
+ "outputs": [
237
+ {
238
+ "internalType": "address",
239
+ "name": "",
240
+ "type": "address"
241
+ }
242
+ ],
243
+ "stateMutability": "view",
244
+ "type": "function"
245
+ },
246
+ {
247
+ "inputs": [
248
+ {
249
+ "internalType": "bytes32",
250
+ "name": "subaccount",
251
+ "type": "bytes32"
252
+ }
253
+ ],
254
+ "name": "getSubaccountId",
255
+ "outputs": [
256
+ {
257
+ "internalType": "uint64",
258
+ "name": "",
259
+ "type": "uint64"
260
+ }
261
+ ],
262
+ "stateMutability": "view",
263
+ "type": "function"
264
+ },
265
+ {
266
+ "inputs": [],
267
+ "name": "getTime",
268
+ "outputs": [
269
+ {
270
+ "internalType": "uint128",
271
+ "name": "",
272
+ "type": "uint128"
273
+ }
274
+ ],
275
+ "stateMutability": "view",
276
+ "type": "function"
277
+ },
278
+ {
279
+ "inputs": [],
280
+ "name": "getVersion",
281
+ "outputs": [
282
+ {
283
+ "internalType": "uint64",
284
+ "name": "",
285
+ "type": "uint64"
286
+ }
287
+ ],
288
+ "stateMutability": "pure",
289
+ "type": "function"
290
+ },
291
+ {
292
+ "inputs": [
293
+ {
294
+ "internalType": "address",
295
+ "name": "_sanctions",
296
+ "type": "address"
297
+ },
298
+ {
299
+ "internalType": "address",
300
+ "name": "_sequencer",
301
+ "type": "address"
302
+ },
303
+ {
304
+ "internalType": "contract IClearinghouse",
305
+ "name": "_clearinghouse",
306
+ "type": "address"
307
+ },
308
+ {
309
+ "internalType": "uint64",
310
+ "name": "slowModeTimeout",
311
+ "type": "uint64"
312
+ },
313
+ {
314
+ "internalType": "uint128",
315
+ "name": "_time",
316
+ "type": "uint128"
317
+ },
318
+ {
319
+ "internalType": "int128[]",
320
+ "name": "_prices",
321
+ "type": "int128[]"
322
+ }
323
+ ],
324
+ "name": "initialize",
325
+ "outputs": [],
326
+ "stateMutability": "nonpayable",
327
+ "type": "function"
328
+ },
329
+ {
330
+ "inputs": [],
331
+ "name": "nSubmissions",
332
+ "outputs": [
333
+ {
334
+ "internalType": "uint64",
335
+ "name": "",
336
+ "type": "uint64"
337
+ }
338
+ ],
339
+ "stateMutability": "view",
340
+ "type": "function"
341
+ },
342
+ {
343
+ "inputs": [],
344
+ "name": "owner",
345
+ "outputs": [
346
+ {
347
+ "internalType": "address",
348
+ "name": "",
349
+ "type": "address"
350
+ }
351
+ ],
352
+ "stateMutability": "view",
353
+ "type": "function"
354
+ },
355
+ {
356
+ "inputs": [
357
+ {
358
+ "internalType": "address",
359
+ "name": "sender",
360
+ "type": "address"
361
+ },
362
+ {
363
+ "internalType": "bytes",
364
+ "name": "transaction",
365
+ "type": "bytes"
366
+ }
367
+ ],
368
+ "name": "processSlowModeTransaction",
369
+ "outputs": [],
370
+ "stateMutability": "nonpayable",
371
+ "type": "function"
372
+ },
373
+ {
374
+ "inputs": [
375
+ {
376
+ "internalType": "address",
377
+ "name": "",
378
+ "type": "address"
379
+ }
380
+ ],
381
+ "name": "referralCodes",
382
+ "outputs": [
383
+ {
384
+ "internalType": "string",
385
+ "name": "",
386
+ "type": "string"
387
+ }
388
+ ],
389
+ "stateMutability": "view",
390
+ "type": "function"
391
+ },
392
+ {
393
+ "inputs": [
394
+ {
395
+ "internalType": "address",
396
+ "name": "wallet",
397
+ "type": "address"
398
+ },
399
+ {
400
+ "internalType": "bool",
401
+ "name": "transferable",
402
+ "type": "bool"
403
+ }
404
+ ],
405
+ "name": "registerTransferableWallet",
406
+ "outputs": [],
407
+ "stateMutability": "nonpayable",
408
+ "type": "function"
409
+ },
410
+ {
411
+ "inputs": [],
412
+ "name": "renounceOwnership",
413
+ "outputs": [],
414
+ "stateMutability": "nonpayable",
415
+ "type": "function"
416
+ },
417
+ {
418
+ "inputs": [
419
+ {
420
+ "internalType": "bytes32",
421
+ "name": "subaccount",
422
+ "type": "bytes32"
423
+ }
424
+ ],
425
+ "name": "requireSubaccount",
426
+ "outputs": [],
427
+ "stateMutability": "view",
428
+ "type": "function"
429
+ },
430
+ {
431
+ "inputs": [
432
+ {
433
+ "internalType": "uint32",
434
+ "name": "",
435
+ "type": "uint32"
436
+ }
437
+ ],
438
+ "name": "sequencerFee",
439
+ "outputs": [
440
+ {
441
+ "internalType": "int128",
442
+ "name": "",
443
+ "type": "int128"
444
+ }
445
+ ],
446
+ "stateMutability": "view",
447
+ "type": "function"
448
+ },
449
+ {
450
+ "inputs": [],
451
+ "name": "sequencerFees",
452
+ "outputs": [
453
+ {
454
+ "internalType": "int128",
455
+ "name": "",
456
+ "type": "int128"
457
+ }
458
+ ],
459
+ "stateMutability": "view",
460
+ "type": "function"
461
+ },
462
+ {
463
+ "inputs": [
464
+ {
465
+ "internalType": "uint32",
466
+ "name": "productId",
467
+ "type": "uint32"
468
+ },
469
+ {
470
+ "internalType": "address",
471
+ "name": "book",
472
+ "type": "address"
473
+ }
474
+ ],
475
+ "name": "setBook",
476
+ "outputs": [],
477
+ "stateMutability": "nonpayable",
478
+ "type": "function"
479
+ },
480
+ {
481
+ "inputs": [
482
+ {
483
+ "internalType": "address",
484
+ "name": "_sequencer",
485
+ "type": "address"
486
+ }
487
+ ],
488
+ "name": "setSequencer",
489
+ "outputs": [],
490
+ "stateMutability": "nonpayable",
491
+ "type": "function"
492
+ },
493
+ {
494
+ "inputs": [],
495
+ "name": "slowModeConfig",
496
+ "outputs": [
497
+ {
498
+ "internalType": "uint64",
499
+ "name": "timeout",
500
+ "type": "uint64"
501
+ },
502
+ {
503
+ "internalType": "uint64",
504
+ "name": "txCount",
505
+ "type": "uint64"
506
+ },
507
+ {
508
+ "internalType": "uint64",
509
+ "name": "txUpTo",
510
+ "type": "uint64"
511
+ }
512
+ ],
513
+ "stateMutability": "view",
514
+ "type": "function"
515
+ },
516
+ {
517
+ "inputs": [
518
+ {
519
+ "internalType": "uint64",
520
+ "name": "",
521
+ "type": "uint64"
522
+ }
523
+ ],
524
+ "name": "slowModeTxs",
525
+ "outputs": [
526
+ {
527
+ "internalType": "uint64",
528
+ "name": "executableAt",
529
+ "type": "uint64"
530
+ },
531
+ {
532
+ "internalType": "address",
533
+ "name": "sender",
534
+ "type": "address"
535
+ },
536
+ {
537
+ "internalType": "bytes",
538
+ "name": "tx",
539
+ "type": "bytes"
540
+ }
541
+ ],
542
+ "stateMutability": "view",
543
+ "type": "function"
544
+ },
545
+ {
546
+ "inputs": [
547
+ {
548
+ "internalType": "bytes",
549
+ "name": "transaction",
550
+ "type": "bytes"
551
+ }
552
+ ],
553
+ "name": "submitSlowModeTransaction",
554
+ "outputs": [],
555
+ "stateMutability": "nonpayable",
556
+ "type": "function"
557
+ },
558
+ {
559
+ "inputs": [
560
+ {
561
+ "internalType": "bytes[]",
562
+ "name": "transactions",
563
+ "type": "bytes[]"
564
+ }
565
+ ],
566
+ "name": "submitTransactions",
567
+ "outputs": [],
568
+ "stateMutability": "nonpayable",
569
+ "type": "function"
570
+ },
571
+ {
572
+ "inputs": [
573
+ {
574
+ "internalType": "uint64",
575
+ "name": "idx",
576
+ "type": "uint64"
577
+ },
578
+ {
579
+ "internalType": "bytes[]",
580
+ "name": "transactions",
581
+ "type": "bytes[]"
582
+ }
583
+ ],
584
+ "name": "submitTransactionsChecked",
585
+ "outputs": [],
586
+ "stateMutability": "nonpayable",
587
+ "type": "function"
588
+ },
589
+ {
590
+ "inputs": [
591
+ {
592
+ "internalType": "uint64",
593
+ "name": "idx",
594
+ "type": "uint64"
595
+ },
596
+ {
597
+ "internalType": "bytes[]",
598
+ "name": "transactions",
599
+ "type": "bytes[]"
600
+ },
601
+ {
602
+ "internalType": "uint256",
603
+ "name": "gasLimit",
604
+ "type": "uint256"
605
+ }
606
+ ],
607
+ "name": "submitTransactionsCheckedWithGasLimit",
608
+ "outputs": [
609
+ {
610
+ "internalType": "uint64",
611
+ "name": "",
612
+ "type": "uint64"
613
+ },
614
+ {
615
+ "internalType": "uint256",
616
+ "name": "",
617
+ "type": "uint256"
618
+ }
619
+ ],
620
+ "stateMutability": "nonpayable",
621
+ "type": "function"
622
+ },
623
+ {
624
+ "inputs": [
625
+ {
626
+ "internalType": "address",
627
+ "name": "newOwner",
628
+ "type": "address"
629
+ }
630
+ ],
631
+ "name": "transferOwnership",
632
+ "outputs": [],
633
+ "stateMutability": "nonpayable",
634
+ "type": "function"
635
+ }
636
+ ]