@integraledger/lcp-binding-evm-escrow 0.9.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 +13 -0
- package/LICENSE +202 -0
- package/NOTICE +14 -0
- package/README.md +116 -0
- package/dist/adapter.d.ts +82 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +152 -0
- package/dist/adapter.js.map +1 -0
- package/dist/calls.d.ts +30 -0
- package/dist/calls.d.ts.map +1 -0
- package/dist/calls.js +67 -0
- package/dist/calls.js.map +1 -0
- package/dist/collectors.d.ts +42 -0
- package/dist/collectors.d.ts.map +1 -0
- package/dist/collectors.js +59 -0
- package/dist/collectors.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle.d.ts +34 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +28 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/manifest.d.ts +52 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +82 -0
- package/dist/manifest.js.map +1 -0
- package/package.json +64 -0
- package/src/adapter.ts +255 -0
- package/src/calls.ts +99 -0
- package/src/collectors.ts +96 -0
- package/src/index.ts +33 -0
- package/src/lifecycle.ts +53 -0
- package/src/manifest.ts +83 -0
package/dist/calls.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The escrow KEY derivations — the off-chain `getHash` (== the event's indexed `paymentInfoHash`) and
|
|
3
|
+
* the payer-agnostic nonce, so a settlement can be keyed and joined without importing viem
|
|
4
|
+
* downstream — viem stays here. There are no calldata encoders in this module and none anywhere in
|
|
5
|
+
* this package: escrow is not our product, so this binding reads the mechanism and never drives it.
|
|
6
|
+
* (This module has no calldata encoders: they were removed
|
|
7
|
+
* with the escrow-operation retirement and the headline was not.) `encodeAbiParameters` below is
|
|
8
|
+
* hashing input, not transaction input.
|
|
9
|
+
*
|
|
10
|
+
* Every struct field and signature is transcribed from the DEPLOYED `AuthCaptureEscrow` at
|
|
11
|
+
* base/commerce-payments @ 98b592b (the pinned deployment, NOT repo HEAD — the charge/capture event ABI
|
|
12
|
+
* drift that shipped a bug earlier came from reading HEAD).
|
|
13
|
+
*
|
|
14
|
+
* `getHashOffchain` replicates the on-chain `getHash` byte-identically, so the settlement key is
|
|
15
|
+
* derivable BEFORE the authorizing tx confirms rather than only from the event. Call it with the real
|
|
16
|
+
* `payer` for the settlement key; call it with `payer = 0` for the ERC-3009 `ReceiveWithAuthorization`
|
|
17
|
+
* nonce the buyer signs (the "payer-agnostic" nonce).
|
|
18
|
+
*/
|
|
19
|
+
import { encodeAbiParameters, keccak256, stringToHex } from "viem";
|
|
20
|
+
import { AUTH_CAPTURE_ESCROW } from "./collectors.js";
|
|
21
|
+
/** The PaymentInfo tuple components, in the DEPLOYED struct's field order (98b592b). */
|
|
22
|
+
const PI_COMPONENTS = {
|
|
23
|
+
type: "tuple",
|
|
24
|
+
components: [
|
|
25
|
+
{ name: "operator", type: "address" },
|
|
26
|
+
{ name: "payer", type: "address" },
|
|
27
|
+
{ name: "receiver", type: "address" },
|
|
28
|
+
{ name: "token", type: "address" },
|
|
29
|
+
{ name: "maxAmount", type: "uint120" },
|
|
30
|
+
{ name: "preApprovalExpiry", type: "uint48" },
|
|
31
|
+
{ name: "authorizationExpiry", type: "uint48" },
|
|
32
|
+
{ name: "refundExpiry", type: "uint48" },
|
|
33
|
+
{ name: "minFeeBps", type: "uint16" },
|
|
34
|
+
{ name: "maxFeeBps", type: "uint16" },
|
|
35
|
+
{ name: "feeReceiver", type: "address" },
|
|
36
|
+
{ name: "salt", type: "uint256" },
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
/** keccak256 of the PaymentInfo typehash STRING (== the deployed PAYMENT_INFO_TYPEHASH, 0xae68…6591). */
|
|
40
|
+
export const PAYMENT_INFO_TYPEHASH = keccak256(stringToHex("PaymentInfo(address operator,address payer,address receiver,address token,uint120 maxAmount,uint48 preApprovalExpiry,uint48 authorizationExpiry,uint48 refundExpiry,uint16 minFeeBps,uint16 maxFeeBps,address feeReceiver,uint256 salt)"));
|
|
41
|
+
const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
42
|
+
/**
|
|
43
|
+
* The off-chain `getHash(paymentInfo)` — `keccak256(abi.encode(chainId, escrow, keccak256(abi.encode(
|
|
44
|
+
* TYPEHASH, paymentInfo))))`. Equals the event's indexed `paymentInfoHash` (the deployed `authorize`/
|
|
45
|
+
* `charge` emit `getHash(paymentInfo)` as that topic) and the settlement key. This matches
|
|
46
|
+
* the on-chain view byte-for-byte (incl. the fee-bearing case).
|
|
47
|
+
*/
|
|
48
|
+
export function getHashOffchain(params) {
|
|
49
|
+
const escrow = params.escrow ?? AUTH_CAPTURE_ESCROW;
|
|
50
|
+
const inner = keccak256(encodeAbiParameters([{ type: "bytes32" }, PI_COMPONENTS], [PAYMENT_INFO_TYPEHASH, params.paymentInfo]));
|
|
51
|
+
return keccak256(encodeAbiParameters([{ type: "uint256" }, { type: "address" }, { type: "bytes32" }], [BigInt(params.chainId), escrow, inner]));
|
|
52
|
+
}
|
|
53
|
+
/** The settlement key / event `paymentInfoHash` for a PaymentInfo (alias of `getHashOffchain`). */
|
|
54
|
+
export function paymentInfoHash(params) {
|
|
55
|
+
return getHashOffchain(params);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The ERC-3009 `ReceiveWithAuthorization` nonce the buyer signs — `getHash(paymentInfo with payer = 0)`
|
|
59
|
+
* (the "payer-agnostic" hash; the collector fills the real payer from the recovered signature).
|
|
60
|
+
*/
|
|
61
|
+
export function payerAgnosticNonce(params) {
|
|
62
|
+
return getHashOffchain({
|
|
63
|
+
...params,
|
|
64
|
+
paymentInfo: { ...params.paymentInfo, payer: ZERO_ADDRESS },
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.js","sourceRoot":"","sources":["../src/calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,wFAAwF;AACxF,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACV,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;QACrC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;QAClC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;QACrC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;QAClC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;QACtC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC7C,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC/C,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE;QACxC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;KAClC;CACO,CAAC;AAEX,yGAAyG;AACzG,MAAM,CAAC,MAAM,qBAAqB,GAAkB,SAAS,CAC3D,WAAW,CACT,yOAAyO,CAC1O,CACF,CAAC;AAEF,MAAM,YAAY,GAAG,4CAAqD,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAI/B;IACC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,mBAAmB,CAAC;IACpD,MAAM,KAAK,GAAG,SAAS,CACrB,mBAAmB,CACjB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,aAAa,CAAC,EACpC,CAAC,qBAAqB,EAAE,MAAM,CAAC,WAAW,CAAC,CAC5C,CACF,CAAC;IACF,OAAO,SAAS,CACd,mBAAmB,CACjB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC/D,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CACxC,CACF,CAAC;AACJ,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,eAAe,CAAC,MAI/B;IACC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAIlC;IACC,OAAO,eAAe,CAAC;QACrB,GAAG,MAAM;QACT,WAAW,EAAE,EAAE,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE;KAC5D,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Commerce Payments token collectors — the modular payer-authorization methods `authorize`/`charge`
|
|
3
|
+
* pull funds through. Addresses are the deterministic base/commerce-payments deployments (identical on
|
|
4
|
+
* Base Mainnet and Base Sepolia). Each carries its **weld grade** (per the manifest) and whether that
|
|
5
|
+
* grade is **on-chain-proven** vs characterized-from-source.
|
|
6
|
+
*
|
|
7
|
+
* The ERC3009 collector's `collectorData` IS the payer's signature (the collector runs it through
|
|
8
|
+
* `_handleERC6492Signature`, so a smart-wallet ERC-6492 sig works too) over the USDC
|
|
9
|
+
* `ReceiveWithAuthorization` with `to = <the collector>`, `value = maxAmount`, `nonce =
|
|
10
|
+
* getHash(paymentInfo with payer = 0)`. The signing itself is the money-path runtime's job
|
|
11
|
+
* this package declares the collectors, their grades, and the policy.
|
|
12
|
+
*/
|
|
13
|
+
import type { Refusal, WeldGrade } from "@integraledger/lcp-binding-core";
|
|
14
|
+
/** The four Commerce Payments collectors — the payer-authorization methods funds are pulled through.
|
|
15
|
+
* Naming one is not the same as being able to USE it here: the shipped policy accepts only collectors
|
|
16
|
+
* whose weld grade is on-chain-proven, and today that is `ERC3009` alone. */
|
|
17
|
+
export type CollectorName = "ERC3009" | "Permit2" | "SpendPermission" | "PreApproval";
|
|
18
|
+
/** One collector's declaration: where it is deployed, what weld grade it earns, and — separately —
|
|
19
|
+
* whether that grade has been PROVEN by an on-chain run rather than read off the pinned source.
|
|
20
|
+
* `proven: false` is not a doubt about the code; it records that nobody has watched it happen. */
|
|
21
|
+
export interface EscrowCollector {
|
|
22
|
+
name: CollectorName;
|
|
23
|
+
address: `0x${string}`;
|
|
24
|
+
grade: WeldGrade;
|
|
25
|
+
/** True iff the grade is proven by an on-chain run (not merely read from the pinned source). */
|
|
26
|
+
proven: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** The base/commerce-payments collector deployments (Base Mainnet == Base Sepolia, deterministic). */
|
|
29
|
+
export declare const COLLECTORS: Record<CollectorName, EscrowCollector>;
|
|
30
|
+
/** The `AuthCaptureEscrow` (Base Mainnet == Base Sepolia). */
|
|
31
|
+
export declare const AUTH_CAPTURE_ESCROW: "0xBdEA0D1bcC5966192B070Fdf62aB4EF5b4420cff";
|
|
32
|
+
/** The declaration for one collector. Total over the union, so it cannot fail — the acceptability check
|
|
33
|
+
* is a separate call, and reaching a collector here is not permission to use it. */
|
|
34
|
+
export declare function getCollector(name: CollectorName): EscrowCollector;
|
|
35
|
+
/**
|
|
36
|
+
* Enforce a **signature-grade, on-chain-proven** collector policy (fail-fast, no silent tx-grade
|
|
37
|
+
* fallback): refuse a `tx`-grade collector where signature-grade is required, and refuse a collector
|
|
38
|
+
* whose grade is not yet on-chain-proven (only ERC3009 is). Returns a `policy-rejection` Refusal
|
|
39
|
+
* or `null` when the collector is acceptable.
|
|
40
|
+
*/
|
|
41
|
+
export declare function assertSignatureGrade(name: CollectorName): Refusal | null;
|
|
42
|
+
//# sourceMappingURL=collectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectors.d.ts","sourceRoot":"","sources":["../src/collectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE1E;;8EAE8E;AAC9E,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,SAAS,GACT,iBAAiB,GACjB,aAAa,CAAC;AAElB;;mGAEmG;AACnG,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,gGAAgG;IAChG,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,sGAAsG;AACtG,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE,eAAe,CAyB7D,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,EAC9B,4CAAqD,CAAC;AAExD;qFACqF;AACrF,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,eAAe,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI,CAiBxE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** The base/commerce-payments collector deployments (Base Mainnet == Base Sepolia, deterministic). */
|
|
2
|
+
export const COLLECTORS = {
|
|
3
|
+
ERC3009: {
|
|
4
|
+
name: "ERC3009",
|
|
5
|
+
address: "0x0E3dF9510de65469C4518D7843919c0b8C7A7757",
|
|
6
|
+
grade: "signature",
|
|
7
|
+
proven: true,
|
|
8
|
+
},
|
|
9
|
+
Permit2: {
|
|
10
|
+
name: "Permit2",
|
|
11
|
+
address: "0x992476B9Ee81d52a5BdA0622C333938D0Af0aB26",
|
|
12
|
+
grade: "signature",
|
|
13
|
+
proven: false,
|
|
14
|
+
},
|
|
15
|
+
SpendPermission: {
|
|
16
|
+
name: "SpendPermission",
|
|
17
|
+
address: "0x8d9F34934dc9619e5DC3Df27D0A40b4A744E7eAa",
|
|
18
|
+
grade: "signature",
|
|
19
|
+
proven: false,
|
|
20
|
+
},
|
|
21
|
+
PreApproval: {
|
|
22
|
+
name: "PreApproval",
|
|
23
|
+
address: "0x1b77ABd71FCD21fbe2398AE821Aa27D1E6B94bC6",
|
|
24
|
+
grade: "tx",
|
|
25
|
+
proven: false,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
/** The `AuthCaptureEscrow` (Base Mainnet == Base Sepolia). */
|
|
29
|
+
export const AUTH_CAPTURE_ESCROW = "0xBdEA0D1bcC5966192B070Fdf62aB4EF5b4420cff";
|
|
30
|
+
/** The declaration for one collector. Total over the union, so it cannot fail — the acceptability check
|
|
31
|
+
* is a separate call, and reaching a collector here is not permission to use it. */
|
|
32
|
+
export function getCollector(name) {
|
|
33
|
+
return COLLECTORS[name];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Enforce a **signature-grade, on-chain-proven** collector policy (fail-fast, no silent tx-grade
|
|
37
|
+
* fallback): refuse a `tx`-grade collector where signature-grade is required, and refuse a collector
|
|
38
|
+
* whose grade is not yet on-chain-proven (only ERC3009 is). Returns a `policy-rejection` Refusal
|
|
39
|
+
* or `null` when the collector is acceptable.
|
|
40
|
+
*/
|
|
41
|
+
export function assertSignatureGrade(name) {
|
|
42
|
+
const c = COLLECTORS[name];
|
|
43
|
+
if (c.grade !== "signature")
|
|
44
|
+
return {
|
|
45
|
+
refused: true,
|
|
46
|
+
haltClass: "policy-rejection",
|
|
47
|
+
code: "escrow/tx-grade-collector",
|
|
48
|
+
detail: `collector ${name} is ${c.grade}-grade; a signature-grade weld is required (no silent tx-grade fallback)`,
|
|
49
|
+
};
|
|
50
|
+
if (!c.proven)
|
|
51
|
+
return {
|
|
52
|
+
refused: true,
|
|
53
|
+
haltClass: "policy-rejection",
|
|
54
|
+
code: "escrow/unproven-collector",
|
|
55
|
+
detail: `collector ${name}'s grade is characterized-from-source but not on-chain-proven — prove it on-chain before use`,
|
|
56
|
+
};
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=collectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectors.js","sourceRoot":"","sources":["../src/collectors.ts"],"names":[],"mappings":"AAkCA,sGAAsG;AACtG,MAAM,CAAC,MAAM,UAAU,GAA2C;IAChE,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,4CAA4C;QACrD,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,4CAA4C;QACrD,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,KAAK;KACd;IACD,eAAe,EAAE;QACf,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,4CAA4C;QACrD,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,KAAK;KACd;IACD,WAAW,EAAE;QACX,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,4CAA4C;QACrD,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,KAAK;KACd;CACF,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAC9B,4CAAqD,CAAC;AAExD;qFACqF;AACrF,MAAM,UAAU,YAAY,CAAC,IAAmB;IAC9C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAmB;IACtD,MAAM,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,CAAC,KAAK,KAAK,WAAW;QACzB,OAAO;YACL,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,2BAA2B;YACjC,MAAM,EAAE,aAAa,IAAI,OAAO,CAAC,CAAC,KAAK,0EAA0E;SAClH,CAAC;IACJ,IAAI,CAAC,CAAC,CAAC,MAAM;QACX,OAAO;YACL,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,2BAA2B;YACjC,MAAM,EAAE,aAAa,IAAI,8FAA8F;SACxH,CAAC;IACJ,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { atrHashFromSalt, createEscrowAdapter, type DecodedEscrowLog, decodeEscrowLogs, ESCROW_EVENTS_ABI, type EscrowAdapterConfig, type EscrowProposal, type EscrowProposalContext, type PaymentInfo, saltFromAtrHash, } from "./adapter.js";
|
|
2
|
+
export { getHashOffchain, PAYMENT_INFO_TYPEHASH, payerAgnosticNonce, paymentInfoHash, } from "./calls.js";
|
|
3
|
+
export { AUTH_CAPTURE_ESCROW, assertSignatureGrade, COLLECTORS, type CollectorName, type EscrowCollector, getCollector, } from "./collectors.js";
|
|
4
|
+
export { type EscrowEventName, type EscrowState, EVENT_TO_STATE, stateFor, } from "./lifecycle.js";
|
|
5
|
+
export { ESCROW_MANIFEST } from "./manifest.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,cAAc,EACd,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { atrHashFromSalt, createEscrowAdapter, decodeEscrowLogs, ESCROW_EVENTS_ABI, saltFromAtrHash, } from "./adapter.js";
|
|
2
|
+
export { getHashOffchain, PAYMENT_INFO_TYPEHASH, payerAgnosticNonce, paymentInfoHash, } from "./calls.js";
|
|
3
|
+
export { AUTH_CAPTURE_ESCROW, assertSignatureGrade, COLLECTORS, getCollector, } from "./collectors.js";
|
|
4
|
+
export { EVENT_TO_STATE, stateFor, } from "./lifecycle.js";
|
|
5
|
+
export { ESCROW_MANIFEST } from "./manifest.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EAEnB,gBAAgB,EAChB,iBAAiB,EAKjB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EAGV,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,cAAc,EACd,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The escrow lifecycle as a discriminated union — illegal states are not constructible. The
|
|
3
|
+
* `charged` state is terminal for COLLECTION (the one-step charge path — no authorize/capture follows),
|
|
4
|
+
* but `refunded` stays reachable within `refundExpiry`, which is exactly the manifest's
|
|
5
|
+
* `finality: { reversible: true }`: an on-rail refund, not a capture reversal — the two answer different
|
|
6
|
+
* questions and both hold. Transitions join on the indexed `paymentInfoHash`.
|
|
7
|
+
*/
|
|
8
|
+
export type EscrowState = {
|
|
9
|
+
s: "proposed";
|
|
10
|
+
} | {
|
|
11
|
+
s: "authorized";
|
|
12
|
+
amount: bigint;
|
|
13
|
+
} | {
|
|
14
|
+
s: "captured";
|
|
15
|
+
amount: bigint;
|
|
16
|
+
} | {
|
|
17
|
+
s: "charged";
|
|
18
|
+
amount: bigint;
|
|
19
|
+
} | {
|
|
20
|
+
s: "voided";
|
|
21
|
+
} | {
|
|
22
|
+
s: "reclaimed";
|
|
23
|
+
} | {
|
|
24
|
+
s: "refunded";
|
|
25
|
+
amount: bigint;
|
|
26
|
+
};
|
|
27
|
+
/** The six on-chain escrow events (`AuthCaptureEscrow`) that drive lifecycle transitions. */
|
|
28
|
+
export type EscrowEventName = "PaymentAuthorized" | "PaymentCaptured" | "PaymentCharged" | "PaymentVoided" | "PaymentReclaimed" | "PaymentRefunded";
|
|
29
|
+
/** The lifecycle state name each event lands in (the manifest's `lifecycleStates`, minus the off-chain
|
|
30
|
+
* `proposed`). Used to label `observe`'s transitions. */
|
|
31
|
+
export declare const EVENT_TO_STATE: Record<EscrowEventName, EscrowState["s"]>;
|
|
32
|
+
/** Build the discriminated `EscrowState` for an event + its amount (amount ignored for void/reclaim). */
|
|
33
|
+
export declare function stateFor(event: EscrowEventName, amount: bigint): EscrowState;
|
|
34
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,CAAC,EAAE,UAAU,CAAA;CAAE,GACjB;IAAE,CAAC,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,CAAC,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,CAAC,EAAE,QAAQ,CAAA;CAAE,GACf;IAAE,CAAC,EAAE,WAAW,CAAA;CAAE,GAClB;IAAE,CAAC,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,6FAA6F;AAC7F,MAAM,MAAM,eAAe,GACvB,mBAAmB,GACnB,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,iBAAiB,CAAC;AAEtB;0DAC0D;AAC1D,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,eAAe,EAAE,WAAW,CAAC,GAAG,CAAC,CAOpE,CAAC;AAEF,yGAAyG;AACzG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAe5E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** The lifecycle state name each event lands in (the manifest's `lifecycleStates`, minus the off-chain
|
|
2
|
+
* `proposed`). Used to label `observe`'s transitions. */
|
|
3
|
+
export const EVENT_TO_STATE = {
|
|
4
|
+
PaymentAuthorized: "authorized",
|
|
5
|
+
PaymentCaptured: "captured",
|
|
6
|
+
PaymentCharged: "charged",
|
|
7
|
+
PaymentVoided: "voided",
|
|
8
|
+
PaymentReclaimed: "reclaimed",
|
|
9
|
+
PaymentRefunded: "refunded",
|
|
10
|
+
};
|
|
11
|
+
/** Build the discriminated `EscrowState` for an event + its amount (amount ignored for void/reclaim). */
|
|
12
|
+
export function stateFor(event, amount) {
|
|
13
|
+
switch (event) {
|
|
14
|
+
case "PaymentAuthorized":
|
|
15
|
+
return { s: "authorized", amount };
|
|
16
|
+
case "PaymentCaptured":
|
|
17
|
+
return { s: "captured", amount };
|
|
18
|
+
case "PaymentCharged":
|
|
19
|
+
return { s: "charged", amount };
|
|
20
|
+
case "PaymentVoided":
|
|
21
|
+
return { s: "voided" };
|
|
22
|
+
case "PaymentReclaimed":
|
|
23
|
+
return { s: "reclaimed" };
|
|
24
|
+
case "PaymentRefunded":
|
|
25
|
+
return { s: "refunded", amount };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAyBA;0DAC0D;AAC1D,MAAM,CAAC,MAAM,cAAc,GAA8C;IACvE,iBAAiB,EAAE,YAAY;IAC/B,eAAe,EAAE,UAAU;IAC3B,cAAc,EAAE,SAAS;IACzB,aAAa,EAAE,QAAQ;IACvB,gBAAgB,EAAE,WAAW;IAC7B,eAAe,EAAE,UAAU;CAC5B,CAAC;AAEF,yGAAyG;AACzG,MAAM,UAAU,QAAQ,CAAC,KAAsB,EAAE,MAAc;IAC7D,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,mBAAmB;YACtB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;QACrC,KAAK,iBAAiB;YACpB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QACnC,KAAK,gBAAgB;YACnB,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAClC,KAAK,eAAe;YAClB,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;QACzB,KAAK,kBAAkB;YACrB,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC;QAC5B,KAAK,iBAAiB;YACpB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { BindingManifest } from "@integraledger/lcp-binding-core";
|
|
2
|
+
/**
|
|
3
|
+
* The Commerce Payments escrow binding manifest (`AuthCaptureEscrow`, authorize→capture).
|
|
4
|
+
*
|
|
5
|
+
* **pattern = "native-field"** — the atrHash rides `PaymentInfo.salt`, an EXISTING protocol field the
|
|
6
|
+
* service already controls (LCP §8.3.1); no derivation, no overlay. **WLD-3 recovery is an event-data scan,
|
|
7
|
+
* not a topic filter:** the indexed topic is `paymentInfoHash`; `salt` rides the cleartext `PaymentInfo`
|
|
8
|
+
* in `PaymentAuthorized`/`PaymentCharged` event data, so `recover`/`enumerate` decode the event and read
|
|
9
|
+
* `salt` (proven on-chain).
|
|
10
|
+
*
|
|
11
|
+
* **recovery.forwardIndexable = false** — the criterion is enumeration bound to a GIVEN atrHash, and this
|
|
12
|
+
* rail cannot do it. `paymentInfoHash` is the only indexed topic, and it is a hash of the whole
|
|
13
|
+
* `PaymentInfo` struct: a caller holding the complete struct could topic-filter, but a caller holding only
|
|
14
|
+
* an atrHash cannot derive it. So `enumerate` fetches the salt-bearing events over a range and filters
|
|
15
|
+
* client-side on the decoded `salt` — an O(range) scan, which is exactly what `indexing:
|
|
16
|
+
* "event-data-scan:paymentInfoHash"` says and what `adapter.ts` does. Six siblings declare `false` for
|
|
17
|
+
* mechanically equivalent scans; the three that declare `true` (cardano, tempo-mpp, evm-x402) each rest on
|
|
18
|
+
* a real index keyed on the atrHash itself.
|
|
19
|
+
*
|
|
20
|
+
* **weldGrades are TRANSCRIBED from an on-chain proof, never authored here**: `ERC3009 =
|
|
21
|
+
* "signature"` is **proven on-chain** (the payer's USDC `ReceiveWithAuthorization` drives
|
|
22
|
+
* `authorize`); `Permit2`/`SpendPermission` = `"signature"` and `PreApproval` = `"tx"` are
|
|
23
|
+
* **characterized from the pinned source** (`collectors/*.sol`) and NOT yet on-chain-proven — an adapter
|
|
24
|
+
* refuses a collector until its grade is proven the same way (`collectors.ts`). If a run ever falsifies a
|
|
25
|
+
* collector, this manifest changes with it — the on-chain proof stays the authority on what may be declared.
|
|
26
|
+
*
|
|
27
|
+
* **THE atrHash MUST BE PER-TRANSACTION, AND THIS IS THE FIRST PLACE IT IS WRITTEN DOWN.** The carrier is
|
|
28
|
+
* `PaymentInfo.salt`, whose own specification calls it "a source of entropy to ensure unique hashes across
|
|
29
|
+
* different payments". An atrHash carries no entropy: it is deterministic, server-side, and identical for
|
|
30
|
+
* every payment made under one terms document. The consequence is on-chain and immediate — the escrow
|
|
31
|
+
* rejects a `PaymentInfo` it has already seen, so a repeat purchase under one ATR with the same payer,
|
|
32
|
+
* caps and expiries reverts. Nothing in this package can detect that, because the collision is between two
|
|
33
|
+
* transactions it never sees together; a deployment reusing one ATR across purchases is the failure mode,
|
|
34
|
+
* and the fix is a per-transaction ATR, which LCP §6.1 wants anyway.
|
|
35
|
+
*
|
|
36
|
+
* **NO `protocol`, and the silence is now examined rather than default.** x402 publishes an `auth-capture`
|
|
37
|
+
* scheme over this SAME contract stack (`base/commerce-payments`, `AuthCaptureEscrow`), read 2026-08-08 —
|
|
38
|
+
* but x402 building on a contract this binding also builds on does not make this binding x402's. There is
|
|
39
|
+
* no `extra` block here, no facilitator, no payload envelope: this package constructs `PaymentInfo`
|
|
40
|
+
* directly and settles against the contract. Declaring `protocol: "x402"` would claim conformance to a
|
|
41
|
+
* wire format it does not implement.
|
|
42
|
+
*
|
|
43
|
+
* The scheme is still worth reading, because it sharpens the salt requirement above. Under x402
|
|
44
|
+
* auth-capture the signature nonce is the **payer-agnostic** `PaymentInfo` hash — "Payer is zeroed" — and
|
|
45
|
+
* freshness rests entirely on the salt: "each signing call generates a fresh `bytes32` salt, so two payers
|
|
46
|
+
* signing concurrently produce distinct nonces with no collision risk." A deterministic salt removes the
|
|
47
|
+
* only thing keeping two DIFFERENT payers apart there. So a deployment that settles through an x402
|
|
48
|
+
* auth-capture facilitator must not weld this way at all, where a bare deployment only has to keep the ATR
|
|
49
|
+
* per-transaction.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ESCROW_MANIFEST: BindingManifest;
|
|
52
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,eAAe,EAAE,eA+B7B,CAAC"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Commerce Payments escrow binding manifest (`AuthCaptureEscrow`, authorize→capture).
|
|
3
|
+
*
|
|
4
|
+
* **pattern = "native-field"** — the atrHash rides `PaymentInfo.salt`, an EXISTING protocol field the
|
|
5
|
+
* service already controls (LCP §8.3.1); no derivation, no overlay. **WLD-3 recovery is an event-data scan,
|
|
6
|
+
* not a topic filter:** the indexed topic is `paymentInfoHash`; `salt` rides the cleartext `PaymentInfo`
|
|
7
|
+
* in `PaymentAuthorized`/`PaymentCharged` event data, so `recover`/`enumerate` decode the event and read
|
|
8
|
+
* `salt` (proven on-chain).
|
|
9
|
+
*
|
|
10
|
+
* **recovery.forwardIndexable = false** — the criterion is enumeration bound to a GIVEN atrHash, and this
|
|
11
|
+
* rail cannot do it. `paymentInfoHash` is the only indexed topic, and it is a hash of the whole
|
|
12
|
+
* `PaymentInfo` struct: a caller holding the complete struct could topic-filter, but a caller holding only
|
|
13
|
+
* an atrHash cannot derive it. So `enumerate` fetches the salt-bearing events over a range and filters
|
|
14
|
+
* client-side on the decoded `salt` — an O(range) scan, which is exactly what `indexing:
|
|
15
|
+
* "event-data-scan:paymentInfoHash"` says and what `adapter.ts` does. Six siblings declare `false` for
|
|
16
|
+
* mechanically equivalent scans; the three that declare `true` (cardano, tempo-mpp, evm-x402) each rest on
|
|
17
|
+
* a real index keyed on the atrHash itself.
|
|
18
|
+
*
|
|
19
|
+
* **weldGrades are TRANSCRIBED from an on-chain proof, never authored here**: `ERC3009 =
|
|
20
|
+
* "signature"` is **proven on-chain** (the payer's USDC `ReceiveWithAuthorization` drives
|
|
21
|
+
* `authorize`); `Permit2`/`SpendPermission` = `"signature"` and `PreApproval` = `"tx"` are
|
|
22
|
+
* **characterized from the pinned source** (`collectors/*.sol`) and NOT yet on-chain-proven — an adapter
|
|
23
|
+
* refuses a collector until its grade is proven the same way (`collectors.ts`). If a run ever falsifies a
|
|
24
|
+
* collector, this manifest changes with it — the on-chain proof stays the authority on what may be declared.
|
|
25
|
+
*
|
|
26
|
+
* **THE atrHash MUST BE PER-TRANSACTION, AND THIS IS THE FIRST PLACE IT IS WRITTEN DOWN.** The carrier is
|
|
27
|
+
* `PaymentInfo.salt`, whose own specification calls it "a source of entropy to ensure unique hashes across
|
|
28
|
+
* different payments". An atrHash carries no entropy: it is deterministic, server-side, and identical for
|
|
29
|
+
* every payment made under one terms document. The consequence is on-chain and immediate — the escrow
|
|
30
|
+
* rejects a `PaymentInfo` it has already seen, so a repeat purchase under one ATR with the same payer,
|
|
31
|
+
* caps and expiries reverts. Nothing in this package can detect that, because the collision is between two
|
|
32
|
+
* transactions it never sees together; a deployment reusing one ATR across purchases is the failure mode,
|
|
33
|
+
* and the fix is a per-transaction ATR, which LCP §6.1 wants anyway.
|
|
34
|
+
*
|
|
35
|
+
* **NO `protocol`, and the silence is now examined rather than default.** x402 publishes an `auth-capture`
|
|
36
|
+
* scheme over this SAME contract stack (`base/commerce-payments`, `AuthCaptureEscrow`), read 2026-08-08 —
|
|
37
|
+
* but x402 building on a contract this binding also builds on does not make this binding x402's. There is
|
|
38
|
+
* no `extra` block here, no facilitator, no payload envelope: this package constructs `PaymentInfo`
|
|
39
|
+
* directly and settles against the contract. Declaring `protocol: "x402"` would claim conformance to a
|
|
40
|
+
* wire format it does not implement.
|
|
41
|
+
*
|
|
42
|
+
* The scheme is still worth reading, because it sharpens the salt requirement above. Under x402
|
|
43
|
+
* auth-capture the signature nonce is the **payer-agnostic** `PaymentInfo` hash — "Payer is zeroed" — and
|
|
44
|
+
* freshness rests entirely on the salt: "each signing call generates a fresh `bytes32` salt, so two payers
|
|
45
|
+
* signing concurrently produce distinct nonces with no collision risk." A deterministic salt removes the
|
|
46
|
+
* only thing keeping two DIFFERENT payers apart there. So a deployment that settles through an x402
|
|
47
|
+
* auth-capture facilitator must not weld this way at all, where a bare deployment only has to keep the ATR
|
|
48
|
+
* per-transaction.
|
|
49
|
+
*/
|
|
50
|
+
export const ESCROW_MANIFEST = {
|
|
51
|
+
rail: "evm:escrow",
|
|
52
|
+
pattern: "native-field",
|
|
53
|
+
nativeField: "PaymentInfo.salt",
|
|
54
|
+
recovery: {
|
|
55
|
+
onChain: true,
|
|
56
|
+
zeroPartyRecoverable: true,
|
|
57
|
+
forwardIndexable: false,
|
|
58
|
+
},
|
|
59
|
+
assetBinding: "carried", // PaymentInfo.token rides the cleartext event data — the record itself names the asset
|
|
60
|
+
successGate: "structural", // a reverted tx emits no logs, so the escrow weld event cannot exist
|
|
61
|
+
indexing: "event-data-scan:paymentInfoHash",
|
|
62
|
+
finality: {
|
|
63
|
+
reversible: true,
|
|
64
|
+
note: 'on-rail void/refund within refundExpiry — not dispute resolution (RCS-5); capture is not reversed, refund is a fresh on-rail remedy The atrHash welded into PaymentInfo.salt MUST be per-transaction: salt is specified as the struct\'s entropy source ("a source of entropy to ensure unique hashes across different payments") and an atrHash carries none, so a repeat purchase under one ATR with the same payer, caps and expiries produces a PaymentInfo the escrow has already seen and reverts.',
|
|
65
|
+
},
|
|
66
|
+
weldGrades: {
|
|
67
|
+
ERC3009: "signature",
|
|
68
|
+
Permit2: "signature",
|
|
69
|
+
SpendPermission: "signature",
|
|
70
|
+
PreApproval: "tx",
|
|
71
|
+
},
|
|
72
|
+
lifecycleStates: [
|
|
73
|
+
"proposed",
|
|
74
|
+
"authorized",
|
|
75
|
+
"captured",
|
|
76
|
+
"charged",
|
|
77
|
+
"voided",
|
|
78
|
+
"reclaimed",
|
|
79
|
+
"refunded",
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,kBAAkB;IAC/B,QAAQ,EAAE;QACR,OAAO,EAAE,IAAI;QACb,oBAAoB,EAAE,IAAI;QAC1B,gBAAgB,EAAE,KAAK;KACxB;IACD,YAAY,EAAE,SAAS,EAAE,uFAAuF;IAChH,WAAW,EAAE,YAAY,EAAE,qEAAqE;IAChG,QAAQ,EAAE,iCAAiC;IAC3C,QAAQ,EAAE;QACR,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,0eAA0e;KACjf;IACD,UAAU,EAAE;QACV,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,WAAW;QACpB,eAAe,EAAE,WAAW;QAC5B,WAAW,EAAE,IAAI;KAClB;IACD,eAAe,EAAE;QACf,UAAU;QACV,YAAY;QACZ,UAAU;QACV,SAAS;QACT,QAAQ;QACR,WAAW;QACX,UAAU;KACX;CACF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@integraledger/lcp-binding-evm-escrow",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Welds an ATR hash into an authorize-and-capture escrow settlement on EVM chains.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lcp",
|
|
7
|
+
"legal-context-protocol",
|
|
8
|
+
"legal-terms",
|
|
9
|
+
"agentic-commerce",
|
|
10
|
+
"settlement",
|
|
11
|
+
"atr-hash",
|
|
12
|
+
"evm",
|
|
13
|
+
"escrow"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"src",
|
|
27
|
+
"CHANGELOG.md",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"NOTICE"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"registry": "https://registry.npmjs.org",
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/IntegraLedger/integra-protocol.git",
|
|
38
|
+
"directory": "packages/binding-evm-escrow"
|
|
39
|
+
},
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/IntegraLedger/integra-protocol/issues"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/IntegraLedger/integra-protocol/tree/main/packages/binding-evm-escrow#readme",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"viem": "2.55.11",
|
|
46
|
+
"@integraledger/lcp-binding-core": "0.9.0",
|
|
47
|
+
"@integraledger/lcp-binding-evm-common": "0.9.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "24.13.3",
|
|
51
|
+
"vitest": "4.1.10",
|
|
52
|
+
"@integraledger/lcp-kernel": "0.9.0"
|
|
53
|
+
},
|
|
54
|
+
"license": "Apache-2.0",
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=24"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsc -p tsconfig.build.json",
|
|
60
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
61
|
+
"test": "vitest run",
|
|
62
|
+
"drift": "vitest run --config vitest.drift.config.ts"
|
|
63
|
+
}
|
|
64
|
+
}
|