Skip to content

Add POLY_1271 deposit wallet support#85

Open
sharananurag998 wants to merge 3 commits into
Polymarket:mainfrom
sharananurag998:agent/poly-1271-support
Open

Add POLY_1271 deposit wallet support#85
sharananurag998 wants to merge 3 commits into
Polymarket:mainfrom
sharananurag998:agent/poly-1271-support

Conversation

@sharananurag998

@sharananurag998 sharananurag998 commented Jul 18, 2026

Copy link
Copy Markdown

What changed

  • add poly-1271 as a supported CLI signature type
  • add --funder, POLYMARKET_FUNDER, and optional config-file funder support
  • pass the explicit deposit wallet to the official CLOB V2 SDK for authentication, balances, orders, and trades
  • show the configured funder in wallet output and use it for read-only approval checks
  • reject direct on-chain approval and CTF mutations for deposit wallets instead of sending them from the signer EOA
  • validate signature-type values and document the deposit-wallet setup

Why

The V2 Rust SDK already supports SignatureType::Poly1271, but the CLI only mapped EOA, proxy, and Gnosis Safe modes and had no way to supply the required deposit-wallet funder. Email and social-login accounts backed by Polymarket deposit wallets therefore authenticated against the wrong wallet or could not see their collateral.

Impact

Users with a Polymarket deposit wallet can authenticate to CLOB V2 and use trading and account commands with the correct funding address. Existing EOA, proxy, and Gnosis Safe configurations remain backward compatible.

Validation

  • cargo check --all-targets
  • cargo test --all-targets (138 tests passed)
  • cargo clippy --all-targets -- -D warnings
  • live read-only CLOB authentication and collateral lookup against a real POLY_1271 deposit wallet; no order was created or posted

Note

Medium Risk
Changes CLOB authentication and order signing for a new wallet mode; validation reduces wrong-wallet auth, but trading behavior depends on the upgraded SDK.

Overview
Adds poly-1271 so email/social Polymarket accounts can use the CLI against their deposit wallet, not just EOA/proxy/Gnosis Safe modes. Users must supply the funding address via --funder, POLYMARKET_FUNDER, or config funder; supplying a funder with any other signature type is rejected so CLOB auth cannot target the wrong wallet.

CLOB authentication and trading paths pass the funder into polymarket_client_sdk_v2 0.7.0 (bumped from 0.5.1 for deposit-wallet maker/signer and ERC-7739 signatures). Wallet create/import/show persist and display the funder; approve check resolves the owner from the funder in poly-1271 mode.

On-chain mutations (approve set, CTF split/merge/redeem) are blocked for poly-1271 with a clear error; signature type parsing is stricter (unknown types error instead of defaulting to EOA). README and integration tests cover setup and pre-network validation.

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

@sharananurag998
sharananurag998 marked this pull request as ready for review July 18, 2026 06:57
Comment thread src/auth.rs
Comment thread src/config.rs Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8c044fe. Configure here.

Comment thread src/commands/clob.rs
Comment thread src/commands/wallet.rs
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.

1 participant