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/esm/index.js
CHANGED
@@ -3655,7 +3655,7 @@ function getNetwork() {
|
|
3655
3655
|
});
|
3656
3656
|
}
|
3657
3657
|
function formatBtcAmount(amount) {
|
3658
|
-
return new Big2(amount).div(__pow(10, 8)).
|
3658
|
+
return new Big2(amount).div(__pow(10, 8)).toFixed();
|
3659
3659
|
}
|
3660
3660
|
function getBtcRpcUrl() {
|
3661
3661
|
return __async(this, null, function* () {
|
@@ -4264,6 +4264,18 @@ function calculateWithdraw(_0) {
|
|
4264
4264
|
errorMsg: "Not enough gas"
|
4265
4265
|
};
|
4266
4266
|
}
|
4267
|
+
const belowMinChangeAmount = newOutputs.some(
|
4268
|
+
(item) => item.value > 0 && item.value < Number(brgConfig.min_change_amount)
|
4269
|
+
);
|
4270
|
+
if (belowMinChangeAmount) {
|
4271
|
+
const minWithdrawAmount = new Big2(brgConfig.min_withdraw_amount).plus(brgConfig.min_change_amount).plus(gasLimit).plus(withdrawFee).toNumber();
|
4272
|
+
return {
|
4273
|
+
gasFee: newFee,
|
4274
|
+
withdrawFee,
|
4275
|
+
isError: true,
|
4276
|
+
errorMsg: `Transaction amount too small. Minimum required: ${formatBtcAmount(minWithdrawAmount)} BTC`
|
4277
|
+
};
|
4278
|
+
}
|
4267
4279
|
const inputSum = newInputs.reduce((sum, cur) => sum + Number(cur.value), 0);
|
4268
4280
|
const outputSum = newOutputs.reduce((sum, cur) => sum + Number(cur.value), 0);
|
4269
4281
|
if (newFee + outputSum !== inputSum) {
|
@@ -4965,7 +4977,7 @@ function getGroup(state) {
|
|
4965
4977
|
|
4966
4978
|
// src/index.ts
|
4967
4979
|
var getVersion = () => {
|
4968
|
-
return "0.5.
|
4980
|
+
return "0.5.51-beta";
|
4969
4981
|
};
|
4970
4982
|
if (typeof window !== "undefined") {
|
4971
4983
|
window.__BTC_WALLET_VERSION = getVersion();
|