Skip to content

Commit

Permalink
Fix: always add safe methods
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Oct 23, 2023
1 parent 14b2a5b commit 52a1814
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/walletconnect/WalletConnectWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type Web3WalletType from '@walletconnect/web3wallet'
import type { Web3WalletTypes } from '@walletconnect/web3wallet'
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 { EIP155, SAFE_COMPATIBLE_METHODS, SAFE_WALLET_METADATA } from './constants'
Expand Down Expand Up @@ -94,7 +95,7 @@ class WalletConnectWallet {
const eip155Accounts = eip155ChainIds.map((eip155ChainId) => `${eip155ChainId}:${safeAddress}`)

// Don't include optionalNamespaces methods/events
const methods = proposal.params.requiredNamespaces[EIP155]?.methods ?? SAFE_COMPATIBLE_METHODS
const methods = uniq((proposal.params.requiredNamespaces[EIP155]?.methods || []).concat(SAFE_COMPATIBLE_METHODS))
const events = proposal.params.requiredNamespaces[EIP155]?.events || []

return buildApprovedNamespaces({
Expand Down

0 comments on commit 52a1814

Please sign in to comment.