@d13co/use-wallet 4.5.6 → 4.5.7
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.cjs +23 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +23 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8881,22 +8881,25 @@ var LiquidEvmBaseWallet = class extends BaseWallet {
|
|
|
8881
8881
|
var import_liquid_accounts_evm = require("liquid-accounts-evm");
|
|
8882
8882
|
var ICON13 = `data:image/svg+xml;base64,${btoa(`
|
|
8883
8883
|
<svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8884
|
-
<rect width="120" height="120" rx="24" fill="
|
|
8885
|
-
<
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
<
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
</linearGradient>
|
|
8894
|
-
</defs>
|
|
8884
|
+
<rect width="120" height="120" rx="24" fill="#627EEA"/>
|
|
8885
|
+
<svg x="30" y="11" width="60" height="98" viewBox="420.1 80.7 1079.8 1758.6">
|
|
8886
|
+
<path d="m959.8 80.7-539.7 895.6 539.7-245.3z" fill="white"/>
|
|
8887
|
+
<path d="m959.8 731-539.7 245.3 539.7 319.1z" fill="white" fill-opacity=".602"/>
|
|
8888
|
+
<path d="m1499.6 976.3-539.8-895.6v650.3z" fill="white" fill-opacity=".602"/>
|
|
8889
|
+
<path d="m959.8 1295.4 539.8-319.1-539.8-245.3z" fill="white" fill-opacity=".2"/>
|
|
8890
|
+
<path d="m420.1 1078.7 539.7 760.6v-441.7z" fill="white"/>
|
|
8891
|
+
<path d="m959.8 1397.6v441.7l540.1-760.6z" fill="white" fill-opacity=".602"/>
|
|
8892
|
+
</svg>
|
|
8895
8893
|
</svg>
|
|
8896
8894
|
`)}`;
|
|
8897
8895
|
var RainbowKitWallet = class _RainbowKitWallet extends LiquidEvmBaseWallet {
|
|
8898
8896
|
options;
|
|
8899
8897
|
_connecting = false;
|
|
8898
|
+
_disconnecting = false;
|
|
8899
|
+
/** True while disconnect() is running. Used by the bridge to prevent re-entrancy. */
|
|
8900
|
+
get isDisconnecting() {
|
|
8901
|
+
return this._disconnecting;
|
|
8902
|
+
}
|
|
8900
8903
|
constructor(params) {
|
|
8901
8904
|
super(params);
|
|
8902
8905
|
this.options = params.options || {};
|
|
@@ -9083,12 +9086,15 @@ var RainbowKitWallet = class _RainbowKitWallet extends LiquidEvmBaseWallet {
|
|
|
9083
9086
|
}
|
|
9084
9087
|
};
|
|
9085
9088
|
disconnect = async () => {
|
|
9089
|
+
this._disconnecting = true;
|
|
9086
9090
|
this.logger.info("Disconnecting...");
|
|
9087
9091
|
try {
|
|
9088
9092
|
const { disconnect: wagmiDisconnect } = await import("@wagmi/core");
|
|
9089
9093
|
await wagmiDisconnect(this.wagmiConfig);
|
|
9090
9094
|
} catch (error) {
|
|
9091
9095
|
this.logger.warn("wagmi disconnect error:", error.message);
|
|
9096
|
+
} finally {
|
|
9097
|
+
this._disconnecting = false;
|
|
9092
9098
|
}
|
|
9093
9099
|
this.evmAddressMap.clear();
|
|
9094
9100
|
this.updateMetadata(_RainbowKitWallet.defaultMetadata);
|
|
@@ -9115,8 +9121,8 @@ var RainbowKitWallet = class _RainbowKitWallet extends LiquidEvmBaseWallet {
|
|
|
9115
9121
|
if (account.isConnected && account.address) {
|
|
9116
9122
|
evmAddresses = account.addresses ? [...account.addresses] : [account.address];
|
|
9117
9123
|
connectorInfo = _RainbowKitWallet.extractConnectorInfo(account);
|
|
9118
|
-
} else {
|
|
9119
|
-
this.logger.warn("EVM wallet
|
|
9124
|
+
} else if (account.status === "reconnecting") {
|
|
9125
|
+
this.logger.warn("EVM wallet reconnecting, resuming from persisted state");
|
|
9120
9126
|
evmAddresses = walletState.accounts.map((a) => a.metadata?.evmAddress).filter(Boolean);
|
|
9121
9127
|
if (evmAddresses.length === 0) {
|
|
9122
9128
|
this.logger.warn("No persisted EVM addresses, cannot resume");
|
|
@@ -9124,6 +9130,10 @@ var RainbowKitWallet = class _RainbowKitWallet extends LiquidEvmBaseWallet {
|
|
|
9124
9130
|
return;
|
|
9125
9131
|
}
|
|
9126
9132
|
connectorInfo = {};
|
|
9133
|
+
} else {
|
|
9134
|
+
this.logger.warn("EVM wallet reconnect failed (status: disconnected), disconnecting");
|
|
9135
|
+
this.onDisconnect();
|
|
9136
|
+
return;
|
|
9127
9137
|
}
|
|
9128
9138
|
if (!connectorInfo.name && walletState.accounts.length > 0) {
|
|
9129
9139
|
const first = walletState.accounts[0];
|