@pear-protocol/core-sdk 1.15.0 → 1.17.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 +32 -2
- package/dist/auth/index.js +38 -0
- package/dist/core/index.d.ts +320 -3
- package/package.json +2 -2
package/dist/auth/index.d.ts
CHANGED
|
@@ -8,6 +8,31 @@ declare class Auth {
|
|
|
8
8
|
constructor(client: HttpClient);
|
|
9
9
|
linkEmail(body: HttpTypes.LinkEmailRequest, headers?: ClientHeaders): Promise<void>;
|
|
10
10
|
linkWallet(body: HttpTypes.LinkWalletRequest, headers?: ClientHeaders): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Begin linking an X account. Send the browser to the returned `authorizeUrl`;
|
|
13
|
+
* X redirects back to the backend callback, which finishes the link.
|
|
14
|
+
*
|
|
15
|
+
* Pass `returnTo` as the page the user is on - normally `location.href` - and the
|
|
16
|
+
* callback returns them there with the outcome on the query string.
|
|
17
|
+
*/
|
|
18
|
+
startXLink(body?: HttpTypes.StartXLinkRequest, headers?: ClientHeaders): Promise<{
|
|
19
|
+
authorizeUrl: string;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Begin signing in with X. Send the browser to the returned `authorizeUrl`; X redirects
|
|
23
|
+
* back to the backend callback, which signs in the Pear account that has this X account
|
|
24
|
+
* connected. It never creates one - connect X from a signed-in session first.
|
|
25
|
+
*
|
|
26
|
+
* Pass `returnTo` as the page the user is on - normally `location.href` - and the
|
|
27
|
+
* callback returns them there with the outcome on the query string.
|
|
28
|
+
*/
|
|
29
|
+
startXLogin(body?: HttpTypes.StartXLoginRequest, headers?: ClientHeaders): Promise<{
|
|
30
|
+
authorizeUrl: string;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Unlink the authenticated user's X account. Removes the public handle immediately.
|
|
34
|
+
*/
|
|
35
|
+
disconnectX(headers?: ClientHeaders): Promise<void>;
|
|
11
36
|
login(body: HttpTypes.LoginRequest, headers?: ClientHeaders): Promise<{
|
|
12
37
|
accessToken: string;
|
|
13
38
|
refreshToken: string;
|
|
@@ -15,7 +40,7 @@ declare class Auth {
|
|
|
15
40
|
id: string;
|
|
16
41
|
role: "basic" | "pro";
|
|
17
42
|
providerId: string | null;
|
|
18
|
-
loginMethod: "email" | "evm_wallet" | "oauth";
|
|
43
|
+
loginMethod: "email" | "evm_wallet" | "oauth" | "x";
|
|
19
44
|
};
|
|
20
45
|
}>;
|
|
21
46
|
requestNonce(body: HttpTypes.RequestNonceRequest, headers?: ClientHeaders): Promise<{
|
|
@@ -29,7 +54,12 @@ declare class Auth {
|
|
|
29
54
|
id: string;
|
|
30
55
|
role: "basic" | "pro";
|
|
31
56
|
providerId: string | null;
|
|
32
|
-
loginMethod: "email" | "evm_wallet" | "oauth";
|
|
57
|
+
loginMethod: "email" | "evm_wallet" | "oauth" | "x";
|
|
58
|
+
identities: {
|
|
59
|
+
provider: "email" | "evm_wallet" | "oauth" | "x";
|
|
60
|
+
externalId: string;
|
|
61
|
+
connectedAt: string;
|
|
62
|
+
}[];
|
|
33
63
|
}>;
|
|
34
64
|
apiKeyMe(headers?: ClientHeaders): Promise<{
|
|
35
65
|
id: string;
|
package/dist/auth/index.js
CHANGED
|
@@ -17,6 +17,44 @@ class Auth {
|
|
|
17
17
|
body
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Begin linking an X account. Send the browser to the returned `authorizeUrl`;
|
|
22
|
+
* X redirects back to the backend callback, which finishes the link.
|
|
23
|
+
*
|
|
24
|
+
* Pass `returnTo` as the page the user is on - normally `location.href` - and the
|
|
25
|
+
* callback returns them there with the outcome on the query string.
|
|
26
|
+
*/
|
|
27
|
+
async startXLink(body = {}, headers) {
|
|
28
|
+
return await this.client.fetch(`/auth/link/x/start`, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
headers,
|
|
31
|
+
body
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Begin signing in with X. Send the browser to the returned `authorizeUrl`; X redirects
|
|
36
|
+
* back to the backend callback, which signs in the Pear account that has this X account
|
|
37
|
+
* connected. It never creates one - connect X from a signed-in session first.
|
|
38
|
+
*
|
|
39
|
+
* Pass `returnTo` as the page the user is on - normally `location.href` - and the
|
|
40
|
+
* callback returns them there with the outcome on the query string.
|
|
41
|
+
*/
|
|
42
|
+
async startXLogin(body = {}, headers) {
|
|
43
|
+
return await this.client.fetch(`/auth/login/x/start`, {
|
|
44
|
+
method: "POST",
|
|
45
|
+
headers,
|
|
46
|
+
body
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Unlink the authenticated user's X account. Removes the public handle immediately.
|
|
51
|
+
*/
|
|
52
|
+
async disconnectX(headers) {
|
|
53
|
+
return await this.client.fetch(`/auth/link/x`, {
|
|
54
|
+
method: "DELETE",
|
|
55
|
+
headers
|
|
56
|
+
});
|
|
57
|
+
}
|
|
20
58
|
async login(body, headers) {
|
|
21
59
|
return await this.client.fetch(`/auth/login`, {
|
|
22
60
|
method: "POST",
|
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;
|
|
@@ -702,6 +702,7 @@ declare class Core {
|
|
|
702
702
|
quantity: string;
|
|
703
703
|
} | undefined;
|
|
704
704
|
}[] | undefined;
|
|
705
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
705
706
|
} | {
|
|
706
707
|
id: string;
|
|
707
708
|
tradeAccountId: string;
|
|
@@ -836,6 +837,7 @@ declare class Core {
|
|
|
836
837
|
quantity: string;
|
|
837
838
|
} | undefined;
|
|
838
839
|
}[] | undefined;
|
|
840
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
839
841
|
trailing?: {
|
|
840
842
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
841
843
|
deltaValue: number;
|
|
@@ -1003,6 +1005,7 @@ declare class Core {
|
|
|
1003
1005
|
quantity: string;
|
|
1004
1006
|
} | undefined;
|
|
1005
1007
|
}[] | undefined;
|
|
1008
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
1006
1009
|
trailing?: {
|
|
1007
1010
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1008
1011
|
deltaValue: number;
|
|
@@ -1014,6 +1017,54 @@ declare class Core {
|
|
|
1014
1017
|
})[];
|
|
1015
1018
|
createdAt: string;
|
|
1016
1019
|
updatedAt: string;
|
|
1020
|
+
attachTriggers?: ({
|
|
1021
|
+
intent: "CLOSE";
|
|
1022
|
+
type: "MARKET";
|
|
1023
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT";
|
|
1024
|
+
condition: {
|
|
1025
|
+
type: "notional";
|
|
1026
|
+
data: {
|
|
1027
|
+
priceSource: "mark" | "mid";
|
|
1028
|
+
threshold: number;
|
|
1029
|
+
};
|
|
1030
|
+
} | {
|
|
1031
|
+
type: "upnl";
|
|
1032
|
+
data: {
|
|
1033
|
+
priceSource: "mark" | "mid";
|
|
1034
|
+
threshold: number;
|
|
1035
|
+
};
|
|
1036
|
+
} | {
|
|
1037
|
+
type: "upnl_bps";
|
|
1038
|
+
data: {
|
|
1039
|
+
priceSource: "mark" | "mid";
|
|
1040
|
+
threshold: number;
|
|
1041
|
+
};
|
|
1042
|
+
};
|
|
1043
|
+
} | {
|
|
1044
|
+
intent: "CLOSE";
|
|
1045
|
+
type: "MARKET";
|
|
1046
|
+
condition: {
|
|
1047
|
+
type: "notional_trailing";
|
|
1048
|
+
data: {
|
|
1049
|
+
priceSource: "mark" | "mid";
|
|
1050
|
+
};
|
|
1051
|
+
} | {
|
|
1052
|
+
type: "upnl_trailing";
|
|
1053
|
+
data: {
|
|
1054
|
+
priceSource: "mark" | "mid";
|
|
1055
|
+
};
|
|
1056
|
+
} | {
|
|
1057
|
+
type: "upnl_bps_trailing";
|
|
1058
|
+
data: {
|
|
1059
|
+
priceSource: "mark" | "mid";
|
|
1060
|
+
};
|
|
1061
|
+
};
|
|
1062
|
+
trailing: {
|
|
1063
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1064
|
+
deltaValue: number;
|
|
1065
|
+
activationValue?: number | undefined;
|
|
1066
|
+
};
|
|
1067
|
+
})[] | undefined;
|
|
1017
1068
|
}[];
|
|
1018
1069
|
nextCursor?: string | undefined;
|
|
1019
1070
|
}>;
|
|
@@ -1140,6 +1191,7 @@ declare class Core {
|
|
|
1140
1191
|
quantity: string;
|
|
1141
1192
|
} | undefined;
|
|
1142
1193
|
}[] | undefined;
|
|
1194
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
1143
1195
|
} | {
|
|
1144
1196
|
id: string;
|
|
1145
1197
|
tradeAccountId: string;
|
|
@@ -1274,6 +1326,7 @@ declare class Core {
|
|
|
1274
1326
|
quantity: string;
|
|
1275
1327
|
} | undefined;
|
|
1276
1328
|
}[] | undefined;
|
|
1329
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
1277
1330
|
trailing?: {
|
|
1278
1331
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1279
1332
|
deltaValue: number;
|
|
@@ -1441,6 +1494,7 @@ declare class Core {
|
|
|
1441
1494
|
quantity: string;
|
|
1442
1495
|
} | undefined;
|
|
1443
1496
|
}[] | undefined;
|
|
1497
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
1444
1498
|
trailing?: {
|
|
1445
1499
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1446
1500
|
deltaValue: number;
|
|
@@ -1452,6 +1506,54 @@ declare class Core {
|
|
|
1452
1506
|
})[];
|
|
1453
1507
|
createdAt: string;
|
|
1454
1508
|
updatedAt: string;
|
|
1509
|
+
attachTriggers?: ({
|
|
1510
|
+
intent: "CLOSE";
|
|
1511
|
+
type: "MARKET";
|
|
1512
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT";
|
|
1513
|
+
condition: {
|
|
1514
|
+
type: "notional";
|
|
1515
|
+
data: {
|
|
1516
|
+
priceSource: "mark" | "mid";
|
|
1517
|
+
threshold: number;
|
|
1518
|
+
};
|
|
1519
|
+
} | {
|
|
1520
|
+
type: "upnl";
|
|
1521
|
+
data: {
|
|
1522
|
+
priceSource: "mark" | "mid";
|
|
1523
|
+
threshold: number;
|
|
1524
|
+
};
|
|
1525
|
+
} | {
|
|
1526
|
+
type: "upnl_bps";
|
|
1527
|
+
data: {
|
|
1528
|
+
priceSource: "mark" | "mid";
|
|
1529
|
+
threshold: number;
|
|
1530
|
+
};
|
|
1531
|
+
};
|
|
1532
|
+
} | {
|
|
1533
|
+
intent: "CLOSE";
|
|
1534
|
+
type: "MARKET";
|
|
1535
|
+
condition: {
|
|
1536
|
+
type: "notional_trailing";
|
|
1537
|
+
data: {
|
|
1538
|
+
priceSource: "mark" | "mid";
|
|
1539
|
+
};
|
|
1540
|
+
} | {
|
|
1541
|
+
type: "upnl_trailing";
|
|
1542
|
+
data: {
|
|
1543
|
+
priceSource: "mark" | "mid";
|
|
1544
|
+
};
|
|
1545
|
+
} | {
|
|
1546
|
+
type: "upnl_bps_trailing";
|
|
1547
|
+
data: {
|
|
1548
|
+
priceSource: "mark" | "mid";
|
|
1549
|
+
};
|
|
1550
|
+
};
|
|
1551
|
+
trailing: {
|
|
1552
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1553
|
+
deltaValue: number;
|
|
1554
|
+
activationValue?: number | undefined;
|
|
1555
|
+
};
|
|
1556
|
+
})[] | undefined;
|
|
1455
1557
|
};
|
|
1456
1558
|
}>;
|
|
1457
1559
|
get: (ladderId: string, headers?: ClientHeaders) => Promise<{
|
|
@@ -1577,6 +1679,7 @@ declare class Core {
|
|
|
1577
1679
|
quantity: string;
|
|
1578
1680
|
} | undefined;
|
|
1579
1681
|
}[] | undefined;
|
|
1682
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
1580
1683
|
} | {
|
|
1581
1684
|
id: string;
|
|
1582
1685
|
tradeAccountId: string;
|
|
@@ -1711,6 +1814,7 @@ declare class Core {
|
|
|
1711
1814
|
quantity: string;
|
|
1712
1815
|
} | undefined;
|
|
1713
1816
|
}[] | undefined;
|
|
1817
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
1714
1818
|
trailing?: {
|
|
1715
1819
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1716
1820
|
deltaValue: number;
|
|
@@ -1878,6 +1982,7 @@ declare class Core {
|
|
|
1878
1982
|
quantity: string;
|
|
1879
1983
|
} | undefined;
|
|
1880
1984
|
}[] | undefined;
|
|
1985
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
1881
1986
|
trailing?: {
|
|
1882
1987
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1883
1988
|
deltaValue: number;
|
|
@@ -1889,6 +1994,54 @@ declare class Core {
|
|
|
1889
1994
|
})[];
|
|
1890
1995
|
createdAt: string;
|
|
1891
1996
|
updatedAt: string;
|
|
1997
|
+
attachTriggers?: ({
|
|
1998
|
+
intent: "CLOSE";
|
|
1999
|
+
type: "MARKET";
|
|
2000
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT";
|
|
2001
|
+
condition: {
|
|
2002
|
+
type: "notional";
|
|
2003
|
+
data: {
|
|
2004
|
+
priceSource: "mark" | "mid";
|
|
2005
|
+
threshold: number;
|
|
2006
|
+
};
|
|
2007
|
+
} | {
|
|
2008
|
+
type: "upnl";
|
|
2009
|
+
data: {
|
|
2010
|
+
priceSource: "mark" | "mid";
|
|
2011
|
+
threshold: number;
|
|
2012
|
+
};
|
|
2013
|
+
} | {
|
|
2014
|
+
type: "upnl_bps";
|
|
2015
|
+
data: {
|
|
2016
|
+
priceSource: "mark" | "mid";
|
|
2017
|
+
threshold: number;
|
|
2018
|
+
};
|
|
2019
|
+
};
|
|
2020
|
+
} | {
|
|
2021
|
+
intent: "CLOSE";
|
|
2022
|
+
type: "MARKET";
|
|
2023
|
+
condition: {
|
|
2024
|
+
type: "notional_trailing";
|
|
2025
|
+
data: {
|
|
2026
|
+
priceSource: "mark" | "mid";
|
|
2027
|
+
};
|
|
2028
|
+
} | {
|
|
2029
|
+
type: "upnl_trailing";
|
|
2030
|
+
data: {
|
|
2031
|
+
priceSource: "mark" | "mid";
|
|
2032
|
+
};
|
|
2033
|
+
} | {
|
|
2034
|
+
type: "upnl_bps_trailing";
|
|
2035
|
+
data: {
|
|
2036
|
+
priceSource: "mark" | "mid";
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
trailing: {
|
|
2040
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
2041
|
+
deltaValue: number;
|
|
2042
|
+
activationValue?: number | undefined;
|
|
2043
|
+
};
|
|
2044
|
+
})[] | undefined;
|
|
1892
2045
|
};
|
|
1893
2046
|
}>;
|
|
1894
2047
|
cancel: (ladderId: string, headers?: ClientHeaders) => Promise<{
|
|
@@ -2008,7 +2161,7 @@ declare class Core {
|
|
|
2008
2161
|
list: (query?: HttpTypes.NotificationListParamsInput, headers?: ClientHeaders) => Promise<{
|
|
2009
2162
|
notifications: {
|
|
2010
2163
|
id: string;
|
|
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";
|
|
2164
|
+
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" | "TRIGGER_CANCELLED_MIS_SCALED";
|
|
2012
2165
|
parameters: {
|
|
2013
2166
|
legs: {
|
|
2014
2167
|
id: string;
|
|
@@ -2019,6 +2172,7 @@ declare class Core {
|
|
|
2019
2172
|
triggerId: string;
|
|
2020
2173
|
positionId: string;
|
|
2021
2174
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
2175
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
|
|
2022
2176
|
metric?: "price" | "ratio" | "weighted_ratio" | "funding_rate" | "prediction_market" | "btc_dominance" | "notional" | "upnl" | "upnl_bps" | "ratio_trailing" | "price_trailing" | "weighted_ratio_trailing" | "notional_trailing" | "upnl_trailing" | "upnl_bps_trailing" | undefined;
|
|
2023
2177
|
level?: number | undefined;
|
|
2024
2178
|
reason?: string | undefined;
|
|
@@ -2032,6 +2186,7 @@ declare class Core {
|
|
|
2032
2186
|
triggerId: string;
|
|
2033
2187
|
positionId: string;
|
|
2034
2188
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
2189
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
|
|
2035
2190
|
metric?: "price" | "ratio" | "weighted_ratio" | "funding_rate" | "prediction_market" | "btc_dominance" | "notional" | "upnl" | "upnl_bps" | "ratio_trailing" | "price_trailing" | "weighted_ratio_trailing" | "notional_trailing" | "upnl_trailing" | "upnl_bps_trailing" | undefined;
|
|
2036
2191
|
level?: number | undefined;
|
|
2037
2192
|
reason?: string | undefined;
|
|
@@ -2122,6 +2277,12 @@ declare class Core {
|
|
|
2122
2277
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
2123
2278
|
weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
|
|
2124
2279
|
type: "auto_rebalance_paused";
|
|
2280
|
+
} | {
|
|
2281
|
+
type: "trigger_cancelled_mis_scaled";
|
|
2282
|
+
triggerId: string;
|
|
2283
|
+
positionKey: string;
|
|
2284
|
+
storedBps: number;
|
|
2285
|
+
readingMarginPct: number;
|
|
2125
2286
|
};
|
|
2126
2287
|
isRead: boolean;
|
|
2127
2288
|
createdAt: string;
|
|
@@ -3486,7 +3647,147 @@ declare class Core {
|
|
|
3486
3647
|
}[] | undefined;
|
|
3487
3648
|
};
|
|
3488
3649
|
}>;
|
|
3489
|
-
closeAll: (body: HttpTypes.CreateTradeCloseAll, headers?: ClientHeaders) => Promise<
|
|
3650
|
+
closeAll: (body: HttpTypes.CreateTradeCloseAll, headers?: ClientHeaders) => Promise<{
|
|
3651
|
+
executions: ({
|
|
3652
|
+
id: string;
|
|
3653
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
3654
|
+
status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
|
|
3655
|
+
createdAt: string;
|
|
3656
|
+
updatedAt: string;
|
|
3657
|
+
intent: "OPEN";
|
|
3658
|
+
orderType: "MARKET";
|
|
3659
|
+
legs: [{
|
|
3660
|
+
symbol: string;
|
|
3661
|
+
side: "BUY" | "SELL";
|
|
3662
|
+
mode: "QUANTITY" | "USD";
|
|
3663
|
+
amount: string;
|
|
3664
|
+
reduceOnly: boolean;
|
|
3665
|
+
}, ...{
|
|
3666
|
+
symbol: string;
|
|
3667
|
+
side: "BUY" | "SELL";
|
|
3668
|
+
mode: "QUANTITY" | "USD";
|
|
3669
|
+
amount: string;
|
|
3670
|
+
reduceOnly: boolean;
|
|
3671
|
+
}[]];
|
|
3672
|
+
error?: string | undefined;
|
|
3673
|
+
orders?: {
|
|
3674
|
+
id: string;
|
|
3675
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
3676
|
+
status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
|
|
3677
|
+
createdAt: string;
|
|
3678
|
+
updatedAt: string;
|
|
3679
|
+
type: "MARKET";
|
|
3680
|
+
symbol: string;
|
|
3681
|
+
side: "BUY" | "SELL";
|
|
3682
|
+
reduceOnly: boolean;
|
|
3683
|
+
quantity: string;
|
|
3684
|
+
price: string;
|
|
3685
|
+
filledQuantity: string;
|
|
3686
|
+
error?: string | undefined;
|
|
3687
|
+
filledPrice?: string | undefined;
|
|
3688
|
+
}[] | undefined;
|
|
3689
|
+
} | {
|
|
3690
|
+
id: string;
|
|
3691
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
3692
|
+
status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
|
|
3693
|
+
createdAt: string;
|
|
3694
|
+
updatedAt: string;
|
|
3695
|
+
intent: "ADJUST";
|
|
3696
|
+
orderType: "MARKET";
|
|
3697
|
+
position: {
|
|
3698
|
+
id: string;
|
|
3699
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
3700
|
+
};
|
|
3701
|
+
legs: [{
|
|
3702
|
+
symbol: string;
|
|
3703
|
+
side: "BUY" | "SELL";
|
|
3704
|
+
mode: "QUANTITY" | "USD";
|
|
3705
|
+
amount: string;
|
|
3706
|
+
reduceOnly: boolean;
|
|
3707
|
+
}, ...{
|
|
3708
|
+
symbol: string;
|
|
3709
|
+
side: "BUY" | "SELL";
|
|
3710
|
+
mode: "QUANTITY" | "USD";
|
|
3711
|
+
amount: string;
|
|
3712
|
+
reduceOnly: boolean;
|
|
3713
|
+
}[]];
|
|
3714
|
+
error?: string | undefined;
|
|
3715
|
+
orders?: {
|
|
3716
|
+
id: string;
|
|
3717
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
3718
|
+
status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
|
|
3719
|
+
createdAt: string;
|
|
3720
|
+
updatedAt: string;
|
|
3721
|
+
type: "MARKET";
|
|
3722
|
+
symbol: string;
|
|
3723
|
+
side: "BUY" | "SELL";
|
|
3724
|
+
reduceOnly: boolean;
|
|
3725
|
+
quantity: string;
|
|
3726
|
+
price: string;
|
|
3727
|
+
filledQuantity: string;
|
|
3728
|
+
error?: string | undefined;
|
|
3729
|
+
filledPrice?: string | undefined;
|
|
3730
|
+
}[] | undefined;
|
|
3731
|
+
} | {
|
|
3732
|
+
id: string;
|
|
3733
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
3734
|
+
status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
|
|
3735
|
+
createdAt: string;
|
|
3736
|
+
updatedAt: string;
|
|
3737
|
+
intent: "CLOSE";
|
|
3738
|
+
orderType: "MARKET";
|
|
3739
|
+
position: {
|
|
3740
|
+
id: string;
|
|
3741
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
3742
|
+
};
|
|
3743
|
+
error?: string | undefined;
|
|
3744
|
+
orders?: {
|
|
3745
|
+
id: string;
|
|
3746
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
3747
|
+
status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
|
|
3748
|
+
createdAt: string;
|
|
3749
|
+
updatedAt: string;
|
|
3750
|
+
type: "MARKET";
|
|
3751
|
+
symbol: string;
|
|
3752
|
+
side: "BUY" | "SELL";
|
|
3753
|
+
reduceOnly: boolean;
|
|
3754
|
+
quantity: string;
|
|
3755
|
+
price: string;
|
|
3756
|
+
filledQuantity: string;
|
|
3757
|
+
error?: string | undefined;
|
|
3758
|
+
filledPrice?: string | undefined;
|
|
3759
|
+
}[] | undefined;
|
|
3760
|
+
} | {
|
|
3761
|
+
id: string;
|
|
3762
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
3763
|
+
status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
|
|
3764
|
+
createdAt: string;
|
|
3765
|
+
updatedAt: string;
|
|
3766
|
+
intent: "REVERSE";
|
|
3767
|
+
orderType: "MARKET";
|
|
3768
|
+
position: {
|
|
3769
|
+
id: string;
|
|
3770
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
3771
|
+
};
|
|
3772
|
+
error?: string | undefined;
|
|
3773
|
+
orders?: {
|
|
3774
|
+
id: string;
|
|
3775
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
3776
|
+
status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
|
|
3777
|
+
createdAt: string;
|
|
3778
|
+
updatedAt: string;
|
|
3779
|
+
type: "MARKET";
|
|
3780
|
+
symbol: string;
|
|
3781
|
+
side: "BUY" | "SELL";
|
|
3782
|
+
reduceOnly: boolean;
|
|
3783
|
+
quantity: string;
|
|
3784
|
+
price: string;
|
|
3785
|
+
filledQuantity: string;
|
|
3786
|
+
error?: string | undefined;
|
|
3787
|
+
filledPrice?: string | undefined;
|
|
3788
|
+
}[] | undefined;
|
|
3789
|
+
})[];
|
|
3790
|
+
}>;
|
|
3490
3791
|
setLeverage: (body: HttpTypes.SetLeverage, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
3491
3792
|
};
|
|
3492
3793
|
triggers: {
|
|
@@ -3603,6 +3904,7 @@ declare class Core {
|
|
|
3603
3904
|
quantity: string;
|
|
3604
3905
|
} | undefined;
|
|
3605
3906
|
}[] | undefined;
|
|
3907
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
3606
3908
|
} | {
|
|
3607
3909
|
id: string;
|
|
3608
3910
|
tradeAccountId: string;
|
|
@@ -3737,6 +4039,7 @@ declare class Core {
|
|
|
3737
4039
|
quantity: string;
|
|
3738
4040
|
} | undefined;
|
|
3739
4041
|
}[] | undefined;
|
|
4042
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
3740
4043
|
trailing?: {
|
|
3741
4044
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
3742
4045
|
deltaValue: number;
|
|
@@ -3904,6 +4207,7 @@ declare class Core {
|
|
|
3904
4207
|
quantity: string;
|
|
3905
4208
|
} | undefined;
|
|
3906
4209
|
}[] | undefined;
|
|
4210
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
3907
4211
|
trailing?: {
|
|
3908
4212
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
3909
4213
|
deltaValue: number;
|
|
@@ -4027,6 +4331,7 @@ declare class Core {
|
|
|
4027
4331
|
quantity: string;
|
|
4028
4332
|
} | undefined;
|
|
4029
4333
|
}[] | undefined;
|
|
4334
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
4030
4335
|
} | {
|
|
4031
4336
|
id: string;
|
|
4032
4337
|
tradeAccountId: string;
|
|
@@ -4161,6 +4466,7 @@ declare class Core {
|
|
|
4161
4466
|
quantity: string;
|
|
4162
4467
|
} | undefined;
|
|
4163
4468
|
}[] | undefined;
|
|
4469
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
4164
4470
|
trailing?: {
|
|
4165
4471
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
4166
4472
|
deltaValue: number;
|
|
@@ -4328,6 +4634,7 @@ declare class Core {
|
|
|
4328
4634
|
quantity: string;
|
|
4329
4635
|
} | undefined;
|
|
4330
4636
|
}[] | undefined;
|
|
4637
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
4331
4638
|
trailing?: {
|
|
4332
4639
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
4333
4640
|
deltaValue: number;
|
|
@@ -4450,6 +4757,7 @@ declare class Core {
|
|
|
4450
4757
|
quantity: string;
|
|
4451
4758
|
} | undefined;
|
|
4452
4759
|
}[] | undefined;
|
|
4760
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
4453
4761
|
} | {
|
|
4454
4762
|
id: string;
|
|
4455
4763
|
tradeAccountId: string;
|
|
@@ -4584,6 +4892,7 @@ declare class Core {
|
|
|
4584
4892
|
quantity: string;
|
|
4585
4893
|
} | undefined;
|
|
4586
4894
|
}[] | undefined;
|
|
4895
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
4587
4896
|
trailing?: {
|
|
4588
4897
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
4589
4898
|
deltaValue: number;
|
|
@@ -4751,6 +5060,7 @@ declare class Core {
|
|
|
4751
5060
|
quantity: string;
|
|
4752
5061
|
} | undefined;
|
|
4753
5062
|
}[] | undefined;
|
|
5063
|
+
semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
|
|
4754
5064
|
trailing?: {
|
|
4755
5065
|
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
4756
5066
|
deltaValue: number;
|
|
@@ -4777,6 +5087,9 @@ declare class Core {
|
|
|
4777
5087
|
address: string | null;
|
|
4778
5088
|
email: string | null;
|
|
4779
5089
|
emailVerified: boolean;
|
|
5090
|
+
xHandle: string | null;
|
|
5091
|
+
xName: string | null;
|
|
5092
|
+
xAvatarUrl: string | null;
|
|
4780
5093
|
};
|
|
4781
5094
|
preferences: {
|
|
4782
5095
|
slippageToleranceBps: number;
|
|
@@ -4854,6 +5167,10 @@ declare class Core {
|
|
|
4854
5167
|
pearFee: string;
|
|
4855
5168
|
tradeFee: string;
|
|
4856
5169
|
totalTrades: number;
|
|
5170
|
+
xHandle?: string | undefined;
|
|
5171
|
+
xName?: string | undefined;
|
|
5172
|
+
xAvatarUrl?: string | undefined;
|
|
5173
|
+
xUserId?: string | undefined;
|
|
4857
5174
|
}[];
|
|
4858
5175
|
}>;
|
|
4859
5176
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Pear Protocol Core SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typecheck": "tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pear-protocol/types": "^1.
|
|
29
|
+
"@pear-protocol/types": "^1.24.0",
|
|
30
30
|
"@pear-protocol/utils": "^0.5.1",
|
|
31
31
|
"qs": "^6.14.0"
|
|
32
32
|
},
|