Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ client.disputes.list(status: "closed", sort: "-opened_at")
`payments.list`/`transactions`/`disputes` and `disputes.list` return a paginated
`{ data:, meta: { page:, per_page:, total: } }` envelope.

Every payment row carries `chain_id`, list rows included. You need it to display
an amount: `amount` is in base units and the token's decimals resolve from
`token` **plus** its chain — an address alone identifies a token only within one
chain — so a listing never needs a `get(id)` per row to render totals.

### Refund (two-phase EIP-3009)

```ruby
Expand Down
6 changes: 5 additions & 1 deletion lib/rail0/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ module Types
Payment = Struct.new(
:id, # String
:contract_id, # String
:chain_id, # Integer — EVM chain id of the deployment. On list rows too: `amount` is
# base units, and the token's decimals resolve from `token` PLUS its chain.
:rail0_id, # String — Protocol-level identifier (66-char hex).
:status, # String
:mode, # String
Expand Down Expand Up @@ -269,7 +271,9 @@ module Types
SyncBlockchain = Struct.new(
:chain_id, # Integer
:start_block, # Integer
:required_confirmations, # Integer
:required_confirmations, # Integer — Fallback burial depth, used where the chain serves no finality tag.
:finality_tag, # String — Which block the chain calls settled ("safe", "finalized" or
# "depth"); the indexer gates every notify on it.
:explorer_url, # Block explorer base URL; null when the chain has none.
:network_type, # String — "testnet" or "mainnet"; selects which chains a deployment indexes.
:rpc_urls, # Array — Ordered list of public RPC endpoints tried in turn (serial fallback).
Expand Down
Loading