Socket
Socket
Sign inDemoInstall

@solana/wallet-adapter-react

Package Overview
Dependencies
Maintainers
14
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/wallet-adapter-react - npm Package Compare versions

Comparing version 0.15.13 to 0.15.14

57

lib/cjs/WalletProvider.js

@@ -79,2 +79,3 @@ "use strict";

return prevWallets;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const { adapter } = prevWallets[index];

@@ -102,30 +103,2 @@ return [...prevWallets.slice(0, index), { adapter, readyState }, ...prevWallets.slice(index + 1)];

}, [name, wallets]);
// If autoConnect is enabled, try to connect when the adapter changes and is ready
(0, react_1.useEffect)(() => {
if (isConnecting.current ||
connecting ||
connected ||
!autoConnect ||
!adapter ||
!(readyState === wallet_adapter_base_1.WalletReadyState.Installed || readyState === wallet_adapter_base_1.WalletReadyState.Loadable))
return;
(function () {
return __awaiter(this, void 0, void 0, function* () {
isConnecting.current = true;
setConnecting(true);
try {
yield adapter.connect();
}
catch (error) {
// Clear the selected wallet
setName(null);
// Don't throw error, but handleError will still be called
}
finally {
setConnecting(false);
isConnecting.current = false;
}
});
})();
}, [isConnecting, connecting, connected, autoConnect, adapter, readyState]);
// If the window is closing or reloading, ignore disconnect and error events from the adapter

@@ -177,2 +150,30 @@ (0, react_1.useEffect)(() => {

}, [adapter]);
// If autoConnect is enabled, try to connect when the adapter changes and is ready
(0, react_1.useEffect)(() => {
if (isConnecting.current ||
connecting ||
connected ||
!autoConnect ||
!adapter ||
!(readyState === wallet_adapter_base_1.WalletReadyState.Installed || readyState === wallet_adapter_base_1.WalletReadyState.Loadable))
return;
(function () {
return __awaiter(this, void 0, void 0, function* () {
isConnecting.current = true;
setConnecting(true);
try {
yield adapter.connect();
}
catch (error) {
// Clear the selected wallet
setName(null);
// Don't throw error, but handleError will still be called
}
finally {
setConnecting(false);
isConnecting.current = false;
}
});
})();
}, [isConnecting, connecting, connected, autoConnect, adapter, readyState]);
// Connect the adapter to the wallet

@@ -179,0 +180,0 @@ const connect = (0, react_1.useCallback)(() => __awaiter(void 0, void 0, void 0, function* () {

{
"name": "@solana/wallet-adapter-react",
"version": "0.15.13",
"version": "0.15.14",
"author": "Solana Maintainers <maintainers@solana.foundation>",

@@ -50,3 +50,4 @@ "repository": "https://github.com/solana-labs/wallet-adapter",

"ts-jest": "^28.0.7"
}
},
"gitHead": "63cdb81401b4f9c0185edecc852fd3087f87616e"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc