Skip to content

Commit

Permalink
Fix: separate WalletConnect storage
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Nov 20, 2023
1 parent 0b7d378 commit 200a948
Show file tree
Hide file tree
Showing 4 changed files with 506 additions and 368 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "2.3.2",
"@web3-onboard/trezor": "^2.4.2",
"@web3-onboard/walletconnect": "^2.4.7",
"@web3-onboard/walletconnect": "^2.5.0",
"@web3auth/mpc-core-kit": "^1.1.3",
"blo": "^1.1.1",
"bn.js": "^5.2.1",
Expand Down
3 changes: 2 additions & 1 deletion src/services/walletconnect/WalletConnectWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { SessionTypes } from '@walletconnect/types'
import { type JsonRpcResponse } from '@walletconnect/jsonrpc-utils'
import uniq from 'lodash/uniq'

import { IS_PRODUCTION, WC_PROJECT_ID } from '@/config/constants'
import { IS_PRODUCTION, LS_NAMESPACE, WC_PROJECT_ID } from '@/config/constants'
import { EIP155, SAFE_COMPATIBLE_METHODS, SAFE_WALLET_METADATA } from './constants'
import { invariant } from '@/utils/helpers'
import { getEip155ChainId, stripEip155Prefix } from './utils'
Expand Down Expand Up @@ -36,6 +36,7 @@ class WalletConnectWallet {
const core = new Core({
projectId: WC_PROJECT_ID,
logger: IS_PRODUCTION ? undefined : 'debug',
customStoragePrefix: LS_NAMESPACE,
})

const web3wallet = await Web3Wallet.init({
Expand Down
4 changes: 2 additions & 2 deletions src/services/walletconnect/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const SAFE_COMPATIBLE_METHODS = [

export const SAFE_WALLET_METADATA = {
name: 'Safe{Wallet}',
description: 'The most trusted platform to manage digital assets on Ethereum',
url: 'https://app.safe.global',
icons: ['https://app.safe.global/favicons/mstile-150x150.png', 'https://app.safe.global/favicons/logo_120x120.png'],
description: 'Smart contract wallet for Ethereum',
icons: ['https://app.safe.global/images/logo-round.svg'],
}

export const EIP155 = 'eip155' as const
Expand Down
Loading

0 comments on commit 200a948

Please sign in to comment.