@scallop-io/sui-scallop-sdk 0.44.10 → 0.44.12
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 +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/models/scallopClient.ts +3 -3
- package/src/queries/coreQuery.ts +10 -0
- package/src/queries/spoolQuery.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -1548,6 +1548,8 @@ var getObligations = async (query, ownerAddress) => {
|
|
|
1548
1548
|
if (paginatedKeyObjectsResponse.hasNextPage && paginatedKeyObjectsResponse.nextCursor) {
|
|
1549
1549
|
hasNextPage = true;
|
|
1550
1550
|
nextCursor = paginatedKeyObjectsResponse.nextCursor;
|
|
1551
|
+
} else {
|
|
1552
|
+
hasNextPage = false;
|
|
1551
1553
|
}
|
|
1552
1554
|
} while (hasNextPage);
|
|
1553
1555
|
const keyObjectIds = keyObjectsResponse.map((ref) => ref?.data?.objectId).filter((id) => id !== void 0);
|
|
@@ -1612,6 +1614,8 @@ var getCoinAmounts = async (query, assetCoinNames, ownerAddress) => {
|
|
|
1612
1614
|
if (paginatedCoinObjectsResponse.hasNextPage && paginatedCoinObjectsResponse.nextCursor) {
|
|
1613
1615
|
hasNextPage = true;
|
|
1614
1616
|
nextCursor = paginatedCoinObjectsResponse.nextCursor;
|
|
1617
|
+
} else {
|
|
1618
|
+
hasNextPage = false;
|
|
1615
1619
|
}
|
|
1616
1620
|
} while (hasNextPage);
|
|
1617
1621
|
const coinAmounts = {};
|
|
@@ -1651,6 +1655,8 @@ var getCoinAmount = async (query, assetCoinName, ownerAddress) => {
|
|
|
1651
1655
|
if (paginatedCoinObjectsResponse.hasNextPage && paginatedCoinObjectsResponse.nextCursor) {
|
|
1652
1656
|
hasNextPage = true;
|
|
1653
1657
|
nextCursor = paginatedCoinObjectsResponse.nextCursor;
|
|
1658
|
+
} else {
|
|
1659
|
+
hasNextPage = false;
|
|
1654
1660
|
}
|
|
1655
1661
|
} while (hasNextPage);
|
|
1656
1662
|
let coinAmount = 0;
|
|
@@ -1694,6 +1700,8 @@ var getMarketCoinAmounts = async (query, marketCoinNames, ownerAddress) => {
|
|
|
1694
1700
|
if (paginatedMarketCoinObjectsResponse.hasNextPage && paginatedMarketCoinObjectsResponse.nextCursor) {
|
|
1695
1701
|
hasNextPage = true;
|
|
1696
1702
|
nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
|
|
1703
|
+
} else {
|
|
1704
|
+
hasNextPage = false;
|
|
1697
1705
|
}
|
|
1698
1706
|
} while (hasNextPage);
|
|
1699
1707
|
const marketCoinAmounts = {};
|
|
@@ -1735,6 +1743,8 @@ var getMarketCoinAmount = async (query, marketCoinName, ownerAddress) => {
|
|
|
1735
1743
|
if (paginatedMarketCoinObjectsResponse.hasNextPage && paginatedMarketCoinObjectsResponse.nextCursor) {
|
|
1736
1744
|
hasNextPage = true;
|
|
1737
1745
|
nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
|
|
1746
|
+
} else {
|
|
1747
|
+
hasNextPage = false;
|
|
1738
1748
|
}
|
|
1739
1749
|
} while (hasNextPage);
|
|
1740
1750
|
let marketCoinAmount = 0;
|
|
@@ -1926,6 +1936,8 @@ var getStakeAccounts = async (query, ownerAddress) => {
|
|
|
1926
1936
|
if (paginatedStakeObjectsResponse.hasNextPage && paginatedStakeObjectsResponse.nextCursor) {
|
|
1927
1937
|
hasNextPage = true;
|
|
1928
1938
|
nextCursor = paginatedStakeObjectsResponse.nextCursor;
|
|
1939
|
+
} else {
|
|
1940
|
+
hasNextPage = false;
|
|
1929
1941
|
}
|
|
1930
1942
|
} while (hasNextPage);
|
|
1931
1943
|
const stakeAccounts = {
|
|
@@ -4597,12 +4609,12 @@ var ScallopClient = class {
|
|
|
4597
4609
|
const sender = walletAddress || this.walletAddress;
|
|
4598
4610
|
txBlock.setSender(sender);
|
|
4599
4611
|
const obligations = await this.query.getObligations(sender);
|
|
4600
|
-
const
|
|
4601
|
-
if (
|
|
4612
|
+
const specificObligationId = obligationId || obligations?.[0]?.id;
|
|
4613
|
+
if (specificObligationId) {
|
|
4602
4614
|
await txBlock.addCollateralQuick(
|
|
4603
4615
|
amount,
|
|
4604
4616
|
collateralCoinName,
|
|
4605
|
-
|
|
4617
|
+
specificObligationId
|
|
4606
4618
|
);
|
|
4607
4619
|
} else {
|
|
4608
4620
|
const [obligation, obligationKey, hotPotato] = txBlock.openObligation();
|