Add WalletClient support to ExchangeOrderBuilder#20
Closed
carlos-poly wants to merge 1 commit intocarlos/02-26-switch_to_pnpmfrom
Closed
Add WalletClient support to ExchangeOrderBuilder#20carlos-poly wants to merge 1 commit intocarlos/02-26-switch_to_pnpmfrom
WalletClient support to ExchangeOrderBuilder#20carlos-poly wants to merge 1 commit intocarlos/02-26-switch_to_pnpmfrom
Conversation
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
55c535c to
c80569a
Compare
WalletClient support to ExchangeOrderBuilder
beb7ce5 to
5fcb9a7
Compare
c80569a to
136452e
Compare
Author
|
Tackled in Polymarket/clob-client#313 |
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
This PR adds viem
WalletClientsupport toExchangeOrderBuilderwhile preserving compatibility with existing ethers signers (Wallet | JsonRpcSigner).What changed
ExchangeOrderBuilderto use a local minimal signer abstraction.Wallet | JsonRpcSigner | WalletClientaccount.addressforWalletClientwalletClient.signTypedData(...)forWalletClientgetAddress()_signTypedData(...)walletClient.account is requiredaccount.addresspackage.json:3.1.0→3.2.0Why
Consumers can now use viem wallet clients directly without wrapping them in ethers-compatible signers.
Backward compatibility
Validation
pnpm testpassespnpm buildpassesNote
Medium Risk
Touches order signing/address validation logic; while behavior is intended to be backwards-compatible, adapter detection and typed-data signing differences could break integrations if signer objects don’t match expected shapes.
Overview
Adds viem
WalletClientsupport toExchangeOrderBuilder. The constructor now acceptsWallet | JsonRpcSigner | WalletClientand routes address resolution and EIP-712 signing through a minimalIExchangeSigneradapter (including a fail-fast error whenwalletClient.accountis missing).Updates tests and release version. Adds a new test suite covering
WalletClientorder building, deterministic typed-data signatures, and the missing-account error case, and bumpspackage.jsonfrom3.1.0to3.2.0.Written by Cursor Bugbot for commit 136452e. This will update automatically on new commits. Configure here.