rail0-sdk 1.5.0 → 1.5.1
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 +11 -2
- data/lib/rail0/error_hints.rb +9 -2
- data/lib/rail0/resources/wallets.rb +20 -4
- data/lib/rail0/types.rb +22 -4
- data/lib/rail0/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 106a0758b1da0b740e9c6e78fb83ffa9cdbfb53d562c2784b67d544aba2d58c3
|
|
4
|
+
data.tar.gz: '09690a456b1bb50bd573944a3ef9b7f980748bb32eb76ce7c17312a70914cf7a'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0e50c24f6276cb4ba23c812dcc8bc7f3b58cf92715855518bb0a76725c3393959487eb29e59794312bd0ccaab49148b436d5c1873cdeb5029db32f5f5a15ef1
|
|
7
|
+
data.tar.gz: 59463fad22c007aea05412ade646a21c051db20a85f886bc62897442c810f3c1d3d0f295f03c252c691661be958e8d3f729e7aacbdc0af4a7613a5d13e626483
|
data/README.md
CHANGED
|
@@ -327,8 +327,17 @@ client.wallets.balances(account_id, id_or_address, chain_id: 84532) # live on-ch
|
|
|
327
327
|
`delete` only deactivates (the same as `update(active: false)`; payments name the
|
|
328
328
|
address, so the row stays). Either way the account's **only active wallet** is
|
|
329
329
|
refused with 422 `last_active_wallet` — login resolves the account from a wallet,
|
|
330
|
-
so an account with none could neither act nor add one back.
|
|
331
|
-
|
|
330
|
+
so an account with none could neither act nor add one back. Another wallet must
|
|
331
|
+
be active first.
|
|
332
|
+
|
|
333
|
+
**A session is bound to the wallet it signed in with.** Reads (`list`, `get`,
|
|
334
|
+
`balances`) are account-wide, but `update`, `delete` and the token-holding methods
|
|
335
|
+
act only on the session's own wallet: another wallet of the same account is
|
|
336
|
+
refused with 403 `not_your_wallet`. An operator session is exempt.
|
|
337
|
+
|
|
338
|
+
> **Adding a wallet is currently unavailable.** The gateway answers every
|
|
339
|
+
> `wallets.create` with 403 `wallet_add_unavailable`. It returns with the merchant
|
|
340
|
+
> wallet-management section, which keeps the request shape and the proof below.
|
|
332
341
|
|
|
333
342
|
**Registering a wallet needs a SIWE proof-of-ownership of the address being
|
|
334
343
|
added**, not merely the session JWT. `auth.prove_address` runs that handshake and
|
data/lib/rail0/error_hints.rb
CHANGED
|
@@ -56,9 +56,16 @@ module Rail0
|
|
|
56
56
|
"payer_must_be_caller" => "the payer must be the signed-in wallet — sign in as the buyer to create its payment",
|
|
57
57
|
"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
58
|
"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",
|
|
59
|
+
# A session is bound to the one wallet it signed in with: the account's other wallets
|
|
60
|
+
# are readable, but not this session's to change (operators are exempt).
|
|
61
|
+
"not_your_wallet" => "a session can change only the wallet it signed in with — sign in with that wallet to update it, deactivate it or manage its tokens",
|
|
62
|
+
# POST /accounts/:id/wallets is suspended for every session until the merchant
|
|
63
|
+
# wallet-management section lands.
|
|
64
|
+
"wallet_add_unavailable" => "adding a wallet to an account is not available yet — it returns with the merchant wallet-management section",
|
|
59
65
|
# Login resolves the account FROM a wallet, so an account left with no active one
|
|
60
|
-
# could neither act nor add a wallet back.
|
|
61
|
-
|
|
66
|
+
# could neither act nor add a wallet back. Adding a wallet is suspended and a session
|
|
67
|
+
# changes only its own wallet, so the other wallet has to be reactivated by an operator.
|
|
68
|
+
"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)",
|
|
62
69
|
"last_admin" => "the change would leave no active operator — grant the operator role to another active account first",
|
|
63
70
|
"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",
|
|
64
71
|
"refund_expired" => "the refund window has closed (refundExpiry passed) — refund/dispute is no longer possible",
|
|
@@ -11,6 +11,12 @@ module Rail0
|
|
|
11
11
|
# with its token holdings nested under +tokens+ (a wallet with no matching
|
|
12
12
|
# tokens is still returned with an empty list). +id_or_address+ accepts either
|
|
13
13
|
# the wallet UUID or its 0x address (unique per account).
|
|
14
|
+
#
|
|
15
|
+
# A session is bound to the wallet it signed in with. Reads (list, get, balances)
|
|
16
|
+
# are account-wide, but update, delete and the token-holding methods act only on
|
|
17
|
+
# the session's own wallet: another wallet of the same account raises ApiError 403
|
|
18
|
+
# +not_your_wallet+ (an operator session is exempt). +create+ is suspended for
|
|
19
|
+
# every session (403 +wallet_add_unavailable+).
|
|
14
20
|
class Wallets
|
|
15
21
|
include Query
|
|
16
22
|
|
|
@@ -51,6 +57,10 @@ module Rail0
|
|
|
51
57
|
|
|
52
58
|
# Add a wallet to the account.
|
|
53
59
|
#
|
|
60
|
+
# CURRENTLY UNAVAILABLE: the gateway answers every session ApiError 403
|
|
61
|
+
# +wallet_add_unavailable+ until the merchant wallet-management section lands.
|
|
62
|
+
# The method and its proof shape are kept because that section reuses them.
|
|
63
|
+
#
|
|
54
64
|
# Requires a SIWE PROOF-OF-OWNERSHIP of the address being added, not merely
|
|
55
65
|
# the session JWT: the gateway verifies that +signature+ recovers to
|
|
56
66
|
# +address+ (422 otherwise), consumes the nonce carried in +message+, and
|
|
@@ -77,9 +87,11 @@ module Rail0
|
|
|
77
87
|
http.post("/accounts/#{segment(account_id)}/wallets", body)
|
|
78
88
|
end
|
|
79
89
|
|
|
80
|
-
# Update a wallet's label and/or active status.
|
|
81
|
-
#
|
|
82
|
-
#
|
|
90
|
+
# Update a wallet's label and/or active status. Only the wallet the session signed
|
|
91
|
+
# in with: another wallet of the account raises ApiError 403 +not_your_wallet+ (an
|
|
92
|
+
# operator may change any). +active: false+ on the account's only active wallet
|
|
93
|
+
# raises ApiError 422 +last_active_wallet+: login resolves the account from a
|
|
94
|
+
# wallet, so an account with none could neither act nor add one back.
|
|
83
95
|
# @param account_id [String] Account UUID.
|
|
84
96
|
# @param id_or_address [String] Wallet UUID or 0x address.
|
|
85
97
|
# @param label [String, nil] New label.
|
|
@@ -93,7 +105,8 @@ module Rail0
|
|
|
93
105
|
end
|
|
94
106
|
|
|
95
107
|
# Soft-delete (deactivate) a wallet — the same as +update(active: false)+, so the
|
|
96
|
-
# account's only active wallet raises ApiError 422 +last_active_wallet
|
|
108
|
+
# account's only active wallet raises ApiError 422 +last_active_wallet+, and another
|
|
109
|
+
# wallet than the session's own 403 +not_your_wallet+. Returns HTTP 204.
|
|
97
110
|
# @param account_id [String] Account UUID.
|
|
98
111
|
# @param id_or_address [String] Wallet UUID or 0x address.
|
|
99
112
|
# @return [nil]
|
|
@@ -119,6 +132,9 @@ module Rail0
|
|
|
119
132
|
# Which tokens a wallet accepts, on which chains. This is what GET
|
|
120
133
|
# /payment_methods then exposes to buyers, so a merchant onboarding flow that
|
|
121
134
|
# can create a wallet but not configure its tokens cannot finish. (#12)
|
|
135
|
+
#
|
|
136
|
+
# Owner only, and only on the wallet the session signed in with: another wallet
|
|
137
|
+
# of the same account raises ApiError 403 +not_your_wallet+.
|
|
122
138
|
|
|
123
139
|
# Accept a token (on a chain) on this wallet.
|
|
124
140
|
#
|
data/lib/rail0/types.rb
CHANGED
|
@@ -106,7 +106,7 @@ module Rail0
|
|
|
106
106
|
)
|
|
107
107
|
|
|
108
108
|
AdminRpcHealthEndpoint = Struct.new(
|
|
109
|
-
:url, # String —
|
|
109
|
+
:url, # String — The endpoint, as configured.
|
|
110
110
|
:ok, # Boolean
|
|
111
111
|
:status, # String
|
|
112
112
|
:error, # String — Short `Class: first line`; never an upstream body.
|
|
@@ -348,6 +348,23 @@ module Rail0
|
|
|
348
348
|
keyword_init: true
|
|
349
349
|
)
|
|
350
350
|
|
|
351
|
+
# The whole account record, as an operator reads it (Full entity: GET /accounts, POST /accounts, and
|
|
352
|
+
# GET/PATCH /accounts/{account_id} for an admin session): every column plus `admin` and the derived
|
|
353
|
+
# `status`.
|
|
354
|
+
AccountFull = Struct.new(
|
|
355
|
+
:id, # String
|
|
356
|
+
:name, # String
|
|
357
|
+
:email, # String — Stored lowercase.
|
|
358
|
+
:active, # Boolean — The operator's switch. false = deactivated.
|
|
359
|
+
:priority_tip, # Boolean — The merchant's fee setting (see Account.priority_tip).
|
|
360
|
+
:claimed_at, # When the merchant claimed the account at POST /claim; null while it is pending its claim.
|
|
361
|
+
:created_at, # String
|
|
362
|
+
:updated_at, # String
|
|
363
|
+
:admin, # Boolean — Whether the account holds the operator grant (a row in administrators).
|
|
364
|
+
:status, # String — One-word reading of active and claimed_at together: pending_claim (not yet claimed, not operational), active (claimed and active) or deactivated (switched off by an operator, claimed or not).
|
|
365
|
+
keyword_init: true
|
|
366
|
+
)
|
|
367
|
+
|
|
351
368
|
# An operator grant with the people named.
|
|
352
369
|
AdministratorFull = Struct.new(
|
|
353
370
|
:id, # String
|
|
@@ -379,9 +396,10 @@ module Rail0
|
|
|
379
396
|
|
|
380
397
|
# One reported policy value.
|
|
381
398
|
PolicySetting = Struct.new(
|
|
382
|
-
:value,
|
|
383
|
-
:env,
|
|
384
|
-
:overridden,
|
|
399
|
+
:value, # The effective value (number, boolean, string, list or map).
|
|
400
|
+
:env, # String — The environment variable that sets it; null for a constant.
|
|
401
|
+
:overridden, # Boolean — Whether that variable is set in this process.
|
|
402
|
+
:description, # String — Plain-text explanation of the entry: what it controls, which part of the gateway reads it and the effect of raising or lowering it, and its unit (from config/policy_descriptions.yml). Every entry has one; older gateways omit the field.
|
|
385
403
|
keyword_init: true
|
|
386
404
|
)
|
|
387
405
|
|
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.5.
|
|
8
|
+
VERSION = "1.5.1"
|
|
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.5.
|
|
4
|
+
version: 1.5.1
|
|
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-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: logger
|