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,536 @@
1
+ [
2
+ {
3
+ "anonymous": false,
4
+ "inputs": [
5
+ {
6
+ "indexed": true,
7
+ "internalType": "bytes32",
8
+ "name": "digest",
9
+ "type": "bytes32"
10
+ },
11
+ {
12
+ "indexed": true,
13
+ "internalType": "bytes32",
14
+ "name": "subaccount",
15
+ "type": "bytes32"
16
+ },
17
+ {
18
+ "indexed": false,
19
+ "internalType": "int128",
20
+ "name": "priceX18",
21
+ "type": "int128"
22
+ },
23
+ {
24
+ "indexed": false,
25
+ "internalType": "int128",
26
+ "name": "amount",
27
+ "type": "int128"
28
+ },
29
+ {
30
+ "indexed": false,
31
+ "internalType": "uint64",
32
+ "name": "expiration",
33
+ "type": "uint64"
34
+ },
35
+ {
36
+ "indexed": false,
37
+ "internalType": "uint64",
38
+ "name": "nonce",
39
+ "type": "uint64"
40
+ },
41
+ {
42
+ "indexed": false,
43
+ "internalType": "bool",
44
+ "name": "isTaker",
45
+ "type": "bool"
46
+ },
47
+ {
48
+ "indexed": false,
49
+ "internalType": "int128",
50
+ "name": "feeAmount",
51
+ "type": "int128"
52
+ },
53
+ {
54
+ "indexed": false,
55
+ "internalType": "int128",
56
+ "name": "baseDelta",
57
+ "type": "int128"
58
+ },
59
+ {
60
+ "indexed": false,
61
+ "internalType": "int128",
62
+ "name": "quoteDelta",
63
+ "type": "int128"
64
+ }
65
+ ],
66
+ "name": "FillOrder",
67
+ "type": "event"
68
+ },
69
+ {
70
+ "inputs": [],
71
+ "name": "claimSequencerFee",
72
+ "outputs": [
73
+ {
74
+ "internalType": "int128",
75
+ "name": "",
76
+ "type": "int128"
77
+ }
78
+ ],
79
+ "stateMutability": "nonpayable",
80
+ "type": "function"
81
+ },
82
+ {
83
+ "inputs": [],
84
+ "name": "dumpFees",
85
+ "outputs": [],
86
+ "stateMutability": "nonpayable",
87
+ "type": "function"
88
+ },
89
+ {
90
+ "inputs": [
91
+ {
92
+ "components": [
93
+ {
94
+ "internalType": "bytes32",
95
+ "name": "sender",
96
+ "type": "bytes32"
97
+ },
98
+ {
99
+ "internalType": "int128",
100
+ "name": "priceX18",
101
+ "type": "int128"
102
+ },
103
+ {
104
+ "internalType": "int128",
105
+ "name": "amount",
106
+ "type": "int128"
107
+ },
108
+ {
109
+ "internalType": "uint64",
110
+ "name": "expiration",
111
+ "type": "uint64"
112
+ },
113
+ {
114
+ "internalType": "uint64",
115
+ "name": "nonce",
116
+ "type": "uint64"
117
+ }
118
+ ],
119
+ "internalType": "struct IEndpoint.Order",
120
+ "name": "order",
121
+ "type": "tuple"
122
+ }
123
+ ],
124
+ "name": "getDigest",
125
+ "outputs": [
126
+ {
127
+ "internalType": "bytes32",
128
+ "name": "",
129
+ "type": "bytes32"
130
+ }
131
+ ],
132
+ "stateMutability": "view",
133
+ "type": "function"
134
+ },
135
+ {
136
+ "inputs": [],
137
+ "name": "getMarket",
138
+ "outputs": [
139
+ {
140
+ "components": [
141
+ {
142
+ "internalType": "uint32",
143
+ "name": "productId",
144
+ "type": "uint32"
145
+ },
146
+ {
147
+ "internalType": "int128",
148
+ "name": "sizeIncrement",
149
+ "type": "int128"
150
+ },
151
+ {
152
+ "internalType": "int128",
153
+ "name": "priceIncrementX18",
154
+ "type": "int128"
155
+ },
156
+ {
157
+ "internalType": "int128",
158
+ "name": "lpSpreadX18",
159
+ "type": "int128"
160
+ },
161
+ {
162
+ "internalType": "int128",
163
+ "name": "collectedFees",
164
+ "type": "int128"
165
+ },
166
+ {
167
+ "internalType": "int128",
168
+ "name": "sequencerFees",
169
+ "type": "int128"
170
+ }
171
+ ],
172
+ "internalType": "struct IOffchainBook.Market",
173
+ "name": "",
174
+ "type": "tuple"
175
+ }
176
+ ],
177
+ "stateMutability": "view",
178
+ "type": "function"
179
+ },
180
+ {
181
+ "inputs": [],
182
+ "name": "getMinSize",
183
+ "outputs": [
184
+ {
185
+ "internalType": "int128",
186
+ "name": "",
187
+ "type": "int128"
188
+ }
189
+ ],
190
+ "stateMutability": "view",
191
+ "type": "function"
192
+ },
193
+ {
194
+ "inputs": [],
195
+ "name": "getVersion",
196
+ "outputs": [
197
+ {
198
+ "internalType": "uint64",
199
+ "name": "",
200
+ "type": "uint64"
201
+ }
202
+ ],
203
+ "stateMutability": "nonpayable",
204
+ "type": "function"
205
+ },
206
+ {
207
+ "inputs": [
208
+ {
209
+ "internalType": "contract IClearinghouse",
210
+ "name": "_clearinghouse",
211
+ "type": "address"
212
+ },
213
+ {
214
+ "internalType": "contract IProductEngine",
215
+ "name": "_engine",
216
+ "type": "address"
217
+ },
218
+ {
219
+ "internalType": "address",
220
+ "name": "_endpoint",
221
+ "type": "address"
222
+ },
223
+ {
224
+ "internalType": "address",
225
+ "name": "_admin",
226
+ "type": "address"
227
+ },
228
+ {
229
+ "internalType": "contract IFeeCalculator",
230
+ "name": "_fees",
231
+ "type": "address"
232
+ },
233
+ {
234
+ "internalType": "uint32",
235
+ "name": "_productId",
236
+ "type": "uint32"
237
+ },
238
+ {
239
+ "internalType": "int128",
240
+ "name": "_sizeIncrement",
241
+ "type": "int128"
242
+ },
243
+ {
244
+ "internalType": "int128",
245
+ "name": "_priceIncrementX18",
246
+ "type": "int128"
247
+ },
248
+ {
249
+ "internalType": "int128",
250
+ "name": "_minSize",
251
+ "type": "int128"
252
+ },
253
+ {
254
+ "internalType": "int128",
255
+ "name": "_lpSpreadX18",
256
+ "type": "int128"
257
+ }
258
+ ],
259
+ "name": "initialize",
260
+ "outputs": [],
261
+ "stateMutability": "nonpayable",
262
+ "type": "function"
263
+ },
264
+ {
265
+ "inputs": [
266
+ {
267
+ "components": [
268
+ {
269
+ "internalType": "uint32",
270
+ "name": "productId",
271
+ "type": "uint32"
272
+ },
273
+ {
274
+ "internalType": "int128",
275
+ "name": "baseDelta",
276
+ "type": "int128"
277
+ },
278
+ {
279
+ "internalType": "int128",
280
+ "name": "quoteDelta",
281
+ "type": "int128"
282
+ },
283
+ {
284
+ "components": [
285
+ {
286
+ "components": [
287
+ {
288
+ "internalType": "bytes32",
289
+ "name": "sender",
290
+ "type": "bytes32"
291
+ },
292
+ {
293
+ "internalType": "int128",
294
+ "name": "priceX18",
295
+ "type": "int128"
296
+ },
297
+ {
298
+ "internalType": "int128",
299
+ "name": "amount",
300
+ "type": "int128"
301
+ },
302
+ {
303
+ "internalType": "uint64",
304
+ "name": "expiration",
305
+ "type": "uint64"
306
+ },
307
+ {
308
+ "internalType": "uint64",
309
+ "name": "nonce",
310
+ "type": "uint64"
311
+ }
312
+ ],
313
+ "internalType": "struct IEndpoint.Order",
314
+ "name": "order",
315
+ "type": "tuple"
316
+ },
317
+ {
318
+ "internalType": "bytes",
319
+ "name": "signature",
320
+ "type": "bytes"
321
+ }
322
+ ],
323
+ "internalType": "struct IEndpoint.SignedOrder",
324
+ "name": "taker",
325
+ "type": "tuple"
326
+ }
327
+ ],
328
+ "internalType": "struct IEndpoint.MatchOrderAMM",
329
+ "name": "tx",
330
+ "type": "tuple"
331
+ },
332
+ {
333
+ "internalType": "address",
334
+ "name": "takerLinkedSigner",
335
+ "type": "address"
336
+ }
337
+ ],
338
+ "name": "matchOrderAMM",
339
+ "outputs": [],
340
+ "stateMutability": "nonpayable",
341
+ "type": "function"
342
+ },
343
+ {
344
+ "inputs": [
345
+ {
346
+ "components": [
347
+ {
348
+ "components": [
349
+ {
350
+ "internalType": "uint32",
351
+ "name": "productId",
352
+ "type": "uint32"
353
+ },
354
+ {
355
+ "internalType": "bool",
356
+ "name": "amm",
357
+ "type": "bool"
358
+ },
359
+ {
360
+ "components": [
361
+ {
362
+ "components": [
363
+ {
364
+ "internalType": "bytes32",
365
+ "name": "sender",
366
+ "type": "bytes32"
367
+ },
368
+ {
369
+ "internalType": "int128",
370
+ "name": "priceX18",
371
+ "type": "int128"
372
+ },
373
+ {
374
+ "internalType": "int128",
375
+ "name": "amount",
376
+ "type": "int128"
377
+ },
378
+ {
379
+ "internalType": "uint64",
380
+ "name": "expiration",
381
+ "type": "uint64"
382
+ },
383
+ {
384
+ "internalType": "uint64",
385
+ "name": "nonce",
386
+ "type": "uint64"
387
+ }
388
+ ],
389
+ "internalType": "struct IEndpoint.Order",
390
+ "name": "order",
391
+ "type": "tuple"
392
+ },
393
+ {
394
+ "internalType": "bytes",
395
+ "name": "signature",
396
+ "type": "bytes"
397
+ }
398
+ ],
399
+ "internalType": "struct IEndpoint.SignedOrder",
400
+ "name": "taker",
401
+ "type": "tuple"
402
+ },
403
+ {
404
+ "components": [
405
+ {
406
+ "components": [
407
+ {
408
+ "internalType": "bytes32",
409
+ "name": "sender",
410
+ "type": "bytes32"
411
+ },
412
+ {
413
+ "internalType": "int128",
414
+ "name": "priceX18",
415
+ "type": "int128"
416
+ },
417
+ {
418
+ "internalType": "int128",
419
+ "name": "amount",
420
+ "type": "int128"
421
+ },
422
+ {
423
+ "internalType": "uint64",
424
+ "name": "expiration",
425
+ "type": "uint64"
426
+ },
427
+ {
428
+ "internalType": "uint64",
429
+ "name": "nonce",
430
+ "type": "uint64"
431
+ }
432
+ ],
433
+ "internalType": "struct IEndpoint.Order",
434
+ "name": "order",
435
+ "type": "tuple"
436
+ },
437
+ {
438
+ "internalType": "bytes",
439
+ "name": "signature",
440
+ "type": "bytes"
441
+ }
442
+ ],
443
+ "internalType": "struct IEndpoint.SignedOrder",
444
+ "name": "maker",
445
+ "type": "tuple"
446
+ }
447
+ ],
448
+ "internalType": "struct IEndpoint.MatchOrders",
449
+ "name": "matchOrders",
450
+ "type": "tuple"
451
+ },
452
+ {
453
+ "internalType": "address",
454
+ "name": "takerLinkedSigner",
455
+ "type": "address"
456
+ },
457
+ {
458
+ "internalType": "address",
459
+ "name": "makerLinkedSigner",
460
+ "type": "address"
461
+ }
462
+ ],
463
+ "internalType": "struct IEndpoint.MatchOrdersWithSigner",
464
+ "name": "tx",
465
+ "type": "tuple"
466
+ }
467
+ ],
468
+ "name": "matchOrders",
469
+ "outputs": [],
470
+ "stateMutability": "nonpayable",
471
+ "type": "function"
472
+ },
473
+ {
474
+ "inputs": [
475
+ {
476
+ "internalType": "int128",
477
+ "name": "_sizeIncrement",
478
+ "type": "int128"
479
+ },
480
+ {
481
+ "internalType": "int128",
482
+ "name": "_priceIncrementX18",
483
+ "type": "int128"
484
+ },
485
+ {
486
+ "internalType": "int128",
487
+ "name": "_minSize",
488
+ "type": "int128"
489
+ },
490
+ {
491
+ "internalType": "int128",
492
+ "name": "_lpSpreadX18",
493
+ "type": "int128"
494
+ }
495
+ ],
496
+ "name": "modifyConfig",
497
+ "outputs": [],
498
+ "stateMutability": "nonpayable",
499
+ "type": "function"
500
+ },
501
+ {
502
+ "inputs": [
503
+ {
504
+ "components": [
505
+ {
506
+ "internalType": "bytes32",
507
+ "name": "sender",
508
+ "type": "bytes32"
509
+ },
510
+ {
511
+ "internalType": "uint32",
512
+ "name": "productId",
513
+ "type": "uint32"
514
+ },
515
+ {
516
+ "internalType": "int128",
517
+ "name": "amount",
518
+ "type": "int128"
519
+ },
520
+ {
521
+ "internalType": "int128",
522
+ "name": "priceX18",
523
+ "type": "int128"
524
+ }
525
+ ],
526
+ "internalType": "struct IEndpoint.SwapAMM",
527
+ "name": "tx",
528
+ "type": "tuple"
529
+ }
530
+ ],
531
+ "name": "swapAMM",
532
+ "outputs": [],
533
+ "stateMutability": "nonpayable",
534
+ "type": "function"
535
+ }
536
+ ]