feat(sdks): forward SuiBets exchange api base URL credential#1756
Open
Bortlesboat wants to merge 1 commit into
Open
feat(sdks): forward SuiBets exchange api base URL credential#1756Bortlesboat wants to merge 1 commit into
Bortlesboat wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Closes #1388. The core exchange factory reads
credentials?.baseUrlas the SuiBets exchange's own API origin (core/src/server/exchange-factory.ts), falling back toSUIBETS_BASE_URL. Neither SDK could forward that value: SDK-levelbaseUrl/base_urlmeans the PMXT sidecar URL, a different concept, and is never included in the credentials payload. Follow-up to #1657, which closed the same gap forwalletAddress.What
Both SDKs gain an option that forwards into the credentials payload as
baseUrl, named to avoid colliding with the sidecar URL option:SuiBetsOptions.apiBaseUrl— stored on the client, merged intogetCredentials()output asbaseUrlwhen set.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
pytest tests/— 267 passed (the 2test_server_managererrors are a pre-existing Windows temp-dir permission issue, present on clean main). New tests cover forwarding alongsidewallet_addressand alone.npx jest tests/exchange-credentials.test.ts— 3 passed;tsc --noEmitclean. New tests mirror the Python cases.