Skip to content

feat(sdks): forward SuiBets exchange api base URL credential#1756

Open
Bortlesboat wants to merge 1 commit into
pmxt-dev:mainfrom
Bortlesboat:fix/suibets-base-url
Open

feat(sdks): forward SuiBets exchange api base URL credential#1756
Bortlesboat wants to merge 1 commit into
pmxt-dev:mainfrom
Bortlesboat:fix/suibets-base-url

Conversation

@Bortlesboat

Copy link
Copy Markdown
Contributor

Why

Closes #1388. The core exchange factory reads credentials?.baseUrl as the SuiBets exchange's own API origin (core/src/server/exchange-factory.ts), falling back to SUIBETS_BASE_URL. Neither SDK could forward that value: SDK-level baseUrl / base_url means the PMXT sidecar URL, a different concept, and is never included in the credentials payload. Follow-up to #1657, which closed the same gap for walletAddress.

What

Both SDKs gain an option that forwards into the credentials payload as baseUrl, named to avoid colliding with the sidecar URL option:

  • TypeScript: SuiBetsOptions.apiBaseUrl — stored on the client, merged into getCredentials() output as baseUrl when set.
  • Python: SuiBets(api_base_url=...) + SuiBetsOptions.api_base_url — same forwarding in _get_credentials_dict().

When unset, behaviour is unchanged (sidecar falls back to SUIBETS_BASE_URL).

Testing

  • Python: pytest tests/ — 267 passed (the 2 test_server_manager errors are a pre-existing Windows temp-dir permission issue, present on clean main). New tests cover forwarding alongside wallet_address and alone.
  • TypeScript: npx jest tests/exchange-credentials.test.ts — 3 passed; tsc --noEmit clean. New tests mirror the Python cases.

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

Labels

None yet

Projects

None yet

1 participant