@scallop-io/sui-scallop-sdk 0.46.61 → 0.47.0-alpha.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.
@@ -70,6 +70,7 @@ export const getSpools = async (
70
70
  spools[spool.marketCoinName] = spool;
71
71
  }
72
72
 
73
+ // console.log(spools);
73
74
  return spools;
74
75
  }
75
76
 
@@ -270,10 +271,10 @@ export const getStakeAccounts = async (
270
271
  } while (hasNextPage);
271
272
 
272
273
  const stakeAccounts: StakeAccounts = {
273
- seth: [],
274
+ sweth: [],
274
275
  ssui: [],
275
- susdc: [],
276
- susdt: [],
276
+ swusdc: [],
277
+ swusdt: [],
277
278
  scetus: [],
278
279
  safsui: [],
279
280
  shasui: [],
@@ -314,8 +315,8 @@ export const getStakeAccounts = async (
314
315
  const index = Number(fields.index);
315
316
  const points = Number(fields.points);
316
317
  const totalPoints = Number(fields.total_points);
317
- if (normalizeStructTag(type) === stakeMarketCoinTypes.seth) {
318
- stakeAccounts.seth.push({
318
+ if (normalizeStructTag(type) === stakeMarketCoinTypes.sweth) {
319
+ stakeAccounts.sweth.push({
319
320
  id,
320
321
  type: normalizeStructTag(type),
321
322
  stakePoolId,
@@ -336,8 +337,8 @@ export const getStakeAccounts = async (
336
337
  points,
337
338
  totalPoints,
338
339
  });
339
- } else if (normalizeStructTag(type) === stakeMarketCoinTypes.susdc) {
340
- stakeAccounts.susdc.push({
340
+ } else if (normalizeStructTag(type) === stakeMarketCoinTypes.swusdc) {
341
+ stakeAccounts.swusdc.push({
341
342
  id,
342
343
  type: normalizeStructTag(type),
343
344
  stakePoolId,
@@ -347,8 +348,8 @@ export const getStakeAccounts = async (
347
348
  points,
348
349
  totalPoints,
349
350
  });
350
- } else if (normalizeStructTag(type) === stakeMarketCoinTypes.susdt) {
351
- stakeAccounts.susdt.push({
351
+ } else if (normalizeStructTag(type) === stakeMarketCoinTypes.swusdt) {
352
+ stakeAccounts.swusdt.push({
352
353
  id,
353
354
  type: normalizeStructTag(type),
354
355
  stakePoolId,
@@ -58,7 +58,7 @@ type PickFromUnion<T, K extends string> = K extends T ? K : never;
58
58
  export type WormholeCoinIds = {
59
59
  [key in PickFromUnion<
60
60
  SupportAssetCoins,
61
- 'eth' | 'btc' | 'usdc' | 'usdt' | 'apt' | 'sol'
61
+ 'weth' | 'wbtc' | 'wusdc' | 'wusdt' | 'wapt' | 'wsol'
62
62
  >]: string;
63
63
  };
64
64
 
@@ -129,7 +129,7 @@ export type MarketPool = {
129
129
  coinWrappedType: CoinWrappedType;
130
130
  coinDecimal: number;
131
131
  coinPrice: number;
132
- supplyLimit: string;
132
+ maxSupplyCoin: number;
133
133
  } & Required<
134
134
  Pick<
135
135
  ParsedMarketPoolData,
@@ -448,7 +448,7 @@ export const parseOriginBorrowIncentivePoolData = (
448
448
  };
449
449
 
450
450
  export const calculateBorrowIncentivePoolPointData = (
451
- parsedBorrowIncentivePoolData: ParsedBorrowIncentivePoolData,
451
+ // parsedBorrowIncentivePoolData: ParsedBorrowIncentivePoolData,
452
452
  parsedBorrowIncentivePoolPointData: ParsedBorrowIncentivePoolPointData,
453
453
  rewardCoinPrice: number,
454
454
  rewardCoinDecimal: number,
package/src/utils/util.ts CHANGED
@@ -34,6 +34,10 @@ export const isMarketCoin = (
34
34
  };
35
35
 
36
36
  export const parseAssetSymbol = (coinName: SupportAssetCoins): string => {
37
+ const isWormhole = coinName.charAt(0) === 'w';
38
+ if (isWormhole) {
39
+ return `w${coinName.slice(1).toUpperCase()}`;
40
+ }
37
41
  switch (coinName) {
38
42
  case 'afsui':
39
43
  return 'afSUI';