Skip to content

Commit 25f5b15

Browse files
fix: remove safe fallback affecting MM smart accounts
1 parent 829b381 commit 25f5b15

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

libs/wallet/src/api/state/walletCapabilitiesAtom.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ export function resolveCapabilitiesForChain(
2828

2929
if (capabilitiesForChain) return capabilitiesForChain
3030

31-
// This fallback was initially here for Safe via WC, even thought it should return a value as shown in the example in
32-
// the long TSDoc comment below. `Object.values` should not be needed, as we are already parsing this properly with
33-
// `numberToHex` above:
34-
35-
return Object.values(capabilities)[0] || null
31+
logWallet.warn('Cannot resolve wallet capabilities for chain', { chainId, capabilities })
32+
return null
3633
}
3734

3835
/**
@@ -133,10 +130,11 @@ export const walletCapabilitiesAtom = atom(async (get): Promise<WalletCapabiliti
133130
timeoutMessage: `Wallet capabilities loading timed out after ${REQUEST_TIMEOUT_MS / 1000}s`,
134131
},
135132
)
133+
logWallet.warn('getCapabilities() failed, but wallet_getCapabilities returned capabilities', legacyCapabilities)
136134

137135
capabilities = resolveCapabilitiesForChain(legacyCapabilities, chainId)
138136

139-
logWallet.warn('getCapabilities() failed, but wallet_getCapabilities returned capabilities', legacyCapabilities)
137+
logWallet.info('Wallet capabilities for this chain:', capabilities)
140138
} catch (err: unknown) {
141139
const rpcError = normalizeError(err)
142140

0 commit comments

Comments
 (0)