You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Two docs examples don't match the current SDK (TypeScript tutorial, ERC-20 gas page) #101
Hi, I was working through the docs and found two code examples that don't work with the
current packages. Both are small fixes. I checked them against @zerodev/sdk 5.5.12, @zerodev/ecdsa-validator 5.4.9 and viem 2.58.0.
ERC-20 gas page: chain is a number, then used as a chain object
File: docs/pages/smart-accounts/pay-gas-with-erc20s.mdx, line 38
// use whatever chain you wantconstchain=mainnet.id
chain is then passed to createZeroDevPaymasterClient({ chain, ... }), which expects a
chain object, and read as chain.id on lines 50, 64, 79 and 113
(gasTokenAddresses[chain.id]['USDC']). Since chain is already the number 1, chain.id is undefined, so the token lookup crashes:
TypeError: Cannot read properties of undefined (reading 'USDC')
Suggested fix:
// use whatever chain you wantconstchain=mainnet
With that one change, the lookup returns the USDC address as expected.
TypeScript tutorial: kernelVersion is missing
File: docs/pages/get-started/sdks/client-side/typescript.mdx, lines 83 and 100
I ran both examples against the latest published packages, before and after each fix.
The first needs no network. For the second, I confirmed the error above and that the fix
gets past it and creates the validator; I didn't run the full account creation against a
live network.
I found similar mismatches on some other pages (a few partner sign-in guides and the
smart routing address pages). Happy to share the list or open a PR for these two if
that's useful.
Activity