Repository navigation
feat!: sync SDK with the current v3 API (remove oracle, fix model drift) - #33
Merged
Merged
Conversation
LN Markets removed GET /oracle/index and GET /oracle/last-price on 2026-07-17; both now return 404, which broke the integration tests. Drop OracleClient, the oracle models, and their tests. Examples now read the price from futures.get_ticker(). Bump to 0.2.0. Co-Authored-By: Claude <noreply@anthropic.com>
Diffed the SDK against the frozen v3 OpenAPI reference (spec.frozen.json, identical to the live /v3/spec.json): - WithdrawOnChainResponse required fields the API never returns, so withdraw_on_chain() failed validation on success - cross new_order() required client_id; it is optional - GetCandlesParams.from_ is optional - add ticker time, price_change_24h and exchanges_weights - add stoploss_mode on new isolated trades (trailing stop at creation) - add the notifications read filter and the new on-chain deposit statuses - add id on the new swap response Integration tests now skip deposit tests when the signet account hits TIER_LIMIT_EXCEEDED instead of failing. Co-Authored-By: Claude <noreply@anthropic.com>
Since ln-markets #2033 (2026-07-29) every authenticated v3 request is geo-blocked by source IP, and GitHub-hosted runners mostly egress from the US, so the authenticated suite fails with 403 FORBIDDEN in CI. Gate those tests behind one requires_auth marker: in CI they run only when CI_PROXY_URL is set, and the workflow routes requests through it via HTTPS_PROXY. Local runs are unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
Signet enforces KYC tier limits on deposits and trades. Move the TIER_LIMIT_EXCEEDED skip from the three deposit tests into a conftest hook so every test and fixture (trades, cross orders) skips on it, while other API errors still fail. Co-Authored-By: Claude <noreply@anthropic.com>
vafanassieff
approved these changes
Oct 26, 2026
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
The SDK had drifted from the v3 API. I diffed it against the published reference (
apps/api-rest-v3/spec.frozen.jsonin the API repo, identical to the livehttps://api.lnmarkets.com/v3/spec.json) and the stream reference (apps/api-stream-v1/spec.frozen.json).Removed (breaking)
client.oracleandmodels.oracle. LN Markets removedGET /oracle/indexandGET /oracle/last-priceon 2026-07-17 (API changelog), so they return404, which made the integration tests fail on every run (e.g. on chore(deps): bump anyio from 4.13.0 to 4.14.2 #30). Migration:futures.get_ticker()for index/last price,futures.get_candles()for history.Fixed
account.withdraw_on_chain()failed validation on success: the response model requireduid,updated_at,block_id,confirmation_heightandfee, which the API never returns.futures.cross.new_order()requiredclient_id, but the API treats it as optional.GetCandlesParams.from_is now optional, as in the API.Added
time,price_change_24h,exchanges_weights.FuturesOrder.stoploss_mode(fixed/trailing), so a trailing stop can be set when opening an isolated trade.readfilter; theunder_review,not_creditedandon_holdon-chain deposit statuses;CreateSwapOutput.id.0.2.0to PyPI throughpublish.yml.Verification
ruff check .: passes.pyright: 0 errors.pytestlocally (no signet creds): 20 passed, 36 skipped/time(intentional, see above)from🤖 Generated with Claude Code