btc-wallet 0.5.69-beta → 0.5.71-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.
@@ -15,4 +15,9 @@ export interface WalletSelectorModalOptions extends _ModalOptions {
15
15
  mobileButtonSize?: string;
16
16
  }
17
17
  export type WalletSelectorModal = _WalletSelectorModal;
18
+ declare global {
19
+ interface Window {
20
+ enableCustomWalletSelectorModal: boolean;
21
+ }
22
+ }
18
23
  export declare function setupWalletSelectorModal(selector: WalletSelector, options: WalletSelectorModalOptions): _WalletSelectorModal;
package/dist/index.js CHANGED
@@ -2775,12 +2775,12 @@ function BtcWalletSelectorContextProvider({
2775
2775
  }) {
2776
2776
  const [isProcessing, setIsProcessing] = (0, import_react11.useState)(false);
2777
2777
  const connectors = [
2778
- new UnisatConnector(),
2779
- new XverseConnector(),
2780
2778
  new OKXConnector(),
2781
2779
  new BitgetConnector(),
2782
- new MagicEdenConnector(),
2783
- new BybitConnector()
2780
+ new BybitConnector(),
2781
+ new XverseConnector(),
2782
+ new UnisatConnector(),
2783
+ new MagicEdenConnector()
2784
2784
  ];
2785
2785
  const walletSelectorContextValue = (0, import_react11.useMemo)(() => {
2786
2786
  const simpleFn = {};
@@ -4914,13 +4914,15 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
4914
4914
  const btcPublicKey = yield btcContext.getPublicKey();
4915
4915
  if (btcPublicKey) {
4916
4916
  yield getNearAccountByBtcPublicKey(btcPublicKey);
4917
- removeWalletButton();
4918
- setupWalletButton({
4919
- env,
4920
- nearWallet: wallet,
4921
- btcWallet: btcContext,
4922
- walletUrl: metadata.walletUrl
4923
- });
4917
+ if (!window.enableCustomWalletSelectorModal) {
4918
+ removeWalletButton();
4919
+ setupWalletButton({
4920
+ env,
4921
+ nearWallet: wallet,
4922
+ btcWallet: btcContext,
4923
+ walletUrl: metadata.walletUrl
4924
+ });
4925
+ }
4924
4926
  }
4925
4927
  } else {
4926
4928
  connectionUpdateTimeout = setTimeout(() => {
@@ -5013,7 +5015,9 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
5013
5015
  }
5014
5016
  state_default.clear();
5015
5017
  window.localStorage.removeItem("near-wallet-selector:selectedWalletId");
5016
- removeWalletButton();
5018
+ if (!window.enableCustomWalletSelectorModal) {
5019
+ removeWalletButton();
5020
+ }
5017
5021
  });
5018
5022
  }
5019
5023
  function isSignedIn() {
@@ -5182,14 +5186,15 @@ function setupWalletSelectorModal(selector, options) {
5182
5186
  const group = getGroup(state);
5183
5187
  subscription = selector.store.observable.subscribe((state2) => {
5184
5188
  const walletId = state2.selectedWalletId;
5189
+ window.enableCustomWalletSelectorModal = true;
5185
5190
  console.log("setupWalletSelectorModal walletId", walletId);
5186
- if (!walletId)
5187
- removeWalletButton();
5188
- if (showWalletUIForNearAccount && walletId !== "btc-wallet") {
5191
+ removeWalletButton();
5192
+ if (walletId === "btc-wallet" || showWalletUIForNearAccount) {
5189
5193
  selector.wallet().then((wallet) => {
5190
5194
  setupWalletButton({
5191
5195
  env,
5192
5196
  nearWallet: wallet,
5197
+ btcWallet: walletId === "btc-wallet" ? window.btcContext : void 0,
5193
5198
  walletUrl,
5194
5199
  draggable,
5195
5200
  initialPosition,
@@ -5287,7 +5292,7 @@ function getGroup(state) {
5287
5292
 
5288
5293
  // src/index.ts
5289
5294
  var getVersion = () => {
5290
- return "0.5.69-beta";
5295
+ return "0.5.71-beta";
5291
5296
  };
5292
5297
  if (typeof window !== "undefined") {
5293
5298
  window.__BTC_WALLET_VERSION = getVersion();