@suilend/sdk 1.1.99 → 2.0.1
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/_generated/_dependencies/source/0x1/ascii/structs.d.ts +7 -7
- package/_generated/_dependencies/source/0x1/ascii/structs.js +35 -75
- package/_generated/_dependencies/source/0x1/index.js +3 -6
- package/_generated/_dependencies/source/0x1/option/structs.d.ts +3 -3
- package/_generated/_dependencies/source/0x1/option/structs.js +31 -69
- package/_generated/_dependencies/source/0x1/type-name/structs.d.ts +5 -5
- package/_generated/_dependencies/source/0x1/type-name/structs.js +20 -25
- package/_generated/_dependencies/source/0x2/bag/structs.d.ts +7 -7
- package/_generated/_dependencies/source/0x2/bag/structs.js +24 -29
- package/_generated/_dependencies/source/0x2/balance/structs.d.ts +7 -7
- package/_generated/_dependencies/source/0x2/balance/structs.js +49 -56
- package/_generated/_dependencies/source/0x2/index.js +3 -6
- package/_generated/_dependencies/source/0x2/object/structs.d.ts +8 -8
- package/_generated/_dependencies/source/0x2/object/structs.js +34 -41
- package/_generated/_dependencies/source/0x2/object-table/structs.d.ts +7 -7
- package/_generated/_dependencies/source/0x2/object-table/structs.js +31 -36
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.d.ts +5 -5
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js +23 -28
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js +4 -7
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.d.ts +11 -11
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js +32 -37
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.d.ts +23 -23
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js +29 -34
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.d.ts +4 -4
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js +21 -59
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.d.ts +55 -55
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js +46 -53
- package/_generated/_framework/reified.d.ts +2 -2
- package/_generated/_framework/reified.js +27 -40
- package/_generated/_framework/util.js +26 -40
- package/_generated/_framework/vector.d.ts +4 -4
- package/_generated/_framework/vector.js +16 -21
- package/_generated/suilend/cell/structs.d.ts +4 -4
- package/_generated/suilend/cell/structs.js +31 -36
- package/_generated/suilend/decimal/structs.d.ts +4 -4
- package/_generated/suilend/decimal/structs.js +19 -24
- package/_generated/suilend/index.js +8 -12
- package/_generated/suilend/lending-market/functions.d.ts +1 -0
- package/_generated/suilend/lending-market/functions.js +271 -302
- package/_generated/suilend/lending-market/structs.d.ts +146 -146
- package/_generated/suilend/lending-market/structs.js +549 -617
- package/_generated/suilend/lending-market-registry/functions.js +7 -11
- package/_generated/suilend/liquidity-mining/structs.d.ts +50 -50
- package/_generated/suilend/liquidity-mining/structs.js +159 -205
- package/_generated/suilend/obligation/structs.d.ts +106 -106
- package/_generated/suilend/obligation/structs.js +313 -363
- package/_generated/suilend/rate-limiter/functions.js +23 -31
- package/_generated/suilend/rate-limiter/structs.d.ts +15 -15
- package/_generated/suilend/rate-limiter/structs.js +49 -56
- package/_generated/suilend/reserve/structs.d.ts +139 -139
- package/_generated/suilend/reserve/structs.js +397 -451
- package/_generated/suilend/reserve-config/functions.js +149 -190
- package/_generated/suilend/reserve-config/structs.d.ts +33 -33
- package/_generated/suilend/reserve-config/structs.js +109 -149
- package/api/events.js +1 -5
- package/api/index.js +1 -17
- package/client.d.ts +10 -10
- package/client.js +118 -128
- package/index.js +7 -23
- package/lib/constants.js +3 -9
- package/lib/index.js +5 -21
- package/lib/initialize.d.ts +3 -3
- package/lib/initialize.js +103 -140
- package/lib/liquidityMining.d.ts +3 -3
- package/lib/liquidityMining.js +57 -72
- package/lib/pyth.js +9 -14
- package/lib/strategyOwnerCap.js +106 -119
- package/lib/transactions.js +2 -7
- package/lib/types.js +4 -7
- package/mmt.js +2 -5
- package/package.json +1 -1
- package/parsers/apiReserveAssetDataEvent.js +25 -33
- package/parsers/index.js +5 -21
- package/parsers/lendingMarket.d.ts +1 -1
- package/parsers/lendingMarket.js +12 -19
- package/parsers/obligation.js +19 -26
- package/parsers/rateLimiter.js +11 -19
- package/parsers/reserve.d.ts +1 -1
- package/parsers/reserve.js +42 -85
- package/strategies.d.ts +11 -11
- package/strategies.js +547 -586
- package/swap/index.js +2 -18
- package/swap/quote.js +57 -65
- package/swap/transaction.d.ts +2 -2
- package/swap/transaction.js +40 -35
- package/utils/events.d.ts +3 -3
- package/utils/events.js +18 -35
- package/utils/index.js +16 -40
- package/utils/obligation.d.ts +4 -4
- package/utils/obligation.js +17 -60
- package/utils/simulate.js +118 -143
package/lib/strategyOwnerCap.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const bn_js_1 = __importDefault(require("bn.js"));
|
|
19
|
-
const sui_fe_1 = require("@suilend/sui-fe");
|
|
20
|
-
const client_1 = require("../client");
|
|
21
|
-
const types_1 = require("./types");
|
|
22
|
-
exports.STRATEGY_WRAPPER_PACKAGE_ID_V1 = "0xba97dc73a07638d03d77ad2161484eb21db577edc9cadcd7035fef4b4f2f6fa1";
|
|
10
|
+
import { SUI_CLOCK_OBJECT_ID, SUI_SYSTEM_STATE_OBJECT_ID, } from "@mysten/sui/utils";
|
|
11
|
+
import BigNumber from "bignumber.js";
|
|
12
|
+
import BN from "bn.js";
|
|
13
|
+
import { MAX_U64, NORMALIZED_AUSD_COINTYPE, NORMALIZED_SUI_COINTYPE, NORMALIZED_USDC_COINTYPE, NORMALIZED_sSUI_COINTYPE, NORMALIZED_stratSUI_COINTYPE, NORMALIZED_suiUSDT_COINTYPE, NORMALIZED_suiWBTC_COINTYPE, NORMALIZED_xBTC_COINTYPE, isSui, } from "@suilend/sui-fe";
|
|
14
|
+
import { LENDING_MARKET_ID, LENDING_MARKET_TYPE, } from "../client";
|
|
15
|
+
import { Side } from "./types";
|
|
16
|
+
export const STRATEGY_WRAPPER_PACKAGE_ID_V1 = "0xba97dc73a07638d03d77ad2161484eb21db577edc9cadcd7035fef4b4f2f6fa1";
|
|
23
17
|
const STRATEGY_WRAPPER_PACKAGE_ID_V7 = "0x864b66441e95323c320ee7584592769930a2d236b45d731011ee7a98eb785b35";
|
|
24
|
-
var StrategyType;
|
|
18
|
+
export var StrategyType;
|
|
25
19
|
(function (StrategyType) {
|
|
26
20
|
StrategyType["sSUI_SUI_LOOPING"] = "1";
|
|
27
21
|
StrategyType["stratSUI_SUI_LOOPING"] = "2";
|
|
@@ -33,208 +27,205 @@ var StrategyType;
|
|
|
33
27
|
StrategyType["AUSD_USDC_LOOPING"] = "6";
|
|
34
28
|
StrategyType["AUSD_suiUSDT_LOOPING"] = "7";
|
|
35
29
|
StrategyType["USDC_suiUSDT_LOOPING"] = "8";
|
|
36
|
-
})(StrategyType || (
|
|
37
|
-
|
|
30
|
+
})(StrategyType || (StrategyType = {}));
|
|
31
|
+
export const STRATEGY_TYPE_INFO_MAP = {
|
|
38
32
|
[StrategyType.sSUI_SUI_LOOPING]: {
|
|
39
33
|
queryParam: "sSUI-SUI-looping",
|
|
40
34
|
header: {
|
|
41
|
-
coinTypes: [
|
|
35
|
+
coinTypes: [NORMALIZED_sSUI_COINTYPE, NORMALIZED_SUI_COINTYPE],
|
|
42
36
|
title: "sSUI/SUI",
|
|
43
37
|
tooltip: "Sets up a sSUI/SUI Looping strategy by depositing sSUI and borrowing SUI to the desired leverage",
|
|
44
38
|
type: "Looping",
|
|
45
39
|
},
|
|
46
40
|
depositBaseCoinType: undefined,
|
|
47
|
-
depositLstCoinType:
|
|
48
|
-
borrowCoinType:
|
|
49
|
-
currencyCoinTypes: [
|
|
50
|
-
defaultCurrencyCoinType:
|
|
41
|
+
depositLstCoinType: NORMALIZED_sSUI_COINTYPE,
|
|
42
|
+
borrowCoinType: NORMALIZED_SUI_COINTYPE,
|
|
43
|
+
currencyCoinTypes: [NORMALIZED_SUI_COINTYPE, NORMALIZED_sSUI_COINTYPE],
|
|
44
|
+
defaultCurrencyCoinType: NORMALIZED_SUI_COINTYPE,
|
|
51
45
|
},
|
|
52
46
|
[StrategyType.stratSUI_SUI_LOOPING]: {
|
|
53
47
|
queryParam: "stratSUI-SUI-looping",
|
|
54
48
|
header: {
|
|
55
|
-
coinTypes: [
|
|
49
|
+
coinTypes: [NORMALIZED_stratSUI_COINTYPE, NORMALIZED_SUI_COINTYPE],
|
|
56
50
|
title: "stratSUI/SUI",
|
|
57
51
|
tooltip: "Sets up a stratSUI/SUI Looping strategy by depositing stratSUI and borrowing SUI to the desired leverage",
|
|
58
52
|
type: "Looping",
|
|
59
53
|
},
|
|
60
54
|
depositBaseCoinType: undefined,
|
|
61
|
-
depositLstCoinType:
|
|
62
|
-
borrowCoinType:
|
|
63
|
-
currencyCoinTypes: [
|
|
64
|
-
defaultCurrencyCoinType:
|
|
55
|
+
depositLstCoinType: NORMALIZED_stratSUI_COINTYPE,
|
|
56
|
+
borrowCoinType: NORMALIZED_SUI_COINTYPE,
|
|
57
|
+
currencyCoinTypes: [NORMALIZED_SUI_COINTYPE, NORMALIZED_stratSUI_COINTYPE],
|
|
58
|
+
defaultCurrencyCoinType: NORMALIZED_SUI_COINTYPE,
|
|
65
59
|
},
|
|
66
60
|
[StrategyType.USDC_sSUI_SUI_LOOPING]: {
|
|
67
61
|
queryParam: "USDC-sSUI-SUI-looping",
|
|
68
62
|
header: {
|
|
69
|
-
coinTypes: [
|
|
63
|
+
coinTypes: [NORMALIZED_USDC_COINTYPE],
|
|
70
64
|
title: "USDC sSUI/SUI",
|
|
71
65
|
tooltip: "Sets up a USDC sSUI/SUI Looping strategy by depositing USDC and looping sSUI/SUI to the desired leverage",
|
|
72
66
|
type: "Looping",
|
|
73
67
|
},
|
|
74
|
-
depositBaseCoinType:
|
|
75
|
-
depositLstCoinType:
|
|
76
|
-
borrowCoinType:
|
|
77
|
-
currencyCoinTypes: [
|
|
78
|
-
defaultCurrencyCoinType:
|
|
68
|
+
depositBaseCoinType: NORMALIZED_USDC_COINTYPE,
|
|
69
|
+
depositLstCoinType: NORMALIZED_sSUI_COINTYPE,
|
|
70
|
+
borrowCoinType: NORMALIZED_SUI_COINTYPE,
|
|
71
|
+
currencyCoinTypes: [NORMALIZED_USDC_COINTYPE],
|
|
72
|
+
defaultCurrencyCoinType: NORMALIZED_USDC_COINTYPE,
|
|
79
73
|
},
|
|
80
74
|
[StrategyType.AUSD_sSUI_SUI_LOOPING]: {
|
|
81
75
|
queryParam: "AUSD-sSUI-SUI-looping",
|
|
82
76
|
header: {
|
|
83
|
-
coinTypes: [
|
|
77
|
+
coinTypes: [NORMALIZED_AUSD_COINTYPE],
|
|
84
78
|
title: "AUSD sSUI/SUI",
|
|
85
79
|
tooltip: "Sets up an AUSD sSUI/SUI Looping strategy by depositing AUSD and looping sSUI/SUI to the desired leverage",
|
|
86
80
|
type: "Looping",
|
|
87
81
|
},
|
|
88
|
-
depositBaseCoinType:
|
|
89
|
-
depositLstCoinType:
|
|
90
|
-
borrowCoinType:
|
|
91
|
-
currencyCoinTypes: [
|
|
92
|
-
defaultCurrencyCoinType:
|
|
82
|
+
depositBaseCoinType: NORMALIZED_AUSD_COINTYPE,
|
|
83
|
+
depositLstCoinType: NORMALIZED_sSUI_COINTYPE,
|
|
84
|
+
borrowCoinType: NORMALIZED_SUI_COINTYPE,
|
|
85
|
+
currencyCoinTypes: [NORMALIZED_AUSD_COINTYPE],
|
|
86
|
+
defaultCurrencyCoinType: NORMALIZED_AUSD_COINTYPE,
|
|
93
87
|
},
|
|
94
88
|
[StrategyType.xBTC_sSUI_SUI_LOOPING]: {
|
|
95
89
|
queryParam: "xBTC-sSUI-SUI-looping",
|
|
96
90
|
header: {
|
|
97
|
-
coinTypes: [
|
|
91
|
+
coinTypes: [NORMALIZED_xBTC_COINTYPE],
|
|
98
92
|
title: "xBTC sSUI/SUI",
|
|
99
93
|
tooltip: "Sets up an xBTC sSUI/SUI Looping strategy by depositing xBTC and looping sSUI/SUI to the desired leverage",
|
|
100
94
|
type: "Looping",
|
|
101
95
|
},
|
|
102
|
-
depositBaseCoinType:
|
|
103
|
-
depositLstCoinType:
|
|
104
|
-
borrowCoinType:
|
|
105
|
-
currencyCoinTypes: [
|
|
106
|
-
defaultCurrencyCoinType:
|
|
96
|
+
depositBaseCoinType: NORMALIZED_xBTC_COINTYPE,
|
|
97
|
+
depositLstCoinType: NORMALIZED_sSUI_COINTYPE,
|
|
98
|
+
borrowCoinType: NORMALIZED_SUI_COINTYPE,
|
|
99
|
+
currencyCoinTypes: [NORMALIZED_xBTC_COINTYPE],
|
|
100
|
+
defaultCurrencyCoinType: NORMALIZED_xBTC_COINTYPE,
|
|
107
101
|
},
|
|
108
102
|
[StrategyType.xBTC_suiWBTC_LOOPING]: {
|
|
109
103
|
queryParam: "xBTC-suiWBTC-looping",
|
|
110
104
|
header: {
|
|
111
|
-
coinTypes: [
|
|
105
|
+
coinTypes: [NORMALIZED_xBTC_COINTYPE, NORMALIZED_suiWBTC_COINTYPE],
|
|
112
106
|
title: "xBTC/suiWBTC",
|
|
113
107
|
tooltip: "Sets up an xBTC/suiWBTC Looping strategy by depositing xBTC and borrowing suiWBTC to the desired leverage",
|
|
114
108
|
type: "Looping",
|
|
115
109
|
},
|
|
116
|
-
depositBaseCoinType:
|
|
110
|
+
depositBaseCoinType: NORMALIZED_xBTC_COINTYPE,
|
|
117
111
|
depositLstCoinType: undefined,
|
|
118
|
-
borrowCoinType:
|
|
119
|
-
currencyCoinTypes: [
|
|
120
|
-
defaultCurrencyCoinType:
|
|
112
|
+
borrowCoinType: NORMALIZED_suiWBTC_COINTYPE,
|
|
113
|
+
currencyCoinTypes: [NORMALIZED_xBTC_COINTYPE, NORMALIZED_suiWBTC_COINTYPE],
|
|
114
|
+
defaultCurrencyCoinType: NORMALIZED_xBTC_COINTYPE,
|
|
121
115
|
},
|
|
122
116
|
[StrategyType.suiUSDT_sSUI_SUI_LOOPING]: {
|
|
123
117
|
queryParam: "suiUSDT-sSUI-SUI-looping",
|
|
124
118
|
header: {
|
|
125
|
-
coinTypes: [
|
|
119
|
+
coinTypes: [NORMALIZED_suiUSDT_COINTYPE],
|
|
126
120
|
title: "suiUSDT sSUI/SUI",
|
|
127
121
|
tooltip: "Sets up a suiUSDT sSUI/SUI Looping strategy by depositing suiUSDT and looping sSUI/SUI to the desired leverage",
|
|
128
122
|
type: "Looping",
|
|
129
123
|
},
|
|
130
|
-
depositBaseCoinType:
|
|
131
|
-
depositLstCoinType:
|
|
132
|
-
borrowCoinType:
|
|
133
|
-
currencyCoinTypes: [
|
|
134
|
-
defaultCurrencyCoinType:
|
|
124
|
+
depositBaseCoinType: NORMALIZED_suiUSDT_COINTYPE,
|
|
125
|
+
depositLstCoinType: NORMALIZED_sSUI_COINTYPE,
|
|
126
|
+
borrowCoinType: NORMALIZED_SUI_COINTYPE,
|
|
127
|
+
currencyCoinTypes: [NORMALIZED_suiUSDT_COINTYPE],
|
|
128
|
+
defaultCurrencyCoinType: NORMALIZED_suiUSDT_COINTYPE,
|
|
135
129
|
},
|
|
136
130
|
[StrategyType.AUSD_USDC_LOOPING]: {
|
|
137
131
|
queryParam: "AUSD-USDC-looping",
|
|
138
132
|
header: {
|
|
139
|
-
coinTypes: [
|
|
133
|
+
coinTypes: [NORMALIZED_AUSD_COINTYPE, NORMALIZED_USDC_COINTYPE],
|
|
140
134
|
title: "AUSD/USDC",
|
|
141
135
|
tooltip: "Sets up an AUSD/USDC Looping strategy by depositing AUSD and borrowing USDC to the desired leverage",
|
|
142
136
|
type: "Looping",
|
|
143
137
|
},
|
|
144
|
-
depositBaseCoinType:
|
|
138
|
+
depositBaseCoinType: NORMALIZED_AUSD_COINTYPE,
|
|
145
139
|
depositLstCoinType: undefined,
|
|
146
|
-
borrowCoinType:
|
|
147
|
-
currencyCoinTypes: [
|
|
148
|
-
defaultCurrencyCoinType:
|
|
140
|
+
borrowCoinType: NORMALIZED_USDC_COINTYPE,
|
|
141
|
+
currencyCoinTypes: [NORMALIZED_AUSD_COINTYPE, NORMALIZED_USDC_COINTYPE],
|
|
142
|
+
defaultCurrencyCoinType: NORMALIZED_AUSD_COINTYPE,
|
|
149
143
|
},
|
|
150
144
|
[StrategyType.AUSD_suiUSDT_LOOPING]: {
|
|
151
145
|
queryParam: "AUSD-suiUSDT-looping",
|
|
152
146
|
header: {
|
|
153
|
-
coinTypes: [
|
|
147
|
+
coinTypes: [NORMALIZED_AUSD_COINTYPE, NORMALIZED_suiUSDT_COINTYPE],
|
|
154
148
|
title: "AUSD/suiUSDT",
|
|
155
149
|
tooltip: "Sets up an AUSD/suiUSDT Looping strategy by depositing AUSD and borrowing suiUSDT to the desired leverage",
|
|
156
150
|
type: "Looping",
|
|
157
151
|
},
|
|
158
|
-
depositBaseCoinType:
|
|
152
|
+
depositBaseCoinType: NORMALIZED_AUSD_COINTYPE,
|
|
159
153
|
depositLstCoinType: undefined,
|
|
160
|
-
borrowCoinType:
|
|
161
|
-
currencyCoinTypes: [
|
|
162
|
-
defaultCurrencyCoinType:
|
|
154
|
+
borrowCoinType: NORMALIZED_suiUSDT_COINTYPE,
|
|
155
|
+
currencyCoinTypes: [NORMALIZED_AUSD_COINTYPE, NORMALIZED_suiUSDT_COINTYPE],
|
|
156
|
+
defaultCurrencyCoinType: NORMALIZED_AUSD_COINTYPE,
|
|
163
157
|
},
|
|
164
158
|
[StrategyType.USDC_suiUSDT_LOOPING]: {
|
|
165
159
|
queryParam: "USDC-suiUSDT-looping",
|
|
166
160
|
header: {
|
|
167
|
-
coinTypes: [
|
|
161
|
+
coinTypes: [NORMALIZED_USDC_COINTYPE, NORMALIZED_suiUSDT_COINTYPE],
|
|
168
162
|
title: "USDC/suiUSDT",
|
|
169
163
|
tooltip: "Sets up a USDC/suiUSDT Looping strategy by depositing USDC and borrowing suiUSDT to the desired leverage",
|
|
170
164
|
type: "Looping",
|
|
171
165
|
},
|
|
172
|
-
depositBaseCoinType:
|
|
166
|
+
depositBaseCoinType: NORMALIZED_USDC_COINTYPE,
|
|
173
167
|
depositLstCoinType: undefined,
|
|
174
|
-
borrowCoinType:
|
|
175
|
-
currencyCoinTypes: [
|
|
176
|
-
defaultCurrencyCoinType:
|
|
168
|
+
borrowCoinType: NORMALIZED_suiUSDT_COINTYPE,
|
|
169
|
+
currencyCoinTypes: [NORMALIZED_USDC_COINTYPE, NORMALIZED_suiUSDT_COINTYPE],
|
|
170
|
+
defaultCurrencyCoinType: NORMALIZED_USDC_COINTYPE,
|
|
177
171
|
},
|
|
178
172
|
};
|
|
179
|
-
const strategyDeposit = (coin, coinType, strategyOwnerCap, reserveArrayIndex, transaction) => transaction.moveCall({
|
|
173
|
+
export const strategyDeposit = (coin, coinType, strategyOwnerCap, reserveArrayIndex, transaction) => transaction.moveCall({
|
|
180
174
|
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V7}::strategy_wrapper::deposit_liquidity_and_deposit_into_obligation`,
|
|
181
|
-
typeArguments: [
|
|
175
|
+
typeArguments: [LENDING_MARKET_TYPE, coinType],
|
|
182
176
|
arguments: [
|
|
183
177
|
transaction.object(strategyOwnerCap),
|
|
184
|
-
transaction.object(
|
|
178
|
+
transaction.object(LENDING_MARKET_ID),
|
|
185
179
|
transaction.pure.u64(reserveArrayIndex),
|
|
186
|
-
transaction.object(
|
|
180
|
+
transaction.object(SUI_CLOCK_OBJECT_ID),
|
|
187
181
|
transaction.object(coin),
|
|
188
182
|
],
|
|
189
183
|
});
|
|
190
|
-
|
|
191
|
-
const strategyBorrow = (coinType, strategyOwnerCap, reserveArrayIndex, value, transaction) => (0, sui_fe_1.isSui)(coinType)
|
|
184
|
+
export const strategyBorrow = (coinType, strategyOwnerCap, reserveArrayIndex, value, transaction) => isSui(coinType)
|
|
192
185
|
? transaction.moveCall({
|
|
193
186
|
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V7}::strategy_wrapper::borrow_sui_from_obligation`,
|
|
194
|
-
typeArguments: [
|
|
187
|
+
typeArguments: [LENDING_MARKET_TYPE],
|
|
195
188
|
arguments: [
|
|
196
189
|
transaction.object(strategyOwnerCap),
|
|
197
|
-
transaction.object(
|
|
190
|
+
transaction.object(LENDING_MARKET_ID),
|
|
198
191
|
transaction.pure.u64(reserveArrayIndex),
|
|
199
|
-
transaction.object(
|
|
192
|
+
transaction.object(SUI_CLOCK_OBJECT_ID),
|
|
200
193
|
transaction.pure.u64(value),
|
|
201
|
-
transaction.object(
|
|
194
|
+
transaction.object(SUI_SYSTEM_STATE_OBJECT_ID),
|
|
202
195
|
],
|
|
203
196
|
})
|
|
204
197
|
: transaction.moveCall({
|
|
205
198
|
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V7}::strategy_wrapper::borrow_from_obligation`,
|
|
206
|
-
typeArguments: [
|
|
199
|
+
typeArguments: [LENDING_MARKET_TYPE, coinType],
|
|
207
200
|
arguments: [
|
|
208
201
|
transaction.object(strategyOwnerCap),
|
|
209
|
-
transaction.object(
|
|
202
|
+
transaction.object(LENDING_MARKET_ID),
|
|
210
203
|
transaction.pure.u64(reserveArrayIndex),
|
|
211
|
-
transaction.object(
|
|
204
|
+
transaction.object(SUI_CLOCK_OBJECT_ID),
|
|
212
205
|
transaction.pure.u64(value),
|
|
213
206
|
],
|
|
214
207
|
});
|
|
215
|
-
|
|
216
|
-
const strategyWithdraw = (coinType, strategyOwnerCap, reserveArrayIndex, value, transaction) => transaction.moveCall({
|
|
208
|
+
export const strategyWithdraw = (coinType, strategyOwnerCap, reserveArrayIndex, value, transaction) => transaction.moveCall({
|
|
217
209
|
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V7}::strategy_wrapper::withdraw_from_obligation_and_redeem`,
|
|
218
|
-
typeArguments: [
|
|
210
|
+
typeArguments: [LENDING_MARKET_TYPE, coinType],
|
|
219
211
|
arguments: [
|
|
220
212
|
transaction.object(strategyOwnerCap),
|
|
221
|
-
transaction.object(
|
|
213
|
+
transaction.object(LENDING_MARKET_ID),
|
|
222
214
|
transaction.pure.u64(reserveArrayIndex),
|
|
223
|
-
transaction.object(
|
|
215
|
+
transaction.object(SUI_CLOCK_OBJECT_ID),
|
|
224
216
|
transaction.pure.u64(value),
|
|
225
217
|
],
|
|
226
218
|
});
|
|
227
|
-
exports.strategyWithdraw = strategyWithdraw;
|
|
228
219
|
const strategyClaimRewards = (coinType, strategyOwnerCap, reserveArrayIndex, rewardIndex, side, transaction) => transaction.moveCall({
|
|
229
220
|
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V7}::strategy_wrapper::claim_rewards`,
|
|
230
|
-
typeArguments: [
|
|
221
|
+
typeArguments: [LENDING_MARKET_TYPE, coinType],
|
|
231
222
|
arguments: [
|
|
232
223
|
transaction.object(strategyOwnerCap),
|
|
233
|
-
transaction.object(
|
|
234
|
-
transaction.object(
|
|
224
|
+
transaction.object(LENDING_MARKET_ID),
|
|
225
|
+
transaction.object(SUI_CLOCK_OBJECT_ID),
|
|
235
226
|
transaction.pure.u64(reserveArrayIndex),
|
|
236
227
|
transaction.pure.u64(rewardIndex),
|
|
237
|
-
transaction.pure.bool(side ===
|
|
228
|
+
transaction.pure.bool(side === Side.DEPOSIT),
|
|
238
229
|
],
|
|
239
230
|
});
|
|
240
231
|
const strategyClaimRewardsAndMergeCoins = (rewardsMap, strategyOwnerCap, transaction) => {
|
|
@@ -264,10 +255,10 @@ const strategyClaimRewardsAndMergeCoins = (rewardsMap, strategyOwnerCap, transac
|
|
|
264
255
|
}
|
|
265
256
|
return mergedCoinsMap;
|
|
266
257
|
};
|
|
267
|
-
const strategyClaimRewardsAndSwapForCoinType = (address, cetusSdk, cetusPartnerId, rewardsMap, rewardPriceMap, depositReserve, strategyOwnerCap, isDepositing, transaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
258
|
+
export const strategyClaimRewardsAndSwapForCoinType = (address, cetusSdk, cetusPartnerId, rewardsMap, rewardPriceMap, depositReserve, strategyOwnerCap, isDepositing, transaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
268
259
|
const filteredRewardsMap = Object.fromEntries(Object.entries(rewardsMap).filter(([coinType]) => {
|
|
269
260
|
var _a;
|
|
270
|
-
return ((_a = rewardPriceMap[coinType]) !== null && _a !== void 0 ? _a : new
|
|
261
|
+
return ((_a = rewardPriceMap[coinType]) !== null && _a !== void 0 ? _a : new BigNumber(0))
|
|
271
262
|
.times(rewardsMap[coinType].amount)
|
|
272
263
|
.gte(0.01);
|
|
273
264
|
}));
|
|
@@ -296,7 +287,7 @@ const strategyClaimRewardsAndSwapForCoinType = (address, cetusSdk, cetusPartnerI
|
|
|
296
287
|
const routers = yield cetusSdk.findRouters({
|
|
297
288
|
from: coinType,
|
|
298
289
|
target: depositReserve.coinType,
|
|
299
|
-
amount: new
|
|
290
|
+
amount: new BN(amount.toString()), // Underestimate (rewards keep accruing)
|
|
300
291
|
byAmountIn: true,
|
|
301
292
|
});
|
|
302
293
|
if (!routers)
|
|
@@ -321,13 +312,13 @@ const strategyClaimRewardsAndSwapForCoinType = (address, cetusSdk, cetusPartnerI
|
|
|
321
312
|
try {
|
|
322
313
|
let coinOut;
|
|
323
314
|
try {
|
|
324
|
-
coinOut = yield cetusSdk.fixableRouterSwapV3({
|
|
315
|
+
coinOut = (yield cetusSdk.fixableRouterSwapV3({
|
|
325
316
|
router: routers,
|
|
326
317
|
inputCoin: coinIn,
|
|
327
318
|
slippage: 3 / 100,
|
|
328
319
|
txb: transaction,
|
|
329
320
|
partner: cetusPartnerId,
|
|
330
|
-
});
|
|
321
|
+
}));
|
|
331
322
|
if (resultCoin)
|
|
332
323
|
transaction.mergeCoins(resultCoin, [coinOut]);
|
|
333
324
|
else
|
|
@@ -346,14 +337,13 @@ const strategyClaimRewardsAndSwapForCoinType = (address, cetusSdk, cetusPartnerI
|
|
|
346
337
|
if (!resultCoin)
|
|
347
338
|
throw new Error("No coin to deposit or transfer");
|
|
348
339
|
if (isDepositing) {
|
|
349
|
-
|
|
340
|
+
strategyDeposit(resultCoin, depositReserve.coinType, strategyOwnerCap, depositReserve.arrayIndex, transaction);
|
|
350
341
|
}
|
|
351
342
|
else {
|
|
352
343
|
transaction.transferObjects([resultCoin], transaction.pure.address(address));
|
|
353
344
|
}
|
|
354
345
|
});
|
|
355
|
-
|
|
356
|
-
const strategySwapSomeDepositsForCoinType = (strategyType, cetusSdk, cetusPartnerId, obligation, noSwapCoinTypes, // coinTypes to not swap for depositReserve.coinType
|
|
346
|
+
export const strategySwapSomeDepositsForCoinType = (strategyType, cetusSdk, cetusPartnerId, obligation, noSwapCoinTypes, // coinTypes to not swap for depositReserve.coinType
|
|
357
347
|
swapPercent, // percent of deposit to swap for depositReserve.coinType (0-100)
|
|
358
348
|
depositReserve, strategyOwnerCap, transaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
359
349
|
// 1) MAX withdraw non-swapCoinTypes deposits
|
|
@@ -362,14 +352,14 @@ depositReserve, strategyOwnerCap, transaction) => __awaiter(void 0, void 0, void
|
|
|
362
352
|
return;
|
|
363
353
|
const withdrawnCoinsMap = {};
|
|
364
354
|
for (const deposit of swapCoinTypeDeposits) {
|
|
365
|
-
const [withdrawnCoin] =
|
|
366
|
-
? BigInt(
|
|
367
|
-
: BigInt(new
|
|
355
|
+
const [withdrawnCoin] = strategyWithdraw(deposit.coinType, strategyOwnerCap, deposit.reserve.arrayIndex, swapPercent.eq(100)
|
|
356
|
+
? BigInt(MAX_U64.toString())
|
|
357
|
+
: BigInt(new BigNumber(new BigNumber(deposit.depositedAmount.times(swapPercent.div(100)))
|
|
368
358
|
.times(10 ** deposit.reserve.token.decimals)
|
|
369
|
-
.integerValue(
|
|
359
|
+
.integerValue(BigNumber.ROUND_DOWN)
|
|
370
360
|
.toString())
|
|
371
361
|
.div(deposit.reserve.cTokenExchangeRate)
|
|
372
|
-
.integerValue(
|
|
362
|
+
.integerValue(BigNumber.ROUND_UP)
|
|
373
363
|
.toString()), transaction);
|
|
374
364
|
withdrawnCoinsMap[deposit.coinType] = {
|
|
375
365
|
deposit,
|
|
@@ -382,14 +372,14 @@ depositReserve, strategyOwnerCap, transaction) => __awaiter(void 0, void 0, void
|
|
|
382
372
|
const amountsAndSortedQuotesMap = Object.fromEntries(yield Promise.all(Object.entries(withdrawnCoinsMap).map(([coinType, { deposit, coin }]) => (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
383
373
|
try {
|
|
384
374
|
// Get amount
|
|
385
|
-
const amount = new
|
|
375
|
+
const amount = new BigNumber(deposit.depositedAmount.times(swapPercent.div(100)))
|
|
386
376
|
.times(10 ** deposit.reserve.token.decimals)
|
|
387
|
-
.integerValue(
|
|
377
|
+
.integerValue(BigNumber.ROUND_DOWN); // Use underestimate (deposits keep accruing if deposit APR >0)
|
|
388
378
|
// Get routes
|
|
389
379
|
const routers = yield cetusSdk.findRouters({
|
|
390
380
|
from: deposit.coinType,
|
|
391
381
|
target: depositReserve.coinType,
|
|
392
|
-
amount: new
|
|
382
|
+
amount: new BN(amount.toString()), // Underestimate (deposits keep accruing if deposit APR >0)
|
|
393
383
|
byAmountIn: true,
|
|
394
384
|
});
|
|
395
385
|
if (!routers)
|
|
@@ -414,13 +404,13 @@ depositReserve, strategyOwnerCap, transaction) => __awaiter(void 0, void 0, void
|
|
|
414
404
|
try {
|
|
415
405
|
let coinOut;
|
|
416
406
|
try {
|
|
417
|
-
coinOut = yield cetusSdk.fixableRouterSwapV3({
|
|
407
|
+
coinOut = (yield cetusSdk.fixableRouterSwapV3({
|
|
418
408
|
router: routers,
|
|
419
409
|
inputCoin: coinIn,
|
|
420
410
|
slippage: 3 / 100,
|
|
421
411
|
txb: transaction,
|
|
422
412
|
partner: cetusPartnerId,
|
|
423
|
-
});
|
|
413
|
+
}));
|
|
424
414
|
}
|
|
425
415
|
catch (err) {
|
|
426
416
|
throw new Error(`No swap quote found for ${coinType}`);
|
|
@@ -439,10 +429,9 @@ depositReserve, strategyOwnerCap, transaction) => __awaiter(void 0, void 0, void
|
|
|
439
429
|
if (!resultCoin)
|
|
440
430
|
throw new Error("No coin to deposit or transfer");
|
|
441
431
|
console.log("[strategySwapSomeDepositsForCoinType] depositing resultCoin");
|
|
442
|
-
|
|
432
|
+
strategyDeposit(resultCoin, depositReserve.coinType, strategyOwnerCap, depositReserve.arrayIndex, transaction);
|
|
443
433
|
});
|
|
444
|
-
|
|
445
|
-
const createStrategyOwnerCapIfNoneExists = (strategyType, strategyOwnerCap, transaction) => {
|
|
434
|
+
export const createStrategyOwnerCapIfNoneExists = (strategyType, strategyOwnerCap, transaction) => {
|
|
446
435
|
let strategyOwnerCapId;
|
|
447
436
|
let didCreate = false;
|
|
448
437
|
if (strategyOwnerCap)
|
|
@@ -450,9 +439,9 @@ const createStrategyOwnerCapIfNoneExists = (strategyType, strategyOwnerCap, tran
|
|
|
450
439
|
else {
|
|
451
440
|
strategyOwnerCapId = transaction.moveCall({
|
|
452
441
|
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V7}::strategy_wrapper::create_strategy_owner_cap`,
|
|
453
|
-
typeArguments: [
|
|
442
|
+
typeArguments: [LENDING_MARKET_TYPE],
|
|
454
443
|
arguments: [
|
|
455
|
-
transaction.object(
|
|
444
|
+
transaction.object(LENDING_MARKET_ID),
|
|
456
445
|
transaction.pure.u8(+strategyType),
|
|
457
446
|
],
|
|
458
447
|
});
|
|
@@ -460,8 +449,6 @@ const createStrategyOwnerCapIfNoneExists = (strategyType, strategyOwnerCap, tran
|
|
|
460
449
|
}
|
|
461
450
|
return { strategyOwnerCapId, didCreate };
|
|
462
451
|
};
|
|
463
|
-
|
|
464
|
-
const sendStrategyOwnerCapToUser = (strategyOwnerCapId, address, transaction) => {
|
|
452
|
+
export const sendStrategyOwnerCapToUser = (strategyOwnerCapId, address, transaction) => {
|
|
465
453
|
transaction.transferObjects([strategyOwnerCapId], transaction.pure.address(address));
|
|
466
454
|
};
|
|
467
|
-
exports.sendStrategyOwnerCapToUser = sendStrategyOwnerCapToUser;
|
package/lib/transactions.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendObligationToUser = exports.createObligationIfNoneExists = void 0;
|
|
4
|
-
const createObligationIfNoneExists = (suilendClient, transaction, obligationOwnerCap) => {
|
|
1
|
+
export const createObligationIfNoneExists = (suilendClient, transaction, obligationOwnerCap) => {
|
|
5
2
|
let obligationOwnerCapId;
|
|
6
3
|
let didCreate = false;
|
|
7
4
|
if (obligationOwnerCap)
|
|
@@ -12,8 +9,6 @@ const createObligationIfNoneExists = (suilendClient, transaction, obligationOwne
|
|
|
12
9
|
}
|
|
13
10
|
return { obligationOwnerCapId, didCreate };
|
|
14
11
|
};
|
|
15
|
-
|
|
16
|
-
const sendObligationToUser = (obligationOwnerCapId, address, transaction) => {
|
|
12
|
+
export const sendObligationToUser = (obligationOwnerCapId, address, transaction) => {
|
|
17
13
|
transaction.transferObjects([obligationOwnerCapId], transaction.pure.address(address));
|
|
18
14
|
};
|
|
19
|
-
exports.sendObligationToUser = sendObligationToUser;
|
package/lib/types.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Action = exports.Side = void 0;
|
|
4
|
-
var Side;
|
|
1
|
+
export var Side;
|
|
5
2
|
(function (Side) {
|
|
6
3
|
Side["DEPOSIT"] = "deposit";
|
|
7
4
|
Side["BORROW"] = "borrow";
|
|
8
|
-
})(Side || (
|
|
9
|
-
var Action;
|
|
5
|
+
})(Side || (Side = {}));
|
|
6
|
+
export var Action;
|
|
10
7
|
(function (Action) {
|
|
11
8
|
Action["DEPOSIT"] = "deposit";
|
|
12
9
|
Action["WITHDRAW"] = "withdraw";
|
|
13
10
|
Action["BORROW"] = "borrow";
|
|
14
11
|
Action["REPAY"] = "repay";
|
|
15
|
-
})(Action || (
|
|
12
|
+
})(Action || (Action = {}));
|
package/mmt.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.MMT_VERSION_OBJECT_ID = exports.MMT_CONTRACT_PACKAGE_ID = void 0;
|
|
4
|
-
exports.MMT_CONTRACT_PACKAGE_ID = "0xcf60a40f45d46fc1e828871a647c1e25a0915dec860d2662eb10fdb382c3c1d1";
|
|
5
|
-
exports.MMT_VERSION_OBJECT_ID = "0x2375a0b1ec12010aaea3b2545acfa2ad34cfbba03ce4b59f4c39e1e25eed1b2a";
|
|
1
|
+
export const MMT_CONTRACT_PACKAGE_ID = "0xcf60a40f45d46fc1e828871a647c1e25a0915dec860d2662eb10fdb382c3c1d1";
|
|
2
|
+
export const MMT_VERSION_OBJECT_ID = "0x2375a0b1ec12010aaea3b2545acfa2ad34cfbba03ce4b59f4c39e1e25eed1b2a";
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sdk","version":"
|
|
1
|
+
{"name":"@suilend/sdk","version":"2.0.1","private":false,"description":"A TypeScript SDK for interacting with the Suilend program","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./client":"./client.js","./mmt":"./mmt.js","./strategies":"./strategies.js","./parsers/apiReserveAssetDataEvent":"./parsers/apiReserveAssetDataEvent.js","./parsers/obligation":"./parsers/obligation.js","./parsers":"./parsers/index.js","./parsers/lendingMarket":"./parsers/lendingMarket.js","./parsers/rateLimiter":"./parsers/rateLimiter.js","./parsers/reserve":"./parsers/reserve.js","./swap/transaction":"./swap/transaction.js","./swap/quote":"./swap/quote.js","./swap":"./swap/index.js","./utils/simulate":"./utils/simulate.js","./utils/events":"./utils/events.js","./utils/obligation":"./utils/obligation.js","./utils":"./utils/index.js","./lib/constants":"./lib/constants.js","./lib/transactions":"./lib/transactions.js","./lib/types":"./lib/types.js","./lib/initialize":"./lib/initialize.js","./lib":"./lib/index.js","./lib/liquidityMining":"./lib/liquidityMining.js","./lib/strategyOwnerCap":"./lib/strategyOwnerCap.js","./lib/pyth":"./lib/pyth.js","./api/events":"./api/events.js","./api":"./api/index.js","./_generated/suilend":"./_generated/suilend/index.js","./_generated/_framework/util":"./_generated/_framework/util.js","./_generated/_framework/reified":"./_generated/_framework/reified.js","./_generated/_framework/vector":"./_generated/_framework/vector.js","./_generated/suilend/obligation/structs":"./_generated/suilend/obligation/structs.js","./_generated/suilend/decimal/structs":"./_generated/suilend/decimal/structs.js","./_generated/suilend/lending-market/functions":"./_generated/suilend/lending-market/functions.js","./_generated/suilend/lending-market/structs":"./_generated/suilend/lending-market/structs.js","./_generated/suilend/reserve-config/functions":"./_generated/suilend/reserve-config/functions.js","./_generated/suilend/reserve-config/structs":"./_generated/suilend/reserve-config/structs.js","./_generated/suilend/liquidity-mining/structs":"./_generated/suilend/liquidity-mining/structs.js","./_generated/suilend/cell/structs":"./_generated/suilend/cell/structs.js","./_generated/suilend/rate-limiter/functions":"./_generated/suilend/rate-limiter/functions.js","./_generated/suilend/rate-limiter/structs":"./_generated/suilend/rate-limiter/structs.js","./_generated/suilend/reserve/structs":"./_generated/suilend/reserve/structs.js","./_generated/suilend/lending-market-registry/functions":"./_generated/suilend/lending-market-registry/functions.js","./_generated/_dependencies/source/0x2":"./_generated/_dependencies/source/0x2/index.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js","./_generated/_dependencies/source/0x1":"./_generated/_dependencies/source/0x1/index.js","./_generated/_dependencies/source/0x2/object-table/structs":"./_generated/_dependencies/source/0x2/object-table/structs.js","./_generated/_dependencies/source/0x2/balance/structs":"./_generated/_dependencies/source/0x2/balance/structs.js","./_generated/_dependencies/source/0x2/object/structs":"./_generated/_dependencies/source/0x2/object/structs.js","./_generated/_dependencies/source/0x2/bag/structs":"./_generated/_dependencies/source/0x2/bag/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js","./_generated/_dependencies/source/0x1/ascii/structs":"./_generated/_dependencies/source/0x1/ascii/structs.js","./_generated/_dependencies/source/0x1/option/structs":"./_generated/_dependencies/source/0x1/option/structs.js","./_generated/_dependencies/source/0x1/type-name/structs":"./_generated/_dependencies/source/0x1/type-name/structs.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix src/","prettier":"prettier --write src/","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ./release.js && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/suilend-fe-public.git"},"bugs":{"url":"https://github.com/suilend/suilend-fe-public/issues"},"dependencies":{"@bluefin-exchange/bluefin7k-aggregator-sdk":"^5.1.5","@cetusprotocol/aggregator-sdk":"^1.4.2","@flowx-finance/sdk":"^1.15.0","@suilend/springsui-sdk":"^2.0.1","aftermath-ts-sdk":"^1.3.24","bignumber.js":"^9.1.2","bn.js":"^5.2.2","crypto-js":"^4.2.0","lodash":"^4.17.21","p-limit":"3.1.0","uuid":"^11.0.3"},"devDependencies":{"@types/bn.js":"^5.2.0","@types/lodash":"^4.17.20","ts-node":"^10.9.2"},"peerDependencies":{"@mysten/bcs":"2.0.1","@mysten/sui":"2.3.1","@suilend/sui-fe":"^2.0.6","@pythnetwork/pyth-sui-js":"2.2.0"},"overrides":{"chalk":"5.3.0","strip-ansi":"7.1.0","color-convert":"2.0.1","color-name":"1.1.4","is-core-module":"2.13.1","error-ex":"1.3.2","has-ansi":"5.0.1"}}
|