@scallop-io/sui-scallop-sdk 0.46.44 → 0.46.46
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 +11 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/models/scallopClient.ts +13 -28
package/dist/index.js
CHANGED
|
@@ -7306,12 +7306,12 @@ var ScallopClient = class {
|
|
|
7306
7306
|
const txBlock = this.builder.createTxBlock();
|
|
7307
7307
|
const sender = walletAddress || this.walletAddress;
|
|
7308
7308
|
txBlock.setSender(sender);
|
|
7309
|
-
const
|
|
7309
|
+
const marketCoin = await txBlock.unstakeQuick(
|
|
7310
7310
|
amount,
|
|
7311
7311
|
stakeMarketCoinName,
|
|
7312
7312
|
stakeAccountId
|
|
7313
7313
|
);
|
|
7314
|
-
txBlock.transferObjects(
|
|
7314
|
+
txBlock.transferObjects([marketCoin], sender);
|
|
7315
7315
|
if (sign) {
|
|
7316
7316
|
return await this.suiKit.signAndSendTxn(
|
|
7317
7317
|
txBlock
|
|
@@ -7324,18 +7324,14 @@ var ScallopClient = class {
|
|
|
7324
7324
|
const txBlock = this.builder.createTxBlock();
|
|
7325
7325
|
const sender = walletAddress || this.walletAddress;
|
|
7326
7326
|
txBlock.setSender(sender);
|
|
7327
|
-
const
|
|
7327
|
+
const stakeMarketCoin = await txBlock.unstakeQuick(
|
|
7328
7328
|
amount,
|
|
7329
7329
|
stakeMarketCoinName,
|
|
7330
7330
|
stakeAccountId
|
|
7331
7331
|
);
|
|
7332
|
-
const
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
const coin = txBlock.withdraw(stakeMarketCoin, stakeCoinName);
|
|
7336
|
-
coins.push(coin);
|
|
7337
|
-
}
|
|
7338
|
-
txBlock.transferObjects(coins, sender);
|
|
7332
|
+
const stakeCoinName = this.utils.parseCoinName(stakeMarketCoinName);
|
|
7333
|
+
const coin = txBlock.withdraw(stakeMarketCoin, stakeCoinName);
|
|
7334
|
+
txBlock.transferObjects([coin], sender);
|
|
7339
7335
|
if (sign) {
|
|
7340
7336
|
return await this.suiKit.signAndSendTxn(
|
|
7341
7337
|
txBlock
|
|
@@ -7469,25 +7465,14 @@ var ScallopClient = class {
|
|
|
7469
7465
|
}
|
|
7470
7466
|
if (SUPPORT_SPOOLS.includes(sCoinName)) {
|
|
7471
7467
|
try {
|
|
7472
|
-
const
|
|
7468
|
+
const stakedMarketCoin = await txBlock.unstakeQuick(
|
|
7473
7469
|
Number.MAX_SAFE_INTEGER,
|
|
7474
7470
|
sCoinName
|
|
7475
7471
|
);
|
|
7476
|
-
if (
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
mergedStakedMarketCoin,
|
|
7481
|
-
stakedMarketCoins.slice(1)
|
|
7482
|
-
);
|
|
7483
|
-
}
|
|
7484
|
-
if (toDestroyMarketCoin) {
|
|
7485
|
-
txBlock.mergeCoins(toDestroyMarketCoin, [
|
|
7486
|
-
mergedStakedMarketCoin
|
|
7487
|
-
]);
|
|
7488
|
-
} else {
|
|
7489
|
-
toDestroyMarketCoin = mergedStakedMarketCoin;
|
|
7490
|
-
}
|
|
7472
|
+
if (toDestroyMarketCoin) {
|
|
7473
|
+
txBlock.mergeCoins(toDestroyMarketCoin, [stakedMarketCoin]);
|
|
7474
|
+
} else {
|
|
7475
|
+
toDestroyMarketCoin = stakedMarketCoin;
|
|
7491
7476
|
}
|
|
7492
7477
|
} catch (e) {
|
|
7493
7478
|
const errMsg = e.toString();
|