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
New wallets need token approvals before trading, and the SDK could not check or set them. PositionClient adds get_trading_approvals_state and setup_trading_approvals, which reads the 17 required approvals on chain and grants only the missing ones (Safe: one MultiSend; EOA: one tx each). It also adds approve_erc20, approve_erc1155_for_all, transfer_erc20, and approvals_example.
Verification
Commands run and their actual results:
ctest --test-dir build -LE live: 50/50 passed
scripts/quality.py origin/main: passed
Checks not run and the reason (or none):
macOS and Debug builds: left to CI
Compatibility and evidence
Public API, binary compatibility, or release implications (or none):
Additive API. PolymarketContracts gains perps_deposit_contract, so consumers must rebuild.
For protocol changes: official docs links and the Python SDK commit or fixture source.
Thanks Bill, looks good overall. I checked this against the docs and Python SDK, and the focused tests passed locally too.
One thing to fix before merging: setup_trading_approvals() loses the earlier transaction hashes if the final EOA approval fails while waiting for its receipt.
I reproduced it with two missing approvals: the first mined successfully, then the second reverted. The method threw TransactionRevertedError with only the final hash, so the caller couldn't inspect the earlier progress.
Could you keep the handle from execute_calls() and preserve the submitted hashes, failing index and original cause through PartialBatchError when the final wait fails? A regression for a final revert after the first approval succeeds would cover it. A final timeout case would be useful too.
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
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
New wallets need token approvals before trading, and the SDK could not check or set them.
PositionClientaddsget_trading_approvals_stateandsetup_trading_approvals, which reads the 17 required approvals on chain and grants only the missing ones (Safe: one MultiSend; EOA: one tx each). It also addsapprove_erc20,approve_erc1155_for_all,transfer_erc20, andapprovals_example.Verification
Commands run and their actual results:
ctest --test-dir build -LE live: 50/50 passedscripts/quality.py origin/main: passedChecks not run and the reason (or none):
Compatibility and evidence
Public API, binary compatibility, or release implications (or none):
Additive API.
PolymarketContractsgainsperps_deposit_contract, so consumers must rebuild.For protocol changes: official docs links and the Python SDK commit or fixture source.
b543c9d(approval set, golden calldata vectors)For live checks: distinguish observed outcomes from local fixture coverage.
0x1a9e…e725), then read back as fully approved.