@scallop-io/sui-scallop-sdk 0.46.44 → 0.46.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "0.46.44",
3
+ "version": "0.46.45",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -1006,26 +1006,15 @@ export class ScallopClient {
1006
1006
  // check for staked market coin in spool
1007
1007
  if (SUPPORT_SPOOLS.includes(sCoinName as SupportStakeMarketCoins)) {
1008
1008
  try {
1009
- const stakedMarketCoins = await txBlock.unstakeQuick(
1009
+ const stakedMarketCoin = await txBlock.unstakeQuick(
1010
1010
  Number.MAX_SAFE_INTEGER,
1011
1011
  sCoinName as SupportStakeMarketCoins
1012
1012
  );
1013
- if (stakedMarketCoins.length > 0) {
1014
- const mergedStakedMarketCoin = stakedMarketCoins[0];
1015
- if (stakedMarketCoins.length > 1) {
1016
- txBlock.mergeCoins(
1017
- mergedStakedMarketCoin,
1018
- stakedMarketCoins.slice(1)
1019
- );
1020
- }
1021
- // merge with takeMarketCoin
1022
- if (toDestroyMarketCoin) {
1023
- txBlock.mergeCoins(toDestroyMarketCoin, [
1024
- mergedStakedMarketCoin,
1025
- ]);
1026
- } else {
1027
- toDestroyMarketCoin = mergedStakedMarketCoin;
1028
- }
1013
+ // merge with takeMarketCoin
1014
+ if (toDestroyMarketCoin) {
1015
+ txBlock.mergeCoins(toDestroyMarketCoin, [stakedMarketCoin]);
1016
+ } else {
1017
+ toDestroyMarketCoin = stakedMarketCoin;
1029
1018
  }
1030
1019
  } catch (e: any) {
1031
1020
  // ignore