btc-wallet 0.2.7 → 0.2.9

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/esm/index.js CHANGED
@@ -2131,6 +2131,7 @@ function BtcWalletSelectorContextProvider({
2131
2131
  autoConnect = false
2132
2132
  }) {
2133
2133
  const [isProcessing, setIsProcessing] = useState8(false);
2134
+ const connectors = [new UnisatConnector(), new XverseConnector()];
2134
2135
  const walletSelectorContextValue = useMemo6(() => {
2135
2136
  const simpleFn = {};
2136
2137
  return {
@@ -2170,7 +2171,7 @@ function BtcWalletSelectorContextProvider({
2170
2171
  }
2171
2172
  },
2172
2173
  autoConnect: false,
2173
- connectors: [new UnisatConnector()],
2174
+ connectors,
2174
2175
  children: [
2175
2176
  children,
2176
2177
  isProcessing && /* @__PURE__ */ jsx12(
@@ -2196,6 +2197,7 @@ function InitBtcWalletSelectorContext() {
2196
2197
  return null;
2197
2198
  }
2198
2199
  function useBtcWalletSelector() {
2200
+ console.log("useBtcWalletSelector");
2199
2201
  const { openConnectModal, openConnectModalAsync, disconnect, requestDirectAccount } = useConnectModal();
2200
2202
  const { accounts, sendBitcoin: sendBitcoin2, getPublicKey, provider, signMessage, connector } = useBTCProvider();
2201
2203
  const publicKey = useRef(null);
@@ -2259,7 +2261,10 @@ function useBtcWalletSelector() {
2259
2261
  });
2260
2262
  }),
2261
2263
  logout: () => {
2262
- disconnect && disconnect();
2264
+ const accountId = accounts && accounts.length ? accounts[0] : null;
2265
+ if (!accountId)
2266
+ return;
2267
+ disconnect == null ? void 0 : disconnect();
2263
2268
  context.emit("btcLogOut");
2264
2269
  },
2265
2270
  account: accounts && accounts.length ? accounts[0] : null,
@@ -2710,6 +2715,11 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
2710
2715
  }
2711
2716
  function signOut() {
2712
2717
  return __async(this, null, function* () {
2718
+ const accountId = state.getAccount();
2719
+ const publicKey = state.getPublicKey();
2720
+ if (!(accountId && publicKey)) {
2721
+ return;
2722
+ }
2713
2723
  const btcContext = window.btcContext;
2714
2724
  if (metadata.syncLogOut) {
2715
2725
  btcContext.logout();
@@ -3054,7 +3064,7 @@ function executeBurrowSupply(_0) {
3054
3064
 
3055
3065
  // src/index.ts
3056
3066
  var getVersion = () => {
3057
- return "0.2.7";
3067
+ return "0.2.9";
3058
3068
  };
3059
3069
  if (typeof window !== "undefined") {
3060
3070
  window.__PARTICLE_BTC_CONNECT_VERSION = getVersion();