btc-wallet 0.5.94-beta → 0.5.95-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 CHANGED
@@ -3061,7 +3061,7 @@ function getWalletConfig(env) {
3061
3061
  });
3062
3062
  }
3063
3063
  var nearRpcUrls = {
3064
- mainnet: ["https://free.rpc.fastnear.com", "https://near.lava.build"],
3064
+ mainnet: ["https://near.lava.build", "https://free.rpc.fastnear.com"],
3065
3065
  testnet: ["https://rpc.testnet.near.org"]
3066
3066
  };
3067
3067
  var btcRpcUrls = {
@@ -4435,11 +4435,25 @@ function calculateWithdraw(_0) {
4435
4435
  }
4436
4436
  const userSatoshis = Number(satoshis);
4437
4437
  const maxBtcFee = Number(brgConfig.max_btc_gas_fee);
4438
- const { inputs, outputs, fee } = (0, import_coinselect.default)(
4438
+ let { inputs, outputs, fee } = (0, import_coinselect.default)(
4439
4439
  utxos,
4440
4440
  [{ address: btcAddress, value: userSatoshis }],
4441
4441
  Math.ceil(feeRate)
4442
4442
  );
4443
+ if (inputs && inputs.length > 10) {
4444
+ const filteredUtxos = utxos.filter((utxo) => utxo.value >= userSatoshis);
4445
+ console.log("filteredUtxos", filteredUtxos);
4446
+ if (filteredUtxos.length > 0) {
4447
+ const result = (0, import_coinselect.default)(
4448
+ filteredUtxos,
4449
+ [{ address: btcAddress, value: userSatoshis }],
4450
+ Math.ceil(feeRate)
4451
+ );
4452
+ inputs = result.inputs;
4453
+ outputs = result.outputs;
4454
+ fee = result.fee;
4455
+ }
4456
+ }
4443
4457
  const newInputs = inputs;
4444
4458
  let newOutputs = outputs;
4445
4459
  let newFee = fee;
@@ -5411,7 +5425,7 @@ function getGroup(state) {
5411
5425
 
5412
5426
  // src/index.ts
5413
5427
  var getVersion = () => {
5414
- return "0.5.94-beta";
5428
+ return "0.5.95-beta";
5415
5429
  };
5416
5430
  if (typeof window !== "undefined") {
5417
5431
  window.__BTC_WALLET_VERSION = getVersion();