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/esm/index.js CHANGED
@@ -2317,12 +2317,17 @@ import bs58 from "bs58";
2317
2317
  import { sha256 } from "js-sha256";
2318
2318
 
2319
2319
  // src/utils/initWalletButton.ts
2320
+ var walletUrlConfig = {
2321
+ dev: "https://wallet-dev.satoshibridge.top",
2322
+ testnet: "https://wallet-test.satoshibridge.top",
2323
+ mainnet: "https://wallet.satoshibridge.top"
2324
+ };
2320
2325
  function setupWalletButton(network, wallet, originalWallet) {
2321
2326
  if (document.getElementById("satoshi-wallet-button")) {
2322
2327
  return;
2323
2328
  }
2324
2329
  const iframe = createIframe({
2325
- iframeUrl: network === "testnet" ? "https://wallet-dev.satoshibridge.top" : "https://wallet.satoshibridge.top",
2330
+ iframeUrl: walletUrlConfig[network],
2326
2331
  iframeStyle: { width: "400px", height: "650px" }
2327
2332
  });
2328
2333
  iframe.addEventListener("mouseenter", () => {
@@ -2525,7 +2530,8 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
2525
2530
  signAndSendTransactions
2526
2531
  };
2527
2532
  const currentConfig = "isDev" in metadata && metadata.isDev ? config.dev : config[options.network.networkId];
2528
- initWalletButton(options.network.networkId, wallet);
2533
+ const walletNetwork = "isDev" in metadata && metadata.isDev ? "dev" : options.network.networkId;
2534
+ initWalletButton(walletNetwork, wallet);
2529
2535
  if (!inter) {
2530
2536
  inter = setInterval(() => __async(void 0, null, function* () {
2531
2537
  const btcContext = window.btcContext;
@@ -2535,7 +2541,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
2535
2541
  context.on("updatePublicKey", (btcPublicKey) => __async(void 0, null, function* () {
2536
2542
  const { nearTempAddress } = yield getNearAccountByBtcPublicKey(btcPublicKey);
2537
2543
  removeWalletButton();
2538
- initWalletButton(options.network.networkId, wallet);
2544
+ initWalletButton(walletNetwork, wallet);
2539
2545
  emitter.emit("accountsChanged", {
2540
2546
  accounts: [
2541
2547
  {
@@ -2592,7 +2598,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
2592
2598
  const accountId = state.getAccount();
2593
2599
  const publicKey = state.getPublicKey();
2594
2600
  const btcContext = window.btcContext;
2595
- initWalletButton(options.network.networkId, wallet);
2601
+ initWalletButton(walletNetwork, wallet);
2596
2602
  if (accountId && publicKey) {
2597
2603
  return [
2598
2604
  {
@@ -2854,7 +2860,7 @@ function pollTransactionStatuses(network, hashes) {
2854
2860
 
2855
2861
  // src/index.ts
2856
2862
  var getVersion = () => {
2857
- return "0.2.1";
2863
+ return "0.2.2";
2858
2864
  };
2859
2865
  if (typeof window !== "undefined") {
2860
2866
  window.__PARTICLE_BTC_CONNECT_VERSION = getVersion();