@scallop-io/sui-scallop-sdk 0.44.9 → 0.44.11
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.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types/query/portfolio.d.ts +3 -0
- package/package.json +2 -2
- package/src/queries/coreQuery.ts +10 -0
- package/src/queries/portfolioQuery.ts +9 -5
- package/src/queries/spoolQuery.ts +2 -0
- package/src/types/query/portfolio.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scallop-io/sui-scallop-sdk",
|
|
3
|
-
"version": "0.44.
|
|
3
|
+
"version": "0.44.11",
|
|
4
4
|
"description": "Typescript sdk for interacting with Scallop contract on SUI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sui",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@noble/hashes": "^1.3.2",
|
|
45
45
|
"@pythnetwork/price-service-client": "^1.8.2",
|
|
46
46
|
"@pythnetwork/pyth-sui-js": "^1.2.4",
|
|
47
|
-
"@scallop-io/sui-kit": "^0.44.
|
|
47
|
+
"@scallop-io/sui-kit": "^0.44.2",
|
|
48
48
|
"@scure/bip39": "^1.2.1",
|
|
49
49
|
"axios": "^1.6.0",
|
|
50
50
|
"bignumber.js": "^9.1.2",
|
package/src/queries/coreQuery.ts
CHANGED
|
@@ -704,6 +704,8 @@ export const getObligations = async (
|
|
|
704
704
|
) {
|
|
705
705
|
hasNextPage = true;
|
|
706
706
|
nextCursor = paginatedKeyObjectsResponse.nextCursor;
|
|
707
|
+
} else {
|
|
708
|
+
hasNextPage = false;
|
|
707
709
|
}
|
|
708
710
|
} while (hasNextPage);
|
|
709
711
|
|
|
@@ -820,6 +822,8 @@ export const getCoinAmounts = async (
|
|
|
820
822
|
) {
|
|
821
823
|
hasNextPage = true;
|
|
822
824
|
nextCursor = paginatedCoinObjectsResponse.nextCursor;
|
|
825
|
+
} else {
|
|
826
|
+
hasNextPage = false;
|
|
823
827
|
}
|
|
824
828
|
} while (hasNextPage);
|
|
825
829
|
|
|
@@ -884,6 +888,8 @@ export const getCoinAmount = async (
|
|
|
884
888
|
) {
|
|
885
889
|
hasNextPage = true;
|
|
886
890
|
nextCursor = paginatedCoinObjectsResponse.nextCursor;
|
|
891
|
+
} else {
|
|
892
|
+
hasNextPage = false;
|
|
887
893
|
}
|
|
888
894
|
} while (hasNextPage);
|
|
889
895
|
|
|
@@ -952,6 +958,8 @@ export const getMarketCoinAmounts = async (
|
|
|
952
958
|
) {
|
|
953
959
|
hasNextPage = true;
|
|
954
960
|
nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
|
|
961
|
+
} else {
|
|
962
|
+
hasNextPage = false;
|
|
955
963
|
}
|
|
956
964
|
} while (hasNextPage);
|
|
957
965
|
|
|
@@ -1018,6 +1026,8 @@ export const getMarketCoinAmount = async (
|
|
|
1018
1026
|
) {
|
|
1019
1027
|
hasNextPage = true;
|
|
1020
1028
|
nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
|
|
1029
|
+
} else {
|
|
1030
|
+
hasNextPage = false;
|
|
1021
1031
|
}
|
|
1022
1032
|
} while (hasNextPage);
|
|
1023
1033
|
|
|
@@ -673,12 +673,16 @@ export const getTotalValueLocked = async (
|
|
|
673
673
|
let borrowValue = BigNumber(0);
|
|
674
674
|
|
|
675
675
|
if (indexer) {
|
|
676
|
-
const
|
|
677
|
-
|
|
678
|
-
supplyValue:
|
|
679
|
-
|
|
680
|
-
|
|
676
|
+
const tvlIndexer = await query.indexer.getTotalValueLocked();
|
|
677
|
+
const tvl: TotalValueLocked = {
|
|
678
|
+
supplyValue: tvlIndexer.supplyValue,
|
|
679
|
+
supplyValueChangeRatio: tvlIndexer.supplyValueChangeRatio,
|
|
680
|
+
borrowValue: tvlIndexer.borrowValue,
|
|
681
|
+
borrowValueChangeRatio: tvlIndexer.borrowValueChangeRatio,
|
|
682
|
+
totalValue: tvlIndexer.totalValue,
|
|
683
|
+
totalValueChangeRatio: tvlIndexer.totalValueChangeRatio,
|
|
681
684
|
};
|
|
685
|
+
return tvl;
|
|
682
686
|
}
|
|
683
687
|
|
|
684
688
|
for (const pool of Object.values(market.pools)) {
|