-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Steps to reproduce:
- Set up a TypeScript project with the latest
@zerodev/sdk(just the package, no client-side required). - Write code to verify a signature with
verifyEIP6492Signature(example below).
Expected: code should compile.
Observed: TypeScript error when client is an OP stack chain client.
Package versions:
@zerodev/sdk:5.3.10viem:2.17.0(due to permissionless requiringviem < 2.18.0)
Triage:
It appears that viem expects a generic to be used to type the PublicClient instance correctly.
Repro code
import { verifyEIP6492Signature } from "@zerodev/sdk";
import { createPublicClient, http } from "viem";
import { arbitrum, base, mainnet, optimism } from "viem/chains";
const mainnetPublicClient = createPublicClient({
chain: mainnet,
transport: http(),
});
const arbPublicClient = createPublicClient({
chain: arbitrum,
transport: http(),
});
const optPublicClient = createPublicClient({
chain: optimism,
transport: http(),
});
const basePublicClient = createPublicClient({
chain: base,
transport: http(),
});
const SIGNATURE_PARAMS = {
signer: "0x3535353535353535353535353535353535353535",
hash: "0x35353535353535353535353535353535353535353535353535353535353535353535353535353535",
signature:
"0x35353535353535353535353535353535353535353535353535353535353535353535353535353535",
} as const;
void verifyEIP6492Signature({
...SIGNATURE_PARAMS,
client: mainnetPublicClient, // OK
});
void verifyEIP6492Signature({
...SIGNATURE_PARAMS,
client: arbPublicClient, // OK
});
void verifyEIP6492Signature({
...SIGNATURE_PARAMS,
client: optPublicClient, // ERR: not assignable to type
});
void verifyEIP6492Signature({
...SIGNATURE_PARAMS,
client: basePublicClient, // ERR: not assignable to type
});Metadata
Metadata
Assignees
Labels
No labels