@scallop-io/sui-scallop-sdk 0.47.0-alpha.1 → 0.47.0-alpha.3

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/index.mjs CHANGED
@@ -9,6 +9,8 @@ var BORROW_FEE_PROTOCOL_ID = IS_VE_SCA_TEST ? "0xc9f859f98ca352a11b97a038c4b4162
9
9
  var SCA_COIN_TYPE = IS_VE_SCA_TEST ? `0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA` : "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
10
10
  var OLD_BORROW_INCENTIVE_PROTOCOL_ID = "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
11
11
  var SUPPORT_POOLS = [
12
+ "usdc",
13
+ // native USDC
12
14
  "weth",
13
15
  "wbtc",
14
16
  "wusdc",
@@ -23,6 +25,7 @@ var SUPPORT_POOLS = [
23
25
  "sca"
24
26
  ];
25
27
  var SUPPORT_COLLATERALS = [
28
+ "usdc",
26
29
  "weth",
27
30
  "wbtc",
28
31
  "wusdc",
@@ -37,6 +40,7 @@ var SUPPORT_COLLATERALS = [
37
40
  "sca"
38
41
  ];
39
42
  var SUPPORT_SPOOLS = [
43
+ "susdc",
40
44
  "sweth",
41
45
  "ssui",
42
46
  "swusdc",
@@ -47,6 +51,7 @@ var SUPPORT_SPOOLS = [
47
51
  "svsui"
48
52
  ];
49
53
  var SUPPORT_SCOIN = [
54
+ "susdc",
50
55
  "ssui",
51
56
  "swusdc",
52
57
  "swusdt",
@@ -89,6 +94,7 @@ var SUPPORT_PACKAGES = [
89
94
 
90
95
  // src/constants/enum.ts
91
96
  var coinDecimals = {
97
+ usdc: 6,
92
98
  weth: 8,
93
99
  wbtc: 8,
94
100
  wusdc: 6,
@@ -101,6 +107,7 @@ var coinDecimals = {
101
107
  hasui: 9,
102
108
  vsui: 9,
103
109
  sca: 9,
110
+ susdc: 6,
104
111
  sweth: 8,
105
112
  swbtc: 8,
106
113
  swusdc: 6,
@@ -115,6 +122,7 @@ var coinDecimals = {
115
122
  ssca: 9
116
123
  };
117
124
  var assetCoins = {
125
+ usdc: "usdc",
118
126
  weth: "weth",
119
127
  wbtc: "wbtc",
120
128
  wusdc: "wusdc",
@@ -129,6 +137,7 @@ var assetCoins = {
129
137
  sca: "sca"
130
138
  };
131
139
  var marketCoins = {
140
+ susdc: "susdc",
132
141
  sweth: "sweth",
133
142
  swbtc: "swbtc",
134
143
  swusdc: "swusdc",
@@ -143,6 +152,7 @@ var marketCoins = {
143
152
  ssca: "ssca"
144
153
  };
145
154
  var sCoins = {
155
+ susdc: "susdc",
146
156
  sweth: "sweth",
147
157
  swusdc: "swusdc",
148
158
  swusdt: "swusdt",
@@ -156,6 +166,7 @@ var sCoins = {
156
166
  swbtc: "swbtc"
157
167
  };
158
168
  var stakeMarketCoins = {
169
+ susdc: "susdc",
159
170
  sweth: "sweth",
160
171
  ssui: "ssui",
161
172
  swusdc: "swusdc",
@@ -173,7 +184,8 @@ var spoolRewardCoins = {
173
184
  scetus: "sui",
174
185
  safsui: "sui",
175
186
  shasui: "sui",
176
- svsui: "sui"
187
+ svsui: "sui",
188
+ susdc: "sui"
177
189
  };
178
190
  var borrowIncentiveRewardCoins = {
179
191
  sui: ["sui", "sca"],
@@ -186,6 +198,7 @@ var borrowIncentiveRewardCoins = {
186
198
  weth: ["sui"]
187
199
  };
188
200
  var coinIds = {
201
+ usdc: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7",
189
202
  sui: "0x0000000000000000000000000000000000000000000000000000000000000002",
190
203
  weth: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5",
191
204
  wbtc: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881",
@@ -211,6 +224,8 @@ var voloCoinIds = {
211
224
  vsui: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55"
212
225
  };
213
226
  var sCoinIds = {
227
+ susdc: "",
228
+ // TODO: sCoin contract
214
229
  ssui: "0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI",
215
230
  scetus: "0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS",
216
231
  ssca: "0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA",
@@ -2718,14 +2733,14 @@ var getObligations = async ({
2718
2733
  );
2719
2734
  return obligations;
2720
2735
  };
2721
- var getObligationLocked = async (cache, obligationId) => {
2722
- const obligationObjectResponse = await cache.queryGetObject(obligationId, {
2736
+ var getObligationLocked = async (cache, obligation) => {
2737
+ const obligationObjectResponse = typeof obligation === "string" ? (await cache.queryGetObject(obligation, {
2723
2738
  showContent: true
2724
- });
2739
+ }))?.data : obligation;
2725
2740
  let obligationLocked = false;
2726
- if (obligationObjectResponse?.data && obligationObjectResponse?.data?.content?.dataType === "moveObject" && "lock_key" in obligationObjectResponse.data.content.fields) {
2741
+ if (obligationObjectResponse && obligationObjectResponse?.content?.dataType === "moveObject" && "lock_key" in obligationObjectResponse.content.fields) {
2727
2742
  obligationLocked = Boolean(
2728
- obligationObjectResponse.data.content.fields.lock_key
2743
+ obligationObjectResponse.content.fields.lock_key
2729
2744
  );
2730
2745
  }
2731
2746
  return obligationLocked;
@@ -3020,6 +3035,7 @@ var getStakeAccounts = async ({
3020
3035
  }
3021
3036
  } while (hasNextPage);
3022
3037
  const stakeAccounts = {
3038
+ susdc: [],
3023
3039
  sweth: [],
3024
3040
  ssui: [],
3025
3041
  swusdc: [],
@@ -6332,7 +6348,7 @@ var ScallopIndexer = class {
6332
6348
  const response = await this.cache.queryClient.fetchQuery({
6333
6349
  queryKey: ["market"],
6334
6350
  queryFn: async () => {
6335
- return await this._requestClient.get(`/api/market`);
6351
+ return await this._requestClient.get(`/api/market/migrate`);
6336
6352
  }
6337
6353
  });
6338
6354
  if (response.status === 200) {
@@ -6395,7 +6411,7 @@ var ScallopIndexer = class {
6395
6411
  const response = await this.cache.queryClient.fetchQuery({
6396
6412
  queryKey: ["spools"],
6397
6413
  queryFn: async () => {
6398
- return await this._requestClient.get(`/api/spools`);
6414
+ return await this._requestClient.get(`/api/spools/migrate`);
6399
6415
  }
6400
6416
  });
6401
6417
  if (response.status === 200) {
@@ -6424,7 +6440,7 @@ var ScallopIndexer = class {
6424
6440
  const response = await this.cache.queryClient.fetchQuery({
6425
6441
  queryKey: ["borrowIncentivePools"],
6426
6442
  queryFn: async () => {
6427
- return await this._requestClient.get(`/api/borrowIncentivePools`);
6443
+ return await this._requestClient.get(`/api/borrowIncentivePools/migrate`);
6428
6444
  }
6429
6445
  });
6430
6446
  if (response.status === 200) {
@@ -7625,7 +7641,7 @@ var ScallopClient = class {
7625
7641
  await this.utils.mergeSimilarCoins(
7626
7642
  txBlock,
7627
7643
  coin,
7628
- this.utils.parseCoinType(this.utils.parseCoinName(stakeCoinName)),
7644
+ this.utils.parseCoinType(stakeCoinName),
7629
7645
  requireSender(txBlock)
7630
7646
  );
7631
7647
  txBlock.transferObjects([coin], sender);