btc-wallet 0.3.19 → 0.3.20

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -3917,10 +3917,12 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
3917
3917
  return;
3918
3918
  const btcNetwork = yield btcContext.getNetwork();
3919
3919
  console.log("btcNetwork:", btcNetwork, network);
3920
- if (network === "mainnet" && btcNetwork !== "livenet") {
3921
- yield btcContext.switchNetwork("livenet");
3922
- } else if (network === "testnet" && btcNetwork !== "testnet") {
3923
- yield btcContext.switchNetwork("testnet");
3920
+ const networkMap = {
3921
+ livenet: ["mainnet"],
3922
+ testnet: ["testnet", "dev"]
3923
+ };
3924
+ if (!networkMap[btcNetwork].includes(network)) {
3925
+ yield btcContext.switchNetwork(btcNetwork === "livenet" ? "testnet" : "livenet");
3924
3926
  }
3925
3927
  });
3926
3928
  }
@@ -3965,7 +3967,7 @@ function setupBTCWallet({
3965
3967
 
3966
3968
  // src/index.ts
3967
3969
  var getVersion = () => {
3968
- return "0.3.19";
3970
+ return "0.3.20";
3969
3971
  };
3970
3972
  if (typeof window !== "undefined") {
3971
3973
  window.__BTC_WALLET_VERSION = getVersion();