Skip to content

docs(types): chain_id on Payment, finality_tag on SyncBlockchain - #17

Merged
pviti merged 1 commit into
mainfrom
feature/payment-chain-id
Aug 17, 2026
Merged

docs(types): chain_id on Payment, finality_tag on SyncBlockchain#17
pviti merged 1 commit into
mainfrom
feature/payment-chain-id

Conversation

@pviti

@pviti pviti commented Aug 17, 2026

Copy link
Copy Markdown
Member

Aligns the typed reference with the current gateway surface: commercelayer/rail0-gateway#193 (chain_id on the payments list entity) and #195 (finality_tag on the chain).

Scope

The structs in lib/rail0/types.rb are 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: 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 — 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, Payments section — every row carries chain_id, list rows included, so a listing needs no get(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

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
pviti marked this pull request as ready for review August 17, 2026 11:10
@pviti
pviti merged commit 9bca5f3 into main Aug 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant