Conversation
Replace ethers.js with viem throughout the SDK for full type safety: - All contract interactions use typed ABIs via parseAbi (zero `as any`) - signPermit uses walletClient.signTypedData instead of raw private keys - Remove @metamask/eth-sig-util dependency - Properly typed QuoteExecutionDetails, PermitSignature, and all public APIs Modernize the build and dev toolchain: - Replace tsdx with zile (ESM-only, nodenext module resolution) - Replace Jest with vitest - Replace ESLint + Prettier with oxlint + oxfmt - Split tsconfig: tsconfig.json (IDE + typecheck) / tsconfig.build.json (zile) - CI now runs typecheck, lint, format:check, build, and test Add MIGRATION.md documenting all breaking API changes for consumers. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces ethers.js with viem and modernizes the entire SDK toolchain. This is a breaking change for consumers.
viem migration
parseAbi— zeroas anycasts in the codebasesignPermitnow useswalletClient.signTypedData()instead of raw private key signing via@metamask/eth-sig-util— works with any wallet type (browser, hardware, etc.)QuoteExecutionDetails,PermitSignature,CrosschainQuoteExecutionDetails, and all public API functions@ethersproject/*,@ethereumjs/util,@metamask/eth-sig-utilToolchain modernization
tsdx→zile(ESM-only,nodenextmodule resolution, TypeScript 5.5)vitestoxlintoxfmttsconfig.json(IDE + typecheck, includes tests) andtsconfig.build.json(zile build, src only)CI
Docs
README.mdupdated with current API examples and dev commandsMIGRATION.mdadded with full before/after guide for consumers migrating from ethersBreaking changes
BigNumberishBigIntish(string | number | bigint)Signer/WalletWalletClientStaticJsonRpcProviderPublicClientTransactionreturnHash(tx hash)signPermit(publicClient, privateKey, ...)signPermit(publicClient, walletClient, ...)getWrappedAssetMethod(name, ...)getWrappedAssetMethod('deposit' | 'withdraw', ...)method(...methodArgs)method()(args pre-bound)Test plan
yarn typecheckpasses (src + tests)yarn lintpasses (1 pre-existing warning: duplicate enum value)yarn format:checkpassesyarn buildsucceedsyarn test— 10/10 tests passMade with Cursor