zklighter-perps 1.0.15 → 1.0.17

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/openapi.json CHANGED
@@ -73,15 +73,6 @@
73
73
  "in": "query",
74
74
  "required": true,
75
75
  "type": "string"
76
- },
77
- {
78
- "name": "sub_account_index",
79
- "description": " NilSubAccountIndex",
80
- "in": "query",
81
- "required": true,
82
- "type": "integer",
83
- "format": "uint8",
84
- "default": "255"
85
76
  }
86
77
  ],
87
78
  "tags": [
@@ -90,7 +81,7 @@
90
81
  "consumes": [
91
82
  "multipart/form-data"
92
83
  ],
93
- "description": "Get account by main account's l1_address or index and sub account's index. Returns detailed account info"
84
+ "description": "Get account by account's l1_address or index. Returns detailed account info"
94
85
  }
95
86
  },
96
87
  "/api/v1/accountActiveOrders": {
@@ -119,15 +110,6 @@
119
110
  "type": "integer",
120
111
  "format": "int32"
121
112
  },
122
- {
123
- "name": "sub_account_index",
124
- "description": " NilSubAccountIndex",
125
- "in": "query",
126
- "required": true,
127
- "type": "integer",
128
- "format": "uint8",
129
- "default": "255"
130
- },
131
113
  {
132
114
  "name": "market_id",
133
115
  "in": "query",
@@ -171,15 +153,6 @@
171
153
  "type": "integer",
172
154
  "format": "int32"
173
155
  },
174
- {
175
- "name": "sub_account_index",
176
- "description": " NilSubAccountIndex",
177
- "in": "query",
178
- "required": true,
179
- "type": "integer",
180
- "format": "uint8",
181
- "default": "255"
182
- },
183
156
  {
184
157
  "name": "filter",
185
158
  "in": "query",
@@ -408,7 +381,7 @@
408
381
  "200": {
409
382
  "description": "A successful response.",
410
383
  "schema": {
411
- "$ref": "#/definitions/MainAccounts"
384
+ "$ref": "#/definitions/Accounts"
412
385
  }
413
386
  },
414
387
  "400": {
@@ -453,7 +426,7 @@
453
426
  "consumes": [
454
427
  "multipart/form-data"
455
428
  ],
456
- "description": "Get accounts returns main accounts by account index"
429
+ "description": "Get accounts returns accounts by account index"
457
430
  }
458
431
  },
459
432
  "/api/v1/accountsByL1Address": {
@@ -488,7 +461,7 @@
488
461
  "consumes": [
489
462
  "multipart/form-data"
490
463
  ],
491
- "description": "Get accounts by l1_address returns main account and its sub accounts"
464
+ "description": "Get accounts by l1_address returns all accounts associated with the given L1 address"
492
465
  }
493
466
  },
494
467
  "/api/v1/block": {
@@ -941,6 +914,67 @@
941
914
  "description": "Get zklighter general info, including contract address, and count of transactions and active users"
942
915
  }
943
916
  },
917
+ "/api/v1/markNotifRead": {
918
+ "get": {
919
+ "summary": "MarkNotifRead",
920
+ "operationId": "MarkNotifRead",
921
+ "responses": {
922
+ "200": {
923
+ "description": "A successful response.",
924
+ "schema": {
925
+ "$ref": "#/definitions/ResultCode"
926
+ }
927
+ },
928
+ "400": {
929
+ "description": "Bad request",
930
+ "schema": {
931
+ "$ref": "#/definitions/ResultCode"
932
+ }
933
+ }
934
+ },
935
+ "parameters": [
936
+ {
937
+ "name": "notif_type",
938
+ "in": "query",
939
+ "required": true,
940
+ "type": "string"
941
+ },
942
+ {
943
+ "name": "account_index",
944
+ "in": "query",
945
+ "required": true,
946
+ "type": "integer",
947
+ "format": "int32"
948
+ },
949
+ {
950
+ "name": "api_key_index",
951
+ "in": "query",
952
+ "required": true,
953
+ "type": "integer",
954
+ "format": "uint8"
955
+ },
956
+ {
957
+ "name": "liquidation_ids",
958
+ "in": "query",
959
+ "required": true,
960
+ "type": "string"
961
+ },
962
+ {
963
+ "name": "signature",
964
+ "in": "query",
965
+ "required": true,
966
+ "type": "string"
967
+ }
968
+ ],
969
+ "tags": [
970
+ "liquidation"
971
+ ],
972
+ "consumes": [
973
+ "multipart/form-data"
974
+ ],
975
+ "description": "Mark"
976
+ }
977
+ },
944
978
  "/api/v1/nextNonce": {
945
979
  "get": {
946
980
  "summary": "GetNextNonce",
@@ -968,7 +1002,7 @@
968
1002
  "format": "int32"
969
1003
  },
970
1004
  {
971
- "name": "sub_account_index",
1005
+ "name": "api_key_index",
972
1006
  "in": "query",
973
1007
  "required": true,
974
1008
  "type": "integer",
@@ -1703,6 +1737,44 @@
1703
1737
  }
1704
1738
  },
1705
1739
  "definitions": {
1740
+ "Account": {
1741
+ "type": "object",
1742
+ "properties": {
1743
+ "code": {
1744
+ "type": "integer",
1745
+ "format": "int32",
1746
+ "example": "100"
1747
+ },
1748
+ "message": {
1749
+ "type": "string"
1750
+ },
1751
+ "index": {
1752
+ "type": "integer",
1753
+ "format": "int32",
1754
+ "example": "1"
1755
+ },
1756
+ "l1_address": {
1757
+ "type": "string",
1758
+ "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
1759
+ },
1760
+ "status": {
1761
+ "type": "integer",
1762
+ "format": "int32",
1763
+ "example": "1"
1764
+ },
1765
+ "collateral": {
1766
+ "type": "string",
1767
+ "example": "46342"
1768
+ }
1769
+ },
1770
+ "title": "Account",
1771
+ "required": [
1772
+ "index",
1773
+ "l1_address",
1774
+ "status",
1775
+ "collateral"
1776
+ ]
1777
+ },
1706
1778
  "AccountMarketStats": {
1707
1779
  "type": "object",
1708
1780
  "properties": {
@@ -1873,6 +1945,35 @@
1873
1945
  "buying_power"
1874
1946
  ]
1875
1947
  },
1948
+ "Accounts": {
1949
+ "type": "object",
1950
+ "properties": {
1951
+ "code": {
1952
+ "type": "integer",
1953
+ "format": "int32",
1954
+ "example": "100"
1955
+ },
1956
+ "message": {
1957
+ "type": "string"
1958
+ },
1959
+ "total": {
1960
+ "type": "integer",
1961
+ "format": "int32",
1962
+ "example": "1"
1963
+ },
1964
+ "accounts": {
1965
+ "type": "array",
1966
+ "items": {
1967
+ "$ref": "#/definitions/Account"
1968
+ }
1969
+ }
1970
+ },
1971
+ "title": "Accounts",
1972
+ "required": [
1973
+ "total",
1974
+ "accounts"
1975
+ ]
1976
+ },
1876
1977
  "Block": {
1877
1978
  "type": "object",
1878
1979
  "properties": {
@@ -2113,38 +2214,19 @@
2113
2214
  "format": "int32",
2114
2215
  "example": "1"
2115
2216
  },
2116
- "sub_account_index": {
2117
- "type": "integer",
2118
- "format": "uint8",
2119
- "example": "1"
2120
- },
2121
2217
  "l1_address": {
2122
2218
  "type": "string",
2123
2219
  "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
2124
2220
  },
2125
- "pk": {
2126
- "type": "string",
2127
- "example": "3ac126b0a0a3cc8cb367ef67a5c77389a85e08e20ce8da3edf34d022e9bf1ab8"
2128
- },
2129
- "nonce": {
2130
- "type": "integer",
2131
- "format": "int64",
2132
- "example": "722"
2133
- },
2134
2221
  "status": {
2135
2222
  "type": "integer",
2136
- "format": "uint8",
2223
+ "format": "int32",
2137
2224
  "example": "1"
2138
2225
  },
2139
2226
  "collateral": {
2140
2227
  "type": "string",
2141
2228
  "example": "46342"
2142
2229
  },
2143
- "collateral_type": {
2144
- "type": "integer",
2145
- "format": "uint8",
2146
- "example": "1"
2147
- },
2148
2230
  "positions": {
2149
2231
  "type": "array",
2150
2232
  "items": {
@@ -2267,7 +2349,7 @@
2267
2349
  "format": "int64",
2268
2350
  "example": "1640995200"
2269
2351
  },
2270
- "verify_at": {
2352
+ "executed_at": {
2271
2353
  "type": "integer",
2272
2354
  "format": "int64",
2273
2355
  "example": "1640995200"
@@ -2286,11 +2368,6 @@
2286
2368
  "type": "integer",
2287
2369
  "format": "int64",
2288
2370
  "example": "1640995200"
2289
- },
2290
- "executed_at": {
2291
- "type": "integer",
2292
- "format": "int64",
2293
- "example": "1640995200"
2294
2371
  }
2295
2372
  },
2296
2373
  "title": "EnrichedTx",
@@ -2524,67 +2601,23 @@
2524
2601
  "total_transaction_count"
2525
2602
  ]
2526
2603
  },
2527
- "MainAccount": {
2604
+ "Liquidation": {
2528
2605
  "type": "object",
2529
2606
  "properties": {
2530
- "code": {
2531
- "type": "integer",
2532
- "format": "int32",
2533
- "example": "100"
2534
- },
2535
- "message": {
2536
- "type": "string"
2537
- },
2538
- "index": {
2607
+ "LiquidationId": {
2539
2608
  "type": "integer",
2540
- "format": "int32",
2541
- "example": "1"
2542
- },
2543
- "l1_address": {
2544
- "type": "string",
2545
- "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
2609
+ "format": "int64"
2546
2610
  },
2547
- "status": {
2548
- "type": "integer",
2549
- "format": "int32",
2550
- "example": "1"
2551
- }
2552
- },
2553
- "title": "MainAccount",
2554
- "required": [
2555
- "index",
2556
- "l1_address",
2557
- "status"
2558
- ]
2559
- },
2560
- "MainAccounts": {
2561
- "type": "object",
2562
- "properties": {
2563
- "code": {
2611
+ "AccountIndex": {
2564
2612
  "type": "integer",
2565
- "format": "int32",
2566
- "example": "100"
2567
- },
2568
- "message": {
2569
- "type": "string"
2613
+ "format": "int32"
2570
2614
  },
2571
- "total": {
2615
+ "LiquidationType": {
2572
2616
  "type": "integer",
2573
- "format": "int32",
2574
- "example": "1"
2575
- },
2576
- "accounts": {
2577
- "type": "array",
2578
- "items": {
2579
- "$ref": "#/definitions/MainAccount"
2580
- }
2617
+ "format": "uint8"
2581
2618
  }
2582
2619
  },
2583
- "title": "MainAccounts",
2584
- "required": [
2585
- "total",
2586
- "accounts"
2587
- ]
2620
+ "title": "Liquidation"
2588
2621
  },
2589
2622
  "MarketInfo": {
2590
2623
  "type": "object",
@@ -2686,14 +2719,9 @@
2686
2719
  "format": "uin16",
2687
2720
  "example": "1"
2688
2721
  },
2689
- "ownerMainAccountIndex": {
2690
- "type": "integer",
2691
- "format": "int64",
2692
- "description": " TODO: should we return this?"
2693
- },
2694
2722
  "owner_account_index": {
2695
2723
  "type": "integer",
2696
- "format": "int64",
2724
+ "format": "int32",
2697
2725
  "example": "1"
2698
2726
  },
2699
2727
  "initial_base_amount": {
@@ -2772,7 +2800,6 @@
2772
2800
  "title": "Order",
2773
2801
  "required": [
2774
2802
  "market_index",
2775
-
2776
2803
  "owner_account_index",
2777
2804
  "initial_base_amount",
2778
2805
  "remaining_base_amount",
@@ -3039,7 +3066,7 @@
3039
3066
  },
3040
3067
  "daily_chart": {
3041
3068
  "type": "object",
3042
- "example": "{1640995200: 3024.66}",
3069
+ "example": "{1640995200:3024.66}",
3043
3070
  "additionalProperties": {
3044
3071
  "type": "number",
3045
3072
  "format": "double"
@@ -3324,12 +3351,6 @@
3324
3351
  "type": "integer",
3325
3352
  "format": "int32"
3326
3353
  },
3327
- "sub_account_index": {
3328
- "type": "integer",
3329
- "format": "uint8",
3330
- "default": "255",
3331
- "description": " NilSubAccountIndex"
3332
- },
3333
3354
  "market_id": {
3334
3355
  "type": "integer",
3335
3356
  "format": "uin16"
@@ -3338,7 +3359,6 @@
3338
3359
  "title": "ReqGetAccountActiveOrders",
3339
3360
  "required": [
3340
3361
  "account_index",
3341
- "sub_account_index",
3342
3362
  "market_id"
3343
3363
  ]
3344
3364
  },
@@ -3361,12 +3381,6 @@
3361
3381
  "type": "integer",
3362
3382
  "format": "int32"
3363
3383
  },
3364
- "sub_account_index": {
3365
- "type": "integer",
3366
- "format": "uint8",
3367
- "default": "255",
3368
- "description": " NilSubAccountIndex"
3369
- },
3370
3384
  "filter": {
3371
3385
  "type": "string",
3372
3386
  "enum": [
@@ -3391,7 +3405,6 @@
3391
3405
  "title": "ReqGetAccountInactiveOrders",
3392
3406
  "required": [
3393
3407
  "account_index",
3394
- "sub_account_index",
3395
3408
  "filter",
3396
3409
  "limit"
3397
3410
  ]
@@ -3685,7 +3698,7 @@
3685
3698
  "type": "integer",
3686
3699
  "format": "int32"
3687
3700
  },
3688
- "sub_account_index": {
3701
+ "api_key_index": {
3689
3702
  "type": "integer",
3690
3703
  "format": "uint8"
3691
3704
  }
@@ -3693,7 +3706,7 @@
3693
3706
  "title": "ReqGetNextNonce",
3694
3707
  "required": [
3695
3708
  "account_index",
3696
- "sub_account_index"
3709
+ "api_key_index"
3697
3710
  ]
3698
3711
  },
3699
3712
  "ReqGetOrderBookDetails": {
@@ -3888,33 +3901,6 @@
3888
3901
  "limit"
3889
3902
  ]
3890
3903
  },
3891
- "ReqGetSubAccount": {
3892
- "type": "object",
3893
- "properties": {
3894
- "by": {
3895
- "type": "string",
3896
- "enum": [
3897
- "index",
3898
- "l1_address"
3899
- ]
3900
- },
3901
- "value": {
3902
- "type": "string"
3903
- },
3904
- "sub_account_index": {
3905
- "type": "integer",
3906
- "format": "uint8",
3907
- "default": "255",
3908
- "description": " NilSubAccountIndex"
3909
- }
3910
- },
3911
- "title": "ReqGetSubAccount",
3912
- "required": [
3913
- "by",
3914
- "value",
3915
- "sub_account_index"
3916
- ]
3917
- },
3918
3904
  "ReqGetTrades": {
3919
3905
  "type": "object",
3920
3906
  "properties": {
@@ -3973,6 +3959,36 @@
3973
3959
  "value"
3974
3960
  ]
3975
3961
  },
3962
+ "ReqMarkNotifRead": {
3963
+ "type": "object",
3964
+ "properties": {
3965
+ "notif_type": {
3966
+ "type": "string"
3967
+ },
3968
+ "account_index": {
3969
+ "type": "integer",
3970
+ "format": "int32"
3971
+ },
3972
+ "api_key_index": {
3973
+ "type": "integer",
3974
+ "format": "uint8"
3975
+ },
3976
+ "liquidation_ids": {
3977
+ "type": "string"
3978
+ },
3979
+ "signature": {
3980
+ "type": "string"
3981
+ }
3982
+ },
3983
+ "title": "ReqMarkNotifRead",
3984
+ "required": [
3985
+ "notif_type",
3986
+ "account_index",
3987
+ "api_key_index",
3988
+ "liquidation_ids",
3989
+ "signature"
3990
+ ]
3991
+ },
3976
3992
  "ReqSearch": {
3977
3993
  "type": "object",
3978
3994
  "properties": {
@@ -4146,11 +4162,6 @@
4146
4162
  "format": "int32",
4147
4163
  "example": "1"
4148
4164
  },
4149
- "owner_sub_account_index": {
4150
- "type": "integer",
4151
- "format": "uint8",
4152
- "example": "1"
4153
- },
4154
4165
  "initial_base_amount": {
4155
4166
  "type": "string",
4156
4167
  "example": "0.1"
@@ -4172,7 +4183,6 @@
4172
4183
  "title": "SimpleOrder",
4173
4184
  "required": [
4174
4185
  "owner_account_index",
4175
- "owner_sub_account_index",
4176
4186
  "initial_base_amount",
4177
4187
  "remaining_base_amount",
4178
4188
  "price",
@@ -4199,59 +4209,6 @@
4199
4209
  "network_id"
4200
4210
  ]
4201
4211
  },
4202
- "SubAccount": {
4203
- "type": "object",
4204
- "properties": {
4205
- "index": {
4206
- "type": "integer",
4207
- "format": "int32",
4208
- "example": "1"
4209
- },
4210
- "sub_account_index": {
4211
- "type": "integer",
4212
- "format": "uint8",
4213
- "example": "1"
4214
- },
4215
- "l1_address": {
4216
- "type": "string",
4217
- "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
4218
- },
4219
- "pk": {
4220
- "type": "string",
4221
- "example": "3ac126b0a0a3cc8cb367ef67a5c77389a85e08e20ce8da3edf34d022e9bf1ab8"
4222
- },
4223
- "nonce": {
4224
- "type": "integer",
4225
- "format": "int64",
4226
- "example": "722"
4227
- },
4228
- "status": {
4229
- "type": "integer",
4230
- "format": "uint8",
4231
- "example": "1"
4232
- },
4233
- "collateral": {
4234
- "type": "string",
4235
- "example": "46342"
4236
- },
4237
- "collateral_type": {
4238
- "type": "integer",
4239
- "format": "uint8",
4240
- "example": "1"
4241
- }
4242
- },
4243
- "title": "SubAccount",
4244
- "required": [
4245
- "index",
4246
- "sub_account_index",
4247
- "l1_address",
4248
- "pk",
4249
- "nonce",
4250
- "status",
4251
- "collateral",
4252
- "collateral_type"
4253
- ]
4254
- },
4255
4212
  "SubAccounts": {
4256
4213
  "type": "object",
4257
4214
  "properties": {
@@ -4263,33 +4220,21 @@
4263
4220
  "message": {
4264
4221
  "type": "string"
4265
4222
  },
4266
- "index": {
4267
- "type": "integer",
4268
- "format": "int32",
4269
- "example": "1"
4270
- },
4271
4223
  "l1_address": {
4272
4224
  "type": "string",
4273
4225
  "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
4274
4226
  },
4275
- "status": {
4276
- "type": "integer",
4277
- "format": "uint8",
4278
- "example": "1"
4279
- },
4280
4227
  "sub_accounts": {
4281
4228
  "type": "array",
4282
4229
  "example": "1",
4283
4230
  "items": {
4284
- "$ref": "#/definitions/SubAccount"
4231
+ "$ref": "#/definitions/Account"
4285
4232
  }
4286
4233
  }
4287
4234
  },
4288
4235
  "title": "SubAccounts",
4289
4236
  "required": [
4290
- "index",
4291
4237
  "l1_address",
4292
- "status",
4293
4238
  "sub_accounts"
4294
4239
  ]
4295
4240
  },
@@ -4330,12 +4275,12 @@
4330
4275
  },
4331
4276
  "maker_account_id": {
4332
4277
  "type": "integer",
4333
- "format": "int64",
4278
+ "format": "int32",
4334
4279
  "example": "1"
4335
4280
  },
4336
4281
  "taker_account_id": {
4337
4282
  "type": "integer",
4338
- "format": "int64",
4283
+ "format": "int32",
4339
4284
  "example": "3"
4340
4285
  },
4341
4286
  "is_maker_ask": {
@@ -4454,7 +4399,7 @@
4454
4399
  "format": "int64",
4455
4400
  "example": "1640995200"
4456
4401
  },
4457
- "verify_at": {
4402
+ "executed_at": {
4458
4403
  "type": "integer",
4459
4404
  "format": "int64",
4460
4405
  "example": "1640995200"
@@ -4479,7 +4424,7 @@
4479
4424
  "expire_at",
4480
4425
  "block_height",
4481
4426
  "created_at",
4482
- "verify_at",
4427
+ "executed_at",
4483
4428
  "sequence_index"
4484
4429
  ]
4485
4430
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {