@pear-protocol/core-sdk 1.12.1 → 1.12.2
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/core/index.d.ts +262 -18
- package/dist/core/index.js +20 -0
- package/package.json +3 -3
package/dist/core/index.d.ts
CHANGED
|
@@ -187,7 +187,7 @@ declare class Core {
|
|
|
187
187
|
get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
|
|
188
188
|
baseBps: string;
|
|
189
189
|
discounts: {
|
|
190
|
-
scope: "
|
|
190
|
+
scope: "connector" | "all" | "user" | "client_id";
|
|
191
191
|
rate: string;
|
|
192
192
|
}[];
|
|
193
193
|
finalBps: string;
|
|
@@ -1904,6 +1904,7 @@ declare class Core {
|
|
|
1904
1904
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1905
1905
|
type: "spot" | "perp" | "hip3";
|
|
1906
1906
|
leverage: number;
|
|
1907
|
+
marginMode: "any" | "isolated" | "cross";
|
|
1907
1908
|
precision: {
|
|
1908
1909
|
quantity: {
|
|
1909
1910
|
decimals: number;
|
|
@@ -1930,6 +1931,7 @@ declare class Core {
|
|
|
1930
1931
|
instruments: {
|
|
1931
1932
|
id: string;
|
|
1932
1933
|
base: string;
|
|
1934
|
+
marginMode: "any" | "isolated" | "cross";
|
|
1933
1935
|
precision: {
|
|
1934
1936
|
quantity: {
|
|
1935
1937
|
contractSize: number;
|
|
@@ -1974,8 +1976,11 @@ declare class Core {
|
|
|
1974
1976
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1975
1977
|
basketKey: string;
|
|
1976
1978
|
displaySymbol: string;
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
+
legs: {
|
|
1980
|
+
id: string;
|
|
1981
|
+
symbol: string;
|
|
1982
|
+
side: "BUY" | "SELL";
|
|
1983
|
+
}[];
|
|
1979
1984
|
price: string;
|
|
1980
1985
|
priceChange24h: string;
|
|
1981
1986
|
weightRatio: string;
|
|
@@ -1991,13 +1996,25 @@ declare class Core {
|
|
|
1991
1996
|
hasMaterializedStats: boolean;
|
|
1992
1997
|
}[];
|
|
1993
1998
|
}>;
|
|
1999
|
+
basketPositions: (body: HttpTypes.MarketBasketPositionCountsPayloadInput, headers?: ClientHeaders) => Promise<{
|
|
2000
|
+
counts: {
|
|
2001
|
+
basketKey: string;
|
|
2002
|
+
opened: number;
|
|
2003
|
+
traders: number;
|
|
2004
|
+
}[];
|
|
2005
|
+
}>;
|
|
1994
2006
|
};
|
|
1995
2007
|
notifications: {
|
|
1996
2008
|
list: (query?: HttpTypes.NotificationListParamsInput, headers?: ClientHeaders) => Promise<{
|
|
1997
2009
|
notifications: {
|
|
1998
2010
|
id: string;
|
|
1999
|
-
category: "TAKE_PROFIT_HIT" | "STOP_LOSS_HIT" | "TRIGGER_ORDER_HIT" | "TAKE_PROFIT_FAILED" | "STOP_LOSS_FAILED" | "TRIGGER_ORDER_FAILED" | "ATTACHED_TRIGGER_DISCARDED";
|
|
2011
|
+
category: "TAKE_PROFIT_HIT" | "STOP_LOSS_HIT" | "TRIGGER_ORDER_HIT" | "TAKE_PROFIT_FAILED" | "STOP_LOSS_FAILED" | "TRIGGER_ORDER_FAILED" | "ATTACHED_TRIGGER_DISCARDED" | "AUTO_REBALANCE_EXECUTED" | "AUTO_REBALANCE_FAILED" | "AUTO_REBALANCE_PAUSED";
|
|
2000
2012
|
parameters: {
|
|
2013
|
+
legs: {
|
|
2014
|
+
id: string;
|
|
2015
|
+
symbol: string;
|
|
2016
|
+
side: "BUY" | "SELL";
|
|
2017
|
+
}[];
|
|
2001
2018
|
type: "take_profit";
|
|
2002
2019
|
triggerId: string;
|
|
2003
2020
|
positionId: string;
|
|
@@ -2006,6 +2023,11 @@ declare class Core {
|
|
|
2006
2023
|
level?: number | undefined;
|
|
2007
2024
|
reason?: string | undefined;
|
|
2008
2025
|
} | {
|
|
2026
|
+
legs: {
|
|
2027
|
+
id: string;
|
|
2028
|
+
symbol: string;
|
|
2029
|
+
side: "BUY" | "SELL";
|
|
2030
|
+
}[];
|
|
2009
2031
|
type: "stop_loss";
|
|
2010
2032
|
triggerId: string;
|
|
2011
2033
|
positionId: string;
|
|
@@ -2014,6 +2036,11 @@ declare class Core {
|
|
|
2014
2036
|
level?: number | undefined;
|
|
2015
2037
|
reason?: string | undefined;
|
|
2016
2038
|
} | {
|
|
2039
|
+
legs: {
|
|
2040
|
+
id: string;
|
|
2041
|
+
symbol: string;
|
|
2042
|
+
side: "BUY" | "SELL";
|
|
2043
|
+
}[];
|
|
2017
2044
|
type: "trigger_order";
|
|
2018
2045
|
triggerId: string;
|
|
2019
2046
|
positionId: string;
|
|
@@ -2022,6 +2049,11 @@ declare class Core {
|
|
|
2022
2049
|
level?: number | undefined;
|
|
2023
2050
|
reason?: string | undefined;
|
|
2024
2051
|
} | {
|
|
2052
|
+
legs: {
|
|
2053
|
+
id: string;
|
|
2054
|
+
symbol: string;
|
|
2055
|
+
side: "BUY" | "SELL";
|
|
2056
|
+
}[];
|
|
2025
2057
|
type: "default_trigger";
|
|
2026
2058
|
triggerId: string;
|
|
2027
2059
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
@@ -2029,6 +2061,11 @@ declare class Core {
|
|
|
2029
2061
|
level?: number | undefined;
|
|
2030
2062
|
reason?: string | undefined;
|
|
2031
2063
|
} | {
|
|
2064
|
+
legs: {
|
|
2065
|
+
id: string;
|
|
2066
|
+
symbol: string;
|
|
2067
|
+
side: "BUY" | "SELL";
|
|
2068
|
+
}[];
|
|
2032
2069
|
type: "attached_trigger_discarded";
|
|
2033
2070
|
positionId: string;
|
|
2034
2071
|
positionKey: string;
|
|
@@ -2040,6 +2077,51 @@ declare class Core {
|
|
|
2040
2077
|
level?: number | undefined;
|
|
2041
2078
|
}[];
|
|
2042
2079
|
activeTriggerLimit: number;
|
|
2080
|
+
} | {
|
|
2081
|
+
legs: {
|
|
2082
|
+
id: string;
|
|
2083
|
+
symbol: string;
|
|
2084
|
+
side: "BUY" | "SELL";
|
|
2085
|
+
currentWeight: number;
|
|
2086
|
+
targetWeight: number;
|
|
2087
|
+
}[];
|
|
2088
|
+
driftPct: number;
|
|
2089
|
+
notionalUsd: number;
|
|
2090
|
+
configId: string;
|
|
2091
|
+
positionId: string;
|
|
2092
|
+
positionKey: string;
|
|
2093
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
2094
|
+
weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
|
|
2095
|
+
type: "auto_rebalance_executed";
|
|
2096
|
+
} | {
|
|
2097
|
+
legs: {
|
|
2098
|
+
id: string;
|
|
2099
|
+
symbol: string;
|
|
2100
|
+
side: "BUY" | "SELL";
|
|
2101
|
+
currentWeight: number;
|
|
2102
|
+
targetWeight: number;
|
|
2103
|
+
}[];
|
|
2104
|
+
driftPct: number;
|
|
2105
|
+
reason: string;
|
|
2106
|
+
configId: string;
|
|
2107
|
+
positionId: string;
|
|
2108
|
+
positionKey: string;
|
|
2109
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
2110
|
+
weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
|
|
2111
|
+
type: "auto_rebalance_failed";
|
|
2112
|
+
} | {
|
|
2113
|
+
legs: {
|
|
2114
|
+
id: string;
|
|
2115
|
+
symbol: string;
|
|
2116
|
+
side: "BUY" | "SELL";
|
|
2117
|
+
}[];
|
|
2118
|
+
pausedReason: "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE";
|
|
2119
|
+
configId: string;
|
|
2120
|
+
positionId: string;
|
|
2121
|
+
positionKey: string;
|
|
2122
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
2123
|
+
weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
|
|
2124
|
+
type: "auto_rebalance_paused";
|
|
2043
2125
|
};
|
|
2044
2126
|
isRead: boolean;
|
|
2045
2127
|
createdAt: string;
|
|
@@ -2096,6 +2178,83 @@ declare class Core {
|
|
|
2096
2178
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
2097
2179
|
}[];
|
|
2098
2180
|
}>;
|
|
2181
|
+
/**
|
|
2182
|
+
* Closed-trade history, newest close first, composed server-side.
|
|
2183
|
+
*
|
|
2184
|
+
* A page may hold fewer than `limit` trades and still return a `nextCursor` —
|
|
2185
|
+
* page until `nextCursor` is absent, never until a page comes back short.
|
|
2186
|
+
*/
|
|
2187
|
+
closed: (query?: HttpTypes.ClosedPositionListParamsInput, headers?: ClientHeaders) => Promise<{
|
|
2188
|
+
limit: number;
|
|
2189
|
+
trades: {
|
|
2190
|
+
positionId: string;
|
|
2191
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
2192
|
+
openedAt: string;
|
|
2193
|
+
closedAt: string;
|
|
2194
|
+
origin: "PARTIAL" | "PEAR" | "EXTERNAL";
|
|
2195
|
+
grossPnl: `-${string}` | `+${string}`;
|
|
2196
|
+
netPnl: `-${string}` | `+${string}`;
|
|
2197
|
+
totalFees: `-${string}` | `+${string}`;
|
|
2198
|
+
tradeFees: `-${string}` | `+${string}`;
|
|
2199
|
+
pearFees: `-${string}` | `+${string}`;
|
|
2200
|
+
totalFunding: `-${string}` | `+${string}`;
|
|
2201
|
+
entryNotional: string;
|
|
2202
|
+
exitNotional: string;
|
|
2203
|
+
exitNotionalComplete: boolean;
|
|
2204
|
+
hasSyntheticFills: boolean;
|
|
2205
|
+
unstableHistoricalData: boolean;
|
|
2206
|
+
longAssets: string[];
|
|
2207
|
+
shortAssets: string[];
|
|
2208
|
+
legs: {
|
|
2209
|
+
asset: string;
|
|
2210
|
+
side: "LONG" | "SHORT";
|
|
2211
|
+
grossPnl: `-${string}` | `+${string}`;
|
|
2212
|
+
netPnl: `-${string}` | `+${string}`;
|
|
2213
|
+
totalFees: `-${string}` | `+${string}`;
|
|
2214
|
+
tradeFees: `-${string}` | `+${string}`;
|
|
2215
|
+
pearFees: `-${string}` | `+${string}`;
|
|
2216
|
+
funding: `-${string}` | `+${string}`;
|
|
2217
|
+
entryNotional: string;
|
|
2218
|
+
exitQuantity: string;
|
|
2219
|
+
undeterminedSize: string;
|
|
2220
|
+
entryVwap?: string | undefined;
|
|
2221
|
+
exitVwap?: string | undefined;
|
|
2222
|
+
}[];
|
|
2223
|
+
closedReason?: "USER" | "NETTED" | "LIQUIDATED" | undefined;
|
|
2224
|
+
steps?: {
|
|
2225
|
+
at: string;
|
|
2226
|
+
grossPnl: `-${string}` | `+${string}`;
|
|
2227
|
+
legs: ({
|
|
2228
|
+
kind: "INCREASE";
|
|
2229
|
+
asset: string;
|
|
2230
|
+
side: "BUY" | "SELL";
|
|
2231
|
+
quantity: string;
|
|
2232
|
+
price: string;
|
|
2233
|
+
tradeFee: `-${string}` | `+${string}`;
|
|
2234
|
+
pearFee: `-${string}` | `+${string}`;
|
|
2235
|
+
} | {
|
|
2236
|
+
kind: "REDUCE";
|
|
2237
|
+
asset: string;
|
|
2238
|
+
side: "BUY" | "SELL";
|
|
2239
|
+
quantity: string;
|
|
2240
|
+
price: string;
|
|
2241
|
+
entryBasis: string;
|
|
2242
|
+
grossPnl: `-${string}` | `+${string}`;
|
|
2243
|
+
tradeFee: `-${string}` | `+${string}`;
|
|
2244
|
+
pearFee: `-${string}` | `+${string}`;
|
|
2245
|
+
} | {
|
|
2246
|
+
kind: "REDUCE_UNPRICED";
|
|
2247
|
+
asset: string;
|
|
2248
|
+
side: "BUY" | "SELL";
|
|
2249
|
+
quantity: string;
|
|
2250
|
+
tradeFee: `-${string}` | `+${string}`;
|
|
2251
|
+
pearFee: `-${string}` | `+${string}`;
|
|
2252
|
+
})[];
|
|
2253
|
+
executionId?: string | undefined;
|
|
2254
|
+
}[] | undefined;
|
|
2255
|
+
}[];
|
|
2256
|
+
nextCursor?: string | undefined;
|
|
2257
|
+
}>;
|
|
2099
2258
|
};
|
|
2100
2259
|
portfolio: {
|
|
2101
2260
|
overview: (query?: HttpTypes.PortfolioQueryInput, headers?: ClientHeaders) => Promise<{
|
|
@@ -2296,17 +2455,38 @@ declare class Core {
|
|
|
2296
2455
|
auto: {
|
|
2297
2456
|
list: (query?: HttpTypes.AutoRebalanceListParamsInput, headers?: ClientHeaders) => Promise<{
|
|
2298
2457
|
limit: number;
|
|
2299
|
-
items: {
|
|
2458
|
+
items: ({
|
|
2300
2459
|
id: string;
|
|
2301
2460
|
positionId: string;
|
|
2302
2461
|
status: "ACTIVE" | "PAUSED";
|
|
2303
|
-
weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
|
|
2304
2462
|
minimumDriftPct: string;
|
|
2305
2463
|
createdAt: string;
|
|
2306
2464
|
updatedAt: string;
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
}
|
|
2465
|
+
weightSource: "INITIAL_WEIGHT";
|
|
2466
|
+
pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
|
|
2467
|
+
} | {
|
|
2468
|
+
id: string;
|
|
2469
|
+
positionId: string;
|
|
2470
|
+
status: "ACTIVE" | "PAUSED";
|
|
2471
|
+
minimumDriftPct: string;
|
|
2472
|
+
createdAt: string;
|
|
2473
|
+
updatedAt: string;
|
|
2474
|
+
weightSource: "LIVE_BETA";
|
|
2475
|
+
timeframe: "1d" | "1h" | "4h";
|
|
2476
|
+
beta: {
|
|
2477
|
+
state: "PENDING";
|
|
2478
|
+
} | {
|
|
2479
|
+
state: "BASELINED";
|
|
2480
|
+
impliedEntryBeta: string;
|
|
2481
|
+
} | {
|
|
2482
|
+
state: "TRACKING";
|
|
2483
|
+
impliedEntryBeta: string;
|
|
2484
|
+
lastDerivedBeta: string;
|
|
2485
|
+
lastProcessedBetaTime: string;
|
|
2486
|
+
driftPct?: string | undefined;
|
|
2487
|
+
};
|
|
2488
|
+
pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
|
|
2489
|
+
})[];
|
|
2310
2490
|
nextCursor?: string | undefined;
|
|
2311
2491
|
}>;
|
|
2312
2492
|
create: (body: HttpTypes.CreateAutoRebalanceConfig, headers?: ClientHeaders) => Promise<{
|
|
@@ -2314,12 +2494,33 @@ declare class Core {
|
|
|
2314
2494
|
id: string;
|
|
2315
2495
|
positionId: string;
|
|
2316
2496
|
status: "ACTIVE" | "PAUSED";
|
|
2317
|
-
weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
|
|
2318
2497
|
minimumDriftPct: string;
|
|
2319
2498
|
createdAt: string;
|
|
2320
2499
|
updatedAt: string;
|
|
2321
|
-
|
|
2322
|
-
|
|
2500
|
+
weightSource: "INITIAL_WEIGHT";
|
|
2501
|
+
pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
|
|
2502
|
+
} | {
|
|
2503
|
+
id: string;
|
|
2504
|
+
positionId: string;
|
|
2505
|
+
status: "ACTIVE" | "PAUSED";
|
|
2506
|
+
minimumDriftPct: string;
|
|
2507
|
+
createdAt: string;
|
|
2508
|
+
updatedAt: string;
|
|
2509
|
+
weightSource: "LIVE_BETA";
|
|
2510
|
+
timeframe: "1d" | "1h" | "4h";
|
|
2511
|
+
beta: {
|
|
2512
|
+
state: "PENDING";
|
|
2513
|
+
} | {
|
|
2514
|
+
state: "BASELINED";
|
|
2515
|
+
impliedEntryBeta: string;
|
|
2516
|
+
} | {
|
|
2517
|
+
state: "TRACKING";
|
|
2518
|
+
impliedEntryBeta: string;
|
|
2519
|
+
lastDerivedBeta: string;
|
|
2520
|
+
lastProcessedBetaTime: string;
|
|
2521
|
+
driftPct?: string | undefined;
|
|
2522
|
+
};
|
|
2523
|
+
pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
|
|
2323
2524
|
};
|
|
2324
2525
|
}>;
|
|
2325
2526
|
update: (id: string, body: HttpTypes.UpdateAutoRebalanceConfig, headers?: ClientHeaders) => Promise<{
|
|
@@ -2327,12 +2528,33 @@ declare class Core {
|
|
|
2327
2528
|
id: string;
|
|
2328
2529
|
positionId: string;
|
|
2329
2530
|
status: "ACTIVE" | "PAUSED";
|
|
2330
|
-
weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
|
|
2331
2531
|
minimumDriftPct: string;
|
|
2332
2532
|
createdAt: string;
|
|
2333
2533
|
updatedAt: string;
|
|
2334
|
-
|
|
2335
|
-
|
|
2534
|
+
weightSource: "INITIAL_WEIGHT";
|
|
2535
|
+
pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
|
|
2536
|
+
} | {
|
|
2537
|
+
id: string;
|
|
2538
|
+
positionId: string;
|
|
2539
|
+
status: "ACTIVE" | "PAUSED";
|
|
2540
|
+
minimumDriftPct: string;
|
|
2541
|
+
createdAt: string;
|
|
2542
|
+
updatedAt: string;
|
|
2543
|
+
weightSource: "LIVE_BETA";
|
|
2544
|
+
timeframe: "1d" | "1h" | "4h";
|
|
2545
|
+
beta: {
|
|
2546
|
+
state: "PENDING";
|
|
2547
|
+
} | {
|
|
2548
|
+
state: "BASELINED";
|
|
2549
|
+
impliedEntryBeta: string;
|
|
2550
|
+
} | {
|
|
2551
|
+
state: "TRACKING";
|
|
2552
|
+
impliedEntryBeta: string;
|
|
2553
|
+
lastDerivedBeta: string;
|
|
2554
|
+
lastProcessedBetaTime: string;
|
|
2555
|
+
driftPct?: string | undefined;
|
|
2556
|
+
};
|
|
2557
|
+
pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
|
|
2336
2558
|
};
|
|
2337
2559
|
}>;
|
|
2338
2560
|
replace: (id: string, body: HttpTypes.ReplaceAutoRebalanceConfig, headers?: ClientHeaders) => Promise<{
|
|
@@ -2340,12 +2562,33 @@ declare class Core {
|
|
|
2340
2562
|
id: string;
|
|
2341
2563
|
positionId: string;
|
|
2342
2564
|
status: "ACTIVE" | "PAUSED";
|
|
2343
|
-
weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
|
|
2344
2565
|
minimumDriftPct: string;
|
|
2345
2566
|
createdAt: string;
|
|
2346
2567
|
updatedAt: string;
|
|
2347
|
-
|
|
2348
|
-
|
|
2568
|
+
weightSource: "INITIAL_WEIGHT";
|
|
2569
|
+
pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
|
|
2570
|
+
} | {
|
|
2571
|
+
id: string;
|
|
2572
|
+
positionId: string;
|
|
2573
|
+
status: "ACTIVE" | "PAUSED";
|
|
2574
|
+
minimumDriftPct: string;
|
|
2575
|
+
createdAt: string;
|
|
2576
|
+
updatedAt: string;
|
|
2577
|
+
weightSource: "LIVE_BETA";
|
|
2578
|
+
timeframe: "1d" | "1h" | "4h";
|
|
2579
|
+
beta: {
|
|
2580
|
+
state: "PENDING";
|
|
2581
|
+
} | {
|
|
2582
|
+
state: "BASELINED";
|
|
2583
|
+
impliedEntryBeta: string;
|
|
2584
|
+
} | {
|
|
2585
|
+
state: "TRACKING";
|
|
2586
|
+
impliedEntryBeta: string;
|
|
2587
|
+
lastDerivedBeta: string;
|
|
2588
|
+
lastProcessedBetaTime: string;
|
|
2589
|
+
driftPct?: string | undefined;
|
|
2590
|
+
};
|
|
2591
|
+
pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
|
|
2349
2592
|
};
|
|
2350
2593
|
}>;
|
|
2351
2594
|
cancel: (id: string, headers?: ClientHeaders) => Promise<void>;
|
|
@@ -2640,6 +2883,7 @@ declare class Core {
|
|
|
2640
2883
|
since: (body: HttpTypes.SyncFillsSinceRequest, headers?: ClientHeaders) => Promise<{
|
|
2641
2884
|
sinceMs: number;
|
|
2642
2885
|
neverSynced: boolean;
|
|
2886
|
+
firstSyncStartedAt?: number | undefined;
|
|
2643
2887
|
confirmedExchangeFillIds?: string[] | undefined;
|
|
2644
2888
|
}>;
|
|
2645
2889
|
reconcile: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
package/dist/core/index.js
CHANGED
|
@@ -207,6 +207,13 @@ class Core {
|
|
|
207
207
|
headers,
|
|
208
208
|
query
|
|
209
209
|
});
|
|
210
|
+
},
|
|
211
|
+
basketPositions: async (body, headers) => {
|
|
212
|
+
return await this.client.fetch(`/markets/baskets/positions`, {
|
|
213
|
+
method: "POST",
|
|
214
|
+
headers,
|
|
215
|
+
body
|
|
216
|
+
});
|
|
210
217
|
}
|
|
211
218
|
};
|
|
212
219
|
notifications = {
|
|
@@ -253,6 +260,19 @@ class Core {
|
|
|
253
260
|
method: "GET",
|
|
254
261
|
headers
|
|
255
262
|
});
|
|
263
|
+
},
|
|
264
|
+
/**
|
|
265
|
+
* Closed-trade history, newest close first, composed server-side.
|
|
266
|
+
*
|
|
267
|
+
* A page may hold fewer than `limit` trades and still return a `nextCursor` —
|
|
268
|
+
* page until `nextCursor` is absent, never until a page comes back short.
|
|
269
|
+
*/
|
|
270
|
+
closed: async (query, headers) => {
|
|
271
|
+
return await this.client.fetch(`/positions/closed`, {
|
|
272
|
+
method: "GET",
|
|
273
|
+
headers,
|
|
274
|
+
query
|
|
275
|
+
});
|
|
256
276
|
}
|
|
257
277
|
};
|
|
258
278
|
portfolio = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.2",
|
|
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.17.0",
|
|
29
|
+
"@pear-protocol/utils": "^0.5.0",
|
|
30
30
|
"qs": "^6.14.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|