@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.js
CHANGED
|
@@ -5117,41 +5117,37 @@ var generateCoreQuickMethod = ({
|
|
|
5117
5117
|
const sCoinName = builder.utils.parseSCoinName(poolCoinName);
|
|
5118
5118
|
if (!sCoinName)
|
|
5119
5119
|
throw new Error(`No sCoin for ${poolCoinName}`);
|
|
5120
|
-
const {
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
);
|
|
5120
|
+
const {
|
|
5121
|
+
leftCoin,
|
|
5122
|
+
takeCoin: sCoins2,
|
|
5123
|
+
totalAmount
|
|
5124
|
+
} = await builder.selectSCoin(txBlock, sCoinName, amount, sender);
|
|
5126
5125
|
txBlock.transferObjects([leftCoin], sender);
|
|
5127
|
-
const
|
|
5128
|
-
const txResult = txBlock.withdraw(marketCoin, poolCoinName);
|
|
5126
|
+
const marketCoins2 = txBlock.burnSCoin(sCoinName, sCoins2);
|
|
5129
5127
|
amount -= totalAmount;
|
|
5130
5128
|
try {
|
|
5131
5129
|
if (amount > 0) {
|
|
5132
|
-
const { leftCoin: leftCoin2, takeCoin:
|
|
5130
|
+
const { leftCoin: leftCoin2, takeCoin: walletMarketCoins } = await builder.selectMarketCoin(
|
|
5133
5131
|
txBlock,
|
|
5134
5132
|
marketCoinName,
|
|
5135
5133
|
amount,
|
|
5136
5134
|
sender
|
|
5137
5135
|
);
|
|
5138
5136
|
txBlock.transferObjects([leftCoin2], sender);
|
|
5139
|
-
txBlock.mergeCoins(
|
|
5140
|
-
txBlock.withdraw(takeCoin2, poolCoinName)
|
|
5141
|
-
]);
|
|
5137
|
+
txBlock.mergeCoins(marketCoins2, [walletMarketCoins]);
|
|
5142
5138
|
}
|
|
5143
5139
|
} catch (e) {
|
|
5144
5140
|
}
|
|
5145
|
-
return
|
|
5141
|
+
return txBlock.withdraw(marketCoins2, poolCoinName);
|
|
5146
5142
|
} catch (e) {
|
|
5147
|
-
const { leftCoin, takeCoin } = await builder.selectMarketCoin(
|
|
5143
|
+
const { leftCoin, takeCoin: walletMarketCoins } = await builder.selectMarketCoin(
|
|
5148
5144
|
txBlock,
|
|
5149
5145
|
marketCoinName,
|
|
5150
5146
|
amount,
|
|
5151
5147
|
sender
|
|
5152
5148
|
);
|
|
5153
5149
|
txBlock.transferObjects([leftCoin], sender);
|
|
5154
|
-
return txBlock.withdraw(
|
|
5150
|
+
return txBlock.withdraw(walletMarketCoins, poolCoinName);
|
|
5155
5151
|
}
|
|
5156
5152
|
},
|
|
5157
5153
|
borrowQuick: async (amount, poolCoinName, obligationId, obligationKey) => {
|