@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.
Files changed (91) hide show
  1. package/_generated/_dependencies/source/0x1/ascii/structs.d.ts +7 -7
  2. package/_generated/_dependencies/source/0x1/ascii/structs.js +35 -75
  3. package/_generated/_dependencies/source/0x1/index.js +3 -6
  4. package/_generated/_dependencies/source/0x1/option/structs.d.ts +3 -3
  5. package/_generated/_dependencies/source/0x1/option/structs.js +31 -69
  6. package/_generated/_dependencies/source/0x1/type-name/structs.d.ts +5 -5
  7. package/_generated/_dependencies/source/0x1/type-name/structs.js +20 -25
  8. package/_generated/_dependencies/source/0x2/bag/structs.d.ts +7 -7
  9. package/_generated/_dependencies/source/0x2/bag/structs.js +24 -29
  10. package/_generated/_dependencies/source/0x2/balance/structs.d.ts +7 -7
  11. package/_generated/_dependencies/source/0x2/balance/structs.js +49 -56
  12. package/_generated/_dependencies/source/0x2/index.js +3 -6
  13. package/_generated/_dependencies/source/0x2/object/structs.d.ts +8 -8
  14. package/_generated/_dependencies/source/0x2/object/structs.js +34 -41
  15. package/_generated/_dependencies/source/0x2/object-table/structs.d.ts +7 -7
  16. package/_generated/_dependencies/source/0x2/object-table/structs.js +31 -36
  17. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.d.ts +5 -5
  18. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js +23 -28
  19. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js +4 -7
  20. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.d.ts +11 -11
  21. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js +32 -37
  22. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.d.ts +23 -23
  23. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js +29 -34
  24. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.d.ts +4 -4
  25. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js +21 -59
  26. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.d.ts +55 -55
  27. package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js +46 -53
  28. package/_generated/_framework/reified.d.ts +2 -2
  29. package/_generated/_framework/reified.js +27 -40
  30. package/_generated/_framework/util.js +26 -40
  31. package/_generated/_framework/vector.d.ts +4 -4
  32. package/_generated/_framework/vector.js +16 -21
  33. package/_generated/suilend/cell/structs.d.ts +4 -4
  34. package/_generated/suilend/cell/structs.js +31 -36
  35. package/_generated/suilend/decimal/structs.d.ts +4 -4
  36. package/_generated/suilend/decimal/structs.js +19 -24
  37. package/_generated/suilend/index.js +8 -12
  38. package/_generated/suilend/lending-market/functions.d.ts +1 -0
  39. package/_generated/suilend/lending-market/functions.js +271 -302
  40. package/_generated/suilend/lending-market/structs.d.ts +146 -146
  41. package/_generated/suilend/lending-market/structs.js +549 -617
  42. package/_generated/suilend/lending-market-registry/functions.js +7 -11
  43. package/_generated/suilend/liquidity-mining/structs.d.ts +50 -50
  44. package/_generated/suilend/liquidity-mining/structs.js +159 -205
  45. package/_generated/suilend/obligation/structs.d.ts +106 -106
  46. package/_generated/suilend/obligation/structs.js +313 -363
  47. package/_generated/suilend/rate-limiter/functions.js +23 -31
  48. package/_generated/suilend/rate-limiter/structs.d.ts +15 -15
  49. package/_generated/suilend/rate-limiter/structs.js +49 -56
  50. package/_generated/suilend/reserve/structs.d.ts +139 -139
  51. package/_generated/suilend/reserve/structs.js +397 -451
  52. package/_generated/suilend/reserve-config/functions.js +149 -190
  53. package/_generated/suilend/reserve-config/structs.d.ts +33 -33
  54. package/_generated/suilend/reserve-config/structs.js +109 -149
  55. package/api/events.js +1 -5
  56. package/api/index.js +1 -17
  57. package/client.d.ts +10 -10
  58. package/client.js +118 -128
  59. package/index.js +7 -23
  60. package/lib/constants.js +3 -9
  61. package/lib/index.js +5 -21
  62. package/lib/initialize.d.ts +3 -3
  63. package/lib/initialize.js +103 -140
  64. package/lib/liquidityMining.d.ts +3 -3
  65. package/lib/liquidityMining.js +57 -72
  66. package/lib/pyth.js +9 -14
  67. package/lib/strategyOwnerCap.js +106 -119
  68. package/lib/transactions.js +2 -7
  69. package/lib/types.js +4 -7
  70. package/mmt.js +2 -5
  71. package/package.json +1 -1
  72. package/parsers/apiReserveAssetDataEvent.js +25 -33
  73. package/parsers/index.js +5 -21
  74. package/parsers/lendingMarket.d.ts +1 -1
  75. package/parsers/lendingMarket.js +12 -19
  76. package/parsers/obligation.js +19 -26
  77. package/parsers/rateLimiter.js +11 -19
  78. package/parsers/reserve.d.ts +1 -1
  79. package/parsers/reserve.js +42 -85
  80. package/strategies.d.ts +11 -11
  81. package/strategies.js +547 -586
  82. package/swap/index.js +2 -18
  83. package/swap/quote.js +57 -65
  84. package/swap/transaction.d.ts +2 -2
  85. package/swap/transaction.js +40 -35
  86. package/utils/events.d.ts +3 -3
  87. package/utils/events.js +18 -35
  88. package/utils/index.js +16 -40
  89. package/utils/obligation.d.ts +4 -4
  90. package/utils/obligation.js +17 -60
  91. package/utils/simulate.js +118 -143
@@ -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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.sendStrategyOwnerCapToUser = exports.createStrategyOwnerCapIfNoneExists = exports.strategySwapSomeDepositsForCoinType = exports.strategyClaimRewardsAndSwapForCoinType = exports.strategyWithdraw = exports.strategyBorrow = exports.strategyDeposit = exports.STRATEGY_TYPE_INFO_MAP = exports.StrategyType = exports.STRATEGY_WRAPPER_PACKAGE_ID_V1 = void 0;
16
- const utils_1 = require("@mysten/sui/utils");
17
- const bignumber_js_1 = __importDefault(require("bignumber.js"));
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 || (exports.StrategyType = StrategyType = {}));
37
- exports.STRATEGY_TYPE_INFO_MAP = {
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: [sui_fe_1.NORMALIZED_sSUI_COINTYPE, sui_fe_1.NORMALIZED_SUI_COINTYPE],
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: sui_fe_1.NORMALIZED_sSUI_COINTYPE,
48
- borrowCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
49
- currencyCoinTypes: [sui_fe_1.NORMALIZED_SUI_COINTYPE, sui_fe_1.NORMALIZED_sSUI_COINTYPE],
50
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
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: [sui_fe_1.NORMALIZED_stratSUI_COINTYPE, sui_fe_1.NORMALIZED_SUI_COINTYPE],
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: sui_fe_1.NORMALIZED_stratSUI_COINTYPE,
62
- borrowCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
63
- currencyCoinTypes: [sui_fe_1.NORMALIZED_SUI_COINTYPE, sui_fe_1.NORMALIZED_stratSUI_COINTYPE],
64
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
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: [sui_fe_1.NORMALIZED_USDC_COINTYPE],
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: sui_fe_1.NORMALIZED_USDC_COINTYPE,
75
- depositLstCoinType: sui_fe_1.NORMALIZED_sSUI_COINTYPE,
76
- borrowCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
77
- currencyCoinTypes: [sui_fe_1.NORMALIZED_USDC_COINTYPE],
78
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_USDC_COINTYPE,
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: [sui_fe_1.NORMALIZED_AUSD_COINTYPE],
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: sui_fe_1.NORMALIZED_AUSD_COINTYPE,
89
- depositLstCoinType: sui_fe_1.NORMALIZED_sSUI_COINTYPE,
90
- borrowCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
91
- currencyCoinTypes: [sui_fe_1.NORMALIZED_AUSD_COINTYPE],
92
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_AUSD_COINTYPE,
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: [sui_fe_1.NORMALIZED_xBTC_COINTYPE],
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: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
103
- depositLstCoinType: sui_fe_1.NORMALIZED_sSUI_COINTYPE,
104
- borrowCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
105
- currencyCoinTypes: [sui_fe_1.NORMALIZED_xBTC_COINTYPE],
106
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
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: [sui_fe_1.NORMALIZED_xBTC_COINTYPE, sui_fe_1.NORMALIZED_suiWBTC_COINTYPE],
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: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
110
+ depositBaseCoinType: NORMALIZED_xBTC_COINTYPE,
117
111
  depositLstCoinType: undefined,
118
- borrowCoinType: sui_fe_1.NORMALIZED_suiWBTC_COINTYPE,
119
- currencyCoinTypes: [sui_fe_1.NORMALIZED_xBTC_COINTYPE, sui_fe_1.NORMALIZED_suiWBTC_COINTYPE],
120
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
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: [sui_fe_1.NORMALIZED_suiUSDT_COINTYPE],
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: sui_fe_1.NORMALIZED_suiUSDT_COINTYPE,
131
- depositLstCoinType: sui_fe_1.NORMALIZED_sSUI_COINTYPE,
132
- borrowCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
133
- currencyCoinTypes: [sui_fe_1.NORMALIZED_suiUSDT_COINTYPE],
134
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_suiUSDT_COINTYPE,
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: [sui_fe_1.NORMALIZED_AUSD_COINTYPE, sui_fe_1.NORMALIZED_USDC_COINTYPE],
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: sui_fe_1.NORMALIZED_AUSD_COINTYPE,
138
+ depositBaseCoinType: NORMALIZED_AUSD_COINTYPE,
145
139
  depositLstCoinType: undefined,
146
- borrowCoinType: sui_fe_1.NORMALIZED_USDC_COINTYPE,
147
- currencyCoinTypes: [sui_fe_1.NORMALIZED_AUSD_COINTYPE, sui_fe_1.NORMALIZED_USDC_COINTYPE],
148
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_AUSD_COINTYPE,
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: [sui_fe_1.NORMALIZED_AUSD_COINTYPE, sui_fe_1.NORMALIZED_suiUSDT_COINTYPE],
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: sui_fe_1.NORMALIZED_AUSD_COINTYPE,
152
+ depositBaseCoinType: NORMALIZED_AUSD_COINTYPE,
159
153
  depositLstCoinType: undefined,
160
- borrowCoinType: sui_fe_1.NORMALIZED_suiUSDT_COINTYPE,
161
- currencyCoinTypes: [sui_fe_1.NORMALIZED_AUSD_COINTYPE, sui_fe_1.NORMALIZED_suiUSDT_COINTYPE],
162
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_AUSD_COINTYPE,
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: [sui_fe_1.NORMALIZED_USDC_COINTYPE, sui_fe_1.NORMALIZED_suiUSDT_COINTYPE],
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: sui_fe_1.NORMALIZED_USDC_COINTYPE,
166
+ depositBaseCoinType: NORMALIZED_USDC_COINTYPE,
173
167
  depositLstCoinType: undefined,
174
- borrowCoinType: sui_fe_1.NORMALIZED_suiUSDT_COINTYPE,
175
- currencyCoinTypes: [sui_fe_1.NORMALIZED_USDC_COINTYPE, sui_fe_1.NORMALIZED_suiUSDT_COINTYPE],
176
- defaultCurrencyCoinType: sui_fe_1.NORMALIZED_USDC_COINTYPE,
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: [client_1.LENDING_MARKET_TYPE, coinType],
175
+ typeArguments: [LENDING_MARKET_TYPE, coinType],
182
176
  arguments: [
183
177
  transaction.object(strategyOwnerCap),
184
- transaction.object(client_1.LENDING_MARKET_ID),
178
+ transaction.object(LENDING_MARKET_ID),
185
179
  transaction.pure.u64(reserveArrayIndex),
186
- transaction.object(utils_1.SUI_CLOCK_OBJECT_ID),
180
+ transaction.object(SUI_CLOCK_OBJECT_ID),
187
181
  transaction.object(coin),
188
182
  ],
189
183
  });
190
- exports.strategyDeposit = strategyDeposit;
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: [client_1.LENDING_MARKET_TYPE],
187
+ typeArguments: [LENDING_MARKET_TYPE],
195
188
  arguments: [
196
189
  transaction.object(strategyOwnerCap),
197
- transaction.object(client_1.LENDING_MARKET_ID),
190
+ transaction.object(LENDING_MARKET_ID),
198
191
  transaction.pure.u64(reserveArrayIndex),
199
- transaction.object(utils_1.SUI_CLOCK_OBJECT_ID),
192
+ transaction.object(SUI_CLOCK_OBJECT_ID),
200
193
  transaction.pure.u64(value),
201
- transaction.object(utils_1.SUI_SYSTEM_STATE_OBJECT_ID),
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: [client_1.LENDING_MARKET_TYPE, coinType],
199
+ typeArguments: [LENDING_MARKET_TYPE, coinType],
207
200
  arguments: [
208
201
  transaction.object(strategyOwnerCap),
209
- transaction.object(client_1.LENDING_MARKET_ID),
202
+ transaction.object(LENDING_MARKET_ID),
210
203
  transaction.pure.u64(reserveArrayIndex),
211
- transaction.object(utils_1.SUI_CLOCK_OBJECT_ID),
204
+ transaction.object(SUI_CLOCK_OBJECT_ID),
212
205
  transaction.pure.u64(value),
213
206
  ],
214
207
  });
215
- exports.strategyBorrow = strategyBorrow;
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: [client_1.LENDING_MARKET_TYPE, coinType],
210
+ typeArguments: [LENDING_MARKET_TYPE, coinType],
219
211
  arguments: [
220
212
  transaction.object(strategyOwnerCap),
221
- transaction.object(client_1.LENDING_MARKET_ID),
213
+ transaction.object(LENDING_MARKET_ID),
222
214
  transaction.pure.u64(reserveArrayIndex),
223
- transaction.object(utils_1.SUI_CLOCK_OBJECT_ID),
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: [client_1.LENDING_MARKET_TYPE, coinType],
221
+ typeArguments: [LENDING_MARKET_TYPE, coinType],
231
222
  arguments: [
232
223
  transaction.object(strategyOwnerCap),
233
- transaction.object(client_1.LENDING_MARKET_ID),
234
- transaction.object(utils_1.SUI_CLOCK_OBJECT_ID),
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 === types_1.Side.DEPOSIT),
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 bignumber_js_1.default(0))
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 bn_js_1.default(amount.toString()), // Underestimate (rewards keep accruing)
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
- (0, exports.strategyDeposit)(resultCoin, depositReserve.coinType, strategyOwnerCap, depositReserve.arrayIndex, transaction);
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
- exports.strategyClaimRewardsAndSwapForCoinType = strategyClaimRewardsAndSwapForCoinType;
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] = (0, exports.strategyWithdraw)(deposit.coinType, strategyOwnerCap, deposit.reserve.arrayIndex, swapPercent.eq(100)
366
- ? BigInt(sui_fe_1.MAX_U64.toString())
367
- : BigInt(new bignumber_js_1.default(new bignumber_js_1.default(deposit.depositedAmount.times(swapPercent.div(100)))
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(bignumber_js_1.default.ROUND_DOWN)
359
+ .integerValue(BigNumber.ROUND_DOWN)
370
360
  .toString())
371
361
  .div(deposit.reserve.cTokenExchangeRate)
372
- .integerValue(bignumber_js_1.default.ROUND_UP)
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 bignumber_js_1.default(deposit.depositedAmount.times(swapPercent.div(100)))
375
+ const amount = new BigNumber(deposit.depositedAmount.times(swapPercent.div(100)))
386
376
  .times(10 ** deposit.reserve.token.decimals)
387
- .integerValue(bignumber_js_1.default.ROUND_DOWN); // Use underestimate (deposits keep accruing if deposit APR >0)
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 bn_js_1.default(amount.toString()), // Underestimate (deposits keep accruing if deposit APR >0)
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
- (0, exports.strategyDeposit)(resultCoin, depositReserve.coinType, strategyOwnerCap, depositReserve.arrayIndex, transaction);
432
+ strategyDeposit(resultCoin, depositReserve.coinType, strategyOwnerCap, depositReserve.arrayIndex, transaction);
443
433
  });
444
- exports.strategySwapSomeDepositsForCoinType = strategySwapSomeDepositsForCoinType;
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: [client_1.LENDING_MARKET_TYPE],
442
+ typeArguments: [LENDING_MARKET_TYPE],
454
443
  arguments: [
455
- transaction.object(client_1.LENDING_MARKET_ID),
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
- exports.createStrategyOwnerCapIfNoneExists = createStrategyOwnerCapIfNoneExists;
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;
@@ -1,7 +1,4 @@
1
- "use strict";
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
- exports.createObligationIfNoneExists = createObligationIfNoneExists;
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
- "use strict";
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 || (exports.Side = 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 || (exports.Action = Action = {}));
12
+ })(Action || (Action = {}));
package/mmt.js CHANGED
@@ -1,5 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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.1.99","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","./api/events":"./api/events.js","./api":"./api/index.js","./lib/constants":"./lib/constants.js","./lib":"./lib/index.js","./lib/initialize":"./lib/initialize.js","./lib/liquidityMining":"./lib/liquidityMining.js","./lib/pyth":"./lib/pyth.js","./lib/strategyOwnerCap":"./lib/strategyOwnerCap.js","./lib/transactions":"./lib/transactions.js","./lib/types":"./lib/types.js","./parsers/apiReserveAssetDataEvent":"./parsers/apiReserveAssetDataEvent.js","./parsers":"./parsers/index.js","./parsers/lendingMarket":"./parsers/lendingMarket.js","./parsers/obligation":"./parsers/obligation.js","./parsers/rateLimiter":"./parsers/rateLimiter.js","./parsers/reserve":"./parsers/reserve.js","./swap":"./swap/index.js","./swap/quote":"./swap/quote.js","./swap/transaction":"./swap/transaction.js","./utils/events":"./utils/events.js","./utils":"./utils/index.js","./utils/obligation":"./utils/obligation.js","./utils/simulate":"./utils/simulate.js","./_generated/_framework/reified":"./_generated/_framework/reified.js","./_generated/_framework/util":"./_generated/_framework/util.js","./_generated/_framework/vector":"./_generated/_framework/vector.js","./_generated/suilend":"./_generated/suilend/index.js","./_generated/suilend/cell/structs":"./_generated/suilend/cell/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/lending-market-registry/functions":"./_generated/suilend/lending-market-registry/functions.js","./_generated/suilend/liquidity-mining/structs":"./_generated/suilend/liquidity-mining/structs.js","./_generated/suilend/obligation/structs":"./_generated/suilend/obligation/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/reserve-config/functions":"./_generated/suilend/reserve-config/functions.js","./_generated/suilend/reserve-config/structs":"./_generated/suilend/reserve-config/structs.js","./_generated/_dependencies/source/0x1":"./_generated/_dependencies/source/0x1/index.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/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","./_generated/_dependencies/source/0x2/bag/structs":"./_generated/_dependencies/source/0x2/bag/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/object-table/structs":"./_generated/_dependencies/source/0x2/object-table/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && 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":"^1.0.27","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":"1.8.1","@mysten/sui":"1.42.0","@suilend/sui-fe":"^0.3.49","@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"}}
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"}}