opensquare-network / subsquare

https://www.subsquare.io
5 stars 5 forks source link

refactor `injectedWeb3[walletname]` code #4296

Closed 2nthony closed 1 week ago

2nthony commented 1 week ago

4295

refactor these code into a useInjectedWeb3Extension hook. if nova ALWAYS return polkadot-js

const extension = injectedWeb3?.[account.meta?.source];
      if (!extension) {
        return;
      }

      const wallet = await extension.enable("subsquare");