Skip to content

Commit e10d754

Browse files
committed
fix: new EvmClientFactory breaking SafeSignatureVerifier
For some reason the Safe provider didn't play nicely with the EIP1193 client and threw the following errors: An unknown RPC error occurred.Details: request already sent (operation="fetchRequest.send", code=UNSUPPORTED_OPERATION, version=6.12.2)Version: [email protected] This patch just goes back to the easy init method of providing an RPC URL, to fix the issue.
1 parent b8ebf0a commit e10d754

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib/safe-signature-verification/SafeSignatureVerifier.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import Safe from "@safe-global/protocol-kit";
22
import { getAddress, hashTypedData, type HashTypedDataParameters } from "viem";
33

4-
import { Eip1193Provider } from "ethers";
54
import { EvmClientFactory } from "../../client/evmClient.js";
65

76
export default abstract class SafeSignatureVerifier {
87
protected chainId: number;
98
protected safeAddress: `0x${string}`;
10-
protected provider: Eip1193Provider;
9+
protected rpcUrl: string;
1110

1211
constructor(chainId: number, safeAddress: `0x${string}`) {
1312
const rpcUrl = EvmClientFactory.getFirstAvailableUrl(chainId);
@@ -17,7 +16,7 @@ export default abstract class SafeSignatureVerifier {
1716
}
1817
this.chainId = chainId;
1918
this.safeAddress = getAddress(safeAddress);
20-
this.provider = EvmClientFactory.createEip1193Client(chainId);
19+
this.rpcUrl = rpcUrl;
2120
}
2221

2322
hashTypedData() {
@@ -38,7 +37,7 @@ export default abstract class SafeSignatureVerifier {
3837

3938
async verify(signature: string): Promise<boolean> {
4039
const safe = await Safe.default.init({
41-
provider: this.provider,
40+
provider: this.rpcUrl,
4241
safeAddress: this.safeAddress,
4342
});
4443

0 commit comments

Comments
 (0)