btc-wallet 0.5.64-beta → 0.5.66-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.
- package/dist/index.js +7 -8
- package/dist/index.js.map +3 -3
- package/esm/index.js +7 -8
- package/esm/index.js.map +3 -3
- package/package.json +1 -1
package/esm/index.js
CHANGED
@@ -2501,6 +2501,8 @@ var ConnectProvider = ({
|
|
2501
2501
|
}, [connector, requestAccount]);
|
2502
2502
|
useEffect5(() => {
|
2503
2503
|
const onAccountChange = (accounts2) => {
|
2504
|
+
if (!accounts2.length)
|
2505
|
+
return;
|
2504
2506
|
setAccounts(accounts2);
|
2505
2507
|
};
|
2506
2508
|
connector == null ? void 0 : connector.on("accountsChanged", onAccountChange);
|
@@ -2812,16 +2814,13 @@ function useBtcWalletSelector() {
|
|
2812
2814
|
const connectWallet = (useModal = false) => __async(this, null, function* () {
|
2813
2815
|
if (connectModalOpen)
|
2814
2816
|
return null;
|
2815
|
-
const account = accounts == null ? void 0 : accounts[0];
|
2816
|
-
if (account)
|
2817
|
-
return account;
|
2818
2817
|
try {
|
2819
2818
|
if (useModal) {
|
2820
2819
|
openConnectModal == null ? void 0 : openConnectModal();
|
2821
2820
|
} else {
|
2822
2821
|
yield requestDirectAccount(connectorRef.current);
|
2823
2822
|
}
|
2824
|
-
const
|
2823
|
+
const account = yield retryOperation(
|
2825
2824
|
() => window.btcContext.account,
|
2826
2825
|
(res) => !!res,
|
2827
2826
|
{
|
@@ -2829,7 +2828,7 @@ function useBtcWalletSelector() {
|
|
2829
2828
|
delayMs: 1e3
|
2830
2829
|
}
|
2831
2830
|
);
|
2832
|
-
return
|
2831
|
+
return account || null;
|
2833
2832
|
} catch (error) {
|
2834
2833
|
console.error("btcLoginError", error);
|
2835
2834
|
context.emit("btcLoginError");
|
@@ -5155,9 +5154,9 @@ function setupWalletSelectorModal(selector, options) {
|
|
5155
5154
|
return modal;
|
5156
5155
|
}
|
5157
5156
|
var CHAINS = [
|
5158
|
-
{ id: "
|
5157
|
+
{ id: "near", name: "Near", description: "Near Account" },
|
5159
5158
|
{ id: "eth", name: "Ethereum", description: "EVM address as Near Account" },
|
5160
|
-
{ id: "
|
5159
|
+
{ id: "btc", name: "Bitcoin", description: "MPC Mapping" }
|
5161
5160
|
];
|
5162
5161
|
function openChainModal(group) {
|
5163
5162
|
return __async(this, null, function* () {
|
@@ -5211,7 +5210,7 @@ function getGroup(state) {
|
|
5211
5210
|
|
5212
5211
|
// src/index.ts
|
5213
5212
|
var getVersion = () => {
|
5214
|
-
return "0.5.
|
5213
|
+
return "0.5.66-beta";
|
5215
5214
|
};
|
5216
5215
|
if (typeof window !== "undefined") {
|
5217
5216
|
window.__BTC_WALLET_VERSION = getVersion();
|