docs: REST API reference and JSON-RPC parity with the node - #313
Draft
majesticwizardcat wants to merge 1 commit into
Draft
majesticwizardcat wants to merge 1 commit into
majesticwizardcat wants to merge 1 commit into
Conversation
- New REST reference (doc/api-reference/rest/), published as a second GitBook spec (pod-rest): every /v1/clob, explorer and bridge route, including /v1/clob/activity from the account activity feed. - JSON-RPC reference brought in line with the node: method params, response fields and encodings, limits, subscription semantics, newHeads, pod_activity, ob_getSolutions; pod_getBridgeClaimProof removed in favour of the REST by-id route. - Guides, the JSON-RPC README, the errors page and the SDK README fixed where they disagreed with the node. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Brings the API docs in line with the node, treating the node code as the source of truth, and adds a reference for the REST API, which was previously undocumented apart from the bridge routes.
REST reference (new)
doc/api-reference/rest/openapi.yamlandrest/README.md, published as a second GitBook spec,pod-rest, next topod-docs./v1/clob/status,/markets,/markets/stats,/candles/{orderbook},/orderbook/{orderbook},/solutions/v1/clob/orders/{account},/fills/{account},/positions/{account},/balances/{account},/triggers/{account},/backstop-transfers/{account},/activity/{account}/v1/tx/{hash},/v1/transactions/v1/bridge/config,/withdrawals,/withdrawals/{account},/withdrawals/by-id/{tx_hash}, with the full claim-proof response and whatpendingmeansEach route documents its parameters, defaults, caps, errors and
Cache-Control. The README covers the/v1prefix on the RPC port, which routes need the indexer, caching, number encodings, and seeding from REST before subscribing.JSON-RPC reference
The highest-impact fixes:
eth_getBalance: plain CLOB cash, not the withdrawable balance.eth_estimateGas: a table lookup, not a fixed 21000.eth_getTransactionCount: honours thependingtag.pod_getVoteBatches: the params are now correct; the old example failed.ob_getOrderbook: bids are ascending, and the example is flipped.ob_getCandles: the window is half-open, andlimitis capped.Orderand triggers: the field encodings are corrected.ob_getPositions: a perp position'srealized_pnlis always 0.pod_orders_v2: the status and reject-code lists now match the node.Also:
ob_getSolutions,newHeadsandpod_activity.pod_getBridgeClaimProof, which no longer exists.Guides and other pages
read-market-data.md: rewritten around REST plus subscriptions.recover-locked-account.md: readsTargetTxas{hash, nonce}.bridge-from-pod.md: the Rust tab polls the by-id route; it used to loop forever.json-rpc-errors.md: adds the missing error codes and the up-frontsince too oldrejection.restUrlis the RPC host plus/v1.Depends on
/v1/clob/activity,pod_activity, ADL frames onpod_orders_v2, cash-sweep backstop rows and the extrapod_positionspushes are documented as they stand on that branch. Merge this after POD-158 Adds pod precompiles documentation #113.pod-restspec has to be accepted in the GitBook organization. The publish workflow now uploads both specs.Left out on purpose
POST /v1/raw-txs: its binary frame format would need describing first.eth_syncing,eth_gasPrice,eth_maxFeePerGas,eth_maxPriorityFeePerGas,eth_getCode,eth_feeHistory,net_versionandweb3_clientVersion, which return fixed or placeholder answers.pod_getAccountRepair,pod_pushAccountRepair,pod_getBridgeClaimSignatures,pod_subscribeVotes, and admin and dev methods.ob_*deprecation, left for a later pass.accountValue, which belong with SDK PRs feat(ts-sdk): account activity resource #310 and feat(ts-sdk): account value on the PnL history #311.Known gap
pod_orders(v1)newandinvalidevents serialize the engine's order type, notOrderResponse. Their real shape differs from the documented one:endis a string and several fields are absent. This is not fixed here.Verification
redocly lint: the REST spec has 0 errors. The JSON-RPC spec adds no new errors (44 before and after, all pre-existing).price_change_24his in basis points, the guide'spod_orderbooksincenow uses the solution-time watermark,pod_activitywas missing from the stale-sincelist, and the README no longer documents unmerged SDK methods.🤖 Generated with Claude Code