btc-wallet 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -2358,12 +2358,17 @@ var import_bs58 = __toESM(require("bs58"), 1);
2358
2358
  var import_js_sha256 = require("js-sha256");
2359
2359
 
2360
2360
  // src/utils/initWalletButton.ts
2361
+ var walletUrlConfig = {
2362
+ dev: "https://wallet-dev.satoshibridge.top",
2363
+ testnet: "https://wallet-test.satoshibridge.top",
2364
+ mainnet: "https://wallet.satoshibridge.top"
2365
+ };
2361
2366
  function setupWalletButton(network, wallet, originalWallet) {
2362
2367
  if (document.getElementById("satoshi-wallet-button")) {
2363
2368
  return;
2364
2369
  }
2365
2370
  const iframe = createIframe({
2366
- iframeUrl: network === "testnet" ? "https://wallet-dev.satoshibridge.top" : "https://wallet.satoshibridge.top",
2371
+ iframeUrl: walletUrlConfig[network],
2367
2372
  iframeStyle: { width: "400px", height: "650px" }
2368
2373
  });
2369
2374
  iframe.addEventListener("mouseenter", () => {
@@ -2566,7 +2571,8 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
2566
2571
  signAndSendTransactions
2567
2572
  };
2568
2573
  const currentConfig = "isDev" in metadata && metadata.isDev ? config.dev : config[options.network.networkId];
2569
- initWalletButton(options.network.networkId, wallet);
2574
+ const walletNetwork = "isDev" in metadata && metadata.isDev ? "dev" : options.network.networkId;
2575
+ initWalletButton(walletNetwork, wallet);
2570
2576
  if (!inter) {
2571
2577
  inter = setInterval(() => __async(void 0, null, function* () {
2572
2578
  const btcContext = window.btcContext;
@@ -2576,7 +2582,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
2576
2582
  context.on("updatePublicKey", (btcPublicKey) => __async(void 0, null, function* () {
2577
2583
  const { nearTempAddress } = yield getNearAccountByBtcPublicKey(btcPublicKey);
2578
2584
  removeWalletButton();
2579
- initWalletButton(options.network.networkId, wallet);
2585
+ initWalletButton(walletNetwork, wallet);
2580
2586
  emitter.emit("accountsChanged", {
2581
2587
  accounts: [
2582
2588
  {
@@ -2633,7 +2639,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
2633
2639
  const accountId = state.getAccount();
2634
2640
  const publicKey = state.getPublicKey();
2635
2641
  const btcContext = window.btcContext;
2636
- initWalletButton(options.network.networkId, wallet);
2642
+ initWalletButton(walletNetwork, wallet);
2637
2643
  if (accountId && publicKey) {
2638
2644
  return [
2639
2645
  {
@@ -2895,7 +2901,7 @@ function pollTransactionStatuses(network, hashes) {
2895
2901
 
2896
2902
  // src/index.ts
2897
2903
  var getVersion = () => {
2898
- return "0.2.1";
2904
+ return "0.2.2";
2899
2905
  };
2900
2906
  if (typeof window !== "undefined") {
2901
2907
  window.__PARTICLE_BTC_CONNECT_VERSION = getVersion();