docs(types): chain_id on Payment, finality_tag on SyncBlockchain - #17
Merged
Conversation
Aligns the typed reference with the current gateway surface. The structs in lib/rail0/types.rb are documentation — the resources return plain Hashes and never instantiate them — so this changes no behaviour, but a shape reference that omits a field is worse than none. - `Payment.chain_id` — the gateway moved it onto the payments LIST entity (commercelayer/rail0-gateway#193). It is what makes an amount renderable: `amount` is in base units and the token's decimals resolve from `token` PLUS its chain, an address alone being ambiguous across chains. - `SyncBlockchain.finality_tag` (commercelayer/rail0-gateway#195) — which block the chain calls settled; the indexer gates every notify on it. The `required_confirmations` comment now says it is the fallback for chains that serve no tag, which is what it became. README: the payments section states that every row carries `chain_id`, list rows included, so a listing needs no `get(id)` per row to display totals. Verified: `bundle exec rake` — 139 examples, 0 failures. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pviti
marked this pull request as ready for review
August 17, 2026 11:10
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.
Aligns the typed reference with the current gateway surface: commercelayer/rail0-gateway#193 (
chain_idon the payments list entity) and #195 (finality_tagon the chain).Scope
The structs in
lib/rail0/types.rbare documentation: the resources return plain Hashes and never instantiate them, so nothing here changes behaviour and nothing could have broken on the new field. A shape reference that omits a field is still worse than none — a reader trusts it.Payment.chain_id— what makes an amount renderable:amountis in base units and the token's decimals resolve fromtokenplus its chain, an address alone being ambiguous across chains.SyncBlockchain.finality_tag— which block the chain calls settled; the indexer gates every notify on it. Therequired_confirmationscomment now says it is the fallback for chains that serve no tag, which is what it became.chain_id, list rows included, so a listing needs noget(id)per row to display totals.No spec covers the struct members (they are not constructed anywhere), so there is no test to extend here — flagging that rather than inventing one.
Verification
bundle exec rake— 139 examples, 0 failures.🤖 Generated with Claude Code