btc-wallet 0.5.41-beta → 0.5.42-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/README.md +1 -5
- package/dist/core/btcUtils.d.ts +1 -5
- package/dist/index.js +3 -7
- package/dist/index.js.map +2 -2
- package/esm/index.js +3 -7
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/esm/index.js
CHANGED
@@ -3874,7 +3874,7 @@ function calculateGasFee(account, amount, feeRate) {
|
|
3874
3874
|
return fee;
|
3875
3875
|
});
|
3876
3876
|
}
|
3877
|
-
function getBtcBalance(account
|
3877
|
+
function getBtcBalance(account) {
|
3878
3878
|
return __async(this, null, function* () {
|
3879
3879
|
if (!account) {
|
3880
3880
|
const res = yield retryOperation(getBtcProvider, (res2) => !!res2.account);
|
@@ -3889,11 +3889,7 @@ function getBtcBalance(account, option) {
|
|
3889
3889
|
const rawBalance = (utxos == null ? void 0 : utxos.reduce((acc, cur) => acc + cur.value, 0)) || 0;
|
3890
3890
|
const balance = rawBalance / __pow(10, btcDecimals);
|
3891
3891
|
const estimatedFee = yield calculateGasFee(account, rawBalance);
|
3892
|
-
|
3893
|
-
if (option == null ? void 0 : option.csna) {
|
3894
|
-
const { protocolFee, repayAmount } = yield getDepositAmount(rawBalance.toString(), option);
|
3895
|
-
availableRawBalance = new Big2(availableRawBalance).minus(protocolFee).minus(repayAmount).toFixed(0);
|
3896
|
-
}
|
3892
|
+
const availableRawBalance = (rawBalance - estimatedFee).toFixed(0);
|
3897
3893
|
const availableBalance = new Big2(availableRawBalance).div(__pow(10, btcDecimals)).round(btcDecimals, Big2.roundDown).toNumber();
|
3898
3894
|
return {
|
3899
3895
|
rawBalance,
|
@@ -4854,7 +4850,7 @@ function getGroup(state) {
|
|
4854
4850
|
|
4855
4851
|
// src/index.ts
|
4856
4852
|
var getVersion = () => {
|
4857
|
-
return "0.5.
|
4853
|
+
return "0.5.42-beta";
|
4858
4854
|
};
|
4859
4855
|
if (typeof window !== "undefined") {
|
4860
4856
|
window.__BTC_WALLET_VERSION = getVersion();
|