rail0-sdk 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +152 -3
- data/lib/rail0/client.rb +10 -1
- data/lib/rail0/error_hints.rb +20 -0
- data/lib/rail0/http_client.rb +2 -1
- data/lib/rail0/payout_verify.rb +211 -0
- data/lib/rail0/request.rb +19 -1
- data/lib/rail0/resources/auth.rb +1 -1
- data/lib/rail0/resources/chains.rb +51 -1
- data/lib/rail0/resources/payments.rb +8 -3
- data/lib/rail0/resources/payout_destinations.rb +149 -0
- data/lib/rail0/resources/payouts.rb +173 -0
- data/lib/rail0/resources/query.rb +1 -1
- data/lib/rail0/resources/webhooks.rb +7 -0
- data/lib/rail0/signing.rb +46 -0
- data/lib/rail0/tx_verify.rb +3 -2
- data/lib/rail0/types.rb +144 -56
- data/lib/rail0/version.rb +1 -1
- metadata +5 -2
data/lib/rail0/types.rb
CHANGED
|
@@ -43,7 +43,7 @@ module Rail0
|
|
|
43
43
|
# A single balance line — the native gas token or one ERC-20.
|
|
44
44
|
AssetBalance = Struct.new(
|
|
45
45
|
:symbol, # String
|
|
46
|
-
:address, # Token contract address; null for the native balance.
|
|
46
|
+
:address, # String | nil — Token contract address; null for the native balance.
|
|
47
47
|
:decimals, # Integer
|
|
48
48
|
:raw, # String — Balance in base units (exact).
|
|
49
49
|
:amount, # String — Human-decimal balance.
|
|
@@ -57,6 +57,15 @@ module Rail0
|
|
|
57
57
|
keyword_init: true
|
|
58
58
|
)
|
|
59
59
|
|
|
60
|
+
# What an account still has in motion (GET /admin/accounts/{id}/exposure, and `exposure` on a 409
|
|
61
|
+
# account_has_open_exposure).
|
|
62
|
+
AccountExposure = Struct.new(
|
|
63
|
+
:payments, # Hash
|
|
64
|
+
:payouts, # Hash
|
|
65
|
+
:empty, # Boolean — true when every count is zero.
|
|
66
|
+
keyword_init: true
|
|
67
|
+
)
|
|
68
|
+
|
|
60
69
|
# The error envelope: exactly code (stable, the only field to branch on), title (short label) and
|
|
61
70
|
# detail (a sentence a UI can print verbatim). The legacy status/message/error aliases were removed
|
|
62
71
|
# in #252.
|
|
@@ -170,9 +179,11 @@ module Rail0
|
|
|
170
179
|
Blockchain = Struct.new(
|
|
171
180
|
:chain_id, # Integer
|
|
172
181
|
:name, # String
|
|
182
|
+
:slug, # String — The chain's short name, the same for its testnet and its mainnet (`arc` is Arc Testnet on a testnet gateway, Arc on production): a gateway serves one network class, so a client may name the chain by slug instead of chain_id. Lowercase, unique per network class.
|
|
173
183
|
:native_symbol, # String
|
|
174
184
|
:network_type, # String
|
|
175
185
|
:explorer_url, # String
|
|
186
|
+
:public_rpc_urls, # Array — Public, keyless RPC endpoints published for clients that read the chain directly (a balance, a receipt), in failover order: try them in turn. Not necessarily the endpoints the gateway itself uses.
|
|
176
187
|
:required_confirmations, # Integer — Confirmations this gateway waits for before treating a transaction as settled. The FALLBACK rule: where the chain serves a finality tag (see finality_tag) that tag governs instead, so a client showing this number on such a chain is describing a rule that is not in force.
|
|
177
188
|
:finality_tag, # String — The block tag the chain calls settled (`safe`, `finalized`), when it serves one — and what the gateway actually gates on. Null where the chain serves none, in which case required_confirmations is counted.
|
|
178
189
|
:contract, # ChainContract
|
|
@@ -211,9 +222,9 @@ module Rail0
|
|
|
211
222
|
Wallet = Struct.new(
|
|
212
223
|
:id, # String
|
|
213
224
|
:address, # String
|
|
214
|
-
:label,
|
|
225
|
+
:label, # String | nil
|
|
215
226
|
:active, # Boolean
|
|
216
|
-
:deactivated_by, # Who switched the wallet off: `owner` (a session signed in with this wallet) or `operator` (an admin session). Null while active, and on a switch-off that predates the record — treated as `operator`. A wallet an operator switched off can be switched back on only by an operator (403 `wallet_deactivated_by_operator`). Always null on GET /payment_methods, which serves active wallets only.
|
|
227
|
+
:deactivated_by, # String | nil — Who switched the wallet off: `owner` (a session signed in with this wallet) or `operator` (an admin session). Null while active, and on a switch-off that predates the record — treated as `operator`. A wallet an operator switched off can be switched back on only by an operator (403 `wallet_deactivated_by_operator`). Always null on GET /payment_methods, which serves active wallets only.
|
|
217
228
|
keyword_init: true
|
|
218
229
|
)
|
|
219
230
|
|
|
@@ -232,9 +243,9 @@ module Rail0
|
|
|
232
243
|
WalletWithTokens = Struct.new(
|
|
233
244
|
:id, # String
|
|
234
245
|
:address, # String
|
|
235
|
-
:label,
|
|
246
|
+
:label, # String | nil
|
|
236
247
|
:active, # Boolean
|
|
237
|
-
:deactivated_by, # Who switched the wallet off: `owner` (a session signed in with this wallet) or `operator` (an admin session). Null while active, and on a switch-off that predates the record — treated as `operator`. A wallet an operator switched off can be switched back on only by an operator (403 `wallet_deactivated_by_operator`). Always null on GET /payment_methods, which serves active wallets only.
|
|
248
|
+
:deactivated_by, # String | nil — Who switched the wallet off: `owner` (a session signed in with this wallet) or `operator` (an admin session). Null while active, and on a switch-off that predates the record — treated as `operator`. A wallet an operator switched off can be switched back on only by an operator (403 `wallet_deactivated_by_operator`). Always null on GET /payment_methods, which serves active wallets only.
|
|
238
249
|
:tokens, # Array
|
|
239
250
|
keyword_init: true
|
|
240
251
|
)
|
|
@@ -255,21 +266,21 @@ module Rail0
|
|
|
255
266
|
:payer, # String
|
|
256
267
|
:payee, # String
|
|
257
268
|
:token, # String
|
|
258
|
-
:decimals, # Decimals of the payment's token: divide `amount`, `capturable_amount` and `refundable_amount` (base units) by 10^decimals to render them, with no GET /tokens join on `token` + `chain_id`. Resolved from the gateway's in-memory chain catalogue, retired tokens and archived contract versions included. Null only when the gateway cannot resolve the token (a contract it has not loaded, a token deleted outright) — fall back to GET /tokens then.
|
|
269
|
+
:decimals, # Integer | nil — Decimals of the payment's token: divide `amount`, `capturable_amount` and `refundable_amount` (base units) by 10^decimals to render them, with no GET /tokens join on `token` + `chain_id`. Resolved from the gateway's in-memory chain catalogue, retired tokens and archived contract versions included. Null only when the gateway cannot resolve the token (a contract it has not loaded, a token deleted outright) — fall back to GET /tokens then.
|
|
259
270
|
:authorization_expiry, # Integer
|
|
260
271
|
:refund_expiry, # Integer
|
|
261
272
|
:escrow_stranded, # Boolean — True exactly inside the stranded-escrow window (#233): a partial capture has permanently ruled void out, and release only opens at authorization_expiry — so no verb can return the buyer's uncaptured escrow until then. Mirrors RAIL0.sol; the gateway names the window, it cannot shorten it.
|
|
262
273
|
:escrow_returnable_at, # String — When the stranded escrow becomes returnable (release opens) — the authorization expiry as ISO-8601. Null whenever nothing is stranded, so presence alone is the signal.
|
|
263
274
|
:disputed, # Boolean — True while an open dispute exists.
|
|
264
275
|
:in_flight, # Boolean — True while one of the payment's transactions is on its way to the chain and not yet settled: status `submitting`, `submitted`, or `pending` holding its signed transaction (the `redrivable` rows — signed and handed over, broadcast not yet sent). A `pending` row still awaiting its signature (an unfinished prepare) does not count, nor do `confirmed`/`failed`. While true the mirrored balances are about to move, so a client should disable further actions on the payment. Carried by list rows too, which embed no transactions; computed for a whole page in one query.
|
|
265
|
-
:last_error_code, # Decoded reason of the last failed on-chain attempt; null once the payment makes forward progress. Non-null means the latest attempt failed.
|
|
266
|
-
:last_error_message, # Human-readable form of last_error_code.
|
|
267
|
-
:description,
|
|
268
|
-
:reference, # This payment's identifier in the merchant's own system; set at create, correctable by the payee.
|
|
269
|
-
:reference_origin, # The system the reference comes from, a lowercase slug (e.g. commercelayer).
|
|
270
|
-
:merchant_note, # The payee's internal note (PATCH /payments/{id}). Present only when the session is the payment's PAYEE, and on the operator's Full view; absent for the payer.
|
|
271
|
-
:metadata,
|
|
272
|
-
:signed_at, # When the payer signature was stored (null while unsigned).
|
|
276
|
+
:last_error_code, # String | nil — Decoded reason of the last failed on-chain attempt; null once the payment makes forward progress. Non-null means the latest attempt failed.
|
|
277
|
+
:last_error_message, # String | nil — Human-readable form of last_error_code.
|
|
278
|
+
:description, # String | nil
|
|
279
|
+
:reference, # String | nil — This payment's identifier in the merchant's own system; set at create, correctable by the payee.
|
|
280
|
+
:reference_origin, # String | nil — The system the reference comes from, a lowercase slug (e.g. commercelayer).
|
|
281
|
+
:merchant_note, # String | nil — The payee's internal note (PATCH /payments/{id}). Present only when the session is the payment's PAYEE, and on the operator's Full view; absent for the payer.
|
|
282
|
+
:metadata, # Hash | nil
|
|
283
|
+
:signed_at, # String | nil — When the payer signature was stored (null while unsigned).
|
|
273
284
|
:created_at, # String
|
|
274
285
|
:updated_at, # String
|
|
275
286
|
keyword_init: true
|
|
@@ -283,23 +294,23 @@ module Rail0
|
|
|
283
294
|
:reason, # String — On-chain bytes32 reason the dispute was opened with (hex); the all-zero word when no reason was given; kept verbatim even when it is outside the dispute-reason dictionary.
|
|
284
295
|
:reason_code, # DisputeOpenReason | nil — The DisputeOpenReason code `reason` reads as; null when no reason was given (the zero bytes32) or when the bytes32 is not in the dictionary (a direct contract call).
|
|
285
296
|
:reason_description, # String — English description of `reason_code`; "No reason given" when `reason` is the zero bytes32; "Unrecognised reason" when it is a non-zero bytes32 outside the dictionary.
|
|
286
|
-
:opened_block,
|
|
297
|
+
:opened_block, # Integer | nil
|
|
287
298
|
:opened_at, # String
|
|
288
|
-
:closed_by,
|
|
289
|
-
:close_reason, # On-chain bytes32 close reason (hex); the all-zero word when closed with no reason; null while the dispute is open.
|
|
299
|
+
:closed_by, # String | nil
|
|
300
|
+
:close_reason, # String | nil — On-chain bytes32 close reason (hex); the all-zero word when closed with no reason; null while the dispute is open.
|
|
290
301
|
:close_reason_code, # DisputeCloseReason | DisputeSystemCloseReason | nil — The code `close_reason` reads as: a DisputeCloseReason, or the system DisputeSystemCloseReason `full_refund` when a full refund auto-closed the dispute. Null while open, when closed with no reason (the zero bytes32), or when the bytes32 is not in the dictionary.
|
|
291
|
-
:close_reason_description, # English description of `close_reason_code`; "No reason given" when `close_reason` is the zero bytes32; "Unrecognised reason" when it is a non-zero bytes32 outside the dictionary; null while open.
|
|
292
|
-
:closed_block,
|
|
293
|
-
:closed_at,
|
|
302
|
+
:close_reason_description, # String | nil — English description of `close_reason_code`; "No reason given" when `close_reason` is the zero bytes32; "Unrecognised reason" when it is a non-zero bytes32 outside the dictionary; null while open.
|
|
303
|
+
:closed_block, # Integer | nil
|
|
304
|
+
:closed_at, # String | nil
|
|
294
305
|
keyword_init: true
|
|
295
306
|
)
|
|
296
307
|
|
|
297
308
|
# What the callback did with a test event (POST /webhooks/{id}/test).
|
|
298
309
|
WebhookTestResult = Struct.new(
|
|
299
310
|
:delivered, # Boolean — The endpoint answered 2xx.
|
|
300
|
-
:response_code, # The HTTP status it answered; null when no response came (see error_reason).
|
|
301
|
-
:response_message, # Up to 1000 printable characters of its response body.
|
|
302
|
-
:error_reason, # Why no response came: a refused address, a TLS or connection error, the deadline.
|
|
311
|
+
:response_code, # String | nil — The HTTP status it answered; null when no response came (see error_reason).
|
|
312
|
+
:response_message, # String | nil — Up to 1000 printable characters of its response body.
|
|
313
|
+
:error_reason, # String | nil — Why no response came: a refused address, a TLS or connection error, the deadline.
|
|
303
314
|
:duration_ms, # Integer — How long the attempt took.
|
|
304
315
|
keyword_init: true
|
|
305
316
|
)
|
|
@@ -310,22 +321,22 @@ module Rail0
|
|
|
310
321
|
:operation, # String — Which on-chain call this row attempts. A SUPERSET of the `{operation}` path enum: `dispute` and `close_dispute` have their own hand-written routes rather than living under the generic namespace, but they mint transaction rows like any other operation, so a generated client must be able to represent them.
|
|
311
322
|
:status, # String
|
|
312
323
|
:redrivable, # Boolean — True when this transaction's broadcast can be re-enqueued: it is `pending` and the gateway holds its signed transaction, i.e. a send that was prepared and signed but never reached the chain. The same predicate `POST /payments/{id}/transactions/{transaction_id}/redrive` guards on, so a client can offer the action exactly when it will succeed instead of on a 422. False on a `pending` row that holds no signed transaction - there the next step is submitting the signature, not a redrive.
|
|
313
|
-
:error_code, # Decoded failure code, null unless `status` is "failed". Same catalogue as an error body's `code`: a RAIL0 custom error (`not_payee`), a token-level revert (`insufficient_token_balance`, `invalid_token_signature`, `authorization_already_used`), a Solidity panic, or a rejection that stopped the broadcast before the chain saw it (`insufficient_gas_funds`, `nonce_too_low`).
|
|
324
|
+
:error_code, # String | nil — Decoded failure code, null unless `status` is "failed". Same catalogue as an error body's `code`: a RAIL0 custom error (`not_payee`), a token-level revert (`insufficient_token_balance`, `invalid_token_signature`, `authorization_already_used`), a Solidity panic, or a rejection that stopped the broadcast before the chain saw it (`insufficient_gas_funds`, `nonce_too_low`).
|
|
314
325
|
:error_title, # String — Short label for `error_code`; null unless failed.
|
|
315
326
|
:error_detail, # String — Sentence explaining the failure; null unless failed. Carries the chain's own words when the revert was not one the gateway recognises.
|
|
316
|
-
:unsigned_transaction,
|
|
317
|
-
:transaction_hash,
|
|
318
|
-
:sender, # The address that SIGNED the submitted transaction, recovered from the signature by the gateway at submit — a fact, not a client claim. Null where the gateway held no signature to recover from (a report-by-hash submit, where the wallet broadcast it itself) or where nothing has been submitted yet. This is what makes `release` gas attributable: that operation is payer-OR-payee, so whose cost it is depends on who signed.
|
|
319
|
-
:amount, # Amount in token BASE units. On capture and refund it is the amount the caller asked for. On void and release it is PROVISIONAL — those operations carry no amount and move the whole uncaptured escrow, so this is the capturable residual as of prepare, re-sealed with the exact on-chain amount when the indexer confirms.
|
|
320
|
-
:block_number,
|
|
321
|
-
:gas_used, # Gas units used, mirrored from the indexer on confirm.
|
|
322
|
-
:gas_limit, # Gas limit, mirrored from the indexer on confirm.
|
|
323
|
-
:effective_gas_price, # Effective gas price in wei, mirrored from the indexer on confirm.
|
|
324
|
-
:base_fee_per_gas, # Block base fee per gas in wei, mirrored from the indexer on confirm.
|
|
325
|
-
:gas_cost, # Total gas cost in wei (gas_used * effective_gas_price); derived, null until confirmed.
|
|
326
|
-
:pending_at,
|
|
327
|
-
:submitted_at,
|
|
328
|
-
:confirmed_at,
|
|
327
|
+
:unsigned_transaction, # String | nil
|
|
328
|
+
:transaction_hash, # String | nil
|
|
329
|
+
:sender, # String | nil — The address that SIGNED the submitted transaction, recovered from the signature by the gateway at submit — a fact, not a client claim. Null where the gateway held no signature to recover from (a report-by-hash submit, where the wallet broadcast it itself) or where nothing has been submitted yet. This is what makes `release` gas attributable: that operation is payer-OR-payee, so whose cost it is depends on who signed.
|
|
330
|
+
:amount, # String | nil — Amount in token BASE units. On capture and refund it is the amount the caller asked for. On void and release it is PROVISIONAL — those operations carry no amount and move the whole uncaptured escrow, so this is the capturable residual as of prepare, re-sealed with the exact on-chain amount when the indexer confirms.
|
|
331
|
+
:block_number, # Integer | nil
|
|
332
|
+
:gas_used, # String | nil — Gas units used, mirrored from the indexer on confirm.
|
|
333
|
+
:gas_limit, # String | nil — Gas limit, mirrored from the indexer on confirm.
|
|
334
|
+
:effective_gas_price, # String | nil — Effective gas price in wei, mirrored from the indexer on confirm.
|
|
335
|
+
:base_fee_per_gas, # String | nil — Block base fee per gas in wei, mirrored from the indexer on confirm.
|
|
336
|
+
:gas_cost, # String | nil — Total gas cost in wei (gas_used * effective_gas_price); derived, null until confirmed.
|
|
337
|
+
:pending_at, # String | nil
|
|
338
|
+
:submitted_at, # String | nil
|
|
339
|
+
:confirmed_at, # String | nil
|
|
329
340
|
:created_at, # String
|
|
330
341
|
:updated_at, # String
|
|
331
342
|
keyword_init: true
|
|
@@ -339,10 +350,10 @@ module Rail0
|
|
|
339
350
|
:address, # String
|
|
340
351
|
:version, # String — Semver, and every ACTIVE deployment must agree on the one the code targets.
|
|
341
352
|
:deployed_at, # String
|
|
342
|
-
:start_block, # Where the indexer starts. Null means the deployment block.
|
|
353
|
+
:start_block, # Integer | nil — Where the indexer starts. Null means the deployment block.
|
|
343
354
|
:active, # Boolean — The single deployment new payments are opened against, at most one per chain.
|
|
344
355
|
:archived, # Boolean — Always false here: the listing excludes archived deployments.
|
|
345
|
-
:archived_at,
|
|
356
|
+
:archived_at, # String | nil
|
|
346
357
|
:created_at, # String
|
|
347
358
|
:updated_at, # String
|
|
348
359
|
keyword_init: true
|
|
@@ -356,7 +367,7 @@ module Rail0
|
|
|
356
367
|
Account = Struct.new(
|
|
357
368
|
:id, # String
|
|
358
369
|
:name, # String
|
|
359
|
-
:email,
|
|
370
|
+
:email, # String | nil
|
|
360
371
|
:priority_tip, # Boolean — Whether the merchant's own transactions tip the network's suggested priority fee (true, the default) or the chain's minimum tip (false: 0 on most chains, 25 gwei on Polygon PoS/Amoy). The buyer's dispute/close_dispute never read it.
|
|
361
372
|
:authorization_ttl, # Integer — Seconds an authorization of the account's new payments stays capturable after the payment is created: the account's own value, or the gateway default (AUTHORIZATION_TTL).
|
|
362
373
|
:refund_ttl, # Integer — Seconds the account's new payments stay refundable, and open to a dispute, after they are created: the account's own value, or the gateway default (REFUND_TTL).
|
|
@@ -402,15 +413,15 @@ module Rail0
|
|
|
402
413
|
:name, # String
|
|
403
414
|
:email, # String — Lowercase.
|
|
404
415
|
:address, # String — Lowercase 0x + 40 hex.
|
|
405
|
-
:created_by, # The operator account of an invite; null for a sign-up.
|
|
416
|
+
:created_by, # String | nil — The operator account of an invite; null for a sign-up.
|
|
406
417
|
:link_version, # Integer — The version of the last link minted; a link for any lower one answers onboarding_link_superseded.
|
|
407
418
|
:last_sent_at, # String — When the last send was queued.
|
|
408
419
|
:send_count, # Integer — Sends queued in all (0 for a request migrated from a pending account, which has no link in the current format yet).
|
|
409
|
-
:last_delivered_at, # When the provider accepted the last send.
|
|
410
|
-
:last_send_error, # A short fixed code for why the last send failed (provider_rejected, timeout, email_domain_not_allowed, …); null when it was delivered or is in flight.
|
|
420
|
+
:last_delivered_at, # String | nil — When the provider accepted the last send.
|
|
421
|
+
:last_send_error, # String | nil — A short fixed code for why the last send failed (provider_rejected, timeout, email_domain_not_allowed, …); null when it was delivered or is in flight.
|
|
411
422
|
:expires_at, # String — When the last link, and the open request, expire.
|
|
412
|
-
:completed_at, # When the claim created the account.
|
|
413
|
-
:terms_version, # The terms version accepted at the claim.
|
|
423
|
+
:completed_at, # String | nil — When the claim created the account.
|
|
424
|
+
:terms_version, # String | nil — The terms version accepted at the claim.
|
|
414
425
|
:created_at, # String
|
|
415
426
|
:updated_at, # String
|
|
416
427
|
:status, # String
|
|
@@ -541,17 +552,19 @@ module Rail0
|
|
|
541
552
|
)
|
|
542
553
|
|
|
543
554
|
EventCallback = Struct.new(
|
|
544
|
-
:id,
|
|
545
|
-
:webhook_id,
|
|
546
|
-
:payment_id,
|
|
547
|
-
:
|
|
548
|
-
:
|
|
549
|
-
:
|
|
550
|
-
:
|
|
551
|
-
:
|
|
552
|
-
:
|
|
553
|
-
:
|
|
554
|
-
:
|
|
555
|
+
:id, # String
|
|
556
|
+
:webhook_id, # String
|
|
557
|
+
:payment_id, # String | nil — The payment a payments.* delivery is about. Exactly one of payment_id, payout_id and payout_destination_id is set.
|
|
558
|
+
:payout_id, # String | nil — The payout a payouts.* delivery is about.
|
|
559
|
+
:payout_destination_id, # String | nil — The destination a payout_destinations.verified delivery is about.
|
|
560
|
+
:topic, # String
|
|
561
|
+
:callback_url, # String
|
|
562
|
+
:response_code, # String | nil
|
|
563
|
+
:response_message, # String | nil
|
|
564
|
+
:error_reason, # String | nil
|
|
565
|
+
:status, # String
|
|
566
|
+
:created_at, # String
|
|
567
|
+
:payload, # String | nil — The JSON request body POSTed to the callback URL (decompressed).
|
|
555
568
|
keyword_init: true
|
|
556
569
|
)
|
|
557
570
|
|
|
@@ -564,5 +577,80 @@ module Rail0
|
|
|
564
577
|
:contract_address, # String — Address (lowercase) of the RAIL0 deployment the payment is bound to, archived versions included. The sweeper accepts a receipt's event only when this contract emitted it.
|
|
565
578
|
keyword_init: true
|
|
566
579
|
)
|
|
580
|
+
|
|
581
|
+
# One entry of the payout audit trail, written in the same transaction as the change it records.
|
|
582
|
+
# Append-only.
|
|
583
|
+
PayoutEvent = Struct.new(
|
|
584
|
+
:id, # String
|
|
585
|
+
:action, # String
|
|
586
|
+
:actor, # String — Who did it: the lowercase 0x address of the session wallet; `system` for the gateway's own settlement (Recovery); `operator:<administrator id>` reserved for an operator (none today).
|
|
587
|
+
:changes, # Hash | nil — `{"before": {…}, "after": {…}}` of the fields the event changed, either side optional. Amounts in base units. Never a signature or a payload. `destination.created` and `destination.min_amount_changed` also carry `confirmed_details`: `{"version": "details_v1", "by": <session address>, "at": <ISO 8601 UTC>}`, the merchant's attestation that they checked the details at the venue.
|
|
588
|
+
:destination_id, # String | nil — The destination, also on every payout event.
|
|
589
|
+
:payout_id, # String | nil — Null for a destination event, and once Retention purged the payout (a never-signed prepare).
|
|
590
|
+
:wallet_id, # String — The destination's / payout's wallet (not necessarily the actor's).
|
|
591
|
+
:created_at, # String
|
|
592
|
+
keyword_init: true
|
|
593
|
+
)
|
|
594
|
+
|
|
595
|
+
# An account named and nothing more, embedded where an operator listing must say whose row each is.
|
|
596
|
+
AccountSummary = Struct.new(
|
|
597
|
+
:id, # String
|
|
598
|
+
:name, # String
|
|
599
|
+
keyword_init: true
|
|
600
|
+
)
|
|
601
|
+
|
|
602
|
+
PayoutDestination = Struct.new(
|
|
603
|
+
:id, # String
|
|
604
|
+
:wallet_id, # String
|
|
605
|
+
:chain_id, # Integer
|
|
606
|
+
:token, # String — ERC-20 address on that chain, lowercased.
|
|
607
|
+
:token_symbol, # String | nil
|
|
608
|
+
:address, # String — The deposit address, lowercased.
|
|
609
|
+
:label, # String | nil
|
|
610
|
+
:kind, # String
|
|
611
|
+
:status, # String
|
|
612
|
+
:has_code, # Boolean | nil — Whether the address held code on this chain when registered (eth_getCode, best effort). An EOA and an undeployed contract look the same.
|
|
613
|
+
:reserve_amount, # String | nil — Base units kept in the wallet on a full-balance payout; null = the suggestion.
|
|
614
|
+
:reserve_amount_formatted, # String | nil — `reserve_amount` in human decimals (the token's decimals); null while the suggestion applies, or when the token left the catalog.
|
|
615
|
+
:suggested_reserve, # String — Base units: the refundable balance of the wallet's payments in this token still inside their refund window.
|
|
616
|
+
:suggested_reserve_formatted, # String | nil — `suggested_reserve` in human decimals; null when the token left the catalog.
|
|
617
|
+
:min_amount, # String | nil — The venue's deposit minimum, base units; null = no minimum. A payout below it is refused (`payout_below_minimum`); the proof transfer is raised to it.
|
|
618
|
+
:min_amount_formatted, # String | nil — `min_amount` in human decimals (the token's decimals); null when there is no minimum, or when the token left the catalog.
|
|
619
|
+
:proof_payout_id, # String | nil
|
|
620
|
+
:verified_at, # String | nil
|
|
621
|
+
:disabled_at, # String | nil
|
|
622
|
+
:created_at, # String
|
|
623
|
+
:updated_at, # String
|
|
624
|
+
keyword_init: true
|
|
625
|
+
)
|
|
626
|
+
|
|
627
|
+
Payout = Struct.new(
|
|
628
|
+
:id, # String
|
|
629
|
+
:destination_id, # String
|
|
630
|
+
:wallet_id, # String
|
|
631
|
+
:chain_id, # Integer
|
|
632
|
+
:token, # String
|
|
633
|
+
:token_symbol, # String | nil
|
|
634
|
+
:address, # String — The recipient.
|
|
635
|
+
:amount, # String — Base units.
|
|
636
|
+
:amount_formatted, # String — Human decimals.
|
|
637
|
+
:purpose, # String
|
|
638
|
+
:status, # String
|
|
639
|
+
:unsigned_transaction, # String | nil — JSON of the EIP-1559 transaction to sign (`to` = the token, `data` = transfer(address,uint256)). Check it against the decoded fields beside it before signing.
|
|
640
|
+
:signed, # Boolean — Whether the gateway stores the wallet's signed transaction (the payload itself is never exposed). A `pending` payout with `signed: true` already has its `transaction_hash` and may be in a mempool: resend it (POST /payouts/{id}/resend); it cannot be re-prepared.
|
|
641
|
+
:transaction_hash, # String | nil — Keccak of the signed transaction, stored with it on submit (so a signed `pending` row has it too), or the hash the wallet reported.
|
|
642
|
+
:sender, # String | nil
|
|
643
|
+
:block_number, # Integer | nil
|
|
644
|
+
:gas_used, # String | nil
|
|
645
|
+
:error_code, # String | nil — When failed: `reverted` (mined, status 0), `foreign_transfer` (mined, but the receipt has no Transfer of this amount of this token from the wallet to this destination), `dropped` (not mined, and the wallet's confirmed nonce has passed the signed transaction's), `submission_timeout` (a reported hash no node has ever known, past SUBMITTED_TX_TTL), `cancelled` (unsigned, cancelled by the merchant with POST /payouts/{id}/cancel or by disabling its destination). `submission_timeout` and `dropped` are not final: POST /payouts/{id}/submitted with a late hash puts the payout back to `submitted`.
|
|
646
|
+
:error_title, # String | nil
|
|
647
|
+
:error_detail, # String | nil
|
|
648
|
+
:submitted_at, # String | nil
|
|
649
|
+
:confirmed_at, # String | nil
|
|
650
|
+
:failed_at, # String | nil
|
|
651
|
+
:created_at, # String
|
|
652
|
+
:updated_at, # String
|
|
653
|
+
keyword_init: true
|
|
654
|
+
)
|
|
567
655
|
end
|
|
568
656
|
end
|
data/lib/rail0/version.rb
CHANGED
|
@@ -5,5 +5,5 @@ module Rail0
|
|
|
5
5
|
# consumed by path from a sibling checkout, where the number bought nothing: no registry
|
|
6
6
|
# ever served a 1.x, no tag was ever cut, and the one consumer resolves the working tree.
|
|
7
7
|
# Publishing from 1.2.0 would have implied two releases nobody can install.
|
|
8
|
-
VERSION = "1.
|
|
8
|
+
VERSION = "1.9.0"
|
|
9
9
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rail0-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Commerce Layer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: logger
|
|
@@ -45,6 +45,7 @@ files:
|
|
|
45
45
|
- lib/rail0/error_hints.rb
|
|
46
46
|
- lib/rail0/http_client.rb
|
|
47
47
|
- lib/rail0/payload_verify.rb
|
|
48
|
+
- lib/rail0/payout_verify.rb
|
|
48
49
|
- lib/rail0/request.rb
|
|
49
50
|
- lib/rail0/resources/accounts.rb
|
|
50
51
|
- lib/rail0/resources/analytics.rb
|
|
@@ -54,6 +55,8 @@ files:
|
|
|
54
55
|
- lib/rail0/resources/health.rb
|
|
55
56
|
- lib/rail0/resources/payment_methods.rb
|
|
56
57
|
- lib/rail0/resources/payments.rb
|
|
58
|
+
- lib/rail0/resources/payout_destinations.rb
|
|
59
|
+
- lib/rail0/resources/payouts.rb
|
|
57
60
|
- lib/rail0/resources/query.rb
|
|
58
61
|
- lib/rail0/resources/tokens.rb
|
|
59
62
|
- lib/rail0/resources/wallets.rb
|