Skip to content

feat: expose trading approvals state (DEV-565) - #262

Open
kartojal wants to merge 1 commit into
mainfrom
feature/dev-565-py-sdk-expose-read-only-trading-approvals-state
Open

feat: expose trading approvals state (DEV-565)#262
kartojal wants to merge 1 commit into
mainfrom
feature/dev-565-py-sdk-expose-read-only-trading-approvals-state

Conversation

@kartojal

@kartojal kartojal commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add typed trading approval state models
  • add signer-free wallet reads to sync and async public clients
  • add authenticated-wallet convenience reads to sync and async secure clients
  • reuse the canonical approval-state resolver in setup_trading_approvals
  • add a deterministic read-only integration test

Related: Polymarket/ts-sdk#286
Linear: DEV-565

Testing

  • full non-integration suite: 2,233 passed, 185 deselected
  • read-only live integration: 1 passed
  • Ruff lint and format checks
  • strict Pyright: 0 errors

Note

Medium Risk
Changes the approval resolution path used by setup_trading_approvals and adds RPC reads for collateral/position operator allowances; behavior should match prior logic but touches trading prerequisites.

Overview
Adds typed trading approval state (TradingApprovalsState, MissingTradingApprovals, and per-token ERC-20/ERC-1155 entries) and splits on-chain approval logic into read state vs build transaction calls (get_trading_approvals_state / build_missing_trading_approval_calls), replacing the old all-in-one resolve_missing_trading_approval_* helpers.

Public sync/async clients gain an RPC transport and get_trading_approvals_state(wallet=...) so any wallet can be checked without a signer. Secure clients expose the same read with an optional wallet (defaulting to the authenticated wallet). setup_trading_approvals now resolves missing approvals via the shared state reader, then submits only the needed calls. New types are exported from the package root; a read-only integration test asserts expected missing approval counts for a known unapproved address.

Reviewed by Cursor Bugbot for commit 88211a3. Bugbot is set up for automated code reviews on this repo. Configure here.

@kartojal
kartojal marked this pull request as ready for review August 10, 2026 16:01

@naruto11eth naruto11eth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm as a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants