@typus/typus-perp-sdk 1.0.28 → 1.0.30
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/src/index.d.ts +6 -0
- package/dist/src/index.js +52 -12
- package/dist/src/typus_perp/index.d.ts +1 -3
- package/dist/src/typus_perp/index.js +3 -3
- package/dist/src/typus_perp/lp-pool/structs.d.ts +56 -0
- package/dist/src/typus_perp/lp-pool/structs.js +12 -0
- package/dist/src/typus_stake_pool/index.d.ts +1 -3
- package/dist/src/typus_stake_pool/index.js +3 -3
- package/dist/src/user/history.js +8 -8
- package/package.json +2 -2
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export * from "./fetch";
|
|
2
2
|
export * from "./user";
|
|
3
3
|
export declare const NETWORK: string;
|
|
4
|
+
export declare const PERP_PACKAGE_ID: string;
|
|
5
|
+
export declare const PERP_PUBLISHED_AT: string;
|
|
6
|
+
export declare const PERP_PKG_V1: string;
|
|
7
|
+
export declare const STAKE_PACKAGE_ID: string;
|
|
8
|
+
export declare const STAKE_PUBLISHED_AT: string;
|
|
9
|
+
export declare const STAKE_PKG_V1: string;
|
|
4
10
|
export declare const LP_POOL: string;
|
|
5
11
|
export declare const LIQUIDITY_POOL: string;
|
|
6
12
|
export declare const LIQUIDITY_POOL_0: string;
|
package/dist/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.STAKE_POOL_VERSION = exports.STAKE_POOL_0 = exports.STAKE_POOL = exports.TLP_TREASURY_CAP = exports.TLP_TOKEN = exports.TLP = exports.PERP_VERSION = exports.MARKET = exports.LIQUIDITY_POOL_0 = exports.LIQUIDITY_POOL = exports.LP_POOL = exports.NETWORK = void 0;
|
|
20
|
+
exports.STAKE_POOL_VERSION = exports.STAKE_POOL_0 = exports.STAKE_POOL = exports.TLP_TREASURY_CAP = exports.TLP_TOKEN = exports.TLP = exports.PERP_VERSION = exports.MARKET = exports.LIQUIDITY_POOL_0 = exports.LIQUIDITY_POOL = exports.LP_POOL = exports.STAKE_PKG_V1 = exports.STAKE_PUBLISHED_AT = exports.STAKE_PACKAGE_ID = exports.PERP_PKG_V1 = exports.PERP_PUBLISHED_AT = exports.PERP_PACKAGE_ID = exports.NETWORK = void 0;
|
|
21
21
|
__exportStar(require("./fetch"), exports);
|
|
22
22
|
__exportStar(require("./user"), exports);
|
|
23
23
|
var dotenv_1 = __importDefault(require("dotenv"));
|
|
@@ -26,18 +26,58 @@ dotenv_1.default.config();
|
|
|
26
26
|
exports.NETWORK = process.env.NEXT_PUBLIC_CLUSTER == "mainnet" ? "MAINNET" : "TESTNET";
|
|
27
27
|
console.log("Load .env NEXT_PUBLIC_CLUSTER: ".concat(process.env.NEXT_PUBLIC_CLUSTER));
|
|
28
28
|
console.log("Initializing Typus Perp SDK for ".concat(exports.NETWORK));
|
|
29
|
+
exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
30
|
+
? "0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3"
|
|
31
|
+
: "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600";
|
|
32
|
+
exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
33
|
+
? "0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3"
|
|
34
|
+
: "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600";
|
|
35
|
+
exports.PERP_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
36
|
+
? "0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3"
|
|
37
|
+
: "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600";
|
|
38
|
+
exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
39
|
+
? "0x59033cb52ab8286b2ff368b8e6b319eefd7f2a4a83bd9152b53ce2a2cc4b6ad0"
|
|
40
|
+
: "0xafe221d6a3abc88d6f6f79b2452840c9f8d4cf8f7e58938b853acee5f06f24a2";
|
|
41
|
+
exports.STAKE_PUBLISHED_AT = exports.NETWORK == "MAINNET"
|
|
42
|
+
? "0x59033cb52ab8286b2ff368b8e6b319eefd7f2a4a83bd9152b53ce2a2cc4b6ad0"
|
|
43
|
+
: "0xafe221d6a3abc88d6f6f79b2452840c9f8d4cf8f7e58938b853acee5f06f24a2";
|
|
44
|
+
exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
45
|
+
? "0x59033cb52ab8286b2ff368b8e6b319eefd7f2a4a83bd9152b53ce2a2cc4b6ad0"
|
|
46
|
+
: "0xafe221d6a3abc88d6f6f79b2452840c9f8d4cf8f7e58938b853acee5f06f24a2";
|
|
29
47
|
// Registry
|
|
30
|
-
exports.LP_POOL = exports.NETWORK == "MAINNET"
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
exports.LP_POOL = exports.NETWORK == "MAINNET"
|
|
49
|
+
? "0x3d5c4b793617d848b46e8239873aa6b4d01abc1e026de226f9d5050ea03b0534"
|
|
50
|
+
: "0xdfd138d539ecfd3b57286e20e5b9fff6c3fcd7986651567591245ba4c87ca6b5";
|
|
51
|
+
exports.LIQUIDITY_POOL = exports.NETWORK == "MAINNET"
|
|
52
|
+
? "0x29919540a3473d2127562e77a41a3f643ccf5e544770efb4d0fe0407d88bbf57"
|
|
53
|
+
: "0x8e4ad806781a50b0bed6011e97d48cc07ef23f2f6d95fd021e8625ffc1ee44f8";
|
|
54
|
+
exports.LIQUIDITY_POOL_0 = exports.NETWORK == "MAINNET"
|
|
55
|
+
? "0x9e1f760bebd2aab8f6e03682917efc28d0d446f3d2d3a4c1d28d385e3f325bda"
|
|
56
|
+
: "0x952fadd71b6ada8fc2e9aacc2e9de2dd3dade9813427af6a3c42a5926e371f04";
|
|
33
57
|
// MarketRegistry
|
|
34
|
-
exports.MARKET = exports.NETWORK == "MAINNET"
|
|
35
|
-
|
|
58
|
+
exports.MARKET = exports.NETWORK == "MAINNET"
|
|
59
|
+
? "0x41a9721eb80d3e097865a2d9d85cbc334f74c7b2b6a50cba1e44fe9802baa9bb"
|
|
60
|
+
: "0x819ad73d991f69640e553048a343b3ddade3c1f807581166c40bb49fa5ae1ded";
|
|
61
|
+
exports.PERP_VERSION = exports.NETWORK == "MAINNET"
|
|
62
|
+
? "0x059366677707d36e6a63fa6eaa3547bb1a32d821e1ba74c78024b471afb62f27"
|
|
63
|
+
: "0x26acf84bc93db806e435da1223e9e6add249724495c4103a08296d1b67d1edfc";
|
|
36
64
|
// LpRegistry
|
|
37
|
-
exports.TLP = exports.NETWORK == "MAINNET"
|
|
38
|
-
|
|
39
|
-
|
|
65
|
+
exports.TLP = exports.NETWORK == "MAINNET"
|
|
66
|
+
? "0xc359ecccc1e5ec6e2d701bc1ad0e2e6f1299717bb43309b4359899f2aeae3d69"
|
|
67
|
+
: "0x42096762e1dd5721621c4104c167569e6afb0586ba92a7f92d834062dd38d7e7";
|
|
68
|
+
exports.TLP_TOKEN = exports.NETWORK == "MAINNET"
|
|
69
|
+
? "0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3::tlp::TLP"
|
|
70
|
+
: "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::tlp::TLP";
|
|
71
|
+
exports.TLP_TREASURY_CAP = exports.NETWORK == "MAINNET"
|
|
72
|
+
? "0xf760d6e1a254f5218f9502a764bda3e7dce4a1fa0ed9414b73efe5cbd5a1fb4c"
|
|
73
|
+
: "0xb180a31c9335d0fb9b7f59b5aa9f0fef7e09292bb0edab9af587f9aa0f411b04";
|
|
40
74
|
// StakePoolRegistry
|
|
41
|
-
exports.STAKE_POOL = exports.NETWORK == "MAINNET"
|
|
42
|
-
|
|
43
|
-
|
|
75
|
+
exports.STAKE_POOL = exports.NETWORK == "MAINNET"
|
|
76
|
+
? "0x973d90d39d9c3f424e64fb2c372df4ceaef9cf6655fafdda1bc10a1b43322737"
|
|
77
|
+
: "0xcd9b35eca5209f8abe8bd9f57b5a6cdda033cc21c3e6663418d40b38681f1d34";
|
|
78
|
+
exports.STAKE_POOL_0 = exports.NETWORK == "MAINNET"
|
|
79
|
+
? "0x2f2d7682e952db55a82ef56f1cfb83dc085f0a92377d55449e1fb2514798c411"
|
|
80
|
+
: "0x29f3c845641a256d13a68c8613836b13aab5bd6ed6c5542e97d8098bec40e09f";
|
|
81
|
+
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET"
|
|
82
|
+
? "0x33b5b105563256282ff1569d5bd13b08cb1f8bd79fd30ca756c7adaccef2d48a"
|
|
83
|
+
: "0xf9c29dd67d8e6a145671a8cf34681d7445b85cbf79b2f204d80af230fc7e8b50";
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PKG_V1 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
var index_1 = require("../index");
|
|
5
|
-
exports
|
|
6
|
-
exports
|
|
7
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "PACKAGE_ID", { enumerable: true, get: function () { return index_1.PERP_PACKAGE_ID; } });
|
|
6
|
+
Object.defineProperty(exports, "PUBLISHED_AT", { enumerable: true, get: function () { return index_1.PERP_PUBLISHED_AT; } });
|
|
7
|
+
Object.defineProperty(exports, "PKG_V1", { enumerable: true, get: function () { return index_1.PERP_PKG_V1; } });
|
|
@@ -48,6 +48,7 @@ export declare class Config implements StructClass {
|
|
|
48
48
|
additional_burn_fee_bp: string;
|
|
49
49
|
swap_fee_bp: string;
|
|
50
50
|
swap_fee_protocol_share_bp: string;
|
|
51
|
+
lending_protocol_share_bp: string;
|
|
51
52
|
u64_padding: string[];
|
|
52
53
|
};
|
|
53
54
|
margin_config: {
|
|
@@ -74,6 +75,7 @@ export declare class Config implements StructClass {
|
|
|
74
75
|
additional_burn_fee_bp: string | number | bigint;
|
|
75
76
|
swap_fee_bp: string | number | bigint;
|
|
76
77
|
swap_fee_protocol_share_bp: string | number | bigint;
|
|
78
|
+
lending_protocol_share_bp: string | number | bigint;
|
|
77
79
|
u64_padding: Iterable<string | number | bigint> & {
|
|
78
80
|
length: number;
|
|
79
81
|
};
|
|
@@ -110,6 +112,7 @@ export declare class Config implements StructClass {
|
|
|
110
112
|
additionalBurnFeeBp: string;
|
|
111
113
|
swapFeeBp: string;
|
|
112
114
|
swapFeeProtocolShareBp: string;
|
|
115
|
+
lendingProtocolShareBp: string;
|
|
113
116
|
u64Padding: string[];
|
|
114
117
|
};
|
|
115
118
|
marginConfig: {
|
|
@@ -137,6 +140,7 @@ export declare class Config implements StructClass {
|
|
|
137
140
|
additionalBurnFeeBp: string;
|
|
138
141
|
swapFeeBp: string;
|
|
139
142
|
swapFeeProtocolShareBp: string;
|
|
143
|
+
lendingProtocolShareBp: string;
|
|
140
144
|
u64Padding: string[];
|
|
141
145
|
};
|
|
142
146
|
marginConfig: {
|
|
@@ -170,6 +174,7 @@ export interface StateFields {
|
|
|
170
174
|
cumulativeBorrowRate: ToField<"u64">;
|
|
171
175
|
previousLastBorrowRateTsMs: ToField<"u64">;
|
|
172
176
|
previousCumulativeBorrowRate: ToField<"u64">;
|
|
177
|
+
currentLendingAmount: ToField<Vector<"u64">>;
|
|
173
178
|
u64Padding: ToField<Vector<"u64">>;
|
|
174
179
|
}
|
|
175
180
|
export type StateReified = Reified<State, StateFields>;
|
|
@@ -191,6 +196,7 @@ export declare class State implements StructClass {
|
|
|
191
196
|
readonly cumulativeBorrowRate: ToField<"u64">;
|
|
192
197
|
readonly previousLastBorrowRateTsMs: ToField<"u64">;
|
|
193
198
|
readonly previousCumulativeBorrowRate: ToField<"u64">;
|
|
199
|
+
readonly currentLendingAmount: ToField<Vector<"u64">>;
|
|
194
200
|
readonly u64Padding: ToField<Vector<"u64">>;
|
|
195
201
|
private constructor();
|
|
196
202
|
static reified(): StateReified;
|
|
@@ -207,6 +213,7 @@ export declare class State implements StructClass {
|
|
|
207
213
|
cumulative_borrow_rate: string;
|
|
208
214
|
previous_last_borrow_rate_ts_ms: string;
|
|
209
215
|
previous_cumulative_borrow_rate: string;
|
|
216
|
+
current_lending_amount: string[];
|
|
210
217
|
u64_padding: string[];
|
|
211
218
|
}, {
|
|
212
219
|
liquidity_amount: string | number | bigint;
|
|
@@ -218,6 +225,9 @@ export declare class State implements StructClass {
|
|
|
218
225
|
cumulative_borrow_rate: string | number | bigint;
|
|
219
226
|
previous_last_borrow_rate_ts_ms: string | number | bigint;
|
|
220
227
|
previous_cumulative_borrow_rate: string | number | bigint;
|
|
228
|
+
current_lending_amount: Iterable<string | number | bigint> & {
|
|
229
|
+
length: number;
|
|
230
|
+
};
|
|
221
231
|
u64_padding: Iterable<string | number | bigint> & {
|
|
222
232
|
length: number;
|
|
223
233
|
};
|
|
@@ -235,6 +245,7 @@ export declare class State implements StructClass {
|
|
|
235
245
|
cumulativeBorrowRate: string;
|
|
236
246
|
previousLastBorrowRateTsMs: string;
|
|
237
247
|
previousCumulativeBorrowRate: string;
|
|
248
|
+
currentLendingAmount: string[];
|
|
238
249
|
u64Padding: string[];
|
|
239
250
|
};
|
|
240
251
|
toJSON(): {
|
|
@@ -247,6 +258,7 @@ export declare class State implements StructClass {
|
|
|
247
258
|
cumulativeBorrowRate: string;
|
|
248
259
|
previousLastBorrowRateTsMs: string;
|
|
249
260
|
previousCumulativeBorrowRate: string;
|
|
261
|
+
currentLendingAmount: string[];
|
|
250
262
|
u64Padding: string[];
|
|
251
263
|
$typeName: string;
|
|
252
264
|
$typeArgs: [];
|
|
@@ -378,6 +390,7 @@ export declare class AddLiquidityTokenEvent implements StructClass {
|
|
|
378
390
|
additional_burn_fee_bp: string;
|
|
379
391
|
swap_fee_bp: string;
|
|
380
392
|
swap_fee_protocol_share_bp: string;
|
|
393
|
+
lending_protocol_share_bp: string;
|
|
381
394
|
u64_padding: string[];
|
|
382
395
|
};
|
|
383
396
|
margin_config: {
|
|
@@ -402,6 +415,7 @@ export declare class AddLiquidityTokenEvent implements StructClass {
|
|
|
402
415
|
cumulative_borrow_rate: string;
|
|
403
416
|
previous_last_borrow_rate_ts_ms: string;
|
|
404
417
|
previous_cumulative_borrow_rate: string;
|
|
418
|
+
current_lending_amount: string[];
|
|
405
419
|
u64_padding: string[];
|
|
406
420
|
};
|
|
407
421
|
u64_padding: string[];
|
|
@@ -428,6 +442,7 @@ export declare class AddLiquidityTokenEvent implements StructClass {
|
|
|
428
442
|
additional_burn_fee_bp: string | number | bigint;
|
|
429
443
|
swap_fee_bp: string | number | bigint;
|
|
430
444
|
swap_fee_protocol_share_bp: string | number | bigint;
|
|
445
|
+
lending_protocol_share_bp: string | number | bigint;
|
|
431
446
|
u64_padding: Iterable<string | number | bigint> & {
|
|
432
447
|
length: number;
|
|
433
448
|
};
|
|
@@ -458,6 +473,9 @@ export declare class AddLiquidityTokenEvent implements StructClass {
|
|
|
458
473
|
cumulative_borrow_rate: string | number | bigint;
|
|
459
474
|
previous_last_borrow_rate_ts_ms: string | number | bigint;
|
|
460
475
|
previous_cumulative_borrow_rate: string | number | bigint;
|
|
476
|
+
current_lending_amount: Iterable<string | number | bigint> & {
|
|
477
|
+
length: number;
|
|
478
|
+
};
|
|
461
479
|
u64_padding: Iterable<string | number | bigint> & {
|
|
462
480
|
length: number;
|
|
463
481
|
};
|
|
@@ -488,6 +506,7 @@ export declare class AddLiquidityTokenEvent implements StructClass {
|
|
|
488
506
|
additionalBurnFeeBp: string;
|
|
489
507
|
swapFeeBp: string;
|
|
490
508
|
swapFeeProtocolShareBp: string;
|
|
509
|
+
lendingProtocolShareBp: string;
|
|
491
510
|
u64Padding: string[];
|
|
492
511
|
};
|
|
493
512
|
marginConfig: {
|
|
@@ -512,6 +531,7 @@ export declare class AddLiquidityTokenEvent implements StructClass {
|
|
|
512
531
|
cumulativeBorrowRate: string;
|
|
513
532
|
previousLastBorrowRateTsMs: string;
|
|
514
533
|
previousCumulativeBorrowRate: string;
|
|
534
|
+
currentLendingAmount: string[];
|
|
515
535
|
u64Padding: string[];
|
|
516
536
|
};
|
|
517
537
|
u64Padding: string[];
|
|
@@ -535,6 +555,7 @@ export declare class AddLiquidityTokenEvent implements StructClass {
|
|
|
535
555
|
additionalBurnFeeBp: string;
|
|
536
556
|
swapFeeBp: string;
|
|
537
557
|
swapFeeProtocolShareBp: string;
|
|
558
|
+
lendingProtocolShareBp: string;
|
|
538
559
|
u64Padding: string[];
|
|
539
560
|
};
|
|
540
561
|
marginConfig: {
|
|
@@ -559,6 +580,7 @@ export declare class AddLiquidityTokenEvent implements StructClass {
|
|
|
559
580
|
cumulativeBorrowRate: string;
|
|
560
581
|
previousLastBorrowRateTsMs: string;
|
|
561
582
|
previousCumulativeBorrowRate: string;
|
|
583
|
+
currentLendingAmount: string[];
|
|
562
584
|
u64Padding: string[];
|
|
563
585
|
};
|
|
564
586
|
u64Padding: string[];
|
|
@@ -845,6 +867,7 @@ export declare class LiquidityPool implements StructClass {
|
|
|
845
867
|
additional_burn_fee_bp: string;
|
|
846
868
|
swap_fee_bp: string;
|
|
847
869
|
swap_fee_protocol_share_bp: string;
|
|
870
|
+
lending_protocol_share_bp: string;
|
|
848
871
|
u64_padding: string[];
|
|
849
872
|
};
|
|
850
873
|
margin_config: {
|
|
@@ -869,6 +892,7 @@ export declare class LiquidityPool implements StructClass {
|
|
|
869
892
|
cumulative_borrow_rate: string;
|
|
870
893
|
previous_last_borrow_rate_ts_ms: string;
|
|
871
894
|
previous_cumulative_borrow_rate: string;
|
|
895
|
+
current_lending_amount: string[];
|
|
872
896
|
u64_padding: string[];
|
|
873
897
|
};
|
|
874
898
|
}[];
|
|
@@ -955,6 +979,7 @@ export declare class LiquidityPool implements StructClass {
|
|
|
955
979
|
additional_burn_fee_bp: string | number | bigint;
|
|
956
980
|
swap_fee_bp: string | number | bigint;
|
|
957
981
|
swap_fee_protocol_share_bp: string | number | bigint;
|
|
982
|
+
lending_protocol_share_bp: string | number | bigint;
|
|
958
983
|
u64_padding: Iterable<string | number | bigint> & {
|
|
959
984
|
length: number;
|
|
960
985
|
};
|
|
@@ -985,6 +1010,9 @@ export declare class LiquidityPool implements StructClass {
|
|
|
985
1010
|
cumulative_borrow_rate: string | number | bigint;
|
|
986
1011
|
previous_last_borrow_rate_ts_ms: string | number | bigint;
|
|
987
1012
|
previous_cumulative_borrow_rate: string | number | bigint;
|
|
1013
|
+
current_lending_amount: Iterable<string | number | bigint> & {
|
|
1014
|
+
length: number;
|
|
1015
|
+
};
|
|
988
1016
|
u64_padding: Iterable<string | number | bigint> & {
|
|
989
1017
|
length: number;
|
|
990
1018
|
};
|
|
@@ -1077,6 +1105,7 @@ export declare class LiquidityPool implements StructClass {
|
|
|
1077
1105
|
additionalBurnFeeBp: string;
|
|
1078
1106
|
swapFeeBp: string;
|
|
1079
1107
|
swapFeeProtocolShareBp: string;
|
|
1108
|
+
lendingProtocolShareBp: string;
|
|
1080
1109
|
u64Padding: string[];
|
|
1081
1110
|
};
|
|
1082
1111
|
marginConfig: {
|
|
@@ -1101,6 +1130,7 @@ export declare class LiquidityPool implements StructClass {
|
|
|
1101
1130
|
cumulativeBorrowRate: string;
|
|
1102
1131
|
previousLastBorrowRateTsMs: string;
|
|
1103
1132
|
previousCumulativeBorrowRate: string;
|
|
1133
|
+
currentLendingAmount: string[];
|
|
1104
1134
|
u64Padding: string[];
|
|
1105
1135
|
};
|
|
1106
1136
|
}[];
|
|
@@ -1160,6 +1190,7 @@ export declare class LiquidityPool implements StructClass {
|
|
|
1160
1190
|
additionalBurnFeeBp: string;
|
|
1161
1191
|
swapFeeBp: string;
|
|
1162
1192
|
swapFeeProtocolShareBp: string;
|
|
1193
|
+
lendingProtocolShareBp: string;
|
|
1163
1194
|
u64Padding: string[];
|
|
1164
1195
|
};
|
|
1165
1196
|
marginConfig: {
|
|
@@ -1184,6 +1215,7 @@ export declare class LiquidityPool implements StructClass {
|
|
|
1184
1215
|
cumulativeBorrowRate: string;
|
|
1185
1216
|
previousLastBorrowRateTsMs: string;
|
|
1186
1217
|
previousCumulativeBorrowRate: string;
|
|
1218
|
+
currentLendingAmount: string[];
|
|
1187
1219
|
u64Padding: string[];
|
|
1188
1220
|
};
|
|
1189
1221
|
}[];
|
|
@@ -2028,6 +2060,7 @@ export interface SpotConfigFields {
|
|
|
2028
2060
|
additionalBurnFeeBp: ToField<"u64">;
|
|
2029
2061
|
swapFeeBp: ToField<"u64">;
|
|
2030
2062
|
swapFeeProtocolShareBp: ToField<"u64">;
|
|
2063
|
+
lendingProtocolShareBp: ToField<"u64">;
|
|
2031
2064
|
u64Padding: ToField<Vector<"u64">>;
|
|
2032
2065
|
}
|
|
2033
2066
|
export type SpotConfigReified = Reified<SpotConfig, SpotConfigFields>;
|
|
@@ -2049,6 +2082,7 @@ export declare class SpotConfig implements StructClass {
|
|
|
2049
2082
|
readonly additionalBurnFeeBp: ToField<"u64">;
|
|
2050
2083
|
readonly swapFeeBp: ToField<"u64">;
|
|
2051
2084
|
readonly swapFeeProtocolShareBp: ToField<"u64">;
|
|
2085
|
+
readonly lendingProtocolShareBp: ToField<"u64">;
|
|
2052
2086
|
readonly u64Padding: ToField<Vector<"u64">>;
|
|
2053
2087
|
private constructor();
|
|
2054
2088
|
static reified(): SpotConfigReified;
|
|
@@ -2065,6 +2099,7 @@ export declare class SpotConfig implements StructClass {
|
|
|
2065
2099
|
additional_burn_fee_bp: string;
|
|
2066
2100
|
swap_fee_bp: string;
|
|
2067
2101
|
swap_fee_protocol_share_bp: string;
|
|
2102
|
+
lending_protocol_share_bp: string;
|
|
2068
2103
|
u64_padding: string[];
|
|
2069
2104
|
}, {
|
|
2070
2105
|
min_deposit: string | number | bigint;
|
|
@@ -2076,6 +2111,7 @@ export declare class SpotConfig implements StructClass {
|
|
|
2076
2111
|
additional_burn_fee_bp: string | number | bigint;
|
|
2077
2112
|
swap_fee_bp: string | number | bigint;
|
|
2078
2113
|
swap_fee_protocol_share_bp: string | number | bigint;
|
|
2114
|
+
lending_protocol_share_bp: string | number | bigint;
|
|
2079
2115
|
u64_padding: Iterable<string | number | bigint> & {
|
|
2080
2116
|
length: number;
|
|
2081
2117
|
};
|
|
@@ -2093,6 +2129,7 @@ export declare class SpotConfig implements StructClass {
|
|
|
2093
2129
|
additionalBurnFeeBp: string;
|
|
2094
2130
|
swapFeeBp: string;
|
|
2095
2131
|
swapFeeProtocolShareBp: string;
|
|
2132
|
+
lendingProtocolShareBp: string;
|
|
2096
2133
|
u64Padding: string[];
|
|
2097
2134
|
};
|
|
2098
2135
|
toJSON(): {
|
|
@@ -2105,6 +2142,7 @@ export declare class SpotConfig implements StructClass {
|
|
|
2105
2142
|
additionalBurnFeeBp: string;
|
|
2106
2143
|
swapFeeBp: string;
|
|
2107
2144
|
swapFeeProtocolShareBp: string;
|
|
2145
|
+
lendingProtocolShareBp: string;
|
|
2108
2146
|
u64Padding: string[];
|
|
2109
2147
|
$typeName: string;
|
|
2110
2148
|
$typeArgs: [];
|
|
@@ -2498,6 +2536,7 @@ export declare class TokenPool implements StructClass {
|
|
|
2498
2536
|
additional_burn_fee_bp: string;
|
|
2499
2537
|
swap_fee_bp: string;
|
|
2500
2538
|
swap_fee_protocol_share_bp: string;
|
|
2539
|
+
lending_protocol_share_bp: string;
|
|
2501
2540
|
u64_padding: string[];
|
|
2502
2541
|
};
|
|
2503
2542
|
margin_config: {
|
|
@@ -2522,6 +2561,7 @@ export declare class TokenPool implements StructClass {
|
|
|
2522
2561
|
cumulative_borrow_rate: string;
|
|
2523
2562
|
previous_last_borrow_rate_ts_ms: string;
|
|
2524
2563
|
previous_cumulative_borrow_rate: string;
|
|
2564
|
+
current_lending_amount: string[];
|
|
2525
2565
|
u64_padding: string[];
|
|
2526
2566
|
};
|
|
2527
2567
|
}, {
|
|
@@ -2545,6 +2585,7 @@ export declare class TokenPool implements StructClass {
|
|
|
2545
2585
|
additional_burn_fee_bp: string | number | bigint;
|
|
2546
2586
|
swap_fee_bp: string | number | bigint;
|
|
2547
2587
|
swap_fee_protocol_share_bp: string | number | bigint;
|
|
2588
|
+
lending_protocol_share_bp: string | number | bigint;
|
|
2548
2589
|
u64_padding: Iterable<string | number | bigint> & {
|
|
2549
2590
|
length: number;
|
|
2550
2591
|
};
|
|
@@ -2575,6 +2616,9 @@ export declare class TokenPool implements StructClass {
|
|
|
2575
2616
|
cumulative_borrow_rate: string | number | bigint;
|
|
2576
2617
|
previous_last_borrow_rate_ts_ms: string | number | bigint;
|
|
2577
2618
|
previous_cumulative_borrow_rate: string | number | bigint;
|
|
2619
|
+
current_lending_amount: Iterable<string | number | bigint> & {
|
|
2620
|
+
length: number;
|
|
2621
|
+
};
|
|
2578
2622
|
u64_padding: Iterable<string | number | bigint> & {
|
|
2579
2623
|
length: number;
|
|
2580
2624
|
};
|
|
@@ -2600,6 +2644,7 @@ export declare class TokenPool implements StructClass {
|
|
|
2600
2644
|
additionalBurnFeeBp: string;
|
|
2601
2645
|
swapFeeBp: string;
|
|
2602
2646
|
swapFeeProtocolShareBp: string;
|
|
2647
|
+
lendingProtocolShareBp: string;
|
|
2603
2648
|
u64Padding: string[];
|
|
2604
2649
|
};
|
|
2605
2650
|
marginConfig: {
|
|
@@ -2624,6 +2669,7 @@ export declare class TokenPool implements StructClass {
|
|
|
2624
2669
|
cumulativeBorrowRate: string;
|
|
2625
2670
|
previousLastBorrowRateTsMs: string;
|
|
2626
2671
|
previousCumulativeBorrowRate: string;
|
|
2672
|
+
currentLendingAmount: string[];
|
|
2627
2673
|
u64Padding: string[];
|
|
2628
2674
|
};
|
|
2629
2675
|
};
|
|
@@ -2644,6 +2690,7 @@ export declare class TokenPool implements StructClass {
|
|
|
2644
2690
|
additionalBurnFeeBp: string;
|
|
2645
2691
|
swapFeeBp: string;
|
|
2646
2692
|
swapFeeProtocolShareBp: string;
|
|
2693
|
+
lendingProtocolShareBp: string;
|
|
2647
2694
|
u64Padding: string[];
|
|
2648
2695
|
};
|
|
2649
2696
|
marginConfig: {
|
|
@@ -2668,6 +2715,7 @@ export declare class TokenPool implements StructClass {
|
|
|
2668
2715
|
cumulativeBorrowRate: string;
|
|
2669
2716
|
previousLastBorrowRateTsMs: string;
|
|
2670
2717
|
previousCumulativeBorrowRate: string;
|
|
2718
|
+
currentLendingAmount: string[];
|
|
2671
2719
|
u64Padding: string[];
|
|
2672
2720
|
};
|
|
2673
2721
|
$typeName: string;
|
|
@@ -3085,6 +3133,7 @@ export declare class UpdateSpotConfigEvent implements StructClass {
|
|
|
3085
3133
|
additional_burn_fee_bp: string;
|
|
3086
3134
|
swap_fee_bp: string;
|
|
3087
3135
|
swap_fee_protocol_share_bp: string;
|
|
3136
|
+
lending_protocol_share_bp: string;
|
|
3088
3137
|
u64_padding: string[];
|
|
3089
3138
|
};
|
|
3090
3139
|
new_spot_config: {
|
|
@@ -3097,6 +3146,7 @@ export declare class UpdateSpotConfigEvent implements StructClass {
|
|
|
3097
3146
|
additional_burn_fee_bp: string;
|
|
3098
3147
|
swap_fee_bp: string;
|
|
3099
3148
|
swap_fee_protocol_share_bp: string;
|
|
3149
|
+
lending_protocol_share_bp: string;
|
|
3100
3150
|
u64_padding: string[];
|
|
3101
3151
|
};
|
|
3102
3152
|
u64_padding: string[];
|
|
@@ -3120,6 +3170,7 @@ export declare class UpdateSpotConfigEvent implements StructClass {
|
|
|
3120
3170
|
additional_burn_fee_bp: string | number | bigint;
|
|
3121
3171
|
swap_fee_bp: string | number | bigint;
|
|
3122
3172
|
swap_fee_protocol_share_bp: string | number | bigint;
|
|
3173
|
+
lending_protocol_share_bp: string | number | bigint;
|
|
3123
3174
|
u64_padding: Iterable<string | number | bigint> & {
|
|
3124
3175
|
length: number;
|
|
3125
3176
|
};
|
|
@@ -3134,6 +3185,7 @@ export declare class UpdateSpotConfigEvent implements StructClass {
|
|
|
3134
3185
|
additional_burn_fee_bp: string | number | bigint;
|
|
3135
3186
|
swap_fee_bp: string | number | bigint;
|
|
3136
3187
|
swap_fee_protocol_share_bp: string | number | bigint;
|
|
3188
|
+
lending_protocol_share_bp: string | number | bigint;
|
|
3137
3189
|
u64_padding: Iterable<string | number | bigint> & {
|
|
3138
3190
|
length: number;
|
|
3139
3191
|
};
|
|
@@ -3161,6 +3213,7 @@ export declare class UpdateSpotConfigEvent implements StructClass {
|
|
|
3161
3213
|
additionalBurnFeeBp: string;
|
|
3162
3214
|
swapFeeBp: string;
|
|
3163
3215
|
swapFeeProtocolShareBp: string;
|
|
3216
|
+
lendingProtocolShareBp: string;
|
|
3164
3217
|
u64Padding: string[];
|
|
3165
3218
|
};
|
|
3166
3219
|
newSpotConfig: {
|
|
@@ -3173,6 +3226,7 @@ export declare class UpdateSpotConfigEvent implements StructClass {
|
|
|
3173
3226
|
additionalBurnFeeBp: string;
|
|
3174
3227
|
swapFeeBp: string;
|
|
3175
3228
|
swapFeeProtocolShareBp: string;
|
|
3229
|
+
lendingProtocolShareBp: string;
|
|
3176
3230
|
u64Padding: string[];
|
|
3177
3231
|
};
|
|
3178
3232
|
u64Padding: string[];
|
|
@@ -3193,6 +3247,7 @@ export declare class UpdateSpotConfigEvent implements StructClass {
|
|
|
3193
3247
|
additionalBurnFeeBp: string;
|
|
3194
3248
|
swapFeeBp: string;
|
|
3195
3249
|
swapFeeProtocolShareBp: string;
|
|
3250
|
+
lendingProtocolShareBp: string;
|
|
3196
3251
|
u64Padding: string[];
|
|
3197
3252
|
};
|
|
3198
3253
|
newSpotConfig: {
|
|
@@ -3205,6 +3260,7 @@ export declare class UpdateSpotConfigEvent implements StructClass {
|
|
|
3205
3260
|
additionalBurnFeeBp: string;
|
|
3206
3261
|
swapFeeBp: string;
|
|
3207
3262
|
swapFeeProtocolShareBp: string;
|
|
3263
|
+
lendingProtocolShareBp: string;
|
|
3208
3264
|
u64Padding: string[];
|
|
3209
3265
|
};
|
|
3210
3266
|
u64Padding: string[];
|
|
@@ -333,6 +333,7 @@ var State = /** @class */ (function () {
|
|
|
333
333
|
this.cumulativeBorrowRate = fields.cumulativeBorrowRate;
|
|
334
334
|
this.previousLastBorrowRateTsMs = fields.previousLastBorrowRateTsMs;
|
|
335
335
|
this.previousCumulativeBorrowRate = fields.previousCumulativeBorrowRate;
|
|
336
|
+
this.currentLendingAmount = fields.currentLendingAmount;
|
|
336
337
|
this.u64Padding = fields.u64Padding;
|
|
337
338
|
}
|
|
338
339
|
State.reified = function () {
|
|
@@ -389,6 +390,7 @@ var State = /** @class */ (function () {
|
|
|
389
390
|
cumulative_borrow_rate: bcs_1.bcs.u64(),
|
|
390
391
|
previous_last_borrow_rate_ts_ms: bcs_1.bcs.u64(),
|
|
391
392
|
previous_cumulative_borrow_rate: bcs_1.bcs.u64(),
|
|
393
|
+
current_lending_amount: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
392
394
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
393
395
|
});
|
|
394
396
|
},
|
|
@@ -406,6 +408,7 @@ var State = /** @class */ (function () {
|
|
|
406
408
|
cumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.cumulative_borrow_rate),
|
|
407
409
|
previousLastBorrowRateTsMs: (0, reified_1.decodeFromFields)("u64", fields.previous_last_borrow_rate_ts_ms),
|
|
408
410
|
previousCumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.previous_cumulative_borrow_rate),
|
|
411
|
+
currentLendingAmount: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.current_lending_amount),
|
|
409
412
|
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
410
413
|
});
|
|
411
414
|
};
|
|
@@ -423,6 +426,7 @@ var State = /** @class */ (function () {
|
|
|
423
426
|
cumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.cumulative_borrow_rate),
|
|
424
427
|
previousLastBorrowRateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_last_borrow_rate_ts_ms),
|
|
425
428
|
previousCumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_cumulative_borrow_rate),
|
|
429
|
+
currentLendingAmount: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.current_lending_amount),
|
|
426
430
|
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
427
431
|
});
|
|
428
432
|
};
|
|
@@ -440,6 +444,7 @@ var State = /** @class */ (function () {
|
|
|
440
444
|
cumulativeBorrowRate: this.cumulativeBorrowRate.toString(),
|
|
441
445
|
previousLastBorrowRateTsMs: this.previousLastBorrowRateTsMs.toString(),
|
|
442
446
|
previousCumulativeBorrowRate: this.previousCumulativeBorrowRate.toString(),
|
|
447
|
+
currentLendingAmount: (0, reified_1.fieldToJSON)("vector<u64>", this.currentLendingAmount),
|
|
443
448
|
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
444
449
|
};
|
|
445
450
|
};
|
|
@@ -457,6 +462,7 @@ var State = /** @class */ (function () {
|
|
|
457
462
|
cumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.cumulativeBorrowRate),
|
|
458
463
|
previousLastBorrowRateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.previousLastBorrowRateTsMs),
|
|
459
464
|
previousCumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.previousCumulativeBorrowRate),
|
|
465
|
+
currentLendingAmount: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.currentLendingAmount),
|
|
460
466
|
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
461
467
|
});
|
|
462
468
|
};
|
|
@@ -3026,6 +3032,7 @@ var SpotConfig = /** @class */ (function () {
|
|
|
3026
3032
|
this.additionalBurnFeeBp = fields.additionalBurnFeeBp;
|
|
3027
3033
|
this.swapFeeBp = fields.swapFeeBp;
|
|
3028
3034
|
this.swapFeeProtocolShareBp = fields.swapFeeProtocolShareBp;
|
|
3035
|
+
this.lendingProtocolShareBp = fields.lendingProtocolShareBp;
|
|
3029
3036
|
this.u64Padding = fields.u64Padding;
|
|
3030
3037
|
}
|
|
3031
3038
|
SpotConfig.reified = function () {
|
|
@@ -3082,6 +3089,7 @@ var SpotConfig = /** @class */ (function () {
|
|
|
3082
3089
|
additional_burn_fee_bp: bcs_1.bcs.u64(),
|
|
3083
3090
|
swap_fee_bp: bcs_1.bcs.u64(),
|
|
3084
3091
|
swap_fee_protocol_share_bp: bcs_1.bcs.u64(),
|
|
3092
|
+
lending_protocol_share_bp: bcs_1.bcs.u64(),
|
|
3085
3093
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
3086
3094
|
});
|
|
3087
3095
|
},
|
|
@@ -3099,6 +3107,7 @@ var SpotConfig = /** @class */ (function () {
|
|
|
3099
3107
|
additionalBurnFeeBp: (0, reified_1.decodeFromFields)("u64", fields.additional_burn_fee_bp),
|
|
3100
3108
|
swapFeeBp: (0, reified_1.decodeFromFields)("u64", fields.swap_fee_bp),
|
|
3101
3109
|
swapFeeProtocolShareBp: (0, reified_1.decodeFromFields)("u64", fields.swap_fee_protocol_share_bp),
|
|
3110
|
+
lendingProtocolShareBp: (0, reified_1.decodeFromFields)("u64", fields.lending_protocol_share_bp),
|
|
3102
3111
|
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
3103
3112
|
});
|
|
3104
3113
|
};
|
|
@@ -3116,6 +3125,7 @@ var SpotConfig = /** @class */ (function () {
|
|
|
3116
3125
|
additionalBurnFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.additional_burn_fee_bp),
|
|
3117
3126
|
swapFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.swap_fee_bp),
|
|
3118
3127
|
swapFeeProtocolShareBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.swap_fee_protocol_share_bp),
|
|
3128
|
+
lendingProtocolShareBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lending_protocol_share_bp),
|
|
3119
3129
|
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
3120
3130
|
});
|
|
3121
3131
|
};
|
|
@@ -3133,6 +3143,7 @@ var SpotConfig = /** @class */ (function () {
|
|
|
3133
3143
|
additionalBurnFeeBp: this.additionalBurnFeeBp.toString(),
|
|
3134
3144
|
swapFeeBp: this.swapFeeBp.toString(),
|
|
3135
3145
|
swapFeeProtocolShareBp: this.swapFeeProtocolShareBp.toString(),
|
|
3146
|
+
lendingProtocolShareBp: this.lendingProtocolShareBp.toString(),
|
|
3136
3147
|
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
3137
3148
|
};
|
|
3138
3149
|
};
|
|
@@ -3150,6 +3161,7 @@ var SpotConfig = /** @class */ (function () {
|
|
|
3150
3161
|
additionalBurnFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.additionalBurnFeeBp),
|
|
3151
3162
|
swapFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.swapFeeBp),
|
|
3152
3163
|
swapFeeProtocolShareBp: (0, reified_1.decodeFromJSONField)("u64", field.swapFeeProtocolShareBp),
|
|
3164
|
+
lendingProtocolShareBp: (0, reified_1.decodeFromJSONField)("u64", field.lendingProtocolShareBp),
|
|
3153
3165
|
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
3154
3166
|
});
|
|
3155
3167
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PKG_V1 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
4
|
var index_1 = require("../index");
|
|
5
|
-
exports
|
|
6
|
-
exports
|
|
7
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "PACKAGE_ID", { enumerable: true, get: function () { return index_1.STAKE_PACKAGE_ID; } });
|
|
6
|
+
Object.defineProperty(exports, "PUBLISHED_AT", { enumerable: true, get: function () { return index_1.STAKE_PUBLISHED_AT; } });
|
|
7
|
+
Object.defineProperty(exports, "PKG_V1", { enumerable: true, get: function () { return index_1.STAKE_PKG_V1; } });
|
package/dist/src/user/history.js
CHANGED
|
@@ -93,8 +93,8 @@ function parseUserHistory(raw_events) {
|
|
|
93
93
|
// console.log(timestamp);
|
|
94
94
|
var _c = __read(type.split("::"), 3), pkg = _c[0], mod = _c[1], name = _c[2];
|
|
95
95
|
switch (name) {
|
|
96
|
-
case structs_2.CreateTradingOrderEvent.
|
|
97
|
-
case structs_2.CreateTradingOrderWithBidReceiptsEvent.
|
|
96
|
+
case structs_2.CreateTradingOrderEvent.$typeName.split("::")[2]:
|
|
97
|
+
case structs_2.CreateTradingOrderWithBidReceiptsEvent.$typeName.split("::")[2]:
|
|
98
98
|
var base_token = (0, constants_1.typeArgToAsset)(json.base_token.name);
|
|
99
99
|
var collateral_token = (0, constants_1.typeArgToAsset)(json.collateral_token.name);
|
|
100
100
|
var market = "".concat(base_token, "/USD");
|
|
@@ -138,7 +138,7 @@ function parseUserHistory(raw_events) {
|
|
|
138
138
|
};
|
|
139
139
|
events.push(e);
|
|
140
140
|
break;
|
|
141
|
-
case structs_1.OrderFilledEvent.
|
|
141
|
+
case structs_1.OrderFilledEvent.$typeName.split("::")[2]:
|
|
142
142
|
var base_token = (0, constants_1.typeArgToAsset)(json.symbol.base_token.name);
|
|
143
143
|
var collateral_token = (0, constants_1.typeArgToAsset)(json.collateral_token.name);
|
|
144
144
|
var market = "".concat(base_token, "/USD");
|
|
@@ -179,7 +179,7 @@ function parseUserHistory(raw_events) {
|
|
|
179
179
|
};
|
|
180
180
|
events.push(e);
|
|
181
181
|
break;
|
|
182
|
-
case structs_1.RealizeFundingEvent.
|
|
182
|
+
case structs_1.RealizeFundingEvent.$typeName.split("::")[2]:
|
|
183
183
|
// same tx with order filled
|
|
184
184
|
var index = events.findLastIndex(function (e) { return e.tx_digest == tx_digest; });
|
|
185
185
|
// console.log(index);
|
|
@@ -189,7 +189,7 @@ function parseUserHistory(raw_events) {
|
|
|
189
189
|
events[index] = __assign(__assign({}, events[index]), { realized_pnl: ((_b = events[index].realized_pnl) !== null && _b !== void 0 ? _b : 0) - x });
|
|
190
190
|
}
|
|
191
191
|
break;
|
|
192
|
-
case structs_2.CancelTradingOrderEvent.
|
|
192
|
+
case structs_2.CancelTradingOrderEvent.$typeName.split("::")[2]:
|
|
193
193
|
var base_token = (0, constants_1.typeArgToAsset)(json.base_token.name);
|
|
194
194
|
var collateral_token = (0, constants_1.typeArgToAsset)(json.collateral_token.name);
|
|
195
195
|
var market = "".concat(base_token, "/USD");
|
|
@@ -214,8 +214,8 @@ function parseUserHistory(raw_events) {
|
|
|
214
214
|
};
|
|
215
215
|
events.push(e);
|
|
216
216
|
break;
|
|
217
|
-
case structs_2.IncreaseCollateralEvent.
|
|
218
|
-
case structs_2.ReleaseCollateralEvent.
|
|
217
|
+
case structs_2.IncreaseCollateralEvent.$typeName.split("::")[2]:
|
|
218
|
+
case structs_2.ReleaseCollateralEvent.$typeName.split("::")[2]:
|
|
219
219
|
var base_token = (0, constants_1.typeArgToAsset)(json.base_token.name);
|
|
220
220
|
var collateral_token = (0, constants_1.typeArgToAsset)(json.collateral_token.name);
|
|
221
221
|
var market = "".concat(base_token, "/USD");
|
|
@@ -247,7 +247,7 @@ function parseUserHistory(raw_events) {
|
|
|
247
247
|
};
|
|
248
248
|
events.push(e);
|
|
249
249
|
break;
|
|
250
|
-
case structs_3.SwapEvent.
|
|
250
|
+
case structs_3.SwapEvent.$typeName.split("::")[2]:
|
|
251
251
|
var from_token = (0, constants_1.typeArgToAsset)(json.from_token_type.name);
|
|
252
252
|
var to_token = (0, constants_1.typeArgToAsset)(json.to_token_type.name);
|
|
253
253
|
var from_price = Number(json.oracle_price_from_token);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typus/typus-perp-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
|
|
5
5
|
"author": "Typus",
|
|
6
6
|
"description": "typus perp sdk",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@typus/typus-sdk": "1.6.
|
|
9
|
+
"@typus/typus-sdk": "1.6.9"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/bs58": "^4.0.1",
|