btc-wallet 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +11 -2
- package/dist/index.js.map +2 -2
- package/esm/index.js +11 -2
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -2232,6 +2232,7 @@ function InitBtcWalletSelectorContext() {
|
|
2232
2232
|
return null;
|
2233
2233
|
}
|
2234
2234
|
function useBtcWalletSelector() {
|
2235
|
+
console.log("useBtcWalletSelector");
|
2235
2236
|
const { openConnectModal, openConnectModalAsync, disconnect, requestDirectAccount } = useConnectModal();
|
2236
2237
|
const { accounts, sendBitcoin: sendBitcoin2, getPublicKey, provider, signMessage, connector } = useBTCProvider();
|
2237
2238
|
const publicKey = (0, import_react11.useRef)(null);
|
@@ -2295,7 +2296,10 @@ function useBtcWalletSelector() {
|
|
2295
2296
|
});
|
2296
2297
|
}),
|
2297
2298
|
logout: () => {
|
2298
|
-
|
2299
|
+
const accountId = accounts && accounts.length ? accounts[0] : null;
|
2300
|
+
if (!accountId)
|
2301
|
+
return;
|
2302
|
+
disconnect == null ? void 0 : disconnect();
|
2299
2303
|
context.emit("btcLogOut");
|
2300
2304
|
},
|
2301
2305
|
account: accounts && accounts.length ? accounts[0] : null,
|
@@ -2746,6 +2750,11 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
2746
2750
|
}
|
2747
2751
|
function signOut() {
|
2748
2752
|
return __async(this, null, function* () {
|
2753
|
+
const accountId = state.getAccount();
|
2754
|
+
const publicKey = state.getPublicKey();
|
2755
|
+
if (!(accountId && publicKey)) {
|
2756
|
+
return;
|
2757
|
+
}
|
2749
2758
|
const btcContext = window.btcContext;
|
2750
2759
|
if (metadata.syncLogOut) {
|
2751
2760
|
btcContext.logout();
|
@@ -3090,7 +3099,7 @@ function executeBurrowSupply(_0) {
|
|
3090
3099
|
|
3091
3100
|
// src/index.ts
|
3092
3101
|
var getVersion = () => {
|
3093
|
-
return "0.2.
|
3102
|
+
return "0.2.9";
|
3094
3103
|
};
|
3095
3104
|
if (typeof window !== "undefined") {
|
3096
3105
|
window.__PARTICLE_BTC_CONNECT_VERSION = getVersion();
|