@integraledger/lcp-binding-evm-common 0.18.3 → 0.19.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 +43 -0
- package/README.md +54 -2
- package/dist/eas.d.ts +28 -13
- package/dist/eas.d.ts.map +1 -1
- package/dist/eas.js +0 -10
- package/dist/eas.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/eas.ts +28 -22
- package/src/index.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @integraledger/lcp-binding-evm-common
|
|
2
2
|
|
|
3
|
+
## 0.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 55ac931: The EAS chain read leaves the binding: the package ships what an attestation MEANS, and the party who verifies performs the read
|
|
8
|
+
|
|
9
|
+
`readEasAttestation` is removed from `@integraledger/lcp-binding-evm-common`. `EAS_GET_ATTESTATION_ABI`,
|
|
10
|
+
`RawEasAttestation`, `EasAttestation`, `decodeEasAttestation` and `isEasValidAsOf` all stay, unchanged.
|
|
11
|
+
|
|
12
|
+
⛔ **The principle, not a cleanup.** Integra records; the parties verify. `recordAttestation` emits every
|
|
13
|
+
envelope with `substrateCheck: { status: "not-attempted" }` and carries `substrate` and `ref` precisely so a
|
|
14
|
+
reader can go and check what this estate did not. A chain read is that reader's act, and it was being
|
|
15
|
+
shipped from inside the recorder's tree.
|
|
16
|
+
|
|
17
|
+
⭐ **Nothing about the check moved out of reach, which is why this is a split rather than a deletion.** The
|
|
18
|
+
ABI to call with, the struct the node returns, the normalization and the two-sided as-of predicate are all
|
|
19
|
+
still exported — everything needed to write the read, minus the performing of it. The replacement runs over
|
|
20
|
+
the `ChainReader` port the caller already holds and is a worked, compiled example in
|
|
21
|
+
`docs/developer/guides/verify-a-settlement.md` Step 5 rather than prose — **two hops**, because the
|
|
22
|
+
envelope's `ref` is a content address for the attestation artifact rather than the EAS uid, and passing it
|
|
23
|
+
to the chain reads a real attestation back as an absence.
|
|
24
|
+
|
|
25
|
+
⚠️ **Measured before removing it: zero callers.** Across all three repositories of this estate,
|
|
26
|
+
`readEasAttestation` appeared in exactly three places — its own definition, its barrel export and its own
|
|
27
|
+
test. It also had a second distinction: of every chain read in the shipped sources, it was the only one that
|
|
28
|
+
took a raw viem `PublicClient` instead of going through `binding-core`'s `ChainReader` port, which every
|
|
29
|
+
binding's `recover` and `observe` use. The documented replacement uses the port.
|
|
30
|
+
|
|
31
|
+
⚠️ `eas.ts`'s file header is rewritten. It described a division of labour with `authority`'s
|
|
32
|
+
`attestation-profile.ts` — that file interpreting attestations generically, "the per-substrate on-chain
|
|
33
|
+
read" living here — which that file no longer states. ⛔ The port was never BUILT rather than removed, and
|
|
34
|
+
the distinction matters to anyone who goes looking for it: no `*Port` type exists in any package's `src/`,
|
|
35
|
+
nothing anywhere dispatches on a substrate identifier, and `attestation-profile.ts`'s own header records
|
|
36
|
+
both facts while `AttestationSubstrateCheck` has exactly one inhabitant. Nothing wired the two ends
|
|
37
|
+
together either. The sentence here outlived the sentence there by a release.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [d4f95bc]
|
|
42
|
+
- @integraledger/lcp-authority@0.19.0
|
|
43
|
+
- @integraledger/lcp-binding-core@0.19.0
|
|
44
|
+
- @integraledger/lcp-kernel@0.19.0
|
|
45
|
+
|
|
3
46
|
## 0.18.3
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @integraledger/lcp-binding-evm-common
|
|
2
2
|
|
|
3
|
-
Shared EVM machinery for the rail bindings: typed-data construction, signature verification,
|
|
4
|
-
|
|
3
|
+
Shared EVM machinery for the rail bindings: typed-data construction, signature verification, event
|
|
4
|
+
decoding, and attestation semantics. This is not itself a rail binding — it is what [`@integraledger/lcp-binding-evm-x402`](../binding-evm-x402#readme),
|
|
5
5
|
[`@integraledger/lcp-binding-evm-escrow`](../binding-evm-escrow#readme) and [`@integraledger/lcp-binding-evm-mpp`](../binding-evm-mpp#readme) are built from.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
@@ -57,6 +57,58 @@ reached.
|
|
|
57
57
|
Collapsing any two of those into one another is how a verifier ends up reporting the wrong thing about
|
|
58
58
|
the one case it exists for.
|
|
59
59
|
|
|
60
|
+
## Attestations — the semantics, never the read
|
|
61
|
+
|
|
62
|
+
EAS (Ethereum Attestation Service) attestations turn up as the substrate behind a profiled attestation in
|
|
63
|
+
an authority chain. This package ships what such an attestation **means** and nothing that goes and fetches
|
|
64
|
+
one: `EAS_GET_ATTESTATION_ABI` (the call to make), `RawEasAttestation` (the shape viem decodes the
|
|
65
|
+
node's tuple into),
|
|
66
|
+
`decodeEasAttestation` (normalize it, and flag a zero uid as `exists: false` rather than as a valid
|
|
67
|
+
attestation with empty fields) and `isEasValidAsOf`.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import {
|
|
71
|
+
decodeEasAttestation,
|
|
72
|
+
isEasValidAsOf,
|
|
73
|
+
} from "@integraledger/lcp-binding-evm-common";
|
|
74
|
+
|
|
75
|
+
const attestation = decodeEasAttestation({
|
|
76
|
+
uid: "0x1111111111111111111111111111111111111111111111111111111111111111",
|
|
77
|
+
schema:
|
|
78
|
+
"0x2222222222222222222222222222222222222222222222222222222222222222",
|
|
79
|
+
time: 1700000000n,
|
|
80
|
+
expirationTime: 0n,
|
|
81
|
+
revocationTime: 0n,
|
|
82
|
+
refUID:
|
|
83
|
+
"0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
84
|
+
recipient: "0xAbC0000000000000000000000000000000000001",
|
|
85
|
+
attester: "0xDeF0000000000000000000000000000000000002",
|
|
86
|
+
revocable: true,
|
|
87
|
+
data: "0xcafe",
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
attestation.attester; // "0xdef0000000000000000000000000000000000002" — lowercased
|
|
91
|
+
attestation.exists; // true
|
|
92
|
+
|
|
93
|
+
// Valid AS OF the settlement, never as of now. The bound is two-sided: an attestation minted AFTER the
|
|
94
|
+
// as-of second is not valid as of it, which is the direction backdating goes. The first call below is
|
|
95
|
+
// `true`; the second is `false`, because the attestation was minted one second after the as-of instant.
|
|
96
|
+
isEasValidAsOf(attestation, 1700000000n);
|
|
97
|
+
isEasValidAsOf(attestation, 1699999999n);
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
⛔ **There is deliberately no `readEasAttestation` here, and there was until 2026-09-17.** A chain read is a
|
|
101
|
+
verifier's act: Integra records, and the parties verify.
|
|
102
|
+
|
|
103
|
+
⚠️ **And reading one is two hops, not one.** The envelope's `ref` is an `lcp:sha256:` content address for
|
|
104
|
+
the attestation *artifact*, never the EAS uid: you resolve the artifact where content is stored by its
|
|
105
|
+
digest — the evidence bundle's manifest names it — and take the uid from inside it, then call
|
|
106
|
+
`getAttestation` with that. Handing `ref` to the chain reads a real attestation back as `exists: false`,
|
|
107
|
+
which is indistinguishable from one nobody minted.
|
|
108
|
+
[verify-a-settlement.md](https://github.com/IntegraLedger/integra-protocol/blob/main/docs/developer/guides/verify-a-settlement.md)
|
|
109
|
+
Step 5 is the worked example, both hops. Nothing about the check moved out of reach; what moved is who
|
|
110
|
+
performs it.
|
|
111
|
+
|
|
60
112
|
## Requirement ids
|
|
61
113
|
|
|
62
114
|
This package's source and its messages cite short ids — `ATA-3`, `RCS-5`, `CMP-6` and their kin.
|
package/dist/eas.d.ts
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* EAS (Ethereum Attestation Service)
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* EAS (Ethereum Attestation Service) semantics — what an EAS attestation MEANS, and nothing that goes and
|
|
3
|
+
* reads one. The on-chain struct's shape, the normalization of what a node returns, and the as-of validity
|
|
4
|
+
* predicate live here; the `getAttestation` call itself is the reader's, over the reader's own client.
|
|
5
|
+
* `docs/developer/guides/verify-a-settlement.md` Step 5 is the worked example, and it is TWO hops: the
|
|
6
|
+
* envelope's `ref` is a content address for the attestation artifact, never the uid, and the uid comes
|
|
7
|
+
* out of the artifact the digest resolves to.
|
|
8
|
+
*
|
|
9
|
+
* ⛔ **The split is deliberate and it is the whole point of this file.** Integra records; the parties
|
|
10
|
+
* verify. A chain read is a verifier's act, so this package ships the ABI, the struct, the decoder and the
|
|
11
|
+
* predicate — everything needed to write the read — and performs none of it. `readEasAttestation` lived
|
|
12
|
+
* here until 2026-09-17 with zero callers in any repository.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ This header used to describe a division of labour with `authority`'s `attestation-profile.ts`: that
|
|
15
|
+
* file interpreting attestations generically, "the per-substrate on-chain read" living here, "pure over the
|
|
16
|
+
* injected viem client". That file no longer states its half. Its own header now records that no such port
|
|
17
|
+
* exists in any package's `src/` and that none is coming, and its `AttestationSubstrateCheck` has exactly
|
|
18
|
+
* one inhabitant — `not-attempted`, the arm that would claim a substrate was checked does not exist.
|
|
19
|
+
*
|
|
20
|
+
* ⛔ The port was never BUILT, not removed, and the distinction matters to anyone looking for it: nothing
|
|
21
|
+
* in any package dispatches on a substrate identifier, and nothing ever wired these two ends together —
|
|
22
|
+
* the read this file used to carry had no caller outside its own test in any repository. A recorded
|
|
23
|
+
* attestation is an inspectable input the walk carries, never an implementation the walk selects.
|
|
24
|
+
*
|
|
25
|
+
* Validity is a state read (attester, expiration, revocation), evaluated AS OF a settlement time exactly
|
|
26
|
+
* like `authority`'s status-list discipline — never "is it valid now", always "was it valid at settlement".
|
|
27
|
+
* Nothing here verifies cryptography: an EAS attestation is an on-chain record, and its authenticity is the
|
|
28
|
+
* chain's, not ours.
|
|
9
29
|
*/
|
|
10
|
-
import type { Hex
|
|
30
|
+
import type { Hex } from "viem";
|
|
11
31
|
/** EAS `getAttestation(bytes32) returns (Attestation)` — the canonical struct (EAS v0.26+ field order). */
|
|
12
32
|
export declare const EAS_GET_ATTESTATION_ABI: readonly [{
|
|
13
33
|
readonly type: "function";
|
|
@@ -99,9 +119,4 @@ export declare function decodeEasAttestation(raw: RawEasAttestation): EasAttesta
|
|
|
99
119
|
* attested AT the as-of second is valid. The attestation was live for exactly that instant.
|
|
100
120
|
*/
|
|
101
121
|
export declare function isEasValidAsOf(att: EasAttestation, asOfUnixSeconds: bigint): boolean;
|
|
102
|
-
/** Read + normalize an EAS attestation by uid, over the injected viem client (imperative shell). */
|
|
103
|
-
export declare function readEasAttestation(client: PublicClient, params: {
|
|
104
|
-
eas: string;
|
|
105
|
-
uid: string;
|
|
106
|
-
}): Promise<EasAttestation>;
|
|
107
122
|
//# sourceMappingURL=eas.d.ts.map
|
package/dist/eas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eas.d.ts","sourceRoot":"","sources":["../src/eas.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"eas.d.ts","sourceRoot":"","sources":["../src/eas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,2GAA2G;AAC3G,eAAO,MAAM,uBAAuB;aAEhC,IAAI,EAAE,UAAU;aAChB,IAAI,EAAE,gBAAgB;aACtB,eAAe,EAAE,MAAM;aACvB,MAAM;iBAAK,IAAI,EAAE,KAAK;iBAAE,IAAI,EAAE,SAAS;;aACvC,OAAO;iBAEH,IAAI,EAAE,OAAO;iBACb,IAAI,EAAE,EAAE;iBACR,UAAU;qBACN,IAAI,EAAE,KAAK;qBAAE,IAAI,EAAE,SAAS;;qBAC5B,IAAI,EAAE,QAAQ;qBAAE,IAAI,EAAE,SAAS;;qBAC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AAG,cAAc,CAc3E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,cAAc,EACnB,eAAe,EAAE,MAAM,GACtB,OAAO,CAQT"}
|
package/dist/eas.js
CHANGED
|
@@ -68,14 +68,4 @@ export function isEasValidAsOf(att, asOfUnixSeconds) {
|
|
|
68
68
|
return false;
|
|
69
69
|
return true;
|
|
70
70
|
}
|
|
71
|
-
/** Read + normalize an EAS attestation by uid, over the injected viem client (imperative shell). */
|
|
72
|
-
export async function readEasAttestation(client, params) {
|
|
73
|
-
const raw = (await client.readContract({
|
|
74
|
-
address: params.eas,
|
|
75
|
-
abi: EAS_GET_ATTESTATION_ABI,
|
|
76
|
-
functionName: "getAttestation",
|
|
77
|
-
args: [params.uid],
|
|
78
|
-
}));
|
|
79
|
-
return decodeEasAttestation(raw);
|
|
80
|
-
}
|
|
81
71
|
//# sourceMappingURL=eas.js.map
|
package/dist/eas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eas.js","sourceRoot":"","sources":["../src/eas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eas.js","sourceRoot":"","sources":["../src/eas.ts"],"names":[],"mappings":"AA+BA,2GAA2G;AAC3G,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,gBAAgB;QACtB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC1C,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,EAAE;gBACR,UAAU,EAAE;oBACV,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;oBAChC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;oBACnC,EAAE,IAAI,EAAE,MAAM,EAA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AmB,EACnB,eAAuB;IAEvB,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC9B,IAAI,GAAG,CAAC,IAAI,GAAG,eAAe;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,GAAG,CAAC,cAAc,KAAK,EAAE,IAAI,GAAG,CAAC,cAAc,IAAI,eAAe;QACpE,OAAO,KAAK,CAAC;IACf,IAAI,GAAG,CAAC,cAAc,KAAK,EAAE,IAAI,GAAG,CAAC,cAAc,IAAI,eAAe;QACpE,OAAO,KAAK,CAAC;IACf,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { makeChainReader } from "./client.js";
|
|
2
|
-
export { decodeEasAttestation, EAS_GET_ATTESTATION_ABI, type EasAttestation, isEasValidAsOf, type RawEasAttestation,
|
|
2
|
+
export { decodeEasAttestation, EAS_GET_ATTESTATION_ABI, type EasAttestation, isEasValidAsOf, type RawEasAttestation, } from "./eas.js";
|
|
3
3
|
export { hashEip712 } from "./eip712.js";
|
|
4
4
|
export { assertBytes32, type BuildEip3009Input, buildEip3009TypedData, type Eip3009Authorization, type Eip3009TypedData, eip155ChainId, isCanonicalSignature, type LcpEvmSigner, TRANSFER_WITH_AUTHORIZATION_TYPE, verifyEip3009Signature, } from "./eip3009.js";
|
|
5
5
|
export { assetWasTransferred, ERC20_TRANSFER_TOPIC0 } from "./erc20.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,aAAa,EACb,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,aAAa,EACb,oBAAoB,EACpB,KAAK,YAAY,EACjB,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,qBAAqB,EACrB,KAAK,EACL,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { makeChainReader } from "./client.js";
|
|
2
|
-
export { decodeEasAttestation, EAS_GET_ATTESTATION_ABI, isEasValidAsOf,
|
|
2
|
+
export { decodeEasAttestation, EAS_GET_ATTESTATION_ABI, isEasValidAsOf, } from "./eas.js";
|
|
3
3
|
export { hashEip712 } from "./eip712.js";
|
|
4
4
|
export { assertBytes32, buildEip3009TypedData, eip155ChainId, isCanonicalSignature, TRANSFER_WITH_AUTHORIZATION_TYPE, verifyEip3009Signature, } from "./eip3009.js";
|
|
5
5
|
export { assetWasTransferred, ERC20_TRANSFER_TOPIC0 } from "./erc20.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EAEvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EAEvB,cAAc,GAEf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,aAAa,EAEb,qBAAqB,EAGrB,aAAa,EACb,oBAAoB,EAEpB,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EAIxB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EAGjB,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EAGtB,qBAAqB,EACrB,KAAK,EACL,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@integraledger/lcp-binding-evm-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Shared EVM machinery for LCP rail bindings: typed-data construction and signature verification.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lcp",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/IntegraLedger/integra-protocol/tree/main/packages/binding-evm-common#readme",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@integraledger/lcp-authority": "0.
|
|
47
|
-
"@integraledger/lcp-binding-core": "0.
|
|
48
|
-
"@integraledger/lcp-kernel": "0.
|
|
46
|
+
"@integraledger/lcp-authority": "0.19.0",
|
|
47
|
+
"@integraledger/lcp-binding-core": "0.19.0",
|
|
48
|
+
"@integraledger/lcp-kernel": "0.19.0",
|
|
49
49
|
"viem": "2.56.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
package/src/eas.ts
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* EAS (Ethereum Attestation Service)
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* EAS (Ethereum Attestation Service) semantics — what an EAS attestation MEANS, and nothing that goes and
|
|
3
|
+
* reads one. The on-chain struct's shape, the normalization of what a node returns, and the as-of validity
|
|
4
|
+
* predicate live here; the `getAttestation` call itself is the reader's, over the reader's own client.
|
|
5
|
+
* `docs/developer/guides/verify-a-settlement.md` Step 5 is the worked example, and it is TWO hops: the
|
|
6
|
+
* envelope's `ref` is a content address for the attestation artifact, never the uid, and the uid comes
|
|
7
|
+
* out of the artifact the digest resolves to.
|
|
8
|
+
*
|
|
9
|
+
* ⛔ **The split is deliberate and it is the whole point of this file.** Integra records; the parties
|
|
10
|
+
* verify. A chain read is a verifier's act, so this package ships the ABI, the struct, the decoder and the
|
|
11
|
+
* predicate — everything needed to write the read — and performs none of it. `readEasAttestation` lived
|
|
12
|
+
* here until 2026-09-17 with zero callers in any repository.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ This header used to describe a division of labour with `authority`'s `attestation-profile.ts`: that
|
|
15
|
+
* file interpreting attestations generically, "the per-substrate on-chain read" living here, "pure over the
|
|
16
|
+
* injected viem client". That file no longer states its half. Its own header now records that no such port
|
|
17
|
+
* exists in any package's `src/` and that none is coming, and its `AttestationSubstrateCheck` has exactly
|
|
18
|
+
* one inhabitant — `not-attempted`, the arm that would claim a substrate was checked does not exist.
|
|
19
|
+
*
|
|
20
|
+
* ⛔ The port was never BUILT, not removed, and the distinction matters to anyone looking for it: nothing
|
|
21
|
+
* in any package dispatches on a substrate identifier, and nothing ever wired these two ends together —
|
|
22
|
+
* the read this file used to carry had no caller outside its own test in any repository. A recorded
|
|
23
|
+
* attestation is an inspectable input the walk carries, never an implementation the walk selects.
|
|
24
|
+
*
|
|
25
|
+
* Validity is a state read (attester, expiration, revocation), evaluated AS OF a settlement time exactly
|
|
26
|
+
* like `authority`'s status-list discipline — never "is it valid now", always "was it valid at settlement".
|
|
27
|
+
* Nothing here verifies cryptography: an EAS attestation is an on-chain record, and its authenticity is the
|
|
28
|
+
* chain's, not ours.
|
|
9
29
|
*/
|
|
10
|
-
import type { Hex
|
|
30
|
+
import type { Hex } from "viem";
|
|
11
31
|
|
|
12
32
|
/** EAS `getAttestation(bytes32) returns (Attestation)` — the canonical struct (EAS v0.26+ field order). */
|
|
13
33
|
export const EAS_GET_ATTESTATION_ABI = [
|
|
@@ -114,17 +134,3 @@ export function isEasValidAsOf(
|
|
|
114
134
|
return false;
|
|
115
135
|
return true;
|
|
116
136
|
}
|
|
117
|
-
|
|
118
|
-
/** Read + normalize an EAS attestation by uid, over the injected viem client (imperative shell). */
|
|
119
|
-
export async function readEasAttestation(
|
|
120
|
-
client: PublicClient,
|
|
121
|
-
params: { eas: string; uid: string },
|
|
122
|
-
): Promise<EasAttestation> {
|
|
123
|
-
const raw = (await client.readContract({
|
|
124
|
-
address: params.eas as Hex,
|
|
125
|
-
abi: EAS_GET_ATTESTATION_ABI,
|
|
126
|
-
functionName: "getAttestation",
|
|
127
|
-
args: [params.uid as Hex],
|
|
128
|
-
})) as RawEasAttestation;
|
|
129
|
-
return decodeEasAttestation(raw);
|
|
130
|
-
}
|