@pear-protocol/core-sdk 1.11.0 → 1.12.0
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/dist/auth/index.d.ts +3 -3
- package/dist/core/index.d.ts +90 -43
- package/dist/core/index.js +35 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -3
- package/package.json +3 -3
- package/dist/admin/index.d.ts +0 -58
- package/dist/admin/index.js +0 -43
package/dist/auth/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare class Auth {
|
|
|
13
13
|
refreshToken: string;
|
|
14
14
|
user: {
|
|
15
15
|
id: string;
|
|
16
|
-
role: "basic" | "pro"
|
|
16
|
+
role: "basic" | "pro";
|
|
17
17
|
providerId: string | null;
|
|
18
18
|
loginMethod: "email" | "evm_wallet" | "oauth";
|
|
19
19
|
};
|
|
@@ -27,13 +27,13 @@ declare class Auth {
|
|
|
27
27
|
logout(headers?: ClientHeaders): Promise<void>;
|
|
28
28
|
me(headers?: ClientHeaders): Promise<{
|
|
29
29
|
id: string;
|
|
30
|
-
role: "basic" | "pro"
|
|
30
|
+
role: "basic" | "pro";
|
|
31
31
|
providerId: string | null;
|
|
32
32
|
loginMethod: "email" | "evm_wallet" | "oauth";
|
|
33
33
|
}>;
|
|
34
34
|
apiKeyMe(headers?: ClientHeaders): Promise<{
|
|
35
35
|
id: string;
|
|
36
|
-
role: "basic" | "pro"
|
|
36
|
+
role: "basic" | "pro";
|
|
37
37
|
scope: "read" | "read_write";
|
|
38
38
|
authMethod: "api_key";
|
|
39
39
|
}>;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -183,6 +183,22 @@ declare class Core {
|
|
|
183
183
|
}>;
|
|
184
184
|
restore: (id: string, headers?: ClientHeaders) => Promise<void>;
|
|
185
185
|
};
|
|
186
|
+
fee: {
|
|
187
|
+
get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
|
|
188
|
+
baseBps: string;
|
|
189
|
+
discounts: {
|
|
190
|
+
scope: "user" | "connector" | "all" | "client_id";
|
|
191
|
+
rate: string;
|
|
192
|
+
}[];
|
|
193
|
+
finalBps: string;
|
|
194
|
+
feeRecipient?: string | undefined;
|
|
195
|
+
overrideBps?: string | undefined;
|
|
196
|
+
overrideScope?: "user" | "client_id" | undefined;
|
|
197
|
+
}>;
|
|
198
|
+
recipient: (query: HttpTypes.GetFeeRecipientParamsInput, headers?: ClientHeaders) => Promise<{
|
|
199
|
+
recipient?: string | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
};
|
|
186
202
|
apiKeys: {
|
|
187
203
|
list: (headers?: ClientHeaders) => Promise<{
|
|
188
204
|
id: string;
|
|
@@ -237,7 +253,6 @@ declare class Core {
|
|
|
237
253
|
symbol: string;
|
|
238
254
|
side: "BUY" | "SELL";
|
|
239
255
|
reduceOnly: boolean;
|
|
240
|
-
leverage: number;
|
|
241
256
|
quantity: string;
|
|
242
257
|
price: string;
|
|
243
258
|
filledQuantity: string;
|
|
@@ -280,7 +295,6 @@ declare class Core {
|
|
|
280
295
|
symbol: string;
|
|
281
296
|
side: "BUY" | "SELL";
|
|
282
297
|
reduceOnly: boolean;
|
|
283
|
-
leverage: number;
|
|
284
298
|
quantity: string;
|
|
285
299
|
price: string;
|
|
286
300
|
filledQuantity: string;
|
|
@@ -310,7 +324,6 @@ declare class Core {
|
|
|
310
324
|
symbol: string;
|
|
311
325
|
side: "BUY" | "SELL";
|
|
312
326
|
reduceOnly: boolean;
|
|
313
|
-
leverage: number;
|
|
314
327
|
quantity: string;
|
|
315
328
|
price: string;
|
|
316
329
|
filledQuantity: string;
|
|
@@ -340,7 +353,6 @@ declare class Core {
|
|
|
340
353
|
symbol: string;
|
|
341
354
|
side: "BUY" | "SELL";
|
|
342
355
|
reduceOnly: boolean;
|
|
343
|
-
leverage: number;
|
|
344
356
|
quantity: string;
|
|
345
357
|
price: string;
|
|
346
358
|
filledQuantity: string;
|
|
@@ -383,7 +395,6 @@ declare class Core {
|
|
|
383
395
|
symbol: string;
|
|
384
396
|
side: "BUY" | "SELL";
|
|
385
397
|
reduceOnly: boolean;
|
|
386
|
-
leverage: number;
|
|
387
398
|
quantity: string;
|
|
388
399
|
price: string;
|
|
389
400
|
filledQuantity: string;
|
|
@@ -426,7 +437,6 @@ declare class Core {
|
|
|
426
437
|
symbol: string;
|
|
427
438
|
side: "BUY" | "SELL";
|
|
428
439
|
reduceOnly: boolean;
|
|
429
|
-
leverage: number;
|
|
430
440
|
quantity: string;
|
|
431
441
|
price: string;
|
|
432
442
|
filledQuantity: string;
|
|
@@ -456,7 +466,6 @@ declare class Core {
|
|
|
456
466
|
symbol: string;
|
|
457
467
|
side: "BUY" | "SELL";
|
|
458
468
|
reduceOnly: boolean;
|
|
459
|
-
leverage: number;
|
|
460
469
|
quantity: string;
|
|
461
470
|
price: string;
|
|
462
471
|
filledQuantity: string;
|
|
@@ -486,7 +495,6 @@ declare class Core {
|
|
|
486
495
|
symbol: string;
|
|
487
496
|
side: "BUY" | "SELL";
|
|
488
497
|
reduceOnly: boolean;
|
|
489
|
-
leverage: number;
|
|
490
498
|
quantity: string;
|
|
491
499
|
price: string;
|
|
492
500
|
filledQuantity: string;
|
|
@@ -666,6 +674,7 @@ declare class Core {
|
|
|
666
674
|
};
|
|
667
675
|
ladderId?: string | undefined;
|
|
668
676
|
ladderIndex?: number | undefined;
|
|
677
|
+
parentTriggerId?: string | undefined;
|
|
669
678
|
triggeredAt?: string | undefined;
|
|
670
679
|
cancelledAt?: string | undefined;
|
|
671
680
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -799,6 +808,7 @@ declare class Core {
|
|
|
799
808
|
};
|
|
800
809
|
ladderId?: string | undefined;
|
|
801
810
|
ladderIndex?: number | undefined;
|
|
811
|
+
parentTriggerId?: string | undefined;
|
|
802
812
|
triggeredAt?: string | undefined;
|
|
803
813
|
cancelledAt?: string | undefined;
|
|
804
814
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -965,6 +975,7 @@ declare class Core {
|
|
|
965
975
|
};
|
|
966
976
|
ladderId?: string | undefined;
|
|
967
977
|
ladderIndex?: number | undefined;
|
|
978
|
+
parentTriggerId?: string | undefined;
|
|
968
979
|
triggeredAt?: string | undefined;
|
|
969
980
|
cancelledAt?: string | undefined;
|
|
970
981
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -1101,6 +1112,7 @@ declare class Core {
|
|
|
1101
1112
|
};
|
|
1102
1113
|
ladderId?: string | undefined;
|
|
1103
1114
|
ladderIndex?: number | undefined;
|
|
1115
|
+
parentTriggerId?: string | undefined;
|
|
1104
1116
|
triggeredAt?: string | undefined;
|
|
1105
1117
|
cancelledAt?: string | undefined;
|
|
1106
1118
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -1234,6 +1246,7 @@ declare class Core {
|
|
|
1234
1246
|
};
|
|
1235
1247
|
ladderId?: string | undefined;
|
|
1236
1248
|
ladderIndex?: number | undefined;
|
|
1249
|
+
parentTriggerId?: string | undefined;
|
|
1237
1250
|
triggeredAt?: string | undefined;
|
|
1238
1251
|
cancelledAt?: string | undefined;
|
|
1239
1252
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -1400,6 +1413,7 @@ declare class Core {
|
|
|
1400
1413
|
};
|
|
1401
1414
|
ladderId?: string | undefined;
|
|
1402
1415
|
ladderIndex?: number | undefined;
|
|
1416
|
+
parentTriggerId?: string | undefined;
|
|
1403
1417
|
triggeredAt?: string | undefined;
|
|
1404
1418
|
cancelledAt?: string | undefined;
|
|
1405
1419
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -1535,6 +1549,7 @@ declare class Core {
|
|
|
1535
1549
|
};
|
|
1536
1550
|
ladderId?: string | undefined;
|
|
1537
1551
|
ladderIndex?: number | undefined;
|
|
1552
|
+
parentTriggerId?: string | undefined;
|
|
1538
1553
|
triggeredAt?: string | undefined;
|
|
1539
1554
|
cancelledAt?: string | undefined;
|
|
1540
1555
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -1668,6 +1683,7 @@ declare class Core {
|
|
|
1668
1683
|
};
|
|
1669
1684
|
ladderId?: string | undefined;
|
|
1670
1685
|
ladderIndex?: number | undefined;
|
|
1686
|
+
parentTriggerId?: string | undefined;
|
|
1671
1687
|
triggeredAt?: string | undefined;
|
|
1672
1688
|
cancelledAt?: string | undefined;
|
|
1673
1689
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -1834,6 +1850,7 @@ declare class Core {
|
|
|
1834
1850
|
};
|
|
1835
1851
|
ladderId?: string | undefined;
|
|
1836
1852
|
ladderIndex?: number | undefined;
|
|
1853
|
+
parentTriggerId?: string | undefined;
|
|
1837
1854
|
triggeredAt?: string | undefined;
|
|
1838
1855
|
cancelledAt?: string | undefined;
|
|
1839
1856
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -1909,6 +1926,17 @@ declare class Core {
|
|
|
1909
1926
|
};
|
|
1910
1927
|
}[];
|
|
1911
1928
|
}>;
|
|
1929
|
+
lite: (query: HttpTypes.InstrumentListParamsInput, headers?: ClientHeaders) => Promise<{
|
|
1930
|
+
instruments: {
|
|
1931
|
+
id: string;
|
|
1932
|
+
base: string;
|
|
1933
|
+
precision: {
|
|
1934
|
+
quantity: {
|
|
1935
|
+
contractSize: number;
|
|
1936
|
+
};
|
|
1937
|
+
};
|
|
1938
|
+
}[];
|
|
1939
|
+
}>;
|
|
1912
1940
|
symbolToIdMap: (query: HttpTypes.InstrumentListParamsInput, headers?: ClientHeaders) => Promise<{
|
|
1913
1941
|
data: Record<string, string>;
|
|
1914
1942
|
}>;
|
|
@@ -2060,6 +2088,7 @@ declare class Core {
|
|
|
2060
2088
|
openLite: (headers?: ClientHeaders) => Promise<{
|
|
2061
2089
|
positions: {
|
|
2062
2090
|
id: string;
|
|
2091
|
+
positionKey: string;
|
|
2063
2092
|
createdAt: string;
|
|
2064
2093
|
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
2065
2094
|
status: "OPEN";
|
|
@@ -2140,6 +2169,7 @@ declare class Core {
|
|
|
2140
2169
|
rollingWindowDays: number;
|
|
2141
2170
|
startDate: string;
|
|
2142
2171
|
endDate: string;
|
|
2172
|
+
fundingSynced: boolean;
|
|
2143
2173
|
};
|
|
2144
2174
|
portfolio: {
|
|
2145
2175
|
realizedOnly: {
|
|
@@ -2225,6 +2255,9 @@ declare class Core {
|
|
|
2225
2255
|
wins: number;
|
|
2226
2256
|
losses: number;
|
|
2227
2257
|
dayPnl: number;
|
|
2258
|
+
dayVolume: number;
|
|
2259
|
+
dayFunding: number;
|
|
2260
|
+
dayNetPnl: number;
|
|
2228
2261
|
hitRate: number | null;
|
|
2229
2262
|
winLossRatio: number | null;
|
|
2230
2263
|
rollingHitRate: number | null;
|
|
@@ -2404,11 +2437,15 @@ declare class Core {
|
|
|
2404
2437
|
strategy: "TWAP";
|
|
2405
2438
|
intent: "OPEN";
|
|
2406
2439
|
sliceIntervalSec: number;
|
|
2407
|
-
|
|
2440
|
+
sliceCount: number;
|
|
2441
|
+
randomization: {
|
|
2442
|
+
timingJitterBps: number;
|
|
2443
|
+
sizeJitterBps: number;
|
|
2444
|
+
};
|
|
2445
|
+
legs: {
|
|
2408
2446
|
symbol: string;
|
|
2409
2447
|
side: "BUY" | "SELL";
|
|
2410
|
-
|
|
2411
|
-
stepAmount: string;
|
|
2448
|
+
weight: number;
|
|
2412
2449
|
}[];
|
|
2413
2450
|
targetNotional: string;
|
|
2414
2451
|
remainingNotional: string;
|
|
@@ -2452,11 +2489,12 @@ declare class Core {
|
|
|
2452
2489
|
strategy: "TWAP";
|
|
2453
2490
|
intent: "CLOSE";
|
|
2454
2491
|
sliceIntervalSec: number;
|
|
2492
|
+
sliceCount: number;
|
|
2493
|
+
randomization: {
|
|
2494
|
+
timingJitterBps: number;
|
|
2495
|
+
sizeJitterBps: number;
|
|
2496
|
+
};
|
|
2455
2497
|
positionId: string;
|
|
2456
|
-
sliceLegs: {
|
|
2457
|
-
symbol: string;
|
|
2458
|
-
stepAmount: string;
|
|
2459
|
-
}[];
|
|
2460
2498
|
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
2461
2499
|
lastSliceAt?: string | undefined;
|
|
2462
2500
|
cancelledAt?: string | undefined;
|
|
@@ -2502,11 +2540,15 @@ declare class Core {
|
|
|
2502
2540
|
strategy: "TWAP";
|
|
2503
2541
|
intent: "OPEN";
|
|
2504
2542
|
sliceIntervalSec: number;
|
|
2505
|
-
|
|
2543
|
+
sliceCount: number;
|
|
2544
|
+
randomization: {
|
|
2545
|
+
timingJitterBps: number;
|
|
2546
|
+
sizeJitterBps: number;
|
|
2547
|
+
};
|
|
2548
|
+
legs: {
|
|
2506
2549
|
symbol: string;
|
|
2507
2550
|
side: "BUY" | "SELL";
|
|
2508
|
-
|
|
2509
|
-
stepAmount: string;
|
|
2551
|
+
weight: number;
|
|
2510
2552
|
}[];
|
|
2511
2553
|
targetNotional: string;
|
|
2512
2554
|
remainingNotional: string;
|
|
@@ -2550,11 +2592,12 @@ declare class Core {
|
|
|
2550
2592
|
strategy: "TWAP";
|
|
2551
2593
|
intent: "CLOSE";
|
|
2552
2594
|
sliceIntervalSec: number;
|
|
2595
|
+
sliceCount: number;
|
|
2596
|
+
randomization: {
|
|
2597
|
+
timingJitterBps: number;
|
|
2598
|
+
sizeJitterBps: number;
|
|
2599
|
+
};
|
|
2553
2600
|
positionId: string;
|
|
2554
|
-
sliceLegs: {
|
|
2555
|
-
symbol: string;
|
|
2556
|
-
stepAmount: string;
|
|
2557
|
-
}[];
|
|
2558
2601
|
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
2559
2602
|
lastSliceAt?: string | undefined;
|
|
2560
2603
|
cancelledAt?: string | undefined;
|
|
@@ -2646,7 +2689,6 @@ declare class Core {
|
|
|
2646
2689
|
symbol: string;
|
|
2647
2690
|
side: "BUY" | "SELL";
|
|
2648
2691
|
reduceOnly: boolean;
|
|
2649
|
-
leverage: number;
|
|
2650
2692
|
quantity: string;
|
|
2651
2693
|
price: string;
|
|
2652
2694
|
filledQuantity: string;
|
|
@@ -2689,7 +2731,6 @@ declare class Core {
|
|
|
2689
2731
|
symbol: string;
|
|
2690
2732
|
side: "BUY" | "SELL";
|
|
2691
2733
|
reduceOnly: boolean;
|
|
2692
|
-
leverage: number;
|
|
2693
2734
|
quantity: string;
|
|
2694
2735
|
price: string;
|
|
2695
2736
|
filledQuantity: string;
|
|
@@ -2719,7 +2760,6 @@ declare class Core {
|
|
|
2719
2760
|
symbol: string;
|
|
2720
2761
|
side: "BUY" | "SELL";
|
|
2721
2762
|
reduceOnly: boolean;
|
|
2722
|
-
leverage: number;
|
|
2723
2763
|
quantity: string;
|
|
2724
2764
|
price: string;
|
|
2725
2765
|
filledQuantity: string;
|
|
@@ -2749,7 +2789,6 @@ declare class Core {
|
|
|
2749
2789
|
symbol: string;
|
|
2750
2790
|
side: "BUY" | "SELL";
|
|
2751
2791
|
reduceOnly: boolean;
|
|
2752
|
-
leverage: number;
|
|
2753
2792
|
quantity: string;
|
|
2754
2793
|
price: string;
|
|
2755
2794
|
filledQuantity: string;
|
|
@@ -2791,7 +2830,6 @@ declare class Core {
|
|
|
2791
2830
|
symbol: string;
|
|
2792
2831
|
side: "BUY" | "SELL";
|
|
2793
2832
|
reduceOnly: boolean;
|
|
2794
|
-
leverage: number;
|
|
2795
2833
|
quantity: string;
|
|
2796
2834
|
price: string;
|
|
2797
2835
|
filledQuantity: string;
|
|
@@ -2834,7 +2872,6 @@ declare class Core {
|
|
|
2834
2872
|
symbol: string;
|
|
2835
2873
|
side: "BUY" | "SELL";
|
|
2836
2874
|
reduceOnly: boolean;
|
|
2837
|
-
leverage: number;
|
|
2838
2875
|
quantity: string;
|
|
2839
2876
|
price: string;
|
|
2840
2877
|
filledQuantity: string;
|
|
@@ -2864,7 +2901,6 @@ declare class Core {
|
|
|
2864
2901
|
symbol: string;
|
|
2865
2902
|
side: "BUY" | "SELL";
|
|
2866
2903
|
reduceOnly: boolean;
|
|
2867
|
-
leverage: number;
|
|
2868
2904
|
quantity: string;
|
|
2869
2905
|
price: string;
|
|
2870
2906
|
filledQuantity: string;
|
|
@@ -2894,7 +2930,6 @@ declare class Core {
|
|
|
2894
2930
|
symbol: string;
|
|
2895
2931
|
side: "BUY" | "SELL";
|
|
2896
2932
|
reduceOnly: boolean;
|
|
2897
|
-
leverage: number;
|
|
2898
2933
|
quantity: string;
|
|
2899
2934
|
price: string;
|
|
2900
2935
|
filledQuantity: string;
|
|
@@ -2936,7 +2971,6 @@ declare class Core {
|
|
|
2936
2971
|
symbol: string;
|
|
2937
2972
|
side: "BUY" | "SELL";
|
|
2938
2973
|
reduceOnly: boolean;
|
|
2939
|
-
leverage: number;
|
|
2940
2974
|
quantity: string;
|
|
2941
2975
|
price: string;
|
|
2942
2976
|
filledQuantity: string;
|
|
@@ -2979,7 +3013,6 @@ declare class Core {
|
|
|
2979
3013
|
symbol: string;
|
|
2980
3014
|
side: "BUY" | "SELL";
|
|
2981
3015
|
reduceOnly: boolean;
|
|
2982
|
-
leverage: number;
|
|
2983
3016
|
quantity: string;
|
|
2984
3017
|
price: string;
|
|
2985
3018
|
filledQuantity: string;
|
|
@@ -3009,7 +3042,6 @@ declare class Core {
|
|
|
3009
3042
|
symbol: string;
|
|
3010
3043
|
side: "BUY" | "SELL";
|
|
3011
3044
|
reduceOnly: boolean;
|
|
3012
|
-
leverage: number;
|
|
3013
3045
|
quantity: string;
|
|
3014
3046
|
price: string;
|
|
3015
3047
|
filledQuantity: string;
|
|
@@ -3039,7 +3071,6 @@ declare class Core {
|
|
|
3039
3071
|
symbol: string;
|
|
3040
3072
|
side: "BUY" | "SELL";
|
|
3041
3073
|
reduceOnly: boolean;
|
|
3042
|
-
leverage: number;
|
|
3043
3074
|
quantity: string;
|
|
3044
3075
|
price: string;
|
|
3045
3076
|
filledQuantity: string;
|
|
@@ -3081,7 +3112,6 @@ declare class Core {
|
|
|
3081
3112
|
symbol: string;
|
|
3082
3113
|
side: "BUY" | "SELL";
|
|
3083
3114
|
reduceOnly: boolean;
|
|
3084
|
-
leverage: number;
|
|
3085
3115
|
quantity: string;
|
|
3086
3116
|
price: string;
|
|
3087
3117
|
filledQuantity: string;
|
|
@@ -3124,7 +3154,6 @@ declare class Core {
|
|
|
3124
3154
|
symbol: string;
|
|
3125
3155
|
side: "BUY" | "SELL";
|
|
3126
3156
|
reduceOnly: boolean;
|
|
3127
|
-
leverage: number;
|
|
3128
3157
|
quantity: string;
|
|
3129
3158
|
price: string;
|
|
3130
3159
|
filledQuantity: string;
|
|
@@ -3154,7 +3183,6 @@ declare class Core {
|
|
|
3154
3183
|
symbol: string;
|
|
3155
3184
|
side: "BUY" | "SELL";
|
|
3156
3185
|
reduceOnly: boolean;
|
|
3157
|
-
leverage: number;
|
|
3158
3186
|
quantity: string;
|
|
3159
3187
|
price: string;
|
|
3160
3188
|
filledQuantity: string;
|
|
@@ -3184,7 +3212,6 @@ declare class Core {
|
|
|
3184
3212
|
symbol: string;
|
|
3185
3213
|
side: "BUY" | "SELL";
|
|
3186
3214
|
reduceOnly: boolean;
|
|
3187
|
-
leverage: number;
|
|
3188
3215
|
quantity: string;
|
|
3189
3216
|
price: string;
|
|
3190
3217
|
filledQuantity: string;
|
|
@@ -3226,7 +3253,6 @@ declare class Core {
|
|
|
3226
3253
|
symbol: string;
|
|
3227
3254
|
side: "BUY" | "SELL";
|
|
3228
3255
|
reduceOnly: boolean;
|
|
3229
|
-
leverage: number;
|
|
3230
3256
|
quantity: string;
|
|
3231
3257
|
price: string;
|
|
3232
3258
|
filledQuantity: string;
|
|
@@ -3269,7 +3295,6 @@ declare class Core {
|
|
|
3269
3295
|
symbol: string;
|
|
3270
3296
|
side: "BUY" | "SELL";
|
|
3271
3297
|
reduceOnly: boolean;
|
|
3272
|
-
leverage: number;
|
|
3273
3298
|
quantity: string;
|
|
3274
3299
|
price: string;
|
|
3275
3300
|
filledQuantity: string;
|
|
@@ -3299,7 +3324,6 @@ declare class Core {
|
|
|
3299
3324
|
symbol: string;
|
|
3300
3325
|
side: "BUY" | "SELL";
|
|
3301
3326
|
reduceOnly: boolean;
|
|
3302
|
-
leverage: number;
|
|
3303
3327
|
quantity: string;
|
|
3304
3328
|
price: string;
|
|
3305
3329
|
filledQuantity: string;
|
|
@@ -3329,7 +3353,6 @@ declare class Core {
|
|
|
3329
3353
|
symbol: string;
|
|
3330
3354
|
side: "BUY" | "SELL";
|
|
3331
3355
|
reduceOnly: boolean;
|
|
3332
|
-
leverage: number;
|
|
3333
3356
|
quantity: string;
|
|
3334
3357
|
price: string;
|
|
3335
3358
|
filledQuantity: string;
|
|
@@ -3426,6 +3449,7 @@ declare class Core {
|
|
|
3426
3449
|
};
|
|
3427
3450
|
ladderId?: string | undefined;
|
|
3428
3451
|
ladderIndex?: number | undefined;
|
|
3452
|
+
parentTriggerId?: string | undefined;
|
|
3429
3453
|
triggeredAt?: string | undefined;
|
|
3430
3454
|
cancelledAt?: string | undefined;
|
|
3431
3455
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -3559,6 +3583,7 @@ declare class Core {
|
|
|
3559
3583
|
};
|
|
3560
3584
|
ladderId?: string | undefined;
|
|
3561
3585
|
ladderIndex?: number | undefined;
|
|
3586
|
+
parentTriggerId?: string | undefined;
|
|
3562
3587
|
triggeredAt?: string | undefined;
|
|
3563
3588
|
cancelledAt?: string | undefined;
|
|
3564
3589
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -3725,6 +3750,7 @@ declare class Core {
|
|
|
3725
3750
|
};
|
|
3726
3751
|
ladderId?: string | undefined;
|
|
3727
3752
|
ladderIndex?: number | undefined;
|
|
3753
|
+
parentTriggerId?: string | undefined;
|
|
3728
3754
|
triggeredAt?: string | undefined;
|
|
3729
3755
|
cancelledAt?: string | undefined;
|
|
3730
3756
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -3847,6 +3873,7 @@ declare class Core {
|
|
|
3847
3873
|
};
|
|
3848
3874
|
ladderId?: string | undefined;
|
|
3849
3875
|
ladderIndex?: number | undefined;
|
|
3876
|
+
parentTriggerId?: string | undefined;
|
|
3850
3877
|
triggeredAt?: string | undefined;
|
|
3851
3878
|
cancelledAt?: string | undefined;
|
|
3852
3879
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -3980,6 +4007,7 @@ declare class Core {
|
|
|
3980
4007
|
};
|
|
3981
4008
|
ladderId?: string | undefined;
|
|
3982
4009
|
ladderIndex?: number | undefined;
|
|
4010
|
+
parentTriggerId?: string | undefined;
|
|
3983
4011
|
triggeredAt?: string | undefined;
|
|
3984
4012
|
cancelledAt?: string | undefined;
|
|
3985
4013
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -4146,6 +4174,7 @@ declare class Core {
|
|
|
4146
4174
|
};
|
|
4147
4175
|
ladderId?: string | undefined;
|
|
4148
4176
|
ladderIndex?: number | undefined;
|
|
4177
|
+
parentTriggerId?: string | undefined;
|
|
4149
4178
|
triggeredAt?: string | undefined;
|
|
4150
4179
|
cancelledAt?: string | undefined;
|
|
4151
4180
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -4267,6 +4296,7 @@ declare class Core {
|
|
|
4267
4296
|
};
|
|
4268
4297
|
ladderId?: string | undefined;
|
|
4269
4298
|
ladderIndex?: number | undefined;
|
|
4299
|
+
parentTriggerId?: string | undefined;
|
|
4270
4300
|
triggeredAt?: string | undefined;
|
|
4271
4301
|
cancelledAt?: string | undefined;
|
|
4272
4302
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -4400,6 +4430,7 @@ declare class Core {
|
|
|
4400
4430
|
};
|
|
4401
4431
|
ladderId?: string | undefined;
|
|
4402
4432
|
ladderIndex?: number | undefined;
|
|
4433
|
+
parentTriggerId?: string | undefined;
|
|
4403
4434
|
triggeredAt?: string | undefined;
|
|
4404
4435
|
cancelledAt?: string | undefined;
|
|
4405
4436
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -4566,6 +4597,7 @@ declare class Core {
|
|
|
4566
4597
|
};
|
|
4567
4598
|
ladderId?: string | undefined;
|
|
4568
4599
|
ladderIndex?: number | undefined;
|
|
4600
|
+
parentTriggerId?: string | undefined;
|
|
4569
4601
|
triggeredAt?: string | undefined;
|
|
4570
4602
|
cancelledAt?: string | undefined;
|
|
4571
4603
|
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
|
|
@@ -4615,7 +4647,7 @@ declare class Core {
|
|
|
4615
4647
|
profile: {
|
|
4616
4648
|
id: string;
|
|
4617
4649
|
displayName: string;
|
|
4618
|
-
role: "basic" | "pro"
|
|
4650
|
+
role: "basic" | "pro";
|
|
4619
4651
|
address: string | null;
|
|
4620
4652
|
email: string | null;
|
|
4621
4653
|
emailVerified: boolean;
|
|
@@ -4683,6 +4715,21 @@ declare class Core {
|
|
|
4683
4715
|
totalUsers: number;
|
|
4684
4716
|
};
|
|
4685
4717
|
}>;
|
|
4718
|
+
leaderboard: (query?: HttpTypes.LeaderboardQueryParamsInput, headers?: ClientHeaders) => Promise<{
|
|
4719
|
+
data: {
|
|
4720
|
+
tradeAccountId: string;
|
|
4721
|
+
exchangeIdentifier: string;
|
|
4722
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
4723
|
+
volume: string;
|
|
4724
|
+
grossRealizedPnl: string;
|
|
4725
|
+
grossUpnl: string;
|
|
4726
|
+
fundingPayment: string;
|
|
4727
|
+
totalNetPnl: string;
|
|
4728
|
+
pearFee: string;
|
|
4729
|
+
tradeFee: string;
|
|
4730
|
+
totalTrades: number;
|
|
4731
|
+
}[];
|
|
4732
|
+
}>;
|
|
4686
4733
|
};
|
|
4687
4734
|
tca: {
|
|
4688
4735
|
execution: (executionId: string, headers?: ClientHeaders) => Promise<{
|
package/dist/core/index.js
CHANGED
|
@@ -55,6 +55,27 @@ class Core {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
+
fee = {
|
|
59
|
+
// Resolves the trading fee and connector fee recipient for the caller's selected trade account.
|
|
60
|
+
// The connector is taken from the trade account, identified by the trade-account header.
|
|
61
|
+
get: async (query, headers) => {
|
|
62
|
+
return await this.client.fetch(`/fee`, {
|
|
63
|
+
method: "GET",
|
|
64
|
+
headers,
|
|
65
|
+
query
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
// Resolves the connector-native approval target for the caller's role — the same fee_recipients
|
|
69
|
+
// row the order path names. Takes an explicit connector rather than a trade account, so the
|
|
70
|
+
// approval flows can ask while the account is still being created.
|
|
71
|
+
recipient: async (query, headers) => {
|
|
72
|
+
return await this.client.fetch(`/fee/recipient`, {
|
|
73
|
+
method: "GET",
|
|
74
|
+
headers,
|
|
75
|
+
query
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
58
79
|
apiKeys = {
|
|
59
80
|
list: async (headers) => {
|
|
60
81
|
return await this.client.fetch(`/api-keys`, {
|
|
@@ -157,6 +178,13 @@ class Core {
|
|
|
157
178
|
query
|
|
158
179
|
});
|
|
159
180
|
},
|
|
181
|
+
lite: async (query, headers) => {
|
|
182
|
+
return await this.client.fetch(`/instruments/lite`, {
|
|
183
|
+
method: "GET",
|
|
184
|
+
headers,
|
|
185
|
+
query
|
|
186
|
+
});
|
|
187
|
+
},
|
|
160
188
|
symbolToIdMap: async (query, headers) => {
|
|
161
189
|
return await this.client.fetch(`/instruments/symbol-to-id-map`, {
|
|
162
190
|
method: "GET",
|
|
@@ -595,6 +623,13 @@ class Core {
|
|
|
595
623
|
headers,
|
|
596
624
|
query
|
|
597
625
|
});
|
|
626
|
+
},
|
|
627
|
+
leaderboard: async (query, headers) => {
|
|
628
|
+
return await this.client.fetch(`/statistics/leaderboard`, {
|
|
629
|
+
method: "GET",
|
|
630
|
+
headers,
|
|
631
|
+
query
|
|
632
|
+
});
|
|
598
633
|
}
|
|
599
634
|
};
|
|
600
635
|
tca = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Admin } from './admin/index.js';
|
|
2
1
|
import { Auth } from './auth/index.js';
|
|
3
2
|
import { Core } from './core/index.js';
|
|
4
3
|
import { External } from './external/index.js';
|
|
@@ -9,7 +8,6 @@ export { FetchError } from './utils.js';
|
|
|
9
8
|
import './http.js';
|
|
10
9
|
|
|
11
10
|
declare class PearSDK {
|
|
12
|
-
admin: Admin;
|
|
13
11
|
auth: Auth;
|
|
14
12
|
core: Core;
|
|
15
13
|
external: External;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { configureProxy } from '@pear-protocol/utils';
|
|
2
2
|
export * from '@pear-protocol/utils';
|
|
3
|
-
import { Admin } from './admin';
|
|
4
3
|
import { Auth } from './auth';
|
|
5
4
|
import { Core } from './core';
|
|
6
5
|
import { External } from './external';
|
|
@@ -10,7 +9,6 @@ import { FetchError } from './utils';
|
|
|
10
9
|
export { FetchError } from './utils';
|
|
11
10
|
|
|
12
11
|
class PearSDK {
|
|
13
|
-
admin;
|
|
14
12
|
auth;
|
|
15
13
|
core;
|
|
16
14
|
external;
|
|
@@ -25,7 +23,6 @@ class PearSDK {
|
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
25
|
const client = new HttpClient(config.url, authMode, config.logger, config.debug);
|
|
28
|
-
this.admin = new Admin(client);
|
|
29
26
|
this.auth = new Auth(client);
|
|
30
27
|
this.core = new Core(client);
|
|
31
28
|
this.external = new External();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Pear Protocol Core SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@pear-protocol/types": "^1.
|
|
29
|
-
"@pear-protocol/utils": "^0.
|
|
28
|
+
"@pear-protocol/types": "^1.15.0",
|
|
29
|
+
"@pear-protocol/utils": "^0.4.0",
|
|
30
30
|
"qs": "^6.14.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
package/dist/admin/index.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { HttpTypes } from '@pear-protocol/types';
|
|
2
|
-
import { HttpClient } from '../http.js';
|
|
3
|
-
import { ClientHeaders } from '../types.js';
|
|
4
|
-
import '@pear-protocol/utils';
|
|
5
|
-
|
|
6
|
-
declare class Admin {
|
|
7
|
-
private client;
|
|
8
|
-
constructor(client: HttpClient);
|
|
9
|
-
clientIds: {
|
|
10
|
-
list: (query?: HttpTypes.ListClientIdsParamsInput, headers?: ClientHeaders) => Promise<{
|
|
11
|
-
id: string;
|
|
12
|
-
code: string;
|
|
13
|
-
label: string;
|
|
14
|
-
isActive: boolean;
|
|
15
|
-
createdAt: string;
|
|
16
|
-
updatedAt: string;
|
|
17
|
-
description?: string | undefined;
|
|
18
|
-
}[]>;
|
|
19
|
-
create: (body: HttpTypes.CreateClientIdPayloadInput, headers?: ClientHeaders) => Promise<{
|
|
20
|
-
id: string;
|
|
21
|
-
code: string;
|
|
22
|
-
label: string;
|
|
23
|
-
isActive: boolean;
|
|
24
|
-
createdAt: string;
|
|
25
|
-
updatedAt: string;
|
|
26
|
-
description?: string | undefined;
|
|
27
|
-
}>;
|
|
28
|
-
update: (id: string, body: HttpTypes.UpdateClientIdPayloadInput, headers?: ClientHeaders) => Promise<{
|
|
29
|
-
id: string;
|
|
30
|
-
code: string;
|
|
31
|
-
label: string;
|
|
32
|
-
isActive: boolean;
|
|
33
|
-
createdAt: string;
|
|
34
|
-
updatedAt: string;
|
|
35
|
-
description?: string | undefined;
|
|
36
|
-
}>;
|
|
37
|
-
activate: (id: string, headers?: ClientHeaders) => Promise<{
|
|
38
|
-
id: string;
|
|
39
|
-
code: string;
|
|
40
|
-
label: string;
|
|
41
|
-
isActive: boolean;
|
|
42
|
-
createdAt: string;
|
|
43
|
-
updatedAt: string;
|
|
44
|
-
description?: string | undefined;
|
|
45
|
-
}>;
|
|
46
|
-
deactivate: (id: string, headers?: ClientHeaders) => Promise<{
|
|
47
|
-
id: string;
|
|
48
|
-
code: string;
|
|
49
|
-
label: string;
|
|
50
|
-
isActive: boolean;
|
|
51
|
-
createdAt: string;
|
|
52
|
-
updatedAt: string;
|
|
53
|
-
description?: string | undefined;
|
|
54
|
-
}>;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { Admin };
|
package/dist/admin/index.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
class Admin {
|
|
2
|
-
client;
|
|
3
|
-
constructor(client) {
|
|
4
|
-
this.client = client;
|
|
5
|
-
}
|
|
6
|
-
clientIds = {
|
|
7
|
-
list: async (query, headers) => {
|
|
8
|
-
return await this.client.fetch(`/admin/client-ids`, {
|
|
9
|
-
method: "GET",
|
|
10
|
-
headers,
|
|
11
|
-
query
|
|
12
|
-
});
|
|
13
|
-
},
|
|
14
|
-
create: async (body, headers) => {
|
|
15
|
-
return await this.client.fetch(`/admin/client-ids`, {
|
|
16
|
-
method: "POST",
|
|
17
|
-
headers,
|
|
18
|
-
body
|
|
19
|
-
});
|
|
20
|
-
},
|
|
21
|
-
update: async (id, body, headers) => {
|
|
22
|
-
return await this.client.fetch(`/admin/client-ids/${id}`, {
|
|
23
|
-
method: "PATCH",
|
|
24
|
-
headers,
|
|
25
|
-
body
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
activate: async (id, headers) => {
|
|
29
|
-
return await this.client.fetch(`/admin/client-ids/${id}/activate`, {
|
|
30
|
-
method: "POST",
|
|
31
|
-
headers
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
deactivate: async (id, headers) => {
|
|
35
|
-
return await this.client.fetch(`/admin/client-ids/${id}/deactivate`, {
|
|
36
|
-
method: "POST",
|
|
37
|
-
headers
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { Admin };
|