btc-wallet 0.5.49-beta → 0.5.51-beta
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 +14 -2
- package/dist/index.js.map +2 -2
- package/esm/index.js +14 -2
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -3725,7 +3725,7 @@ function getNetwork() {
|
|
3725
3725
|
});
|
3726
3726
|
}
|
3727
3727
|
function formatBtcAmount(amount) {
|
3728
|
-
return new import_big2.default(amount).div(__pow(10, 8)).
|
3728
|
+
return new import_big2.default(amount).div(__pow(10, 8)).toFixed();
|
3729
3729
|
}
|
3730
3730
|
function getBtcRpcUrl() {
|
3731
3731
|
return __async(this, null, function* () {
|
@@ -4334,6 +4334,18 @@ function calculateWithdraw(_0) {
|
|
4334
4334
|
errorMsg: "Not enough gas"
|
4335
4335
|
};
|
4336
4336
|
}
|
4337
|
+
const belowMinChangeAmount = newOutputs.some(
|
4338
|
+
(item) => item.value > 0 && item.value < Number(brgConfig.min_change_amount)
|
4339
|
+
);
|
4340
|
+
if (belowMinChangeAmount) {
|
4341
|
+
const minWithdrawAmount = new import_big2.default(brgConfig.min_withdraw_amount).plus(brgConfig.min_change_amount).plus(gasLimit).plus(withdrawFee).toNumber();
|
4342
|
+
return {
|
4343
|
+
gasFee: newFee,
|
4344
|
+
withdrawFee,
|
4345
|
+
isError: true,
|
4346
|
+
errorMsg: `Transaction amount too small. Minimum required: ${formatBtcAmount(minWithdrawAmount)} BTC`
|
4347
|
+
};
|
4348
|
+
}
|
4337
4349
|
const inputSum = newInputs.reduce((sum, cur) => sum + Number(cur.value), 0);
|
4338
4350
|
const outputSum = newOutputs.reduce((sum, cur) => sum + Number(cur.value), 0);
|
4339
4351
|
if (newFee + outputSum !== inputSum) {
|
@@ -5033,7 +5045,7 @@ function getGroup(state) {
|
|
5033
5045
|
|
5034
5046
|
// src/index.ts
|
5035
5047
|
var getVersion = () => {
|
5036
|
-
return "0.5.
|
5048
|
+
return "0.5.51-beta";
|
5037
5049
|
};
|
5038
5050
|
if (typeof window !== "undefined") {
|
5039
5051
|
window.__BTC_WALLET_VERSION = getVersion();
|