@integraledger/lcp-binding-evm-escrow 0.12.1 → 0.12.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.
- package/CHANGELOG.md +34 -0
- package/dist/adapter.d.ts +15 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +1 -0
- package/dist/adapter.js.map +1 -1
- package/package.json +4 -4
- package/src/adapter.ts +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @integraledger/lcp-binding-evm-escrow
|
|
2
2
|
|
|
3
|
+
## 0.12.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3cfaff4: `decodeEscrowLogs` surfaces the indexed `paymentInfoHash` — the escrow's join key.
|
|
8
|
+
|
|
9
|
+
**⛔⛔ IT WAS DECODED AND THEN NOT READ.** `paymentInfoHash` is an indexed parameter on all six escrow
|
|
10
|
+
events, so `decodeEventLog` has always returned it — but the `args` cast picked out `paymentInfo` and
|
|
11
|
+
`amount` and nothing else, so it never reached `DecodedEscrowLog`. A consumer that needed the key had no
|
|
12
|
+
way to read it off the chain and could only take a caller's word for which payment a transition belonged
|
|
13
|
+
to, which is not a join.
|
|
14
|
+
|
|
15
|
+
**⭐ WHY IT MATTERS: FOUR OF THE SIX EVENTS CANNOT RE-PROVE THEIR OWN atrHash.** Only `PaymentAuthorized`
|
|
16
|
+
and `PaymentCharged` carry the cleartext `PaymentInfo` whose `salt` IS the atrHash, so `recover` can never
|
|
17
|
+
answer for a `PaymentCaptured`, `PaymentVoided`, `PaymentReclaimed` or `PaymentRefunded`. What those carry
|
|
18
|
+
is this indexed hash — and it is exactly what `conditional-weld` keys its durable log by, and what its
|
|
19
|
+
`ports.ts` names as the thing the package exists to prove: _"the atrHash has to be recoverable from the
|
|
20
|
+
authorization artifact AND the capture artifact, joining on the rail's own key (`paymentInfoHash` on
|
|
21
|
+
Base)."_ The join was designed; the key was simply unreachable through the port.
|
|
22
|
+
|
|
23
|
+
**⭐ SURFACED HERE RATHER THAN ON `LifecycleTransition`.** `binding-core` fixes that shape for fifteen
|
|
24
|
+
bindings and this is one rail's own key — and `decodeEscrowLogs`' own docblock already names itself as the
|
|
25
|
+
sanctioned route for exactly this: _"the only way a consumer reaches the asset behind the weld… a caller
|
|
26
|
+
checking that a settlement moved the asset its record names calls this directly."_ Additive: the field is
|
|
27
|
+
added, `salt` is unmoved, and nothing outside this adapter constructs a `DecodedEscrowLog`.
|
|
28
|
+
|
|
29
|
+
Driven three ways: dropping the field, hard-coding it to a constant, and taking it from the salt (right on
|
|
30
|
+
an authorize, zeroed on a capture — the shape a naive implementation takes) each turn tests red. The
|
|
31
|
+
constant case is the one that matters: two logs from different payments must decode to different keys, or a
|
|
32
|
+
capture from another payment would join to this one's log.
|
|
33
|
+
|
|
34
|
+
- @integraledger/lcp-binding-core@0.12.2
|
|
35
|
+
- @integraledger/lcp-binding-evm-common@0.12.2
|
|
36
|
+
|
|
3
37
|
## 0.12.1
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/dist/adapter.d.ts
CHANGED
|
@@ -57,6 +57,21 @@ export interface EscrowAdapterConfig {
|
|
|
57
57
|
*/
|
|
58
58
|
export interface DecodedEscrowLog {
|
|
59
59
|
name: EscrowEventName;
|
|
60
|
+
/**
|
|
61
|
+
* ⭐⭐ **THE JOIN KEY — the indexed topic on ALL SIX events, and the only thing tying a salt-less one to
|
|
62
|
+
* the payment it belongs to.**
|
|
63
|
+
*
|
|
64
|
+
* Four of the six events carry no cleartext `PaymentInfo`, so {@link WeldAdapter.recover} can never
|
|
65
|
+
* answer for them: a `PaymentCaptured` cannot re-prove its own atrHash. What it carries is this hash,
|
|
66
|
+
* indexed, and `conditional-weld`'s durable log is keyed by exactly it — *"the atrHash has to be
|
|
67
|
+
* recoverable from the authorization artifact AND the capture artifact, joining on the rail's own key
|
|
68
|
+
* (`paymentInfoHash` on Base)"*. A consumer that cannot read this key off the chain has to take a
|
|
69
|
+
* caller's word for which payment a transition belongs to, which is not a join.
|
|
70
|
+
*
|
|
71
|
+
* ⚠️ It was decoded and then not read: `decodeEventLog` returns it as an indexed parameter, and the
|
|
72
|
+
* `args` cast below picked out `paymentInfo` and `amount` only.
|
|
73
|
+
*/
|
|
74
|
+
paymentInfoHash: `0x${string}`;
|
|
60
75
|
/** The atrHash weld, as the raw `PaymentInfo.salt` uint256. Absent on events carrying no `PaymentInfo`. */
|
|
61
76
|
salt?: bigint;
|
|
62
77
|
amount: bigint;
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAKV,WAAW,EACZ,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,GAAG,EAAkB,KAAK,GAAG,EAAY,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAMtE;0EAC0E;AAC1E,eAAO,MAAM,iBAAiB,EAAE,GAO9B,CAAC;AAEH,iGAAiG;AACjG,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,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
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Welds an ATR hash into an authorize-and-capture escrow settlement on EVM chains.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lcp",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"homepage": "https://github.com/IntegraLedger/integra-protocol/tree/main/packages/binding-evm-escrow#readme",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"viem": "2.55.11",
|
|
46
|
-
"@integraledger/lcp-binding-core": "0.12.
|
|
47
|
-
"@integraledger/lcp-binding-evm-common": "0.12.
|
|
46
|
+
"@integraledger/lcp-binding-core": "0.12.2",
|
|
47
|
+
"@integraledger/lcp-binding-evm-common": "0.12.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "24.13.3",
|
|
51
51
|
"vitest": "4.1.10",
|
|
52
|
-
"@integraledger/lcp-kernel": "0.12.
|
|
52
|
+
"@integraledger/lcp-kernel": "0.12.2"
|
|
53
53
|
},
|
|
54
54
|
"license": "Apache-2.0",
|
|
55
55
|
"engines": {
|
package/src/adapter.ts
CHANGED
|
@@ -86,6 +86,21 @@ export interface EscrowAdapterConfig {
|
|
|
86
86
|
*/
|
|
87
87
|
export interface DecodedEscrowLog {
|
|
88
88
|
name: EscrowEventName;
|
|
89
|
+
/**
|
|
90
|
+
* ⭐⭐ **THE JOIN KEY — the indexed topic on ALL SIX events, and the only thing tying a salt-less one to
|
|
91
|
+
* the payment it belongs to.**
|
|
92
|
+
*
|
|
93
|
+
* Four of the six events carry no cleartext `PaymentInfo`, so {@link WeldAdapter.recover} can never
|
|
94
|
+
* answer for them: a `PaymentCaptured` cannot re-prove its own atrHash. What it carries is this hash,
|
|
95
|
+
* indexed, and `conditional-weld`'s durable log is keyed by exactly it — *"the atrHash has to be
|
|
96
|
+
* recoverable from the authorization artifact AND the capture artifact, joining on the rail's own key
|
|
97
|
+
* (`paymentInfoHash` on Base)"*. A consumer that cannot read this key off the chain has to take a
|
|
98
|
+
* caller's word for which payment a transition belongs to, which is not a join.
|
|
99
|
+
*
|
|
100
|
+
* ⚠️ It was decoded and then not read: `decodeEventLog` returns it as an indexed parameter, and the
|
|
101
|
+
* `args` cast below picked out `paymentInfo` and `amount` only.
|
|
102
|
+
*/
|
|
103
|
+
paymentInfoHash: `0x${string}`;
|
|
89
104
|
/** The atrHash weld, as the raw `PaymentInfo.salt` uint256. Absent on events carrying no `PaymentInfo`. */
|
|
90
105
|
salt?: bigint;
|
|
91
106
|
amount: bigint;
|
|
@@ -121,6 +136,8 @@ export function decodeEscrowLogs(
|
|
|
121
136
|
topics: log.topics,
|
|
122
137
|
});
|
|
123
138
|
const args = decoded.args as unknown as {
|
|
139
|
+
/** Indexed on every one of the six events — see {@link DecodedEscrowLog.paymentInfoHash}. */
|
|
140
|
+
paymentInfoHash: `0x${string}`;
|
|
124
141
|
paymentInfo?: {
|
|
125
142
|
salt: bigint;
|
|
126
143
|
token: `0x${string}`;
|
|
@@ -131,6 +148,7 @@ export function decodeEscrowLogs(
|
|
|
131
148
|
};
|
|
132
149
|
out.push({
|
|
133
150
|
name: decoded.eventName as unknown as EscrowEventName,
|
|
151
|
+
paymentInfoHash: args.paymentInfoHash,
|
|
134
152
|
...(args.paymentInfo !== undefined
|
|
135
153
|
? {
|
|
136
154
|
salt: args.paymentInfo.salt,
|