@scallop-io/sui-scallop-sdk 0.46.58 → 0.46.60
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 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/builders/coreBuilder.ts +23 -26
package/dist/index.mjs
CHANGED
|
@@ -5046,41 +5046,37 @@ var generateCoreQuickMethod = ({
|
|
|
5046
5046
|
const sCoinName = builder.utils.parseSCoinName(poolCoinName);
|
|
5047
5047
|
if (!sCoinName)
|
|
5048
5048
|
throw new Error(`No sCoin for ${poolCoinName}`);
|
|
5049
|
-
const {
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
);
|
|
5049
|
+
const {
|
|
5050
|
+
leftCoin,
|
|
5051
|
+
takeCoin: sCoins2,
|
|
5052
|
+
totalAmount
|
|
5053
|
+
} = await builder.selectSCoin(txBlock, sCoinName, amount, sender);
|
|
5055
5054
|
txBlock.transferObjects([leftCoin], sender);
|
|
5056
|
-
const
|
|
5057
|
-
const txResult = txBlock.withdraw(marketCoin, poolCoinName);
|
|
5055
|
+
const marketCoins2 = txBlock.burnSCoin(sCoinName, sCoins2);
|
|
5058
5056
|
amount -= totalAmount;
|
|
5059
5057
|
try {
|
|
5060
5058
|
if (amount > 0) {
|
|
5061
|
-
const { leftCoin: leftCoin2, takeCoin:
|
|
5059
|
+
const { leftCoin: leftCoin2, takeCoin: walletMarketCoins } = await builder.selectMarketCoin(
|
|
5062
5060
|
txBlock,
|
|
5063
5061
|
marketCoinName,
|
|
5064
5062
|
amount,
|
|
5065
5063
|
sender
|
|
5066
5064
|
);
|
|
5067
5065
|
txBlock.transferObjects([leftCoin2], sender);
|
|
5068
|
-
txBlock.mergeCoins(
|
|
5069
|
-
txBlock.withdraw(takeCoin2, poolCoinName)
|
|
5070
|
-
]);
|
|
5066
|
+
txBlock.mergeCoins(marketCoins2, [walletMarketCoins]);
|
|
5071
5067
|
}
|
|
5072
5068
|
} catch (e) {
|
|
5073
5069
|
}
|
|
5074
|
-
return
|
|
5070
|
+
return txBlock.withdraw(marketCoins2, poolCoinName);
|
|
5075
5071
|
} catch (e) {
|
|
5076
|
-
const { leftCoin, takeCoin } = await builder.selectMarketCoin(
|
|
5072
|
+
const { leftCoin, takeCoin: walletMarketCoins } = await builder.selectMarketCoin(
|
|
5077
5073
|
txBlock,
|
|
5078
5074
|
marketCoinName,
|
|
5079
5075
|
amount,
|
|
5080
5076
|
sender
|
|
5081
5077
|
);
|
|
5082
5078
|
txBlock.transferObjects([leftCoin], sender);
|
|
5083
|
-
return txBlock.withdraw(
|
|
5079
|
+
return txBlock.withdraw(walletMarketCoins, poolCoinName);
|
|
5084
5080
|
}
|
|
5085
5081
|
},
|
|
5086
5082
|
borrowQuick: async (amount, poolCoinName, obligationId, obligationKey) => {
|