@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/dist/index.js
CHANGED
|
@@ -1612,6 +1612,8 @@ var getObligations = async (query, ownerAddress) => {
|
|
|
1612
1612
|
if (paginatedKeyObjectsResponse.hasNextPage && paginatedKeyObjectsResponse.nextCursor) {
|
|
1613
1613
|
hasNextPage = true;
|
|
1614
1614
|
nextCursor = paginatedKeyObjectsResponse.nextCursor;
|
|
1615
|
+
} else {
|
|
1616
|
+
hasNextPage = false;
|
|
1615
1617
|
}
|
|
1616
1618
|
} while (hasNextPage);
|
|
1617
1619
|
const keyObjectIds = keyObjectsResponse.map((ref) => ref?.data?.objectId).filter((id) => id !== void 0);
|
|
@@ -1676,6 +1678,8 @@ var getCoinAmounts = async (query, assetCoinNames, ownerAddress) => {
|
|
|
1676
1678
|
if (paginatedCoinObjectsResponse.hasNextPage && paginatedCoinObjectsResponse.nextCursor) {
|
|
1677
1679
|
hasNextPage = true;
|
|
1678
1680
|
nextCursor = paginatedCoinObjectsResponse.nextCursor;
|
|
1681
|
+
} else {
|
|
1682
|
+
hasNextPage = false;
|
|
1679
1683
|
}
|
|
1680
1684
|
} while (hasNextPage);
|
|
1681
1685
|
const coinAmounts = {};
|
|
@@ -1715,6 +1719,8 @@ var getCoinAmount = async (query, assetCoinName, ownerAddress) => {
|
|
|
1715
1719
|
if (paginatedCoinObjectsResponse.hasNextPage && paginatedCoinObjectsResponse.nextCursor) {
|
|
1716
1720
|
hasNextPage = true;
|
|
1717
1721
|
nextCursor = paginatedCoinObjectsResponse.nextCursor;
|
|
1722
|
+
} else {
|
|
1723
|
+
hasNextPage = false;
|
|
1718
1724
|
}
|
|
1719
1725
|
} while (hasNextPage);
|
|
1720
1726
|
let coinAmount = 0;
|
|
@@ -1758,6 +1764,8 @@ var getMarketCoinAmounts = async (query, marketCoinNames, ownerAddress) => {
|
|
|
1758
1764
|
if (paginatedMarketCoinObjectsResponse.hasNextPage && paginatedMarketCoinObjectsResponse.nextCursor) {
|
|
1759
1765
|
hasNextPage = true;
|
|
1760
1766
|
nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
|
|
1767
|
+
} else {
|
|
1768
|
+
hasNextPage = false;
|
|
1761
1769
|
}
|
|
1762
1770
|
} while (hasNextPage);
|
|
1763
1771
|
const marketCoinAmounts = {};
|
|
@@ -1799,6 +1807,8 @@ var getMarketCoinAmount = async (query, marketCoinName, ownerAddress) => {
|
|
|
1799
1807
|
if (paginatedMarketCoinObjectsResponse.hasNextPage && paginatedMarketCoinObjectsResponse.nextCursor) {
|
|
1800
1808
|
hasNextPage = true;
|
|
1801
1809
|
nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
|
|
1810
|
+
} else {
|
|
1811
|
+
hasNextPage = false;
|
|
1802
1812
|
}
|
|
1803
1813
|
} while (hasNextPage);
|
|
1804
1814
|
let marketCoinAmount = 0;
|
|
@@ -1990,6 +2000,8 @@ var getStakeAccounts = async (query, ownerAddress) => {
|
|
|
1990
2000
|
if (paginatedStakeObjectsResponse.hasNextPage && paginatedStakeObjectsResponse.nextCursor) {
|
|
1991
2001
|
hasNextPage = true;
|
|
1992
2002
|
nextCursor = paginatedStakeObjectsResponse.nextCursor;
|
|
2003
|
+
} else {
|
|
2004
|
+
hasNextPage = false;
|
|
1993
2005
|
}
|
|
1994
2006
|
} while (hasNextPage);
|
|
1995
2007
|
const stakeAccounts = {
|
|
@@ -2740,12 +2752,16 @@ var getTotalValueLocked = async (query, indexer = false) => {
|
|
|
2740
2752
|
let supplyValue = (0, import_bignumber3.default)(0);
|
|
2741
2753
|
let borrowValue = (0, import_bignumber3.default)(0);
|
|
2742
2754
|
if (indexer) {
|
|
2743
|
-
const
|
|
2744
|
-
|
|
2745
|
-
supplyValue:
|
|
2746
|
-
|
|
2747
|
-
|
|
2755
|
+
const tvlIndexer = await query.indexer.getTotalValueLocked();
|
|
2756
|
+
const tvl2 = {
|
|
2757
|
+
supplyValue: tvlIndexer.supplyValue,
|
|
2758
|
+
supplyValueChangeRatio: tvlIndexer.supplyValueChangeRatio,
|
|
2759
|
+
borrowValue: tvlIndexer.borrowValue,
|
|
2760
|
+
borrowValueChangeRatio: tvlIndexer.borrowValueChangeRatio,
|
|
2761
|
+
totalValue: tvlIndexer.totalValue,
|
|
2762
|
+
totalValueChangeRatio: tvlIndexer.totalValueChangeRatio
|
|
2748
2763
|
};
|
|
2764
|
+
return tvl2;
|
|
2749
2765
|
}
|
|
2750
2766
|
for (const pool of Object.values(market.pools)) {
|
|
2751
2767
|
supplyValue = supplyValue.plus(
|