carbon-js-sdk 0.8.9-beta.1 → 0.8.9
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/lib/codec/index.js +50 -50
- package/lib/websocket/channel.js +24 -24
- package/lib/websocket/models.d.ts +6 -6
- package/lib/websocket/types.d.ts +17 -17
- package/package.json +1 -1
package/lib/codec/index.js
CHANGED
|
@@ -2293,7 +2293,7 @@ exports.EIP712Types = {
|
|
|
2293
2293
|
],
|
|
2294
2294
|
"OrderBook": [
|
|
2295
2295
|
{
|
|
2296
|
-
"name": "
|
|
2296
|
+
"name": "market_id",
|
|
2297
2297
|
"type": "string"
|
|
2298
2298
|
},
|
|
2299
2299
|
{
|
|
@@ -2309,7 +2309,7 @@ exports.EIP712Types = {
|
|
|
2309
2309
|
],
|
|
2310
2310
|
"StopBook": [
|
|
2311
2311
|
{
|
|
2312
|
-
"name": "
|
|
2312
|
+
"name": "market_id",
|
|
2313
2313
|
"type": "string"
|
|
2314
2314
|
},
|
|
2315
2315
|
{
|
|
@@ -2343,7 +2343,7 @@ exports.EIP712Types = {
|
|
|
2343
2343
|
],
|
|
2344
2344
|
"OrderBookEvent": [
|
|
2345
2345
|
{
|
|
2346
|
-
"name": "
|
|
2346
|
+
"name": "market_id",
|
|
2347
2347
|
"type": "string"
|
|
2348
2348
|
},
|
|
2349
2349
|
{
|
|
@@ -2368,7 +2368,7 @@ exports.EIP712Types = {
|
|
|
2368
2368
|
],
|
|
2369
2369
|
"ClearVirtualOrderBookEvent": [
|
|
2370
2370
|
{
|
|
2371
|
-
"name": "
|
|
2371
|
+
"name": "market_id",
|
|
2372
2372
|
"type": "string"
|
|
2373
2373
|
}
|
|
2374
2374
|
],
|
|
@@ -2386,7 +2386,7 @@ exports.EIP712Types = {
|
|
|
2386
2386
|
],
|
|
2387
2387
|
"StopBook_V2_32_0": [
|
|
2388
2388
|
{
|
|
2389
|
-
"name": "
|
|
2389
|
+
"name": "market_id",
|
|
2390
2390
|
"type": "string"
|
|
2391
2391
|
},
|
|
2392
2392
|
{
|
|
@@ -2408,7 +2408,7 @@ exports.EIP712Types = {
|
|
|
2408
2408
|
],
|
|
2409
2409
|
"QueryImpactPriceRequest": [
|
|
2410
2410
|
{
|
|
2411
|
-
"name": "
|
|
2411
|
+
"name": "market_id",
|
|
2412
2412
|
"type": "string"
|
|
2413
2413
|
},
|
|
2414
2414
|
{
|
|
@@ -2432,7 +2432,7 @@ exports.EIP712Types = {
|
|
|
2432
2432
|
],
|
|
2433
2433
|
"QueryGetBookRequest": [
|
|
2434
2434
|
{
|
|
2435
|
-
"name": "
|
|
2435
|
+
"name": "market_id",
|
|
2436
2436
|
"type": "string"
|
|
2437
2437
|
}
|
|
2438
2438
|
],
|
|
@@ -2464,7 +2464,7 @@ exports.EIP712Types = {
|
|
|
2464
2464
|
],
|
|
2465
2465
|
"QueryGetStopBookRequest": [
|
|
2466
2466
|
{
|
|
2467
|
-
"name": "
|
|
2467
|
+
"name": "market_id",
|
|
2468
2468
|
"type": "string"
|
|
2469
2469
|
}
|
|
2470
2470
|
],
|
|
@@ -2502,7 +2502,7 @@ exports.EIP712Types = {
|
|
|
2502
2502
|
"type": "uint64"
|
|
2503
2503
|
},
|
|
2504
2504
|
{
|
|
2505
|
-
"name": "
|
|
2505
|
+
"name": "market_id",
|
|
2506
2506
|
"type": "string"
|
|
2507
2507
|
},
|
|
2508
2508
|
{
|
|
@@ -2543,7 +2543,7 @@ exports.EIP712Types = {
|
|
|
2543
2543
|
],
|
|
2544
2544
|
"PerpsMarketAmm": [
|
|
2545
2545
|
{
|
|
2546
|
-
"name": "
|
|
2546
|
+
"name": "market_id",
|
|
2547
2547
|
"type": "string"
|
|
2548
2548
|
},
|
|
2549
2549
|
{
|
|
@@ -2557,7 +2557,7 @@ exports.EIP712Types = {
|
|
|
2557
2557
|
],
|
|
2558
2558
|
"Candlestick": [
|
|
2559
2559
|
{
|
|
2560
|
-
"name": "
|
|
2560
|
+
"name": "market_id",
|
|
2561
2561
|
"type": "string"
|
|
2562
2562
|
},
|
|
2563
2563
|
{
|
|
@@ -2611,7 +2611,7 @@ exports.EIP712Types = {
|
|
|
2611
2611
|
"type": "string"
|
|
2612
2612
|
},
|
|
2613
2613
|
{
|
|
2614
|
-
"name": "
|
|
2614
|
+
"name": "market_id",
|
|
2615
2615
|
"type": "string"
|
|
2616
2616
|
},
|
|
2617
2617
|
{
|
|
@@ -2739,7 +2739,7 @@ exports.EIP712Types = {
|
|
|
2739
2739
|
],
|
|
2740
2740
|
"QueryCandlesticksRequest": [
|
|
2741
2741
|
{
|
|
2742
|
-
"name": "
|
|
2742
|
+
"name": "market_id",
|
|
2743
2743
|
"type": "string"
|
|
2744
2744
|
},
|
|
2745
2745
|
{
|
|
@@ -2768,7 +2768,7 @@ exports.EIP712Types = {
|
|
|
2768
2768
|
"type": "string"
|
|
2769
2769
|
},
|
|
2770
2770
|
{
|
|
2771
|
-
"name": "
|
|
2771
|
+
"name": "market_id",
|
|
2772
2772
|
"type": "string"
|
|
2773
2773
|
},
|
|
2774
2774
|
{
|
|
@@ -2820,7 +2820,7 @@ exports.EIP712Types = {
|
|
|
2820
2820
|
"type": "string"
|
|
2821
2821
|
},
|
|
2822
2822
|
{
|
|
2823
|
-
"name": "
|
|
2823
|
+
"name": "market_id",
|
|
2824
2824
|
"type": "string"
|
|
2825
2825
|
},
|
|
2826
2826
|
{
|
|
@@ -2847,7 +2847,7 @@ exports.EIP712Types = {
|
|
|
2847
2847
|
],
|
|
2848
2848
|
"LiquidatorPosition": [
|
|
2849
2849
|
{
|
|
2850
|
-
"name": "
|
|
2850
|
+
"name": "market_id",
|
|
2851
2851
|
"type": "string"
|
|
2852
2852
|
},
|
|
2853
2853
|
{
|
|
@@ -5728,7 +5728,7 @@ exports.EIP712Types = {
|
|
|
5728
5728
|
"type": "string"
|
|
5729
5729
|
},
|
|
5730
5730
|
{
|
|
5731
|
-
"name": "
|
|
5731
|
+
"name": "market_id",
|
|
5732
5732
|
"type": "string"
|
|
5733
5733
|
},
|
|
5734
5734
|
{
|
|
@@ -5739,7 +5739,7 @@ exports.EIP712Types = {
|
|
|
5739
5739
|
],
|
|
5740
5740
|
"PositionPool": [
|
|
5741
5741
|
{
|
|
5742
|
-
"name": "
|
|
5742
|
+
"name": "market_id",
|
|
5743
5743
|
"type": "string"
|
|
5744
5744
|
},
|
|
5745
5745
|
{
|
|
@@ -7626,7 +7626,7 @@ exports.EIP712Types = {
|
|
|
7626
7626
|
"type": "string"
|
|
7627
7627
|
},
|
|
7628
7628
|
{
|
|
7629
|
-
"name": "
|
|
7629
|
+
"name": "market_id",
|
|
7630
7630
|
"type": "string"
|
|
7631
7631
|
},
|
|
7632
7632
|
{
|
|
@@ -7651,7 +7651,7 @@ exports.EIP712Types = {
|
|
|
7651
7651
|
"type": "string"
|
|
7652
7652
|
},
|
|
7653
7653
|
{
|
|
7654
|
-
"name": "
|
|
7654
|
+
"name": "market_id",
|
|
7655
7655
|
"type": "string"
|
|
7656
7656
|
},
|
|
7657
7657
|
{
|
|
@@ -7661,7 +7661,7 @@ exports.EIP712Types = {
|
|
|
7661
7661
|
],
|
|
7662
7662
|
"MarketLeverage": [
|
|
7663
7663
|
{
|
|
7664
|
-
"name": "
|
|
7664
|
+
"name": "market_id",
|
|
7665
7665
|
"type": "string"
|
|
7666
7666
|
},
|
|
7667
7667
|
{
|
|
@@ -7693,7 +7693,7 @@ exports.EIP712Types = {
|
|
|
7693
7693
|
"type": "string"
|
|
7694
7694
|
},
|
|
7695
7695
|
{
|
|
7696
|
-
"name": "
|
|
7696
|
+
"name": "market_id",
|
|
7697
7697
|
"type": "string"
|
|
7698
7698
|
}
|
|
7699
7699
|
],
|
|
@@ -7723,7 +7723,7 @@ exports.EIP712Types = {
|
|
|
7723
7723
|
"type": "string"
|
|
7724
7724
|
},
|
|
7725
7725
|
{
|
|
7726
|
-
"name": "
|
|
7726
|
+
"name": "market_id",
|
|
7727
7727
|
"type": "string"
|
|
7728
7728
|
},
|
|
7729
7729
|
{
|
|
@@ -7740,7 +7740,7 @@ exports.EIP712Types = {
|
|
|
7740
7740
|
"type": "string"
|
|
7741
7741
|
},
|
|
7742
7742
|
{
|
|
7743
|
-
"name": "
|
|
7743
|
+
"name": "market_id",
|
|
7744
7744
|
"type": "string"
|
|
7745
7745
|
},
|
|
7746
7746
|
{
|
|
@@ -7766,7 +7766,7 @@ exports.EIP712Types = {
|
|
|
7766
7766
|
"type": "string"
|
|
7767
7767
|
},
|
|
7768
7768
|
{
|
|
7769
|
-
"name": "
|
|
7769
|
+
"name": "market_id",
|
|
7770
7770
|
"type": "string"
|
|
7771
7771
|
},
|
|
7772
7772
|
{
|
|
@@ -7806,7 +7806,7 @@ exports.EIP712Types = {
|
|
|
7806
7806
|
"type": "string"
|
|
7807
7807
|
},
|
|
7808
7808
|
{
|
|
7809
|
-
"name": "
|
|
7809
|
+
"name": "market_id",
|
|
7810
7810
|
"type": "string"
|
|
7811
7811
|
},
|
|
7812
7812
|
{
|
|
@@ -7871,7 +7871,7 @@ exports.EIP712Types = {
|
|
|
7871
7871
|
"type": "string"
|
|
7872
7872
|
},
|
|
7873
7873
|
{
|
|
7874
|
-
"name": "
|
|
7874
|
+
"name": "market_id",
|
|
7875
7875
|
"type": "string"
|
|
7876
7876
|
},
|
|
7877
7877
|
{
|
|
@@ -8179,7 +8179,7 @@ exports.EIP712Types = {
|
|
|
8179
8179
|
"type": "string"
|
|
8180
8180
|
},
|
|
8181
8181
|
{
|
|
8182
|
-
"name": "
|
|
8182
|
+
"name": "market_id",
|
|
8183
8183
|
"type": "string"
|
|
8184
8184
|
},
|
|
8185
8185
|
{
|
|
@@ -8462,7 +8462,7 @@ exports.EIP712Types = {
|
|
|
8462
8462
|
"type": "string"
|
|
8463
8463
|
},
|
|
8464
8464
|
{
|
|
8465
|
-
"name": "
|
|
8465
|
+
"name": "market_id",
|
|
8466
8466
|
"type": "string"
|
|
8467
8467
|
},
|
|
8468
8468
|
{
|
|
@@ -8510,7 +8510,7 @@ exports.EIP712Types = {
|
|
|
8510
8510
|
"type": "string"
|
|
8511
8511
|
},
|
|
8512
8512
|
{
|
|
8513
|
-
"name": "
|
|
8513
|
+
"name": "market_id",
|
|
8514
8514
|
"type": "string"
|
|
8515
8515
|
},
|
|
8516
8516
|
{
|
|
@@ -8545,7 +8545,7 @@ exports.EIP712Types = {
|
|
|
8545
8545
|
"type": "string"
|
|
8546
8546
|
},
|
|
8547
8547
|
{
|
|
8548
|
-
"name": "
|
|
8548
|
+
"name": "market_id",
|
|
8549
8549
|
"type": "string"
|
|
8550
8550
|
}
|
|
8551
8551
|
],
|
|
@@ -8598,7 +8598,7 @@ exports.EIP712Types = {
|
|
|
8598
8598
|
"type": "string"
|
|
8599
8599
|
},
|
|
8600
8600
|
{
|
|
8601
|
-
"name": "
|
|
8601
|
+
"name": "market_id",
|
|
8602
8602
|
"type": "string"
|
|
8603
8603
|
},
|
|
8604
8604
|
{
|
|
@@ -8691,7 +8691,7 @@ exports.EIP712Types = {
|
|
|
8691
8691
|
"type": "string"
|
|
8692
8692
|
},
|
|
8693
8693
|
{
|
|
8694
|
-
"name": "
|
|
8694
|
+
"name": "market_id",
|
|
8695
8695
|
"type": "string"
|
|
8696
8696
|
}
|
|
8697
8697
|
],
|
|
@@ -8781,7 +8781,7 @@ exports.EIP712Types = {
|
|
|
8781
8781
|
],
|
|
8782
8782
|
"PoolRoute": [
|
|
8783
8783
|
{
|
|
8784
|
-
"name": "
|
|
8784
|
+
"name": "market_id",
|
|
8785
8785
|
"type": "string"
|
|
8786
8786
|
},
|
|
8787
8787
|
{
|
|
@@ -9583,7 +9583,7 @@ exports.EIP712Types = {
|
|
|
9583
9583
|
"type": "uint64"
|
|
9584
9584
|
},
|
|
9585
9585
|
{
|
|
9586
|
-
"name": "
|
|
9586
|
+
"name": "market_id",
|
|
9587
9587
|
"type": "string"
|
|
9588
9588
|
}
|
|
9589
9589
|
],
|
|
@@ -10923,7 +10923,7 @@ exports.EIP712Types = {
|
|
|
10923
10923
|
],
|
|
10924
10924
|
"MarketEvent": [
|
|
10925
10925
|
{
|
|
10926
|
-
"name": "
|
|
10926
|
+
"name": "market_id",
|
|
10927
10927
|
"type": "Market",
|
|
10928
10928
|
"packageName": "/Switcheo.carbon.market"
|
|
10929
10929
|
},
|
|
@@ -11016,7 +11016,7 @@ exports.EIP712Types = {
|
|
|
11016
11016
|
],
|
|
11017
11017
|
"QueryGetMarketResponse": [
|
|
11018
11018
|
{
|
|
11019
|
-
"name": "
|
|
11019
|
+
"name": "market_id",
|
|
11020
11020
|
"type": "Market",
|
|
11021
11021
|
"packageName": "/Switcheo.carbon.market"
|
|
11022
11022
|
}
|
|
@@ -11417,7 +11417,7 @@ exports.EIP712Types = {
|
|
|
11417
11417
|
"GenesisState": [],
|
|
11418
11418
|
"MarketStats": [
|
|
11419
11419
|
{
|
|
11420
|
-
"name": "
|
|
11420
|
+
"name": "market_id",
|
|
11421
11421
|
"type": "string"
|
|
11422
11422
|
},
|
|
11423
11423
|
{
|
|
@@ -12245,7 +12245,7 @@ exports.EIP712Types = {
|
|
|
12245
12245
|
],
|
|
12246
12246
|
"MarketLiquidityUsageMultiplier": [
|
|
12247
12247
|
{
|
|
12248
|
-
"name": "
|
|
12248
|
+
"name": "market_id",
|
|
12249
12249
|
"type": "string"
|
|
12250
12250
|
},
|
|
12251
12251
|
{
|
|
@@ -12471,7 +12471,7 @@ exports.EIP712Types = {
|
|
|
12471
12471
|
],
|
|
12472
12472
|
"UpdateMarketLiquidityUsageMultiplierEvent": [
|
|
12473
12473
|
{
|
|
12474
|
-
"name": "
|
|
12474
|
+
"name": "market_id",
|
|
12475
12475
|
"type": "string"
|
|
12476
12476
|
},
|
|
12477
12477
|
{
|
|
@@ -12930,7 +12930,7 @@ exports.EIP712Types = {
|
|
|
12930
12930
|
"/Switcheo.carbon.position": {
|
|
12931
12931
|
"Position": [
|
|
12932
12932
|
{
|
|
12933
|
-
"name": "
|
|
12933
|
+
"name": "market_id",
|
|
12934
12934
|
"type": "string"
|
|
12935
12935
|
},
|
|
12936
12936
|
{
|
|
@@ -12968,7 +12968,7 @@ exports.EIP712Types = {
|
|
|
12968
12968
|
],
|
|
12969
12969
|
"APIPosition": [
|
|
12970
12970
|
{
|
|
12971
|
-
"name": "
|
|
12971
|
+
"name": "market_id",
|
|
12972
12972
|
"type": "string"
|
|
12973
12973
|
},
|
|
12974
12974
|
{
|
|
@@ -13099,7 +13099,7 @@ exports.EIP712Types = {
|
|
|
13099
13099
|
"type": "string"
|
|
13100
13100
|
},
|
|
13101
13101
|
{
|
|
13102
|
-
"name": "
|
|
13102
|
+
"name": "market_id",
|
|
13103
13103
|
"type": "string"
|
|
13104
13104
|
},
|
|
13105
13105
|
{
|
|
@@ -13131,7 +13131,7 @@ exports.EIP712Types = {
|
|
|
13131
13131
|
"type": "string"
|
|
13132
13132
|
},
|
|
13133
13133
|
{
|
|
13134
|
-
"name": "
|
|
13134
|
+
"name": "market_id",
|
|
13135
13135
|
"type": "string"
|
|
13136
13136
|
}
|
|
13137
13137
|
],
|
|
@@ -13148,7 +13148,7 @@ exports.EIP712Types = {
|
|
|
13148
13148
|
"type": "string"
|
|
13149
13149
|
},
|
|
13150
13150
|
{
|
|
13151
|
-
"name": "
|
|
13151
|
+
"name": "market_id",
|
|
13152
13152
|
"type": "string"
|
|
13153
13153
|
},
|
|
13154
13154
|
{
|
|
@@ -13192,7 +13192,7 @@ exports.EIP712Types = {
|
|
|
13192
13192
|
"type": "string"
|
|
13193
13193
|
},
|
|
13194
13194
|
{
|
|
13195
|
-
"name": "
|
|
13195
|
+
"name": "market_id",
|
|
13196
13196
|
"type": "string"
|
|
13197
13197
|
},
|
|
13198
13198
|
{
|
|
@@ -13233,7 +13233,7 @@ exports.EIP712Types = {
|
|
|
13233
13233
|
"type": "string"
|
|
13234
13234
|
},
|
|
13235
13235
|
{
|
|
13236
|
-
"name": "
|
|
13236
|
+
"name": "market_id",
|
|
13237
13237
|
"type": "string"
|
|
13238
13238
|
},
|
|
13239
13239
|
{
|
|
@@ -13428,7 +13428,7 @@ exports.EIP712Types = {
|
|
|
13428
13428
|
],
|
|
13429
13429
|
"SettlementPriceParams": [
|
|
13430
13430
|
{
|
|
13431
|
-
"name": "
|
|
13431
|
+
"name": "market_id",
|
|
13432
13432
|
"type": "string"
|
|
13433
13433
|
},
|
|
13434
13434
|
{
|
|
@@ -13451,7 +13451,7 @@ exports.EIP712Types = {
|
|
|
13451
13451
|
],
|
|
13452
13452
|
"QueryPriceSetRequest": [
|
|
13453
13453
|
{
|
|
13454
|
-
"name": "
|
|
13454
|
+
"name": "market_id",
|
|
13455
13455
|
"type": "string"
|
|
13456
13456
|
}
|
|
13457
13457
|
],
|
|
@@ -13616,7 +13616,7 @@ exports.EIP712Types = {
|
|
|
13616
13616
|
"type": "string"
|
|
13617
13617
|
},
|
|
13618
13618
|
{
|
|
13619
|
-
"name": "
|
|
13619
|
+
"name": "market_id",
|
|
13620
13620
|
"type": "string"
|
|
13621
13621
|
},
|
|
13622
13622
|
{
|
package/lib/websocket/channel.js
CHANGED
|
@@ -5,24 +5,24 @@ const types_1 = require("./types");
|
|
|
5
5
|
const generateChannelId = (params) => {
|
|
6
6
|
switch (params.channel) {
|
|
7
7
|
case types_1.WSChannel.candlesticks: {
|
|
8
|
-
const { channel,
|
|
9
|
-
return [channel,
|
|
8
|
+
const { channel, market_id, resolution } = params;
|
|
9
|
+
return [channel, market_id, resolution].join(":");
|
|
10
10
|
}
|
|
11
11
|
case types_1.WSChannel.books: {
|
|
12
|
-
const { channel,
|
|
13
|
-
return [channel,
|
|
12
|
+
const { channel, market_id } = params;
|
|
13
|
+
return [channel, market_id].join(":");
|
|
14
14
|
}
|
|
15
15
|
case types_1.WSChannel.recent_trades: {
|
|
16
|
-
const { channel,
|
|
17
|
-
return [channel,
|
|
16
|
+
const { channel, market_id } = params;
|
|
17
|
+
return [channel, market_id].join(":");
|
|
18
18
|
}
|
|
19
19
|
case types_1.WSChannel.orders: {
|
|
20
20
|
const { channel, address } = params;
|
|
21
21
|
return [channel, address].join(":");
|
|
22
22
|
}
|
|
23
23
|
case types_1.WSChannel.orders_by_market: {
|
|
24
|
-
const { channel,
|
|
25
|
-
return [channel,
|
|
24
|
+
const { channel, market_id, address } = params;
|
|
25
|
+
return [channel, market_id, address].join(":");
|
|
26
26
|
}
|
|
27
27
|
case types_1.WSChannel.balances: {
|
|
28
28
|
const { channel, address } = params;
|
|
@@ -33,32 +33,32 @@ const generateChannelId = (params) => {
|
|
|
33
33
|
return [channel, address].join(":");
|
|
34
34
|
}
|
|
35
35
|
case types_1.WSChannel.account_trades_by_market: {
|
|
36
|
-
const { channel,
|
|
37
|
-
return [channel,
|
|
36
|
+
const { channel, market_id, address } = params;
|
|
37
|
+
return [channel, market_id, address].join(":");
|
|
38
38
|
}
|
|
39
39
|
case types_1.WSChannel.market_stats: {
|
|
40
40
|
const { channel } = params;
|
|
41
41
|
return [channel].join(":");
|
|
42
42
|
}
|
|
43
43
|
case types_1.WSChannel.market_stats_by_market: {
|
|
44
|
-
const { channel,
|
|
45
|
-
return [channel,
|
|
44
|
+
const { channel, market_id } = params;
|
|
45
|
+
return [channel, market_id].join(":");
|
|
46
46
|
}
|
|
47
47
|
case types_1.WSChannel.leverages: {
|
|
48
48
|
const { channel, address } = params;
|
|
49
49
|
return [channel, address].join(":");
|
|
50
50
|
}
|
|
51
51
|
case types_1.WSChannel.leverages_by_market: {
|
|
52
|
-
const { channel,
|
|
53
|
-
return [channel,
|
|
52
|
+
const { channel, market_id, address } = params;
|
|
53
|
+
return [channel, market_id, address].join(":");
|
|
54
54
|
}
|
|
55
55
|
case types_1.WSChannel.positions: {
|
|
56
56
|
const { channel, address } = params;
|
|
57
57
|
return [channel, address].join(":");
|
|
58
58
|
}
|
|
59
59
|
case types_1.WSChannel.positions_by_market: {
|
|
60
|
-
const { channel,
|
|
61
|
-
return [channel,
|
|
60
|
+
const { channel, market_id, address } = params;
|
|
61
|
+
return [channel, market_id, address].join(":");
|
|
62
62
|
}
|
|
63
63
|
case types_1.WSChannel.pools: {
|
|
64
64
|
const { channel } = params;
|
|
@@ -135,18 +135,18 @@ const parseChannelId = (rawChannelId) => {
|
|
|
135
135
|
case types_1.WSChannel.candlesticks:
|
|
136
136
|
return {
|
|
137
137
|
channel,
|
|
138
|
-
|
|
138
|
+
market_id: param0,
|
|
139
139
|
resolution: param1,
|
|
140
140
|
};
|
|
141
141
|
case types_1.WSChannel.books:
|
|
142
142
|
return {
|
|
143
143
|
channel,
|
|
144
|
-
|
|
144
|
+
market_id: param0,
|
|
145
145
|
};
|
|
146
146
|
case types_1.WSChannel.recent_trades:
|
|
147
147
|
return {
|
|
148
148
|
channel,
|
|
149
|
-
|
|
149
|
+
market_id: param0,
|
|
150
150
|
};
|
|
151
151
|
case types_1.WSChannel.orders:
|
|
152
152
|
return {
|
|
@@ -156,7 +156,7 @@ const parseChannelId = (rawChannelId) => {
|
|
|
156
156
|
case types_1.WSChannel.orders_by_market:
|
|
157
157
|
return {
|
|
158
158
|
channel,
|
|
159
|
-
|
|
159
|
+
market_id: param0,
|
|
160
160
|
address: param1,
|
|
161
161
|
};
|
|
162
162
|
case types_1.WSChannel.balances:
|
|
@@ -172,7 +172,7 @@ const parseChannelId = (rawChannelId) => {
|
|
|
172
172
|
case types_1.WSChannel.account_trades_by_market:
|
|
173
173
|
return {
|
|
174
174
|
channel,
|
|
175
|
-
|
|
175
|
+
market_id: param0,
|
|
176
176
|
address: param1,
|
|
177
177
|
};
|
|
178
178
|
case types_1.WSChannel.market_stats:
|
|
@@ -182,7 +182,7 @@ const parseChannelId = (rawChannelId) => {
|
|
|
182
182
|
case types_1.WSChannel.market_stats_by_market:
|
|
183
183
|
return {
|
|
184
184
|
channel,
|
|
185
|
-
|
|
185
|
+
market_id: param0,
|
|
186
186
|
};
|
|
187
187
|
case types_1.WSChannel.leverages:
|
|
188
188
|
return {
|
|
@@ -192,7 +192,7 @@ const parseChannelId = (rawChannelId) => {
|
|
|
192
192
|
case types_1.WSChannel.leverages_by_market:
|
|
193
193
|
return {
|
|
194
194
|
channel,
|
|
195
|
-
|
|
195
|
+
market_id: param0,
|
|
196
196
|
address: param1,
|
|
197
197
|
};
|
|
198
198
|
case types_1.WSChannel.positions:
|
|
@@ -203,7 +203,7 @@ const parseChannelId = (rawChannelId) => {
|
|
|
203
203
|
case types_1.WSChannel.positions_by_market:
|
|
204
204
|
return {
|
|
205
205
|
channel,
|
|
206
|
-
|
|
206
|
+
market_id: param0,
|
|
207
207
|
address: param1,
|
|
208
208
|
};
|
|
209
209
|
case types_1.WSChannel.pools:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface AccountTrade {
|
|
2
2
|
order_id: string;
|
|
3
|
-
|
|
3
|
+
market_id: string;
|
|
4
4
|
side: string;
|
|
5
5
|
price: string;
|
|
6
6
|
quantity: string;
|
|
@@ -24,7 +24,7 @@ export interface HistoryOrder {
|
|
|
24
24
|
is_liquidation?: boolean;
|
|
25
25
|
is_post_only?: boolean;
|
|
26
26
|
is_reduce_only?: boolean;
|
|
27
|
-
|
|
27
|
+
market_id: string;
|
|
28
28
|
order_type: string;
|
|
29
29
|
pool_id?: number;
|
|
30
30
|
price: string;
|
|
@@ -52,7 +52,7 @@ export interface BaseHistoryOrderEvent extends BaseHistoryOrder {
|
|
|
52
52
|
export interface Candlestick {
|
|
53
53
|
time: string;
|
|
54
54
|
close: string;
|
|
55
|
-
|
|
55
|
+
market_id: string;
|
|
56
56
|
open: string;
|
|
57
57
|
high: string;
|
|
58
58
|
low: string;
|
|
@@ -63,7 +63,7 @@ export interface Candlestick {
|
|
|
63
63
|
export interface RecentTrade {
|
|
64
64
|
block_created_at: string;
|
|
65
65
|
block_height: number;
|
|
66
|
-
|
|
66
|
+
market_id: string;
|
|
67
67
|
price: string;
|
|
68
68
|
quantity: string;
|
|
69
69
|
id?: string;
|
|
@@ -86,7 +86,7 @@ export interface RecentTrade {
|
|
|
86
86
|
maker_fee_commission_address?: string;
|
|
87
87
|
}
|
|
88
88
|
export interface Position {
|
|
89
|
-
|
|
89
|
+
market_id: string;
|
|
90
90
|
address: string;
|
|
91
91
|
trade_id: string;
|
|
92
92
|
side: string;
|
|
@@ -114,7 +114,7 @@ export interface MarketStat {
|
|
|
114
114
|
index_price: string;
|
|
115
115
|
mark_price: string;
|
|
116
116
|
last_price: string;
|
|
117
|
-
|
|
117
|
+
market_id: string;
|
|
118
118
|
market_type: string;
|
|
119
119
|
premium_rate: string;
|
|
120
120
|
last_funding_at: string;
|
package/lib/websocket/types.d.ts
CHANGED
|
@@ -67,36 +67,36 @@ export declare enum WSRequest {
|
|
|
67
67
|
CDPRewardsDebts = "get_cdp_reward_debts"
|
|
68
68
|
}
|
|
69
69
|
export interface WsGetRecentTradesParams {
|
|
70
|
-
|
|
70
|
+
market_id: string;
|
|
71
71
|
}
|
|
72
72
|
export interface WsGetCandlesticksParams {
|
|
73
|
-
|
|
73
|
+
market_id: string;
|
|
74
74
|
resolution: string;
|
|
75
75
|
from?: string;
|
|
76
76
|
to?: string;
|
|
77
77
|
}
|
|
78
78
|
export interface WsGetOrderHistoryParams {
|
|
79
|
-
|
|
79
|
+
market_id: string;
|
|
80
80
|
address: string;
|
|
81
81
|
}
|
|
82
82
|
export interface WsGetOpenOrdersParams {
|
|
83
|
-
|
|
83
|
+
market_id: string;
|
|
84
84
|
address: string;
|
|
85
85
|
}
|
|
86
86
|
export interface WsGetAccountTradesParams {
|
|
87
|
-
|
|
87
|
+
market_id: string;
|
|
88
88
|
address: string;
|
|
89
89
|
page?: number;
|
|
90
90
|
}
|
|
91
91
|
export interface WsGetMarketStatsParams {
|
|
92
|
-
|
|
92
|
+
market_id: string;
|
|
93
93
|
}
|
|
94
94
|
export interface WsGetLeveragesParams {
|
|
95
|
-
|
|
95
|
+
market_id: string;
|
|
96
96
|
address: string;
|
|
97
97
|
}
|
|
98
98
|
export interface WsGetPositionsParams {
|
|
99
|
-
|
|
99
|
+
market_id: string;
|
|
100
100
|
address: string;
|
|
101
101
|
status?: string;
|
|
102
102
|
order_by?: string;
|
|
@@ -139,21 +139,21 @@ export interface WsSubscribeParams {
|
|
|
139
139
|
channel: WSChannel;
|
|
140
140
|
}
|
|
141
141
|
export interface WsSubscribeCandlesticksParams extends WsSubscribeParams {
|
|
142
|
-
|
|
142
|
+
market_id: string;
|
|
143
143
|
resolution: string;
|
|
144
144
|
subscribeUID: string;
|
|
145
145
|
}
|
|
146
146
|
export interface WsSubscribeBooksParams extends WsSubscribeParams {
|
|
147
|
-
|
|
147
|
+
market_id: string;
|
|
148
148
|
}
|
|
149
149
|
export interface WsSubscribeRecentTradesParams extends WsSubscribeParams {
|
|
150
|
-
|
|
150
|
+
market_id: string;
|
|
151
151
|
}
|
|
152
152
|
export interface WsSubscribeOrdersAllParams extends WsSubscribeParams {
|
|
153
153
|
address: string;
|
|
154
154
|
}
|
|
155
155
|
export interface WsSubscribeOrdersByMarketParams extends WsSubscribeParams {
|
|
156
|
-
|
|
156
|
+
market_id: string;
|
|
157
157
|
address: string;
|
|
158
158
|
}
|
|
159
159
|
export interface WsSubscribeWalletBalanceParams extends WsSubscribeParams {
|
|
@@ -163,26 +163,26 @@ export interface WsSubscribeAccountTradesAllParams extends WsSubscribeParams {
|
|
|
163
163
|
address: string;
|
|
164
164
|
}
|
|
165
165
|
export interface WsSubscribeAccountTradesByMarketParams extends WsSubscribeParams {
|
|
166
|
-
|
|
166
|
+
market_id: string;
|
|
167
167
|
address: string;
|
|
168
168
|
}
|
|
169
169
|
export interface WsSubscribeMarketStatsAllParams extends WsSubscribeParams {
|
|
170
170
|
}
|
|
171
171
|
export interface WsSubscribeMarketStatsByMarketParams extends WsSubscribeParams {
|
|
172
|
-
|
|
172
|
+
market_id: string;
|
|
173
173
|
}
|
|
174
174
|
export interface WsSubscribeLeveragesAllParams extends WsSubscribeParams {
|
|
175
175
|
address: string;
|
|
176
176
|
}
|
|
177
177
|
export interface WsSubscribeLeveragesByMarketParams extends WsSubscribeParams {
|
|
178
|
-
|
|
178
|
+
market_id: string;
|
|
179
179
|
address: string;
|
|
180
180
|
}
|
|
181
181
|
export interface WsSubscribePositionsAllParams extends WsSubscribeParams {
|
|
182
182
|
address: string;
|
|
183
183
|
}
|
|
184
184
|
export interface WsSubscribePositionsByMarketParams extends WsSubscribeParams {
|
|
185
|
-
|
|
185
|
+
market_id: string;
|
|
186
186
|
address: string;
|
|
187
187
|
}
|
|
188
188
|
export interface WsSubscribePoolsAllParams extends WsSubscribeParams {
|
|
@@ -194,7 +194,7 @@ export interface WsSubscribeCommitmentParams extends WsSubscribeParams {
|
|
|
194
194
|
address: string;
|
|
195
195
|
}
|
|
196
196
|
export interface WsUnsubscribeCandlesticksParams extends WsSubscribeParams {
|
|
197
|
-
|
|
197
|
+
market_id: string;
|
|
198
198
|
resolution: string;
|
|
199
199
|
}
|
|
200
200
|
export interface WsSubscribeCDPBorrows extends WsSubscribeParams {
|