@depay/web3-wallets-evm 15.4.0 → 15.4.2

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.
@@ -60268,11 +60268,26 @@ const getPlainInstance = ()=>{
60268
60268
  return currentPlainInstance
60269
60269
  };
60270
60270
 
60271
- const isConnected = async()=>{
60272
- let connector = getPlainInstance();
60273
- let accounts;
60274
- try { accounts = await connector.sendCustomRequest({ method: 'eth_accounts' }); } catch (error) {}
60275
- return accounts && accounts.length
60271
+ const isConnected = ()=>{
60272
+ return new Promise(async(resolve, reject)=>{
60273
+ setTimeout(()=>{ resolve(false); }, 3000);
60274
+
60275
+ if(!localStorage['walletconnect'] || JSON.parse(localStorage['walletconnect']).handshakeTopic.length == 0) {
60276
+ return resolve(false)
60277
+ }
60278
+
60279
+ let connector = getPlainInstance();
60280
+ let accounts;
60281
+
60282
+ try {
60283
+ let blockNumber = await connector.sendCustomRequest({ method: 'eth_blockNumber' });
60284
+ if(blockNumber) {
60285
+ accounts = await connector.sendCustomRequest({ method: 'eth_accounts' });
60286
+ }
60287
+ } catch (error) { resolve(false); }
60288
+
60289
+ return resolve(accounts && accounts.length)
60290
+ })
60276
60291
  };
60277
60292
 
60278
60293
  const getConnectedInstance$1 = async()=>{
package/dist/esm/index.js CHANGED
@@ -831,11 +831,26 @@ const getPlainInstance = ()=>{
831
831
  return currentPlainInstance
832
832
  };
833
833
 
834
- const isConnected = async()=>{
835
- let connector = getPlainInstance();
836
- let accounts;
837
- try { accounts = await connector.sendCustomRequest({ method: 'eth_accounts' }); } catch (error) {}
838
- return accounts && accounts.length
834
+ const isConnected = ()=>{
835
+ return new Promise(async(resolve, reject)=>{
836
+ setTimeout(()=>{ resolve(false); }, 3000);
837
+
838
+ if(!localStorage['walletconnect'] || JSON.parse(localStorage['walletconnect']).handshakeTopic.length == 0) {
839
+ return resolve(false)
840
+ }
841
+
842
+ let connector = getPlainInstance();
843
+ let accounts;
844
+
845
+ try {
846
+ let blockNumber = await connector.sendCustomRequest({ method: 'eth_blockNumber' });
847
+ if(blockNumber) {
848
+ accounts = await connector.sendCustomRequest({ method: 'eth_accounts' });
849
+ }
850
+ } catch (error) { resolve(false); }
851
+
852
+ return resolve(accounts && accounts.length)
853
+ })
839
854
  };
840
855
 
841
856
  const getConnectedInstance$1 = async()=>{
@@ -60268,11 +60268,26 @@ const getPlainInstance = ()=>{
60268
60268
  return currentPlainInstance
60269
60269
  };
60270
60270
 
60271
- const isConnected = async()=>{
60272
- let connector = getPlainInstance();
60273
- let accounts;
60274
- try { accounts = await connector.sendCustomRequest({ method: 'eth_accounts' }); } catch (error) {}
60275
- return accounts && accounts.length
60271
+ const isConnected = ()=>{
60272
+ return new Promise(async(resolve, reject)=>{
60273
+ setTimeout(()=>{ resolve(false); }, 3000);
60274
+
60275
+ if(!localStorage['walletconnect'] || JSON.parse(localStorage['walletconnect']).handshakeTopic.length == 0) {
60276
+ return resolve(false)
60277
+ }
60278
+
60279
+ let connector = getPlainInstance();
60280
+ let accounts;
60281
+
60282
+ try {
60283
+ let blockNumber = await connector.sendCustomRequest({ method: 'eth_blockNumber' });
60284
+ if(blockNumber) {
60285
+ accounts = await connector.sendCustomRequest({ method: 'eth_accounts' });
60286
+ }
60287
+ } catch (error) { resolve(false); }
60288
+
60289
+ return resolve(accounts && accounts.length)
60290
+ })
60276
60291
  };
60277
60292
 
60278
60293
  const getConnectedInstance$1 = async()=>{
@@ -60272,11 +60272,26 @@
60272
60272
  return currentPlainInstance
60273
60273
  };
60274
60274
 
60275
- const isConnected = async()=>{
60276
- let connector = getPlainInstance();
60277
- let accounts;
60278
- try { accounts = await connector.sendCustomRequest({ method: 'eth_accounts' }); } catch (error) {}
60279
- return accounts && accounts.length
60275
+ const isConnected = ()=>{
60276
+ return new Promise(async(resolve, reject)=>{
60277
+ setTimeout(()=>{ resolve(false); }, 3000);
60278
+
60279
+ if(!localStorage['walletconnect'] || JSON.parse(localStorage['walletconnect']).handshakeTopic.length == 0) {
60280
+ return resolve(false)
60281
+ }
60282
+
60283
+ let connector = getPlainInstance();
60284
+ let accounts;
60285
+
60286
+ try {
60287
+ let blockNumber = await connector.sendCustomRequest({ method: 'eth_blockNumber' });
60288
+ if(blockNumber) {
60289
+ accounts = await connector.sendCustomRequest({ method: 'eth_accounts' });
60290
+ }
60291
+ } catch (error) { resolve(false); }
60292
+
60293
+ return resolve(accounts && accounts.length)
60294
+ })
60280
60295
  };
60281
60296
 
60282
60297
  const getConnectedInstance$1 = async()=>{
package/dist/umd/index.js CHANGED
@@ -834,11 +834,26 @@
834
834
  return currentPlainInstance
835
835
  };
836
836
 
837
- const isConnected = async()=>{
838
- let connector = getPlainInstance();
839
- let accounts;
840
- try { accounts = await connector.sendCustomRequest({ method: 'eth_accounts' }); } catch (error) {}
841
- return accounts && accounts.length
837
+ const isConnected = ()=>{
838
+ return new Promise(async(resolve, reject)=>{
839
+ setTimeout(()=>{ resolve(false); }, 3000);
840
+
841
+ if(!localStorage['walletconnect'] || JSON.parse(localStorage['walletconnect']).handshakeTopic.length == 0) {
842
+ return resolve(false)
843
+ }
844
+
845
+ let connector = getPlainInstance();
846
+ let accounts;
847
+
848
+ try {
849
+ let blockNumber = await connector.sendCustomRequest({ method: 'eth_blockNumber' });
850
+ if(blockNumber) {
851
+ accounts = await connector.sendCustomRequest({ method: 'eth_accounts' });
852
+ }
853
+ } catch (error) { resolve(false); }
854
+
855
+ return resolve(accounts && accounts.length)
856
+ })
842
857
  };
843
858
 
844
859
  const getConnectedInstance$1 = async()=>{
@@ -60272,11 +60272,26 @@
60272
60272
  return currentPlainInstance
60273
60273
  };
60274
60274
 
60275
- const isConnected = async()=>{
60276
- let connector = getPlainInstance();
60277
- let accounts;
60278
- try { accounts = await connector.sendCustomRequest({ method: 'eth_accounts' }); } catch (error) {}
60279
- return accounts && accounts.length
60275
+ const isConnected = ()=>{
60276
+ return new Promise(async(resolve, reject)=>{
60277
+ setTimeout(()=>{ resolve(false); }, 3000);
60278
+
60279
+ if(!localStorage['walletconnect'] || JSON.parse(localStorage['walletconnect']).handshakeTopic.length == 0) {
60280
+ return resolve(false)
60281
+ }
60282
+
60283
+ let connector = getPlainInstance();
60284
+ let accounts;
60285
+
60286
+ try {
60287
+ let blockNumber = await connector.sendCustomRequest({ method: 'eth_blockNumber' });
60288
+ if(blockNumber) {
60289
+ accounts = await connector.sendCustomRequest({ method: 'eth_accounts' });
60290
+ }
60291
+ } catch (error) { resolve(false); }
60292
+
60293
+ return resolve(accounts && accounts.length)
60294
+ })
60280
60295
  };
60281
60296
 
60282
60297
  const getConnectedInstance$1 = async()=>{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/web3-wallets-evm",
3
3
  "moduleName": "Web3Wallets",
4
- "version": "15.4.0",
4
+ "version": "15.4.2",
5
5
  "description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.",
6
6
  "main": "dist/umd/index.evm.js",
7
7
  "module": "dist/esm/index.evm.js",