Skip to content

fix: accept documented RelayClient constructor aliases - #26

Open
binggao1230 wants to merge 1 commit into
Polymarket:mainfrom
binggao1230:fix-25-doc-constructor-aliases
Open

fix: accept documented RelayClient constructor aliases#26
binggao1230 wants to merge 1 commit into
Polymarket:mainfrom
binggao1230:fix-25-doc-constructor-aliases

Conversation

@binggao1230

@binggao1230 binggao1230 commented Jun 27, 2026

Copy link
Copy Markdown

Summary

  • accept the documented host, chain, and signer keyword aliases in RelayClient.__init__
  • preserve the existing relayer_url, chain_id, and private_key API, with existing names taking precedence
  • keep documented relayer API key fields on the client so the setup snippet no longer fails at construction

Fixes #25.

Tests

  • uv run --with-requirements requirements.txt pytest tests/test_client_deposit_wallet.py -q
  • uv run --with-requirements requirements.txt pytest -q

Note

Low Risk
Constructor-only compatibility change with explicit validation; no changes to relay execution or auth header logic.

Overview
RelayClient.__init__ now accepts documented keyword aliases host, chain, and signer (keyword-only) as fallbacks when relayer_url, chain_id, and private_key are omitted. Existing parameter names still win when both are passed.

Construction requires a relayer URL and chain id after alias resolution; missing values raise TypeError. relayer_api_key and relayer_api_key_address are accepted and stored on the client instance.

Tests cover alias-based construction (including trailing-slash URL normalization) and precedence of canonical names over aliases.

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

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.

TypeError: RelayClient.__init__() got an unexpected keyword argument 'host'

1 participant