Skip to content

Commit

Permalink
workaround for safe kit builds (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
frontendphil authored Nov 13, 2024
1 parent 37a10ae commit b9429dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions extension/src/panel/integrations/safe/kits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ export const initSafeProtocolKit = async (
chainId: ChainId,
safeAddress: string
) => {
// @ts-expect-error protocol-kit is only available as a CJS module. That doesn't play super nice with us being ESM.
if (Safe.default) {
// @ts-expect-error protocol-kit is only available as a CJS module. That doesn't play super nice with us being ESM.
return await Safe.default.init({
// we must pass the RPC endpoint as a string. If we pass an EIP1193 provider, Safe will send eth_requestAccounts calls (which will fail)
provider: RPC[chainId],
safeAddress,
})
}

return await Safe.init({
// we must pass the RPC endpoint as a string. If we pass an EIP1193 provider, Safe will send eth_requestAccounts calls (which will fail)
provider: RPC[chainId],
Expand Down

0 comments on commit b9429dd

Please sign in to comment.