zklighter-perps 1.0.14 → 1.0.16

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": {
@@ -968,7 +941,7 @@
968
941
  "format": "int32"
969
942
  },
970
943
  {
971
- "name": "sub_account_index",
944
+ "name": "api_key_index",
972
945
  "in": "query",
973
946
  "required": true,
974
947
  "type": "integer",
@@ -1703,6 +1676,44 @@
1703
1676
  }
1704
1677
  },
1705
1678
  "definitions": {
1679
+ "Account": {
1680
+ "type": "object",
1681
+ "properties": {
1682
+ "code": {
1683
+ "type": "integer",
1684
+ "format": "int32",
1685
+ "example": "100"
1686
+ },
1687
+ "message": {
1688
+ "type": "string"
1689
+ },
1690
+ "index": {
1691
+ "type": "integer",
1692
+ "format": "int32",
1693
+ "example": "1"
1694
+ },
1695
+ "l1_address": {
1696
+ "type": "string",
1697
+ "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
1698
+ },
1699
+ "status": {
1700
+ "type": "integer",
1701
+ "format": "int32",
1702
+ "example": "1"
1703
+ },
1704
+ "collateral": {
1705
+ "type": "string",
1706
+ "example": "46342"
1707
+ }
1708
+ },
1709
+ "title": "Account",
1710
+ "required": [
1711
+ "index",
1712
+ "l1_address",
1713
+ "status",
1714
+ "collateral"
1715
+ ]
1716
+ },
1706
1717
  "AccountMarketStats": {
1707
1718
  "type": "object",
1708
1719
  "properties": {
@@ -1873,6 +1884,35 @@
1873
1884
  "buying_power"
1874
1885
  ]
1875
1886
  },
1887
+ "Accounts": {
1888
+ "type": "object",
1889
+ "properties": {
1890
+ "code": {
1891
+ "type": "integer",
1892
+ "format": "int32",
1893
+ "example": "100"
1894
+ },
1895
+ "message": {
1896
+ "type": "string"
1897
+ },
1898
+ "total": {
1899
+ "type": "integer",
1900
+ "format": "int32",
1901
+ "example": "1"
1902
+ },
1903
+ "accounts": {
1904
+ "type": "array",
1905
+ "items": {
1906
+ "$ref": "#/definitions/Account"
1907
+ }
1908
+ }
1909
+ },
1910
+ "title": "Accounts",
1911
+ "required": [
1912
+ "total",
1913
+ "accounts"
1914
+ ]
1915
+ },
1876
1916
  "Block": {
1877
1917
  "type": "object",
1878
1918
  "properties": {
@@ -2113,38 +2153,19 @@
2113
2153
  "format": "int32",
2114
2154
  "example": "1"
2115
2155
  },
2116
- "sub_account_index": {
2117
- "type": "integer",
2118
- "format": "uint8",
2119
- "example": "1"
2120
- },
2121
2156
  "l1_address": {
2122
2157
  "type": "string",
2123
2158
  "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
2124
2159
  },
2125
- "pk": {
2126
- "type": "string",
2127
- "example": "3ac126b0a0a3cc8cb367ef67a5c77389a85e08e20ce8da3edf34d022e9bf1ab8"
2128
- },
2129
- "nonce": {
2130
- "type": "integer",
2131
- "format": "int64",
2132
- "example": "722"
2133
- },
2134
2160
  "status": {
2135
2161
  "type": "integer",
2136
- "format": "uint8",
2162
+ "format": "int32",
2137
2163
  "example": "1"
2138
2164
  },
2139
2165
  "collateral": {
2140
2166
  "type": "string",
2141
2167
  "example": "46342"
2142
2168
  },
2143
- "collateral_type": {
2144
- "type": "integer",
2145
- "format": "uint8",
2146
- "example": "1"
2147
- },
2148
2169
  "positions": {
2149
2170
  "type": "array",
2150
2171
  "items": {
@@ -2451,7 +2472,7 @@
2451
2472
  "format": "boolean",
2452
2473
  "example": "true"
2453
2474
  },
2454
- "validator_Info": {
2475
+ "validator_info": {
2455
2476
  "type": "array",
2456
2477
  "items": {
2457
2478
  "$ref": "#/definitions/ValidatorInfo"
@@ -2483,7 +2504,7 @@
2483
2504
  "required": [
2484
2505
  "l1_providers",
2485
2506
  "l1_providers_health",
2486
- "validator_Info",
2507
+ "validator_info",
2487
2508
  "contract_addresses",
2488
2509
  "latest_l1_generic_block",
2489
2510
  "latest_l1_governance_block",
@@ -2524,68 +2545,6 @@
2524
2545
  "total_transaction_count"
2525
2546
  ]
2526
2547
  },
2527
- "MainAccount": {
2528
- "type": "object",
2529
- "properties": {
2530
- "code": {
2531
- "type": "integer",
2532
- "format": "int32",
2533
- "example": "100"
2534
- },
2535
- "message": {
2536
- "type": "string"
2537
- },
2538
- "index": {
2539
- "type": "integer",
2540
- "format": "int32",
2541
- "example": "1"
2542
- },
2543
- "l1_address": {
2544
- "type": "string",
2545
- "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
2546
- },
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": {
2564
- "type": "integer",
2565
- "format": "int32",
2566
- "example": "100"
2567
- },
2568
- "message": {
2569
- "type": "string"
2570
- },
2571
- "total": {
2572
- "type": "integer",
2573
- "format": "int32",
2574
- "example": "1"
2575
- },
2576
- "accounts": {
2577
- "type": "array",
2578
- "items": {
2579
- "$ref": "#/definitions/MainAccount"
2580
- }
2581
- }
2582
- },
2583
- "title": "MainAccounts",
2584
- "required": [
2585
- "total",
2586
- "accounts"
2587
- ]
2588
- },
2589
2548
  "MarketInfo": {
2590
2549
  "type": "object",
2591
2550
  "properties": {
@@ -2686,14 +2645,9 @@
2686
2645
  "format": "uin16",
2687
2646
  "example": "1"
2688
2647
  },
2689
- "ownerMainAccountIndex": {
2690
- "type": "integer",
2691
- "format": "int64",
2692
- "description": " TODO: should we return this?"
2693
- },
2694
2648
  "owner_account_index": {
2695
2649
  "type": "integer",
2696
- "format": "int64",
2650
+ "format": "int32",
2697
2651
  "example": "1"
2698
2652
  },
2699
2653
  "initial_base_amount": {
@@ -2772,7 +2726,6 @@
2772
2726
  "title": "Order",
2773
2727
  "required": [
2774
2728
  "market_index",
2775
-
2776
2729
  "owner_account_index",
2777
2730
  "initial_base_amount",
2778
2731
  "remaining_base_amount",
@@ -3039,7 +2992,7 @@
3039
2992
  },
3040
2993
  "daily_chart": {
3041
2994
  "type": "object",
3042
- "example": "{1640995200: 3024.66}",
2995
+ "example": "{1640995200:3024.66}",
3043
2996
  "additionalProperties": {
3044
2997
  "type": "number",
3045
2998
  "format": "double"
@@ -3324,12 +3277,6 @@
3324
3277
  "type": "integer",
3325
3278
  "format": "int32"
3326
3279
  },
3327
- "sub_account_index": {
3328
- "type": "integer",
3329
- "format": "uint8",
3330
- "default": "255",
3331
- "description": " NilSubAccountIndex"
3332
- },
3333
3280
  "market_id": {
3334
3281
  "type": "integer",
3335
3282
  "format": "uin16"
@@ -3338,7 +3285,6 @@
3338
3285
  "title": "ReqGetAccountActiveOrders",
3339
3286
  "required": [
3340
3287
  "account_index",
3341
- "sub_account_index",
3342
3288
  "market_id"
3343
3289
  ]
3344
3290
  },
@@ -3361,12 +3307,6 @@
3361
3307
  "type": "integer",
3362
3308
  "format": "int32"
3363
3309
  },
3364
- "sub_account_index": {
3365
- "type": "integer",
3366
- "format": "uint8",
3367
- "default": "255",
3368
- "description": " NilSubAccountIndex"
3369
- },
3370
3310
  "filter": {
3371
3311
  "type": "string",
3372
3312
  "enum": [
@@ -3391,7 +3331,6 @@
3391
3331
  "title": "ReqGetAccountInactiveOrders",
3392
3332
  "required": [
3393
3333
  "account_index",
3394
- "sub_account_index",
3395
3334
  "filter",
3396
3335
  "limit"
3397
3336
  ]
@@ -3685,7 +3624,7 @@
3685
3624
  "type": "integer",
3686
3625
  "format": "int32"
3687
3626
  },
3688
- "sub_account_index": {
3627
+ "api_key_index": {
3689
3628
  "type": "integer",
3690
3629
  "format": "uint8"
3691
3630
  }
@@ -3693,7 +3632,7 @@
3693
3632
  "title": "ReqGetNextNonce",
3694
3633
  "required": [
3695
3634
  "account_index",
3696
- "sub_account_index"
3635
+ "api_key_index"
3697
3636
  ]
3698
3637
  },
3699
3638
  "ReqGetOrderBookDetails": {
@@ -3888,33 +3827,6 @@
3888
3827
  "limit"
3889
3828
  ]
3890
3829
  },
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
3830
  "ReqGetTrades": {
3919
3831
  "type": "object",
3920
3832
  "properties": {
@@ -4146,11 +4058,6 @@
4146
4058
  "format": "int32",
4147
4059
  "example": "1"
4148
4060
  },
4149
- "owner_sub_account_index": {
4150
- "type": "integer",
4151
- "format": "uint8",
4152
- "example": "1"
4153
- },
4154
4061
  "initial_base_amount": {
4155
4062
  "type": "string",
4156
4063
  "example": "0.1"
@@ -4172,7 +4079,6 @@
4172
4079
  "title": "SimpleOrder",
4173
4080
  "required": [
4174
4081
  "owner_account_index",
4175
- "owner_sub_account_index",
4176
4082
  "initial_base_amount",
4177
4083
  "remaining_base_amount",
4178
4084
  "price",
@@ -4199,59 +4105,6 @@
4199
4105
  "network_id"
4200
4106
  ]
4201
4107
  },
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
4108
  "SubAccounts": {
4256
4109
  "type": "object",
4257
4110
  "properties": {
@@ -4263,33 +4116,21 @@
4263
4116
  "message": {
4264
4117
  "type": "string"
4265
4118
  },
4266
- "index": {
4267
- "type": "integer",
4268
- "format": "int32",
4269
- "example": "1"
4270
- },
4271
4119
  "l1_address": {
4272
4120
  "type": "string",
4273
4121
  "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
4274
4122
  },
4275
- "status": {
4276
- "type": "integer",
4277
- "format": "uint8",
4278
- "example": "1"
4279
- },
4280
4123
  "sub_accounts": {
4281
4124
  "type": "array",
4282
4125
  "example": "1",
4283
4126
  "items": {
4284
- "$ref": "#/definitions/SubAccount"
4127
+ "$ref": "#/definitions/Account"
4285
4128
  }
4286
4129
  }
4287
4130
  },
4288
4131
  "title": "SubAccounts",
4289
4132
  "required": [
4290
- "index",
4291
4133
  "l1_address",
4292
- "status",
4293
4134
  "sub_accounts"
4294
4135
  ]
4295
4136
  },
@@ -4330,12 +4171,12 @@
4330
4171
  },
4331
4172
  "maker_account_id": {
4332
4173
  "type": "integer",
4333
- "format": "int64",
4174
+ "format": "int32",
4334
4175
  "example": "1"
4335
4176
  },
4336
4177
  "taker_account_id": {
4337
4178
  "type": "integer",
4338
- "format": "int64",
4179
+ "format": "int32",
4339
4180
  "example": "3"
4340
4181
  },
4341
4182
  "is_maker_ask": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {