@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.
- package/dist/constants/common.d.ts +6 -6
- package/dist/index.js +150 -140
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +150 -140
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopQuery.d.ts +35 -35
- package/dist/models/scallopUtils.d.ts +1 -1
- package/dist/queries/borrowIncentiveQuery.d.ts +6 -6
- package/dist/queries/coreQuery.d.ts +12 -12
- package/dist/queries/portfolioQuery.d.ts +6 -6
- package/dist/queries/sCoinQuery.d.ts +1 -1
- package/dist/queries/spoolQuery.d.ts +3 -3
- package/dist/types/constant/enum.d.ts +1 -1
- package/dist/types/query/core.d.ts +1 -1
- package/dist/utils/query.d.ts +1 -1
- package/package.json +1 -1
- package/src/builders/oracle.ts +4 -0
- package/src/constants/common.ts +25 -24
- package/src/constants/enum.ts +70 -67
- package/src/constants/flashloan.ts +6 -6
- package/src/constants/testAddress.ts +12 -12
- package/src/models/scallopAddress.ts +12 -12
- package/src/models/scallopUtils.ts +26 -26
- package/src/queries/borrowIncentiveQuery.ts +1 -1
- package/src/queries/coreQuery.ts +17 -8
- package/src/queries/spoolQuery.ts +10 -9
- package/src/types/constant/enum.ts +1 -1
- package/src/types/query/core.ts +1 -1
- package/src/utils/query.ts +1 -1
- package/src/utils/util.ts +4 -0
|
@@ -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
|
-
|
|
274
|
+
sweth: [],
|
|
274
275
|
ssui: [],
|
|
275
|
-
|
|
276
|
-
|
|
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.
|
|
318
|
-
stakeAccounts.
|
|
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.
|
|
340
|
-
stakeAccounts.
|
|
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.
|
|
351
|
-
stakeAccounts.
|
|
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
|
-
'
|
|
61
|
+
'weth' | 'wbtc' | 'wusdc' | 'wusdt' | 'wapt' | 'wsol'
|
|
62
62
|
>]: string;
|
|
63
63
|
};
|
|
64
64
|
|
package/src/types/query/core.ts
CHANGED
package/src/utils/query.ts
CHANGED
|
@@ -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';
|