@integraledger/profile-facilitator 0.5.0 → 0.6.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.
- package/CHANGELOG.md +556 -0
- package/README.md +754 -111
- package/dist/core.d.ts +1 -1
- package/dist/core.js +683 -66
- package/dist/http.d.ts +19 -4
- package/dist/http.js +16 -6
- package/dist/module.d.ts +111 -24
- package/dist/module.js +39 -0
- package/dist/modules/algorand/index.js +1 -1
- package/dist/modules/aptos/index.js +1 -1
- package/dist/modules/cardano/index.js +1 -1
- package/dist/modules/casper/index.js +15 -3
- package/dist/modules/concordium/index.js +1 -1
- package/dist/modules/erc7710/index.d.ts +8 -5
- package/dist/modules/erc7710/index.js +1111 -34
- package/dist/modules/evm/escrow.d.ts +125 -0
- package/dist/modules/evm/escrow.js +619 -0
- package/dist/modules/evm/forms.d.ts +39 -11
- package/dist/modules/evm/forms.js +191 -25
- package/dist/modules/evm/index.d.ts +41 -6
- package/dist/modules/evm/index.js +1135 -20
- package/dist/modules/evm/node.d.ts +16 -1
- package/dist/modules/evm/node.js +181 -26
- package/dist/modules/evm/nonce-proof.d.ts +186 -0
- package/dist/modules/evm/nonce-proof.js +779 -0
- package/dist/modules/hedera/executor.js +1 -1
- package/dist/modules/hedera/index.js +1 -1
- package/dist/modules/lnbtc/index.js +3 -2
- package/dist/modules/near/index.js +1 -1
- package/dist/modules/polkadot/index.js +1 -1
- package/dist/modules/solana/index.d.ts +3 -0
- package/dist/modules/solana/index.js +119 -10
- package/dist/modules/solana/reader.d.ts +2 -1
- package/dist/modules/solana/reader.js +42 -4
- package/dist/modules/solana/upto-claim.d.ts +58 -0
- package/dist/modules/solana/upto-claim.js +269 -0
- package/dist/modules/starknet/index.js +9 -2
- package/dist/modules/stellar/index.d.ts +5 -0
- package/dist/modules/stellar/index.js +18 -8
- package/dist/modules/stellar/node.d.ts +7 -1
- package/dist/modules/stellar/node.js +51 -7
- package/dist/modules/sui/index.js +66 -20
- package/dist/modules/sui/node.d.ts +13 -0
- package/dist/modules/sui/node.js +60 -0
- package/dist/modules/ton/index.js +6 -2
- package/dist/modules/tron/index.js +1 -1
- package/dist/modules/xrpl/index.js +61 -12
- package/dist/modules/xrpl/node.d.ts +31 -2
- package/dist/modules/xrpl/node.js +88 -17
- package/dist/modules/xrpl/upto.js +106 -20
- package/dist/record.d.ts +52 -8
- package/dist/record.js +39 -5
- package/dist/wrapper.d.ts +7 -5
- package/dist/wrapper.js +7 -5
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Every release of `@integraledger/profile-facilitator`, the settler, with what an operator must act on. The format
|
|
4
|
+
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). The package is 0.x: a minor release may change the
|
|
5
|
+
configuration, the answers or the storage.
|
|
6
|
+
|
|
7
|
+
## [0.6.0] - 2026-12-05
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- The record's `instrument` table has a column `submitted`, set just before the class's settle is called. Both new columns are
|
|
12
|
+
created with the table only: 0.6.0 does not serve a database 0.5.x made
|
|
13
|
+
([Upgrading from 0.5.x](./README.md#upgrading-from-05x)).
|
|
14
|
+
- The record's `instrument` table has a column `fence`, the claim's fencing number: 1 at the claim, one more each time
|
|
15
|
+
a settle takes the claim again. A settle names a transaction for the claim, takes one back and ends its hold only
|
|
16
|
+
while the row's number is still the one it took the claim with. A settle whose hold lapsed and was taken by another
|
|
17
|
+
leaves that settle's name in the row and its hold in place, so a repeat never finds the row naming nothing while
|
|
18
|
+
another settle's send of the same bytes is out, and a third settle never takes the claim while the second is
|
|
19
|
+
sending. A settle that watches a claim another settle holds ends no hold.
|
|
20
|
+
- `evm`: a network's `signer` may give `signTransaction` and `sendRawTransaction` (`EvmSender`) beside
|
|
21
|
+
`FacilitatorEvmSigner`. `auth-capture` requires them (below).
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- The peer dependency is `@integraledger/lcp` `~0.7.0` (0.5.1: `~0.6.3`). Install `@integraledger/lcp@~0.7.0` beside
|
|
26
|
+
it. [Upgrading from 0.5.x](./README.md#upgrading-from-05x) states what an operator changes.
|
|
27
|
+
- Before a refusal that reads final, a settle reads its row again, and, where its wait left no time for the chain's
|
|
28
|
+
read, the chain: a settle that paused past its hold, or lost the race to the claim, answers what they show (a final
|
|
29
|
+
row as a final row is answered; a claim another settle took, pending naming what its row names or
|
|
30
|
+
`unexpected_settle_error`; a final read by its answer), never a refusal of a payment another settle executed. A
|
|
31
|
+
refusal at the check before the claim reads the row again too, and a claim made since is answered as a held one.
|
|
32
|
+
- A store call that fails inside the class's settle of a submission (the module's state, the fee meter's count, the
|
|
33
|
+
naming write), which the class turns into a refusal carrying the database's text, is answered
|
|
34
|
+
`unexpected_settle_error` where nothing was named, never that refusal: nothing was sent, and a repeat asks again.
|
|
35
|
+
- `evm`, `erc7710`: a success the class answers on one receipt at the head is given at once, and the row stays open,
|
|
36
|
+
naming its transaction, until lcp's read shows the payment final on the finalized chain (a read made at once, for at
|
|
37
|
+
most a second, or a repeat's). Until then a repeat reads the chain and answers what it shows: `settlement_pending`
|
|
38
|
+
naming the transaction while its block is above the finalized one, or, where the chain does not hold it (a receipt
|
|
39
|
+
from a node on another fork), what the existing rules give, the same signed payment sent again among them. A later
|
|
40
|
+
success naming another transaction carries `extra.supersedes`, the transaction of the success given before; once
|
|
41
|
+
final, a repeat is answered `invalid_transaction_state` naming the transaction, as before. The operator log has
|
|
42
|
+
`success-superseded` and `success-withdrawn`.
|
|
43
|
+
- The README states whose finality the settler's is: its endpoint's, read from no second source. An operator puts
|
|
44
|
+
behind one endpoint only backends that agree on every block at or below their `finalized` ones, and carries the risk
|
|
45
|
+
of a chain whose `finalized` block its consensus does not make irreversible.
|
|
46
|
+
- `evm`: the read of an escrow message (`auth-capture`'s capture, void or refund) knows the escrow's hold and charge
|
|
47
|
+
events by the topics its bytecode emits (the event's name and its parameters' types, no member's name): a hold or
|
|
48
|
+
charge after the block read before the claim is replayed, where it was passed over.
|
|
49
|
+
- `evm`: an escrow message is not answered `invalid_transaction_state` for good while a transaction the settler signed
|
|
50
|
+
for its call may have executed it or still may. The refusal is given only where one finalized block, read by its
|
|
51
|
+
hash, shows of each such transaction that its nonce is not taken while the escrow's amounts let no call of the
|
|
52
|
+
message execute any more, or that another transaction of the key took its nonce, or that it reverted; where the
|
|
53
|
+
finalized chain shows one of them executed with the message's event, the answer is the success naming it; otherwise
|
|
54
|
+
`settlement_pending` naming the row's transaction. A capture its own transaction executed after another capture of
|
|
55
|
+
the payment was answered `invalid_transaction_state` for good where one lookup by its hash found nothing.
|
|
56
|
+
- `evm`: a transaction of an escrow message the node shows in a block while it answers no receipt for it is no longer
|
|
57
|
+
read as held unmined: it is settled where one finalized block shows it at the gas key's nonce and the events of its
|
|
58
|
+
block, read by that block's hash, hold the message's event by it.
|
|
59
|
+
- `evm`: where the block read before an escrow message's claim could not be read, the node's head is read again
|
|
60
|
+
before the message's first signing and kept in the module's state, and nothing is signed where it cannot be read;
|
|
61
|
+
the message's reads search from it. Such a row answered `settlement_pending` on every repeat once its amounts no
|
|
62
|
+
longer stood.
|
|
63
|
+
- `evm`: a transaction of an escrow message the node dropped for a fee cap below the base fee is signed again at the
|
|
64
|
+
same nonce with a replacement's fees, named in the row and sent, where the node shows none of the transactions
|
|
65
|
+
signed at that nonce and its `pending` count shows none of the key there. Its same bytes were sent again and
|
|
66
|
+
refused while the base fee stayed above their cap.
|
|
67
|
+
- `evm`: no replacement of an escrow message's transaction is signed whose own bound (gas limit times fee cap) is
|
|
68
|
+
above the network's whole fee budget.
|
|
69
|
+
- `evm`: a repeat of an escrow hold (`auth-capture`'s authorize or charge) whose authorization the chain shows unused
|
|
70
|
+
sends nothing while the node holds a transaction of the gas key unmined (its `pending` count above its `latest` one),
|
|
71
|
+
as a repeat of a capture, void or refund does. It is answered `settlement_pending` naming the hold's transaction
|
|
72
|
+
where the row names it, and `unexpected_settle_error` where it names none (the answer to the hold's send was lost).
|
|
73
|
+
- `evm`: where a network registers `auth-capture`, as the default scheme list (`exact`, `upto`, `auth-capture`,
|
|
74
|
+
`batch-settlement`) does, its `signer` must give `signTransaction` and `sendRawTransaction`; the settler does not
|
|
75
|
+
start with one that lacks either (`evm on <network>: auth-capture needs a signer that gives signTransaction and
|
|
76
|
+
sendRawTransaction`). With viem: `signTransaction: async (r) => client.signTransaction(await
|
|
77
|
+
client.prepareTransactionRequest(r))`, `sendRawTransaction: (r) => client.sendRawTransaction(r)`. A network that
|
|
78
|
+
names `schemes` without `auth-capture` needs neither.
|
|
79
|
+
- `erc7710`: the module's signer gives `signTransaction` and `sendRawTransaction` (with viem:
|
|
80
|
+
`signTransaction: async (r) => client.signTransaction(await client.prepareTransactionRequest(r))`,
|
|
81
|
+
`sendRawTransaction: (r) => client.sendRawTransaction(r)`); the settler does not start without them
|
|
82
|
+
(`erc7710 on <network>: the signer must give signTransaction and sendRawTransaction`).
|
|
83
|
+
- `erc7710`: `module_state` holds the module's signed redemptions, each removed once the finalized chain shows that
|
|
84
|
+
redemption's receipt, by a later settle of the module that sends a redemption on that network, and kept otherwise, a settle that sends
|
|
85
|
+
nothing included: one answered a success on a receipt at the head whose block the chain then drops, its nonce taken
|
|
86
|
+
by another transaction of the key, is still read by a repeat, retired, and the sale redeemed by a transaction of its
|
|
87
|
+
own, whose success carries `extra.supersedes`; its bytes are kept after that. It holds the sale each was signed for,
|
|
88
|
+
removed once the key's transaction count at a finalized block, read by its hash, is above its nonce and the
|
|
89
|
+
finalized chain shows what took that nonce, or was read eight times without showing it; for each network the keys whose records are listed, so that those of a
|
|
90
|
+
key the settler no longer signs with are removed as its own are; a settle waits a quarter of a second at most for
|
|
91
|
+
these removals, which go on beside its receipt wait; for each key on a network the
|
|
92
|
+
list of those and the nonce below which nothing is sent; and, for each root delegator on a network, the redemption
|
|
93
|
+
in flight. One transaction is one sale's payment after its receipt as before it: a sale whose signing gives another
|
|
94
|
+
sale's bytes, or bytes at a nonce the finalized chain has passed, is answered `unexpected_settle_error` with nothing
|
|
95
|
+
sent, and its repeat is redeemed by its own transaction.
|
|
96
|
+
- `erc7710`: a redemption whose buyer never asks again does not hold back other sales. One that never reached the node
|
|
97
|
+
is sent again, the same bytes, by the settle of the next sale that signs those bytes; one the node holds unmined and
|
|
98
|
+
underpriced is replaced at its nonce, by the module's rule for a replacement, by the settle or repeat of a sale that
|
|
99
|
+
waits behind it. Either is done for the sale that owns the redemption, and its next repeat names a replacement in
|
|
100
|
+
its row before it judges any redemption at that nonce. Where several were signed at one nonce and the node shows
|
|
101
|
+
one mined, a repeat names that one in the row. A held redemption a key the settler no longer signs with signed is
|
|
102
|
+
not replaced.
|
|
103
|
+
- A held claim is given to the class's settle again, or answered a success by what the chain shows of it, only for a
|
|
104
|
+
payment of the body that claimed the row; another signature over it goes to the class's check. The record keeps the
|
|
105
|
+
body's digest as the row's `body`. The body is what the module states makes two payments under one instrument one
|
|
106
|
+
payment, and, where it states nothing, the payload with its requirements as presented, the signature among them.
|
|
107
|
+
- `stellar`: lcp's read is made by the transaction the module submitted, where the record holds one, and by the first
|
|
108
|
+
act under H otherwise. A buyer who pays twice under one H (a wallet that signs again after `settlement_pending`),
|
|
109
|
+
the second payment submitted by this settler, is answered success naming the second once it lands. A second payment
|
|
110
|
+
this settler did not submit is answered `invalid_transaction_state` naming the first. The module keeps its
|
|
111
|
+
transaction's hash in the record before it sends it, and takes it back out where the node refuses the send, so that
|
|
112
|
+
a settler that stops before the send's answer still has its read made by that transaction.
|
|
113
|
+
- `ton`: lcp's read is made by the request the payment presents (`byRequest`), the payer's signed W5 request, which
|
|
114
|
+
names it by its body hash before anything is sent. A buyer who pays twice under one H, each request at its own
|
|
115
|
+
sequence number, is answered for the second by the second's run: success naming it once it lands, where the class's
|
|
116
|
+
answer was lost or the settler stopped before it, and `pending` while it has not run. A payment at another sequence
|
|
117
|
+
number never decides the second's answer.
|
|
118
|
+
- `evm` `x402/exact/eip155/eip3009`: lcp's read is made by the authorization the payment presents (`byAuthorization`),
|
|
119
|
+
its use on the asset. A buyer who pays under one H on one EIP-3009 token and then on another, the nonce being
|
|
120
|
+
single-use only on each token, is answered for the payment presented by its own use: success naming it once it lands,
|
|
121
|
+
where the class's answer was lost, and the class's own answer while it has not landed. The payer's use of H on another
|
|
122
|
+
token never decides the answer, and never makes the row final.
|
|
123
|
+
- `solana` `x402/upto/solana` and `x402/batch-settlement/solana`: the answers that rest on lcp's read of a channel
|
|
124
|
+
opening follow lcp's rule for when an `open` pays the option's payee. The read counts the `open` only where it gives
|
|
125
|
+
the payee a share above zero basis points of what the channel pays out: as the `open`'s payee, where the
|
|
126
|
+
distribution's basis points sum below 10,000, or as a recipient the distribution lists above zero basis points. An
|
|
127
|
+
`open` naming the payee as its payee beside a distribution of 10,000 basis points to another account, or listing the
|
|
128
|
+
payee at zero basis points and leaving it no remainder, pays the payee nothing and is not read as paying it; the
|
|
129
|
+
settler answers it as a payment to another account. What the read records as moved is the deposit the `open` names,
|
|
130
|
+
as observed, one entry into the channel. The rule is lcp's.
|
|
131
|
+
- `starknet`: lcp's `exactStarknet.reference` reads a call's `To` and `Calldata`, and `Execute After` and
|
|
132
|
+
`Execute Before`, as hex, a decimal string or a non-negative safe integer, as starknet.js writes them, so such a
|
|
133
|
+
payment goes on to the module's own checks. A `Selector` is hex only. The rule is lcp's.
|
|
134
|
+
- `sui`: `/verify` refuses a transaction already executed, `invalid_transaction_state` (`sui/executed-by-payer`),
|
|
135
|
+
whoever presents it and however often: `isValid: true` tells the caller that a settle may follow, and the `/settle`
|
|
136
|
+
of such a transaction answers a failure naming it. `/verify` refuses every row the record holds, as on every other
|
|
137
|
+
module, and reads the chain after the module's checks (step 8 of the order of checks).
|
|
138
|
+
- `xrpl`, multisigned payer: the settler's own path applies the class's `SendMax` rule with its reasons (`@x402/xrpl`
|
|
139
|
+
2.31.0): no `SendMax` on XRP (`invalid_exact_xrpl_payload_sendmax_not_allowed`); on an issued currency a `SendMax` is
|
|
140
|
+
required, of the `Amount`'s currency and issuer and no less than the `Amount` (`sendmax_required`,
|
|
141
|
+
`sendmax_iou_mismatch`, `sendmax_too_low`). `Paths`, then `DeliverMin`
|
|
142
|
+
(`invalid_exact_xrpl_payload_delivermin_not_allowed`), then the partial-payment flag are refused with their own
|
|
143
|
+
reasons, in the class's order.
|
|
144
|
+
- `xrpl`, multisigned payer: where the requirements name `extra.destinationTag`, a payment that does not carry that
|
|
145
|
+
`DestinationTag` is refused `invalid_exact_xrpl_payload_destination_tag_mismatch`, and a tag that is not a 32-bit
|
|
146
|
+
unsigned integer `invalid_exact_xrpl_destination_tag_malformed`, as the class refuses a payment signed with one key
|
|
147
|
+
(`@x402/xrpl` 2.31.0). Where the requirements name none, any tag passes, as in the class.
|
|
148
|
+
- `xrpl`, multisigned payer: a `LastLedgerSequence` the validated ledger has reached, or one above the class's
|
|
149
|
+
`getMaxLastLedgerSequence` (the validated ledger plus the requirements' `maxTimeoutSeconds` divided by 5 and rounded
|
|
150
|
+
up, plus 2), is refused; the second `invalid_exact_xrpl_payload_lastledgersequence_too_large`, as the class's
|
|
151
|
+
`verifyLedgerExpiry` refuses a payment signed with one key (`@x402/xrpl` 2.31.0).
|
|
152
|
+
- `/settle` reads an `x402/upto/solana` claim (and its zero-amount cancel) on chain. It has landed where a finalized
|
|
153
|
+
transaction on its channel succeeded with the payment-channels program's `settle_and_seal` of that channel and, for a
|
|
154
|
+
positive amount, the ed25519 check of the claim's own voucher signature; it has not landed while the channel account
|
|
155
|
+
reads `Open`. A claim landed by another route, a transaction the settler did not name, that carries the presented
|
|
156
|
+
claim's voucher signature is read as the body presented only for a row the settler gave to the class at a
|
|
157
|
+
`confirmed` slot below the slot the transaction landed in, which the module keeps when it first gives the row to the
|
|
158
|
+
class, and of those, for the first row read against the transaction: the voucher covers the channel, the amount and
|
|
159
|
+
the expiry and no other member of the body. So the identical claim, given to the class before it landed by another
|
|
160
|
+
route, is answered success where it is the first such row read against the transaction; any other body carrying the
|
|
161
|
+
same voucher, and a body first given at a `confirmed` slot at or past the one the transaction landed in, is answered
|
|
162
|
+
`invalid_transaction_state`. A body given after the transaction landed but while `node`'s `confirmed` slot was still
|
|
163
|
+
below it counts as given before: how wide that window is depends on how far `node` lags the cluster. A transaction
|
|
164
|
+
the settler named is decided by the row that named it. Each transaction the class sends for a claim is kept in the
|
|
165
|
+
claim's row before it is sent, and is not sent where the row cannot keep it or another settle has taken the claim.
|
|
166
|
+
The claim is given to the class again only where no transaction was sent for it (the class refused or threw before
|
|
167
|
+
sending, or it was never given to the class), or where the channel reads `Open` and the last transaction sent for it
|
|
168
|
+
can no longer land: it landed and failed, or its blockhash has ended and the node holds no status for it. The
|
|
169
|
+
blockhash has ended where `isBlockhashValid` answers `false` at `finalized` at a `finalized` slot at least 150 past
|
|
170
|
+
the context slot of the first answer of `true` at `confirmed`, which the module asks for just before the send and at
|
|
171
|
+
each read until one comes: the rule of lcp's `x402-upto-solana` profile. A `false` before such a `true`, or short of
|
|
172
|
+
that slot, decides nothing, since a node answers `false` at `finalized` for a blockhash its `finalized` bank does
|
|
173
|
+
not hold yet. Where the class answers a failure naming no transaction after sending one, `/settle` answers
|
|
174
|
+
`settlement_pending` naming the transaction sent, and success once the read shows it landed. Where another claim or
|
|
175
|
+
cancel of the channel landed, the claim is answered `invalid_transaction_state` naming that transaction. Every form
|
|
176
|
+
keyed by its digest that the settler records, batch settlement's refund among them, is never sent twice at once.
|
|
177
|
+
Batch settlement's claim and settle, and on `solana` its seal, are not recorded, and go to the class each time they
|
|
178
|
+
are sent (below).
|
|
179
|
+
- `erc7710`: a redemption is keyed by the delegation and the H the payment echoes: each sale is its own row, and the
|
|
180
|
+
same sale presented again, in sequence or at once, is answered from its row. x402's ERC-7710 delegation is one-time or
|
|
181
|
+
multi-use, its caveats the limit: on the level that signs no H (`x402/exact/eip155/erc7710`) the H is not signed, so
|
|
182
|
+
what can be redeemed through one delegation, beyond what the delegator holds, is bounded by the caveats the
|
|
183
|
+
delegator signed, and by nothing else. One redemption per root delegator (the payload's `delegator`) is in flight at
|
|
184
|
+
a time on a network, whatever delegation it comes through: a second sale's settle waits, up to half the settle wait,
|
|
185
|
+
until the first's redemption is mined or can never land, and only then simulates its own; where the wait ends first,
|
|
186
|
+
nothing is sent and the answer is `unexpected_settle_error`, which a repeat settles. The first's mark ends on what
|
|
187
|
+
the node shows, never on its age once it names a redemption, and a lookup by hash that finds nothing ends nothing;
|
|
188
|
+
where the gas key signed it and the node's pending count shows no transaction of the key at its nonce, which is
|
|
189
|
+
still the key's next, the second sale's redemption is signed at that same nonce. The module signs at a named nonce only where the node's
|
|
190
|
+
pending count, read then, shows no transaction of the gas key held there, whichever scheme sent it.
|
|
191
|
+
- `erc7710`: the module signs each redemption before it sends it, keeps the signed bytes in its state, and the record
|
|
192
|
+
holds their hash before they are sent: on the level that signs no H lcp's read finds a redemption only by the
|
|
193
|
+
transaction the record holds, so a lost answer to the send, or a stop between the send and its answer, is still
|
|
194
|
+
read. A send that fails, a JSON-RPC error included, is answered `settlement_pending` naming that hash, since no
|
|
195
|
+
failure shows that the node took nothing. A repeat that takes the claim sends the same bytes again where the count
|
|
196
|
+
of the key that signed them, at the finalized block, has not passed their nonce and its pending count is not above
|
|
197
|
+
that nonce; a nonce is
|
|
198
|
+
taken once, so the bytes land at most once. Where the node shows one signed at their nonce by its hash unmined, and
|
|
199
|
+
none signed after it, below its latest block's base fee, or below its suggested tip a settle wait after the last at
|
|
200
|
+
that nonce was signed (the tip of one priced by `gasPrice` alone being that price less the base fee), the repeat
|
|
201
|
+
replaces it at the same nonce with the fees the node asks, its tip never below the tip it replaces (a `gasPrice`
|
|
202
|
+
alone offering that price), and never raises them on repeats alone, naming the replacement in the row first; a
|
|
203
|
+
replacement whose send fails and that the node does not show is judged only once the node shows it, and the row names again the one the
|
|
204
|
+
node holds. The signer's
|
|
205
|
+
`signTransaction` signs with the fee members a request names. A new nonce is signed only where one block, read by its hash (EIP-1898) and shown
|
|
206
|
+
an ancestor of the finalized block, shows that a different transaction took the nonce: the row stops naming the hash,
|
|
207
|
+
nothing is sent on that repeat, and the claim is answered `unexpected_settle_error`. The block in which the key's
|
|
208
|
+
count passed the nonce, once found, is kept in the module's state, so later repeats need no state of that block
|
|
209
|
+
again. Where the node does not hold that block, or held its state on no repeat that searched for it, or a read
|
|
210
|
+
fails, the row keeps naming the hash and nothing is sent. A lookup by hash that finds nothing is no part of that
|
|
211
|
+
proof.
|
|
212
|
+
- `erc7710`: where nothing is sent for a cause a repeat may settle, the answer is `unexpected_settle_error`: the
|
|
213
|
+
signer could not sign the redemption (it reads the gas, the fees and the nonce from the node), the module's own
|
|
214
|
+
state could not be written before the send, or a send failed and one finalized block then shows another transaction
|
|
215
|
+
of the gas key took the nonce. `invalid_transaction` is the sale's own refusal, its simulation's.
|
|
216
|
+
- `erc7710`, `x402/exact/eip155/erc7710`: a named redemption the node mined and reverted, its receipt at or below the
|
|
217
|
+
finalized block, is final, answered `invalid_transaction_state` naming it, on its own settle and on every repeat;
|
|
218
|
+
above the finalized block it is `settlement_pending` naming it. On `x402/exact/eip155/erc7710-salt` it stays
|
|
219
|
+
`settlement_pending` naming it, since lcp's search for H can still meet another redemption carrying H.
|
|
220
|
+
|
|
221
|
+
### Fixed
|
|
222
|
+
|
|
223
|
+
- `solana`: the reader asks `getSignaturesForAddress` again, about a slot later and at most five times within the
|
|
224
|
+
read's deadline, where the node answers JSON-RPC error -32016 (its `minContextSlot` not yet reached). A load-balanced
|
|
225
|
+
endpoint answers it from a backend a slot or two behind the one that gave lcp the slot, and the read was `unreadable`
|
|
226
|
+
on the first such answer. Any other error, and the last refusal, still reject.
|
|
227
|
+
- `evm`'s `auth-capture` and `erc7710`: a repeat's read and its `settlement_pending` answer start from the transaction
|
|
228
|
+
the row names once that repeat's sends and namings are done (for an escrow message, the read then judges whichever
|
|
229
|
+
transaction at its nonce the node shows a receipt for): after a replacement's send failed and the row names the held
|
|
230
|
+
transaction again, that one; after the row names a replacement the node holds, that replacement.
|
|
231
|
+
- A repeat of a payment the record holds sends nothing before its read where the network's fee budget is spent: no
|
|
232
|
+
transaction its row names is sent again or replaced at its nonce (`auth-capture`, `erc7710`), and it is answered
|
|
233
|
+
from the read. Each transaction a repeat names before it sends it is counted against the budget by its hash.
|
|
234
|
+
- `evm`'s `batch-settlement`: a channel refund the finalized chain shows executed, its own receipt holding the channel
|
|
235
|
+
contract's `Refunded` for the channel its `channelConfig` names, is the success, naming it, the row final. A refund
|
|
236
|
+
whose first answer was lost is answered once its block is finalized.
|
|
237
|
+
- `evm`'s `exact`, `upto` and `batch-settlement` claims: a settle answers success only on a receipt that carries its
|
|
238
|
+
own payment. Where another transaction of the gas key took the nonce of a settle's transaction, viem's wait answers
|
|
239
|
+
that transaction's receipt, which x402's class takes as its own on Permit2 `exact`, `upto` and a channel's claim
|
|
240
|
+
whatever that transaction was, and on EIP-3009 `exact` where it moved the same value between the same parties of the
|
|
241
|
+
same token (a repeat purchase), the receipt check x402's class makes there. The settle takes it only where the node
|
|
242
|
+
shows that transaction as the same call of the same account at the same nonce (the transaction sent, signed again at
|
|
243
|
+
another fee), and its answer then names that transaction; any other, and a receipt that names no transaction where
|
|
244
|
+
the node does not show the receipt of the transaction waited for, answers `settlement_pending` naming its own
|
|
245
|
+
transaction. Each call of these classes is signed before it is sent where the gas key gives `signTransaction` and
|
|
246
|
+
`sendRawTransaction`, so that its account, nonce and call are known whatever the node later shows of it. The
|
|
247
|
+
transaction `exact` and `upto` keep as a pending settlement is let go once one finalized block, read by its hash,
|
|
248
|
+
shows a different transaction of the gas key at its nonce that did not execute its call, searched from the node's head
|
|
249
|
+
as it was signed; a repeat then sends the same signed authorization again, which the token or Permit2 executes once.
|
|
250
|
+
Until then a repeat waits for the transaction the class keeps. The module's own node calls hold a settle at most two
|
|
251
|
+
seconds before the class's wait for a receipt and at most two seconds after one that ended with a receipt that does
|
|
252
|
+
not name the transaction waited for, and not at all where the wait ends with the transaction's own receipt or with
|
|
253
|
+
none. A channel's deposit whose transaction the node dropped stays `settlement_pending`, and nothing is sent for it
|
|
254
|
+
again.
|
|
255
|
+
- `evm`'s `auth-capture` and `erc7710`: a settle answers success only on the receipt of the transaction it sent. viem's
|
|
256
|
+
`waitForTransactionReceipt` answers the receipt of another transaction of the gas key at the same nonce where it
|
|
257
|
+
finds one: a replacement a repeat made at the same nonce, or another payment's transaction, which never executed
|
|
258
|
+
this sale or escrow message. A settle given such a receipt answers `settlement_pending` naming its own transaction
|
|
259
|
+
and keeps what it signed, and the read decides on a repeat: the replacement's success, or, where another payment
|
|
260
|
+
took the nonce, nothing paid yet.
|
|
261
|
+
- `/settle` of another body under a claim the record holds (a copy the payer signed again under the same nonce) is
|
|
262
|
+
answered `invalid_transaction_state`, and the row stays the claim's, where lcp's read shows that body failed, as
|
|
263
|
+
where it shows it settled. A copy whose own validity passed leaves the row a claim while the claim's own transaction
|
|
264
|
+
can still land, and the claim's body is answered by its own read: a success once that transaction lands.
|
|
265
|
+
- `/settle` answers success for a payment the settler gave to the class's settle once lcp's read shows that payment
|
|
266
|
+
settled, whatever the class answered: an answer to the send that was lost, a class that answers `transaction: ""` on
|
|
267
|
+
a failure after its broadcast (`@x402/tvm`, `@x402/aptos` and `@x402/near` 2.31.0), a class's settle that
|
|
268
|
+
outlasts the claim's hold, or the settler stopped between the send and its answer. A class's failure naming no
|
|
269
|
+
transaction reads the same whether or not the node took the send, so the payment the settler gave to the class is its
|
|
270
|
+
success even where it landed by another route. Only the body that claimed the row is: a call presenting another body
|
|
271
|
+
under the same instrument (a copy signed again under its nonce) is answered `invalid_transaction_state` and the row
|
|
272
|
+
stays a claim. A payment the settler never gave to the class (one with no claim, or under a claim refused before the
|
|
273
|
+
class's settle: a spent fee budget, the settle's wait over) is answered `invalid_transaction_state`.
|
|
274
|
+
- `/settle` refused by the checks of `/verify` answers their reason and, where they gave one, their message as
|
|
275
|
+
`errorMessage`, on every module, for every payment the settler records. A later message the settler does not record
|
|
276
|
+
(batch settlement's claim and settle on `evm`, and claim, seal and settle on `solana`) is answered with the reason of
|
|
277
|
+
the class's check alone where that check refuses it at `/settle`.
|
|
278
|
+
- `solana` exact, `upto` and batch settlement, and `xrpl` exact: a payment whose `accepted` differs from the
|
|
279
|
+
requirements only where the scheme lets it is verified and settled. On Solana that is the members the stock server
|
|
280
|
+
of the scheme declares as its dynamic fields, which a stock resource server rebuilds for the paid request:
|
|
281
|
+
`recentBlockhash` and `lastValidBlockHeight` for exact, those two and `recentSlot` for `upto`, `recentBlockhash` and
|
|
282
|
+
`recentSlot` for batch settlement. On the XRP Ledger, an `assetTransferMethod` `ticketSequence` that a payment by
|
|
283
|
+
ticket declares where the requirements name no method. lcp's `reference` decides it.
|
|
284
|
+
- The `solana` module's reader sends lcp's `minContextSlot` to the node as a JSON number, so a read whose search lcp
|
|
285
|
+
bounds by a slot (an opening read with its search, a transfer read) reaches the node. A `minContextSlot` outside the
|
|
286
|
+
slots the reader reads (0 to 2^53 - 1) is refused as a malformed call, sending nothing.
|
|
287
|
+
- `casper`: the read of a used nonce asks the token's `used_nonces` for the item key CEP-3009 tokens write, the hex of
|
|
288
|
+
blake2b-256 over the tagged `from` and the nonce as `Bytes`, as Casper testnet's csprUSD (`@x402/casper`'s testnet
|
|
289
|
+
token) holds it. A lost or retried `/settle` of a payment that landed is answered `invalid_transaction_state` naming
|
|
290
|
+
the transaction that landed.
|
|
291
|
+
- `sui`: before the simulation, the module reads the objects the transaction names at a version (its gas payment, each
|
|
292
|
+
owned or immutable input, each object it receives) from the GraphQL endpoint (`multiGetObjects`) and refuses
|
|
293
|
+
`invalid_transaction` (`sui/object-version-unavailable`) at `/verify` and `/settle` where one is at a later version,
|
|
294
|
+
no longer live, or held under another digest at that version: Sui's simulation takes an owned input at its latest
|
|
295
|
+
version and answers success for a transaction whose gas coin the buyer spent after signing, which execution refuses
|
|
296
|
+
(the object's version "is unavailable for consumption"). A version the endpoint's index does not yet hold shows
|
|
297
|
+
nothing more; an object it shows at a later version is refused whether or not it still holds the version named,
|
|
298
|
+
since an object's version only increases.
|
|
299
|
+
- `xrpl`: the settler's node reader takes a transaction in either of rippled's forms, `tx` with `meta` (API version 1,
|
|
300
|
+
which rippled answers to a request naming no `api_version`, as the settler's do) and `tx_blob` with `meta_blob`
|
|
301
|
+
(version 2), from `tx` and from `account_tx` (rippled 3.1.3, xrpld 3.3.0), so a payment that validated after its
|
|
302
|
+
first `/settle` answered `settlement_pending` is answered settled.
|
|
303
|
+
- `xrpl`: the settler's node reader ends lcp's search of the payer's history at the validated ledger of the same
|
|
304
|
+
`server_info` answer, since `account_tx` reads validated ledgers only, so the search reads whole and a lapsed,
|
|
305
|
+
consumed or `tec` payment reads final `failed`.
|
|
306
|
+
- `xrpl`: the node reader answers a transaction that rippled holds unvalidated with no metadata (one whose submission
|
|
307
|
+
rippled refused, `tefPAST_SEQ` or `tefMAX_LEDGER`, which rippled keeps in its cache, or one no closed ledger holds
|
|
308
|
+
yet) as not found, the search not read whole, as lcp's `XrplReader` states. The read of such a payment answers as it
|
|
309
|
+
does without the submission, and a payment still to land reads `pending`, then settled once it lands.
|
|
310
|
+
- `xrpl`, multisigned payer: a signer whose account the ledger does not hold, which a signer list allows and rippled
|
|
311
|
+
executes, is taken where it signs with the key its address derives from, and refused
|
|
312
|
+
`invalid_exact_xrpl_payload_signer_not_authorized` otherwise, as rippled does.
|
|
313
|
+
- `xrpl`, `x402/upto/xrpl`: a settle-time `amount` that is not a string of canonical drops (zero, or a positive
|
|
314
|
+
decimal with no sign, space or leading zero, below 10^17) is refused `invalid_payment_requirements`
|
|
315
|
+
(`x402/option-malformed`) before anything is submitted, `""`, `" 0"`, `"0x0"`, `"00"`, `"+0"`, `0` and `["0"]`
|
|
316
|
+
among them.
|
|
317
|
+
- `x402/upto/xrpl`: a claim is a success only where its metadata shows the delivery, as the scheme says a facilitator
|
|
318
|
+
should confirm it: the channel's `Balance` after the claim at or above the charge. rippled closes a channel that has
|
|
319
|
+
expired by the ledger the claim lands in (its `CancelAfter`, or the payer's requested close, `Expiration`) without
|
|
320
|
+
delivering, and still answers `tesSUCCESS`. `/settle` answers a claim short of the charge `transaction_failed`, its
|
|
321
|
+
row is final, and a repeat is answered `invalid_transaction_state` naming the claim. The read judges the claim the
|
|
322
|
+
record holds by its own charge, the `Balance` it carries, whoever presents the payment next; a repeat presenting
|
|
323
|
+
another claim is answered `invalid_transaction_state` and leaves the row as it was. Metadata that shows no node of
|
|
324
|
+
the channel, which a claim landing with `tesSUCCESS` always modifies or deletes, is unreadable, not a failure:
|
|
325
|
+
`/settle` answers `settlement_pending` naming the claim, the row stays open, and a repeat reads the claim again.
|
|
326
|
+
Against such metadata a bare close is judged by the presented `amount`, and a repeat whose `amount` is not canonical
|
|
327
|
+
drops is unreadable too: `settlement_pending` naming the claim, the row left open, never a final failure. The
|
|
328
|
+
settle-time headroom check is an admission floor against the validated ledger, as the scheme's rule 7 states it
|
|
329
|
+
([The modules](./README.md#the-modules)).
|
|
330
|
+
- `x402/upto/xrpl`: `/settle` with no `settlementTransaction` is refused
|
|
331
|
+
`invalid_upto_xrpl_missing_settlement_transaction`, the scheme's code, at any charge.
|
|
332
|
+
- The later messages of the multi-step schemes reach x402's class, as they reach it without the settler, so a seller
|
|
333
|
+
whose only facilitator is the settler can collect:
|
|
334
|
+
- `evm` `auth-capture`: the capture, void and refund x402's lifecycle manager sends, and the hold's own payload the
|
|
335
|
+
resource server stamps `capture` after its handler or `void` on cancel. Each is its own row, keyed by the message
|
|
336
|
+
its receiver authorizer signs, every member it signs (the typed-data domain, the payment's hash as the members it
|
|
337
|
+
commits to, its type, and its amounts, fee terms and refund collector as the class signs them, each number as
|
|
338
|
+
`BigInt` reads it, as the class does), which is also the row's body: one message spelt two ways, or signed again by
|
|
339
|
+
a signer whose signatures differ each time, is sent once, and another signature over it goes to the class's check.
|
|
340
|
+
- `evm` `batch-settlement`: the claim, settle and refund x402's channel manager sends, under its own requirements at
|
|
341
|
+
amount `"0"`. At `/settle` the class's `settle` checks a claim, settle or refund before it sends. A claim and a
|
|
342
|
+
settle are not recorded: the manager sends the same settle in every round.
|
|
343
|
+
- `solana` `batch-settlement`: the claim, seal and settle, checked at `/settle` by the class's `settle`, as `upto`'s
|
|
344
|
+
claim is, and not recorded.
|
|
345
|
+
|
|
346
|
+
A later message the record does not hold (a batch settlement's `claim` and `settle`, and `seal` on `solana`) is
|
|
347
|
+
given to the class's settle only where the request's wait leaves time for it, as a recorded payment is; otherwise
|
|
348
|
+
nothing is sent and the answer is `unexpected_settle_error`. What each message moves is bounded on chain by what the
|
|
349
|
+
opening funded: the escrow captures at most what is capturable and refunds at most what was captured; the channel
|
|
350
|
+
contract and program claim only above the recorded total and at most the payer-signed voucher. A repeat of an escrow
|
|
351
|
+
message that landed is answered from its row and sends nothing. An escrow refund for the default `delegated`
|
|
352
|
+
operator is funded by the seller's gas key: the class refuses it unless `authCapture.refundFunding` is set. An
|
|
353
|
+
escrow message is read from the escrow, its `paymentState` and its events by the payment's hash, since the escrow
|
|
354
|
+
itself takes a second identical capture or refund while enough is capturable or refundable. The gas key signs each
|
|
355
|
+
escrow call first (`EvmSender`, above), and the transaction is named in the row before it is sent, by a write that
|
|
356
|
+
holds only while no later settle has taken the claim: a settle that had not named its transaction when another took
|
|
357
|
+
the claim sends nothing, and one that had is found by the next settle's read of that transaction and of the key's
|
|
358
|
+
mined count. A transaction signed for an escrow message is sent again only as its same signed bytes, or replaced at
|
|
359
|
+
its own nonce, named in the row first, by the rule the `erc7710` module replaces a redemption by: where the node
|
|
360
|
+
shows one signed at that nonce by its hash unmined, and none signed after it, with its fee cap below the latest base
|
|
361
|
+
fee, or its tip below the node's suggestion a whole settle wait after the last at that nonce was signed.
|
|
362
|
+
A message is signed at a new nonce only where, for every transaction signed for it that the node does not show, the
|
|
363
|
+
block the node names `finalized`, read by its hash (EIP-1898), shows both the gas key's count past that
|
|
364
|
+
transaction's nonce and the escrow's amounts still those the message expects; the void of a capture's remainder
|
|
365
|
+
likewise. One that was marked, when signed, as not yet named, and that the row does not name, was never sent, and
|
|
366
|
+
is passed over: another settle took the claim before its naming, or a stop came between the two. A first send that never reached the node, or that the gas key could not pay for, then lands once, on a
|
|
367
|
+
repeat of the identical message, the lifecycle manager's own included. A transaction named and sent for an escrow
|
|
368
|
+
message is answered `settlement_pending` naming it, whatever failure the class answers, until the read shows the
|
|
369
|
+
message final. A message the escrow reverted is final at the `finalized` block, answered
|
|
370
|
+
`invalid_transaction_state` naming the reverted transaction; one another act made impossible is
|
|
371
|
+
`invalid_transaction_state` naming that act's transaction, or naming nothing where the escrow's amounts had passed it
|
|
372
|
+
at the block read before the claim (the latest), once that block is finalized (`before-position`); one the read
|
|
373
|
+
cannot place stays `settlement_pending`. A channel refund the chain mined and reverted is final once its block is
|
|
374
|
+
finalized (a final answer that rests on a receipt, an escrow message's and a redemption's too, is given only where
|
|
375
|
+
the receipt's block, named by its hash, is shown on the finalized chain), `invalid_transaction_state` naming it, and `settlement_pending` naming it before; a repeat of it, and the
|
|
376
|
+
channel manager's refund of the same channel signed again by a deterministic receiver authorizer (the same payload),
|
|
377
|
+
send nothing.
|
|
378
|
+
- A repeat of a payment whose row names a transaction an earlier settle gave to the class is never answered a refusal
|
|
379
|
+
that names nothing while that transaction may still land or has landed. Where the class's check refuses the repeat,
|
|
380
|
+
the class's settle fails naming nothing (the gas key's own refusal to send among them), the network's fee budget is
|
|
381
|
+
spent, the settle wait has no time left, or a store call before the submission fails, `/settle` answers
|
|
382
|
+
`settlement_pending` naming the row's transaction, and what it withheld goes to the operator log (`refusal-withheld`
|
|
383
|
+
with the `reason`, or the failure's own entry, each with the transaction). Before, each was answered as for a row
|
|
384
|
+
that names nothing (the class's reason, the gas key's error text, `fee_budget_spent` or `unexpected_settle_error`,
|
|
385
|
+
with no transaction) while the settler's own transaction had executed or could still land. A copy of a named
|
|
386
|
+
message that the class's check refuses for a fault of its own (another signature) is answered the same way; nothing
|
|
387
|
+
is sent for it. An instrument keyed by its transaction's id, which its row names from the claim on, is answered as
|
|
388
|
+
before.
|
|
389
|
+
- Where the read made after the class's settle failed names a transaction of the instrument above the finalized block,
|
|
390
|
+
`/settle` answers `settlement_pending` naming it, on a first settle and on a repeat; before, it gave the class's
|
|
391
|
+
failure. A repeat of a claim an earlier settle gave to the class unnamed (an escrow's hold, a published class's own
|
|
392
|
+
send) whose row names nothing is no longer answered the class's refusal, which may be of that earlier submission's
|
|
393
|
+
own transaction (a hold was refused `invalid_auth_capture_evm_simulation_failed` while it had executed): where the
|
|
394
|
+
class's check or its settle refuses it naming nothing, the read is made, a final read decides, one that names a
|
|
395
|
+
transaction above the finalized block is `settlement_pending` naming it, and any other is
|
|
396
|
+
`unexpected_settle_error` (`claim-unread`, with the reason refused), until a read names the transaction or shows
|
|
397
|
+
the instrument final.
|
|
398
|
+
- A repeat keeps no search position from a read whose answer names a transaction the row does not name (one found
|
|
399
|
+
above the finalized block): the position can be past that transaction, and the next repeat, searching on from it,
|
|
400
|
+
never met the transaction again, so a hold that had landed was answered `unexpected_settle_error` on every repeat.
|
|
401
|
+
The next repeat now searches again from the position the row holds.
|
|
402
|
+
- `evm`: the node reader's log queries. A refusal that states the most blocks one query may span (in its message or
|
|
403
|
+
its `data`, with whatever HTTP status) is read as that bound: the range is asked in calls of that many blocks, at
|
|
404
|
+
most 20 a query, and the endpoint is not asked a wider range again while the process runs; a refusal that states no
|
|
405
|
+
bound halves the range for that query. A rate limit (HTTP 429, or a JSON-RPC error that says so with any status) is
|
|
406
|
+
no longer read as a range too large: the read pauses as long as `Retry-After` says, or 250 ms doubling, at most four
|
|
407
|
+
times and never past its deadline, and asks the same range again. A range the answering node says is past its head
|
|
408
|
+
is asked again, not halved. Before, an endpoint that takes fewer than 2,000 blocks a query left an escrow message
|
|
409
|
+
whose read needs the search `settlement_pending` on every repeat. The search still starts at its first block on
|
|
410
|
+
each repeat.
|
|
411
|
+
- `stellar`: the reader follows `getEvents`'s cursor until it names the end of a scan at or past the last ledger asked
|
|
412
|
+
for or the last one the RPC holds. Stellar RPC scans at most 10,000 ledgers per call, and a page that matched nothing
|
|
413
|
+
in them is short or empty and carries a cursor: such a page was taken as the end of the range, so a payment more than
|
|
414
|
+
10,000 ledgers past the search's start was never found, and the search said it had read through. A page with no
|
|
415
|
+
cursor in the RPC's form is out of form, never the end of the range.
|
|
416
|
+
- `stellar`: each `getEvents` call is bounded by the read's deadline, or the network's `eventsTimeoutMs` where set,
|
|
417
|
+
not 5 s: on mainnet one call from a ledger days back often took longer, and the read gave no answer.
|
|
418
|
+
- `stellar`: the RPC's refusal of a start below its oldest ledger (`-32600`, "startLedger must be within the ledger
|
|
419
|
+
range") is the read's `history-gap`, not `transport`, which a caller would retry on the same node for good.
|
|
420
|
+
|
|
421
|
+
- `xrpl`: the reader names what a successful Payment that is not partial delivered, its `Amount`. It asks rippled for
|
|
422
|
+
binary answers, whose metadata never holds `delivered_amount` (rippled adds it to JSON answers only) and holds
|
|
423
|
+
`DeliveredAmount` for a partial payment only, so `moved` was missing on every such payment. A partial payment names
|
|
424
|
+
only its `DeliveredAmount`; a transaction the codec cannot decode names nothing delivered.
|
|
425
|
+
|
|
426
|
+
### Documentation
|
|
427
|
+
|
|
428
|
+
- The README's module table lists the networks each stock class takes: `hedera:mainnet` and `hedera:testnet` (not
|
|
429
|
+
`hedera:previewnet` or `hedera:devnet`, which `@x402/hedera`'s class refuses `network_mismatch`), Algorand's mainnet
|
|
430
|
+
and testnet genesis labels (`@x402/avm`'s class refuses any other, "Unsupported Algorand network"), and `aptos:1`
|
|
431
|
+
and `aptos:2` (`@x402/aptos`'s class refuses another chain id).
|
|
432
|
+
- The README and the settler guide state that `solana`'s `x402/batch-settlement/solana` is client-signed only: an
|
|
433
|
+
option of x402's Solana batch server with server-signed vouchers, its default once an operator is configured, is
|
|
434
|
+
refused `invalid_payment_requirements` (`x402/option-not-this-pairing`), and that server's start-up check does not
|
|
435
|
+
read the voucher mode, so the refusal comes at the first deposit. The route's `extra.voucherSigner` `"client"` opts
|
|
436
|
+
out.
|
|
437
|
+
- The README and the settler guide give a floor for a Solana `upto` route's `maxTimeoutSeconds` as guidance, which
|
|
438
|
+
the settler does not enforce: about 125 seconds more than the longest time from the channel's opening to the claim,
|
|
439
|
+
since the voucher counts from the opening and a claim whose voucher expires inside the stock class's 120-second
|
|
440
|
+
window of its process cannot be made by that process; 150 seconds covers a claim made within about 25 seconds of the
|
|
441
|
+
opening, and 300 one made within about 175. On a local validator, after a first send that never reached the node,
|
|
442
|
+
the claim was paid about 122 seconds after its first settle at blocks of about 125 ms and of about 420 ms alike; at
|
|
443
|
+
about 420 ms, a route of 150 seconds paid a claim made 16 seconds after the opening and not one made 40 seconds
|
|
444
|
+
after it.
|
|
445
|
+
- The README, the settler guide and the reference state that `evm`'s `batch-settlement` admits a channel's `refund`
|
|
446
|
+
as a later message by its payload's type alone, the buyer's own refund request (x402's client `refundChannel`, under
|
|
447
|
+
the route's option) too, without lcp's option filter, lcp's channel read or the zero-amount rule: the record, what
|
|
448
|
+
the kind declares, the fee budget and the class still hold it, and the class settles a refund only with the receiver
|
|
449
|
+
authorizer's signature, whose key the settler does not hold. They state that where `authCapture` delegates the
|
|
450
|
+
receiver authorizer to the class, nothing the settler passes authenticates the caller to `resolveCallerIdentity`: a
|
|
451
|
+
resolver that identifies the caller by an extension finds none, and the class refuses each call it would sign; one
|
|
452
|
+
that derives an identity from the payment or its requirements makes holding the settler's credential the whole
|
|
453
|
+
authority for a void or a refund the class signs as that authorizer.
|
|
454
|
+
|
|
455
|
+
## [0.5.1] - 2026-11-20
|
|
456
|
+
|
|
457
|
+
### Changed
|
|
458
|
+
|
|
459
|
+
- The peer dependency is `@integraledger/lcp` `~0.6.3` (0.5.0: `~0.6.0`). Install `@integraledger/lcp@~0.6.3` beside
|
|
460
|
+
it: the `starknet` kind takes an amount of zero on Starknet Sepolia's STRK and USDC, as lcp does from 0.6.3.
|
|
461
|
+
- The README's module table gives each pairing's `confirmed` as `@integraledger/lcp`'s registry now states it: `yes`
|
|
462
|
+
on `x402/exact/cardano/lock`, `x402/exact/eip155/permit2`, `x402/upto/eip155/permit2`,
|
|
463
|
+
`x402/auth-capture/eip155/eip3009`, `x402/auth-capture/eip155/permit2`, `x402/batch-settlement/eip155`,
|
|
464
|
+
`x402/exact/eip155/erc7710`, `x402/exact/eip155/erc7710-salt` and `x402/upto/xrpl`, each shown end to end by a
|
|
465
|
+
recorded run on a test network. No module's behaviour changes.
|
|
466
|
+
- `GET /supported`: each kind's `extra.acceptsZero` is the list of its pairings that take an amount of zero, `[]`
|
|
467
|
+
where none does, where 0.5.0 stated a boolean for the kind. An option of amount zero is refused
|
|
468
|
+
`invalid_payment_requirements` where its pairing is not in the list. `exact` on an `eip155` network names
|
|
469
|
+
`x402/exact/eip155/eip3009`, whose transfer of zero Base Sepolia's USDC takes, and not `x402/exact/eip155/permit2`,
|
|
470
|
+
whose proxy reverts at zero; `sui` names `x402/exact/sui`, a transfer of zero having executed on Sui testnet where the
|
|
471
|
+
buyer pays gas; `starknet` names `x402/exact/starknet` on `starknet:SN_SEPOLIA`, where lcp takes an amount of zero on
|
|
472
|
+
STRK and USDC, each of whose `transfer` of 0 emits a `Transfer` of 0, and states `[]` on `starknet:SN_MAIN`.
|
|
473
|
+
`polkadot` states `[]`. Each module's list and its evidence are in [The modules](./README.md#the-modules).
|
|
474
|
+
|
|
475
|
+
### Fixed
|
|
476
|
+
|
|
477
|
+
- `x402/upto/eip155/permit2`: `/settle` of a charge below the maximum the payment accepted, the requirements x402's
|
|
478
|
+
`upto` resource server sends, was refused `invalid_payload`. Requirements that are the option the payment accepted in
|
|
479
|
+
every member but an `amount` at or below the accepted one are held as that option, and the check `/settle` makes
|
|
480
|
+
before it submits verifies the permit against the accepted maximum, as the class's own settle does
|
|
481
|
+
([The modules](./README.md#the-modules)).
|
|
482
|
+
- `x402/upto/solana`: `/settle` of the deposit and of the claim x402's `upto` resource server sends, each carrying the
|
|
483
|
+
`type` that server adds, was refused `invalid_upto_svm_payload_type` by the check `/settle` makes before it submits,
|
|
484
|
+
the class's `verify` of an opening. A deposit is checked as the buyer sent it, without the `type`, and a claim by the
|
|
485
|
+
class's own settle ([The modules](./README.md#the-modules)).
|
|
486
|
+
|
|
487
|
+
## [0.5.0] - 2026-11-18
|
|
488
|
+
|
|
489
|
+
The settler for the x402 pairings `@integraledger/lcp` 0.6.0 ships, on x402's own facilitator class (`@x402/core`
|
|
490
|
+
2.31.0) with one module per chain form. 0.4.0 served Tron and Polkadot alone.
|
|
491
|
+
|
|
492
|
+
### Changed
|
|
493
|
+
|
|
494
|
+
- The package moved into this repository, in [`settler/`](https://github.com/IntegraLedger/integra-protocol/tree/main/settler):
|
|
495
|
+
its `repository`, `homepage` and `bugs` name `IntegraLedger/integra-protocol`. 0.4.0 and earlier were published from
|
|
496
|
+
another repository, and this file starts at 0.5.0.
|
|
497
|
+
- The peer dependency is `@integraledger/lcp` `~0.6.0` (0.4.0: `~0.5.0`). Install `@integraledger/lcp@~0.6.0` beside it.
|
|
498
|
+
- `engines.node` is `>=24.22.1` (0.4.0: `>=24`).
|
|
499
|
+
- Storage. The record moves from the table `settlement` to the table `instrument`, beside two new tables, `fee` and
|
|
500
|
+
`module_state`, all three created at start where they do not exist ([Storage](./README.md#storage)). 0.5.0 never
|
|
501
|
+
reads or writes `settlement`, and does not fill `instrument` from it. The role in `store.url` needs `CREATE` on the
|
|
502
|
+
schema and owns the tables ([The database](./README.md#the-database)).
|
|
503
|
+
- The record keys a payment by its instrument: a Tron payment by its transaction id, as before, and a Polkadot payment
|
|
504
|
+
by its signer and the account nonce it signed, no longer by the extrinsic's hash, so a payment signed again at the
|
|
505
|
+
same nonce is the same payment.
|
|
506
|
+
- A repeated `/settle` of a payment the record holds final is answered `invalid_transaction_state` naming the
|
|
507
|
+
transaction the row holds, whatever the first answer was. 0.4.0 answered a stored success so, and returned any other
|
|
508
|
+
stored final answer as first given.
|
|
509
|
+
- `GET /supported`: each kind's `extra` also states `pairings`, `key` and `acceptsZero`, and `feeBudget: true` on a
|
|
510
|
+
network with a fee budget; `signers` is keyed by CAIP family (`"tron:*": []`, `"polkadot:*": []`), where 0.4.0
|
|
511
|
+
answered `{}`.
|
|
512
|
+
- A request body may hold up to 132,096 bytes (0.4.0: 65,536); a larger one is answered `413`.
|
|
513
|
+
|
|
514
|
+
### Added
|
|
515
|
+
|
|
516
|
+
- Sixteen modules, each started by its own member of the configuration: `algorand`, `aptos`, `cardano`, `casper`,
|
|
517
|
+
`concordium`, `erc7710`, `evm`, `hedera`, `lnbtc`, `near`, `solana`, `starknet`, `stellar`, `sui`, `ton` and `xrpl`,
|
|
518
|
+
beside `tron` and `polkadot`. Each module's networks, pairings, key and the registry's `confirmed` value for each
|
|
519
|
+
pairing are in [The modules](./README.md#the-modules). `casper` serves `casper:casper-test` alone and does not start
|
|
520
|
+
on `casper:casper`; `x402/exact/casper` and `x402/exact/ccd` are served with `confirmed` `no`. The `cardano`,
|
|
521
|
+
`concordium` and `ton` modules take an lcp reader the operator writes.
|
|
522
|
+
- `credential`: the bearer credential every call must then present. A deployment with a module whose key is not
|
|
523
|
+
`none` does not start without it; `tron` and `polkadot` hold no key, so a 0.4.0 configuration starts without one. A
|
|
524
|
+
call without it is answered `401` before its body is read.
|
|
525
|
+
- `feeBudgets`, at most one per network, which cap the fees a module's key pays; a spent budget is answered
|
|
526
|
+
`fee_budget_spent`.
|
|
527
|
+
- The export `FeeBudgetConfig`.
|
|
528
|
+
- `extra.acceptsZero`: a kind that states `false`, as Tron's and Polkadot's do, refuses an option of amount zero
|
|
529
|
+
`invalid_payment_requirements`.
|
|
530
|
+
- Start refusals for the new members (a credential's characters, fee budgets, the modules' own members, a keyed module
|
|
531
|
+
without `credential`), each listed with its message in [What stops the start](./README.md#what-stops-the-start).
|
|
532
|
+
|
|
533
|
+
### Unchanged
|
|
534
|
+
|
|
535
|
+
- The configuration members `listen`, `store`, `settleWaitMs`, `operatorLog`, `tron` and `polkadot`, with the same
|
|
536
|
+
shapes, and the server's request timeout of `settleWaitMs` plus 60 seconds.
|
|
537
|
+
|
|
538
|
+
### Upgrading from 0.4.0
|
|
539
|
+
|
|
540
|
+
0.5.0 does not know the payments 0.4.0 answered, and judges a repeated `/settle` of one afresh, by the module's checks
|
|
541
|
+
and lcp's read of the chain ([Upgrading from 0.4.0](./README.md#upgrading-from-040)):
|
|
542
|
+
|
|
543
|
+
- A payment 0.4.0 answered success is never answered success again: Tron's checks refuse a transaction id the node
|
|
544
|
+
holds in its blocks or pending pool, and an expiration passed; Polkadot's node no longer answers the extrinsic valid
|
|
545
|
+
once its nonce is used. The answer is `invalid_transaction_state` naming the transaction where lcp's read shows the
|
|
546
|
+
payment final, and otherwise the check's refusal.
|
|
547
|
+
- A payment 0.4.0 answered `settlement_pending` is answered the same way once its transaction is in a block, so 0.5.0
|
|
548
|
+
never answers it success, though it landed; a Polkadot extrinsic still in the node's pool when the repeat arrives is
|
|
549
|
+
claimed and answered success once final.
|
|
550
|
+
- Neither rail lets one signed payment land twice. Finish 0.4.0's pending payments on 0.4.0 before switching, or read
|
|
551
|
+
them with lcp's `status`, and do not run both versions at once for the same payments: each keeps its own record, and
|
|
552
|
+
each can answer one payment success.
|
|
553
|
+
|
|
554
|
+
[0.6.0]: https://github.com/IntegraLedger/integra-protocol/tree/settler-v0.6.0/settler
|
|
555
|
+
[0.5.1]: https://github.com/IntegraLedger/integra-protocol/tree/settler-v0.5.1/settler
|
|
556
|
+
[0.5.0]: https://github.com/IntegraLedger/integra-protocol/tree/settler-v0.5.0/settler
|