rail0-sdk 1.7.1 → 1.7.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d88d3da009d4c04853e8fb794eba655913763a1391c6e0bd6915bda6cb68d36
4
- data.tar.gz: 5cc37022ce71f950c6b11dcf421902518b63caebfd54a13f78eaf909a7eef39c
3
+ metadata.gz: 3c69ef678235fc14acf0f3bcaebc302bd3b63d6dd1b41a1358381b49fd6a9738
4
+ data.tar.gz: 1d42362b54cf2118b2150087211bd7f5df49a8248278af49603fd745d32be08b
5
5
  SHA512:
6
- metadata.gz: 2512e0a842d7d76749dc4028a0c1d2590b7fe1dd4e95676572a39aa8c41fa9a882c2e4a534e85080f0fe8089c8001c6f2101ff4b9fb7ab9f4e2cc9d7e6d35d62
7
- data.tar.gz: 7b569639525815722a586f308d45ebc67c964cbd4f6f1ae4c5bac4a8c5a731589b03dffebcfcdb375e3a265f9f1143b52162d5e8685de591e39a364de3257cf8
6
+ metadata.gz: 061516a40ea00e3ebf114f9ae841bfac830682f443caaa8f82fbe4789de91d1eab760896c6a0447a371092cd01f5bbb9f30200e8e17f0897bce60390ba541e82
7
+ data.tar.gz: 5f0e8c80653d3234d24f2816f607a84ecfb99c743afa2dd58fa64d3c184510458796ab54efc8cad00c7b478f35a26bf68d6339e1c592dff8d2712d087e3aae03
data/README.md CHANGED
@@ -382,6 +382,7 @@ client.wallets.list(account_id, token_active: true)
382
382
 
383
383
  client.wallets.get(account_id, id_or_address)
384
384
  client.wallets.update(account_id, id_or_address, label: "Renamed", active: false)
385
+ client.wallets.update(account_id, id_or_address, active: true) # back on (see below)
385
386
  client.wallets.delete(account_id, id_or_address) # 204
386
387
  client.wallets.balances(account_id, id_or_address, chain_id: 84532) # live on-chain balances
387
388
  ```
@@ -392,6 +393,17 @@ refused with 422 `last_active_wallet` — login resolves the account from a wall
392
393
  so an account with none could neither act nor add one back. Another wallet must
393
394
  be active first.
394
395
 
396
+ **Switching a wallet back on.** Every switch-off records who did it in the wallet's
397
+ `deactivated_by`: `"owner"` (a session signed in with that wallet) or `"operator"`
398
+ (an operator session); `nil` while active, and on a switch-off older than the record.
399
+ A deactivated wallet's session is read-only (403 `wallet_deactivated`) except for one
400
+ write: `update(account_id, id, active: true)` on its **own** wallet, which switches it
401
+ back on when its owner switched it off. A wallet an operator switched off (or with
402
+ `deactivated_by: nil`) raises 403 `wallet_deactivated_by_operator`: an operator's
403
+ switch-off revokes the key, so only an operator lifts it. The flip side: a wallet its
404
+ owner switched off can be switched back on by whoever holds its key, so a definitive
405
+ revocation (a leaked key) must come from an operator.
406
+
395
407
  **A session is bound to the wallet it signed in with.** Reads (`list`, `get`,
396
408
  `balances`) are account-wide, but `update`, `delete` and the token-holding methods
397
409
  act only on the session's own wallet: another wallet of the same account is
@@ -55,7 +55,10 @@ module Rail0
55
55
  "not_payer_or_payee" => "only the payer or the payee may do this",
56
56
  "release_submitter_not_a_party" => "a release must be sent by the payment's payer or payee — omit `from` to build it for the signed-in wallet",
57
57
  "payer_must_be_caller" => "the payer must be the signed-in wallet — sign in as the buyer to create its payment",
58
- "wallet_deactivated" => "this wallet is deactivated: it can still read, but not act on payments or change the account — reactivate it or sign in with another of the account's wallets",
58
+ # gateway#439: a deactivated session may switch its OWN wallet back on when its owner
59
+ # switched it off; an operator's switch-off is the operator's to lift.
60
+ "wallet_deactivated" => "this wallet is deactivated: it can still read, but not act on payments or change the account — if you switched it off, its own session can switch it back on (wallets.update(..., active: true)), or sign in with another of the account's wallets",
61
+ "wallet_deactivated_by_operator" => "an operator deactivated this wallet, so only an operator can reactivate it — ask an operator to reactivate it",
59
62
  "account_deactivated" => "the merchant account is deactivated: void, release and refund still work, but authorize, charge, capture and account changes do not — ask an operator to reactivate it",
60
63
  # A session is bound to the one wallet it signed in with: the account's other wallets
61
64
  # are readable, but not this session's to change (operators are exempt).
@@ -65,8 +68,9 @@ module Rail0
65
68
  "wallet_add_unavailable" => "adding a wallet to an account is not available yet — it returns with the merchant wallet-management section",
66
69
  # Login resolves the account FROM a wallet, so an account left with no active one
67
70
  # could neither act nor add a wallet back. Adding a wallet is suspended and a session
68
- # changes only its own wallet, so the other wallet has to be reactivated by an operator.
69
- "last_active_wallet" => "this is the account's only active wallet — another wallet must be active before this one can be switched off (adding a wallet is not available yet; an operator can reactivate one)",
71
+ # changes only its own wallet, so the other wallet comes back on from its own session
72
+ # (if its owner switched it off) or from an operator (gateway#439).
73
+ "last_active_wallet" => "this is the account's only active wallet — another wallet must be active before this one can be switched off: sign in with one you switched off and reactivate it, or ask an operator (adding a wallet is not available yet)",
70
74
  "last_admin" => "the change would leave no active operator — grant the operator role to another active account first",
71
75
  "not_redrivable" => "only a pending transaction that already holds its signed bytes can be redriven — check the transaction's `redrivable` flag, and submit the signature if it has none",
72
76
  "refund_expired" => "the refund window has closed (refundExpiry passed) — refund/dispute is no longer possible",
@@ -92,11 +92,16 @@ module Rail0
92
92
  # operator may change any). +active: false+ on the account's only active wallet
93
93
  # raises ApiError 422 +last_active_wallet+: login resolves the account from a
94
94
  # wallet, so an account with none could neither act nor add one back.
95
+ #
96
+ # +active: true+ is the one write a deactivated wallet's own session may make: it
97
+ # switches the wallet back on when its owner switched it off. A wallet an operator
98
+ # switched off (+deactivated_by+ "operator", or nil on an older switch-off) raises
99
+ # ApiError 403 +wallet_deactivated_by_operator+: only an operator lifts it.
95
100
  # @param account_id [String] Account UUID.
96
101
  # @param id_or_address [String] Wallet UUID or 0x address.
97
102
  # @param label [String, nil] New label.
98
103
  # @param active [Boolean, nil] New active status.
99
- # @return [Hash] id, address, label, active
104
+ # @return [Hash] id, address, label, active, deactivated_by
100
105
  def update(account_id, id_or_address, label: nil, active: nil)
101
106
  body = {}
102
107
  body[:label] = label unless label.nil?
data/lib/rail0/types.rb CHANGED
@@ -209,10 +209,11 @@ module Rail0
209
209
 
210
210
  # Public-safe wallet view (the reduced set a buyer needs to discover a merchant's payment methods).
211
211
  Wallet = Struct.new(
212
- :id, # String
213
- :address, # String
212
+ :id, # String
213
+ :address, # String
214
214
  :label,
215
- :active, # Boolean
215
+ :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.
216
217
  keyword_init: true
217
218
  )
218
219
 
@@ -229,11 +230,12 @@ module Rail0
229
230
  # A wallet with its token holdings nested inline. `tokens` is empty when the wallet has none — the
230
231
  # wallet is still returned, never omitted.
231
232
  WalletWithTokens = Struct.new(
232
- :id, # String
233
- :address, # String
233
+ :id, # String
234
+ :address, # String
234
235
  :label,
235
- :active, # Boolean
236
- :tokens, # Array
236
+ :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.
238
+ :tokens, # Array
237
239
  keyword_init: true
238
240
  )
239
241
 
@@ -474,7 +476,8 @@ module Rail0
474
476
  :webhooks, # Hash
475
477
  :settlement, # Hash
476
478
  :rate_limit, # Hash
477
- :siwe, # Hash
479
+ :siwe, # Hash — domains (SIWE_DOMAIN), accepted_chain_ids (1 plus the ids of the active catalog chains: the chainId values a login may carry) and nonce_ttl.
480
+ :session, # Hash — environment (RAIL0_ENVIRONMENT, default RACK_ENV: the scope every issued token is bound to), jwt_ttl and jwt_audience: the session token's lifetime (a constant) and audience (`rail0-gateway:<environment>`).
478
481
  :fees, # Hash
479
482
  :rpc, # Hash
480
483
  :onboarding, # Hash
@@ -532,18 +535,5 @@ module Rail0
532
535
  :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.
533
536
  keyword_init: true
534
537
  )
535
-
536
- # Per-chain indexer config.
537
- SyncBlockchain = Struct.new(
538
- :chain_id, # Integer
539
- :start_block, # Integer
540
- :required_confirmations, # Integer — Fallback burial depth, used where the chain serves no finality tag.
541
- :finality_tag, # String — Which block the chain calls settled; the indexer gates every notify on it.
542
- :explorer_url, # Block explorer base URL; null when the chain has none.
543
- :network_type, # String — "testnet" or "mainnet"; selects which chains a deployment indexes.
544
- :rpc_urls, # Array — Ordered list of public RPC endpoints tried in turn (serial fallback).
545
- :contracts, # Array — Active RAIL0 contract addresses on the chain (all watched versions).
546
- keyword_init: true
547
- )
548
538
  end
549
539
  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.7.1"
8
+ VERSION = "1.7.2"
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.7.1
4
+ version: 1.7.2
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-20 00:00:00.000000000 Z
11
+ date: 2026-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logger