@typus/typus-perp-sdk 1.1.32-codegen-exp28 → 1.1.32-codegen-exp30
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TOKEN } from "@typus/typus-sdk/dist/src/constants";
|
|
2
|
-
export type actionType = "Place Order" | "Cancel Order" | "Order Filled (Open Position)" | "Order Filled (Increase Position)" | "Order Filled (Close Position)" | "Realized PnL" | "Modify Collateral" | "Exercise Position" | "Liquidation" | "Force Cancel Order" | "Force Close Position" | "Swap" | "Realize Funding";
|
|
2
|
+
export type actionType = "Place Order" | "Cancel Order" | "Order Filled (Open Position)" | "Order Filled (Increase Position)" | "Order Filled (Close Position)" | "Realized PnL" | "Modify Collateral" | "Exercise Position" | "Liquidation" | "Force Cancel Order" | "Force Close Position" | "Swap" | "Claim Profit" | "Realize Funding";
|
|
3
3
|
export type sideType = "Long" | "Short";
|
|
4
4
|
export type orderType = "Market" | "Limit" | "Take Profit" | "Stop Loss";
|
|
5
5
|
export type statusType = "Open" | "Filled" | "Canceled";
|
package/dist/src/user/history.js
CHANGED
|
@@ -12,6 +12,7 @@ exports.toSentioToken = toSentioToken;
|
|
|
12
12
|
const constants_1 = require("@typus/typus-sdk/dist/src/constants");
|
|
13
13
|
const position_1 = require("../generated/typus_perp/position");
|
|
14
14
|
const trading_1 = require("../generated/typus_perp/trading");
|
|
15
|
+
const profit_vault_1 = require("../generated/typus_perp/profit_vault");
|
|
15
16
|
const lp_pool_1 = require("../generated/typus_perp/lp_pool");
|
|
16
17
|
const sentio_1 = require("../../src/api/sentio");
|
|
17
18
|
const src_1 = require("../../src");
|
|
@@ -300,6 +301,37 @@ async function parseUserHistory(raw_events) {
|
|
|
300
301
|
break;
|
|
301
302
|
}
|
|
302
303
|
}
|
|
304
|
+
if (mod === "profit_vault") {
|
|
305
|
+
switch (name) {
|
|
306
|
+
case profit_vault_1.WithdrawProfitEvent.name.split("::")[2]:
|
|
307
|
+
const profit_token = (0, constants_1.typeArgToAsset)(json.token_type.name);
|
|
308
|
+
const profit_token_decimal = (0, constants_1.assetToDecimal)(profit_token);
|
|
309
|
+
const profit = Number(json.withdraw_amount) / 10 ** profit_token_decimal;
|
|
310
|
+
const e = {
|
|
311
|
+
action: "Claim Profit",
|
|
312
|
+
typeName: name,
|
|
313
|
+
order_id: undefined,
|
|
314
|
+
position_id: undefined,
|
|
315
|
+
market: 'TYPUS/USD',
|
|
316
|
+
side: undefined,
|
|
317
|
+
order_type: undefined,
|
|
318
|
+
status: 'Filled',
|
|
319
|
+
size: profit,
|
|
320
|
+
base_token: profit_token,
|
|
321
|
+
collateral: undefined,
|
|
322
|
+
collateral_token: profit_token,
|
|
323
|
+
price: undefined,
|
|
324
|
+
realized_pnl: undefined,
|
|
325
|
+
timestamp,
|
|
326
|
+
tx_digest,
|
|
327
|
+
dov_index: undefined,
|
|
328
|
+
sender: "user",
|
|
329
|
+
};
|
|
330
|
+
console.log(e);
|
|
331
|
+
events.push(e);
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
303
335
|
});
|
|
304
336
|
// console.log(events);
|
|
305
337
|
return events;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typus/typus-perp-sdk",
|
|
3
|
-
"version": "1.1.32-codegen-
|
|
3
|
+
"version": "1.1.32-codegen-exp30",
|
|
4
4
|
"repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
|
|
5
5
|
"author": "Typus",
|
|
6
6
|
"description": "typus perp sdk",
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/Typus-Lab/typus-perp-sdk#readme",
|
|
46
46
|
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
|
|
47
|
-
}
|
|
47
|
+
}
|