Skip to content

Commit

Permalink
fix(react-wallet-v2): ensure clientId is logged and stored
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrem committed Jun 16, 2023
1 parent 9b09576 commit a7ab09b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wallets/react-wallet-v2/src/utils/WalletConnectUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export async function createSignClient(relayerRegionURL: string) {
icons: ['https://avatars.githubusercontent.com/u/37784886']
}
})

try {
const clientId = await signClient.core.crypto.getClientId()
console.log('WalletConnect ClientID: ', clientId)
localStorage.setItem('WALLETCONNECT_CLIENT_ID', clientId)
} catch (error) {
console.error('Failed to set WalletConnect clientId in localStorage: ', error)
}
}

export async function updateSignClientChainId(chainId: string, address: string) {
Expand Down

0 comments on commit a7ab09b

Please sign in to comment.