@keelcodes/manifest 0.1.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.
@@ -0,0 +1,58 @@
1
+ import { type Hex } from 'viem';
2
+ import type { Pim } from './types.js';
3
+ export type TrustLevel = 0 | 1 | 2 | 3;
4
+ export type TrustLevelName = 'Unverified' | 'Community' | 'Protocol Signed' | 'Wallet Verified';
5
+ /** The four levels, verbatim from the draft's "Trust level assignment" table. */
6
+ export interface TrustLevelDefinition {
7
+ level: TrustLevel;
8
+ name: TrustLevelName;
9
+ criteria: string;
10
+ }
11
+ export declare const TRUST_LEVELS: readonly TrustLevelDefinition[];
12
+ /** Which signature payload interpretation recovered the signer. */
13
+ export type SignatureRecovery = 'digest' | 'personal';
14
+ /** Whether to try raw-digest, EIP-191, or both interpretations. Default `auto`. */
15
+ export type SignatureScheme = SignatureRecovery | 'auto';
16
+ export interface TrustOptions {
17
+ /** Addresses recognised as a known community publisher → Level 1. */
18
+ knownCommunitySigners?: readonly string[];
19
+ /** Addresses recognised as protocol-controlled (website/ENS/ECP) → Level 2. */
20
+ protocolSigners?: readonly string[];
21
+ /** Addresses reviewed and pinned by the wallet team → Level 3. */
22
+ walletVerifiedSigners?: readonly string[];
23
+ /** Payload interpretation; defaults to trying both. */
24
+ scheme?: SignatureScheme;
25
+ }
26
+ export interface TrustInfo {
27
+ level: TrustLevel;
28
+ name: TrustLevelName;
29
+ /** True only when a signature recovered to the declared `signer`. */
30
+ verified: boolean;
31
+ signer?: Hex;
32
+ signerLabel?: string;
33
+ /** How the recovered signature was interpreted (only when `verified`). */
34
+ scheme?: SignatureRecovery;
35
+ /** Human-readable explanation, always present. */
36
+ reason: string;
37
+ }
38
+ /**
39
+ * The canonical byte content a signature commits to: the PIM with the
40
+ * `signatures` section removed, serialised with no whitespace.
41
+ *
42
+ * `JSON.stringify` preserves object key order, which is how the document was
43
+ * parsed — consistent with "remove spacing/newlines" and no key reordering
44
+ * being specified.
45
+ */
46
+ export declare function canonicalPimJson(pim: Pim): string;
47
+ /** keccak256 of the canonical PIM content (the message the spec says is signed). */
48
+ export declare function pimDigest(pim: Pim): Hex;
49
+ /**
50
+ * Assign a trust level to a PIM.
51
+ *
52
+ * This is a *verifier*, not an oracle: without registry options a verifiable
53
+ * signature still grades Level 0 (unknown signer), matching the standard.
54
+ *
55
+ * Async because viem's signer-recovery is async; the rest of the function is pure.
56
+ */
57
+ export declare function trustLevelOf(pim: Pim, options?: TrustOptions): Promise<TrustInfo>;
58
+ //# sourceMappingURL=trust.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../src/trust.ts"],"names":[],"mappings":"AAqBA,OAAO,EAA6D,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACvC,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEhG,iFAAiF;AACjF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,YAAY,EAAE,SAAS,oBAAoB,EAqBvD,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtD,mFAAmF;AACnF,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,+EAA+E;IAC/E,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,kEAAkE;IAClE,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,uDAAuD;IACvD,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAIjD;AAED,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CA0D3F"}
package/dist/trust.js ADDED
@@ -0,0 +1,153 @@
1
+ // ============================================================================
2
+ // ERC-8313 trust grading.
3
+ //
4
+ // The standard defines four trust levels and, crucially, *how a signature is
5
+ // computed*: "The signature MUST be of the keccak256 hash of the entire PIM
6
+ // excluding the signatures section. Any spacing, new lines or hidden characters
7
+ // added for human-readability MUST be removed before the hash is generated."
8
+ //
9
+ // What the draft does NOT define is whether that hash is signed directly
10
+ // (`eth_sign`-style raw digest) or wrapped in EIP-191 (`personal_sign`). Both
11
+ // are seen in the wild, so we try both and say which one matched — a signature
12
+ // is only reported as verified when it *actually* recovers to the declared
13
+ // signer under one of the two interpretations. We never fake a pass.
14
+ //
15
+ // Level assignment beyond the cryptographic check needs out-of-band knowledge
16
+ // (is this address on the protocol's website? is it the wallet's pinned
17
+ // signer?). That is caller-supplied via {@link TrustOptions}; an address we can
18
+ // cryptographically verify but cannot place in any registry is *still* Level 0
19
+ // ("signer address is unknown") per the standard's own criteria.
20
+ // ============================================================================
21
+ import { keccak256, recoverAddress, recoverMessageAddress, toBytes } from 'viem';
22
+ export const TRUST_LEVELS = [
23
+ {
24
+ level: 0,
25
+ name: 'Unverified',
26
+ criteria: 'No signature included or signer address is unknown.',
27
+ },
28
+ {
29
+ level: 1,
30
+ name: 'Community',
31
+ criteria: 'Signature from a known community publisher. Hash verified. Signer not the protocol team.',
32
+ },
33
+ {
34
+ level: 2,
35
+ name: 'Protocol Signed',
36
+ criteria: "Signature from an address on a protocol's website, or registered with an ENS domain, or broadcast using ECP.",
37
+ },
38
+ {
39
+ level: 3,
40
+ name: 'Wallet Verified',
41
+ criteria: 'Internally reviewed and pinned by the wallet team. MAY be bundled with the wallet.',
42
+ },
43
+ ];
44
+ /**
45
+ * The canonical byte content a signature commits to: the PIM with the
46
+ * `signatures` section removed, serialised with no whitespace.
47
+ *
48
+ * `JSON.stringify` preserves object key order, which is how the document was
49
+ * parsed — consistent with "remove spacing/newlines" and no key reordering
50
+ * being specified.
51
+ */
52
+ export function canonicalPimJson(pim) {
53
+ const { signatures: _signatures, ...rest } = pim;
54
+ void _signatures;
55
+ return JSON.stringify(rest);
56
+ }
57
+ /** keccak256 of the canonical PIM content (the message the spec says is signed). */
58
+ export function pimDigest(pim) {
59
+ return keccak256(toBytes(canonicalPimJson(pim)));
60
+ }
61
+ /**
62
+ * Assign a trust level to a PIM.
63
+ *
64
+ * This is a *verifier*, not an oracle: without registry options a verifiable
65
+ * signature still grades Level 0 (unknown signer), matching the standard.
66
+ *
67
+ * Async because viem's signer-recovery is async; the rest of the function is pure.
68
+ */
69
+ export async function trustLevelOf(pim, options = {}) {
70
+ const signatures = Array.isArray(pim.signatures) ? pim.signatures : [];
71
+ if (signatures.length === 0) {
72
+ return {
73
+ level: 0,
74
+ name: 'Unverified',
75
+ verified: false,
76
+ reason: 'no signatures present',
77
+ };
78
+ }
79
+ const community = lowerSet(options.knownCommunitySigners);
80
+ const protocol = lowerSet(options.protocolSigners);
81
+ const wallet = lowerSet(options.walletVerifiedSigners);
82
+ const scheme = options.scheme ?? 'auto';
83
+ let sawEcdsa = false;
84
+ for (const signature of signatures) {
85
+ if (signature.type !== 'ecdsa')
86
+ continue;
87
+ if (typeof signature.signer !== 'string' || typeof signature.signature !== 'string')
88
+ continue;
89
+ sawEcdsa = true;
90
+ const recovered = await recoverSigners(pim, signature.signature, scheme);
91
+ const declared = signature.signer.toLowerCase();
92
+ const matched = recovered.get(declared);
93
+ if (matched === undefined)
94
+ continue;
95
+ const level = wallet.has(declared)
96
+ ? 3
97
+ : protocol.has(declared)
98
+ ? 2
99
+ : community.has(declared)
100
+ ? 1
101
+ : 0;
102
+ const info = {
103
+ level,
104
+ name: trustName(level),
105
+ verified: true,
106
+ signer: signature.signer,
107
+ scheme: matched,
108
+ reason: level === 0
109
+ ? 'signature verified, but the signer is not in any known trust registry (unknown signer → Unverified)'
110
+ : `signature verified; signer is a known ${trustName(level).toLowerCase()} publisher`,
111
+ };
112
+ if (signature.signerLabel !== undefined)
113
+ info.signerLabel = signature.signerLabel;
114
+ return info;
115
+ }
116
+ return {
117
+ level: 0,
118
+ name: 'Unverified',
119
+ verified: false,
120
+ reason: sawEcdsa
121
+ ? 'signature present but it did not recover to the declared signer (payload/canonicalisation mismatch)'
122
+ : 'no supported (ecdsa) signature present',
123
+ };
124
+ }
125
+ async function recoverSigners(pim, signature, scheme) {
126
+ const recovered = new Map();
127
+ const canonical = canonicalPimJson(pim);
128
+ if (scheme === 'digest' || scheme === 'auto') {
129
+ try {
130
+ const hash = keccak256(toBytes(canonical));
131
+ recovered.set((await recoverAddress({ hash, signature })).toLowerCase(), 'digest');
132
+ }
133
+ catch {
134
+ // Not a valid signature under this interpretation; try the next.
135
+ }
136
+ }
137
+ if (scheme === 'personal' || scheme === 'auto') {
138
+ try {
139
+ recovered.set((await recoverMessageAddress({ message: canonical, signature })).toLowerCase(), 'personal');
140
+ }
141
+ catch {
142
+ // Not a valid signature under this interpretation.
143
+ }
144
+ }
145
+ return recovered;
146
+ }
147
+ function trustName(level) {
148
+ return TRUST_LEVELS[level]?.name ?? 'Unverified';
149
+ }
150
+ function lowerSet(values) {
151
+ return new Set((values ?? []).map((value) => value.toLowerCase()));
152
+ }
153
+ //# sourceMappingURL=trust.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust.js","sourceRoot":"","sources":["../src/trust.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,0BAA0B;AAC1B,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,gFAAgF;AAChF,6EAA6E;AAC7E,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,+EAA+E;AAC/E,2EAA2E;AAC3E,qEAAqE;AACrE,EAAE;AACF,8EAA8E;AAC9E,wEAAwE;AACxE,gFAAgF;AAChF,+EAA+E;AAC/E,iEAAiE;AACjE,+EAA+E;AAE/E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,qBAAqB,EAAE,OAAO,EAAY,MAAM,MAAM,CAAC;AAa3F,MAAM,CAAC,MAAM,YAAY,GAAoC;IAC3D;QACE,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,qDAAqD;KAChE;IACD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,0FAA0F;KACrG;IACD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,8GAA8G;KACzH;IACD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,oFAAoF;KAC/F;CACF,CAAC;AAgCF;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAQ;IACvC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,CAAC;IACjD,KAAK,WAAW,C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ACvD,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAExC,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC7C,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;YAC3C,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,CAAC;QACrF,CAAC;QAAC,MAAM,CAAC;YACP,iEAAiE;QACnE,CAAC;IACH,CAAC;IACD,IAAI,MAAM,KAAK,UAAU,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC/C,IAAI,CAAC;YACH,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,qBAAqB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CAAC;QAC5G,CAAC;QAAC,MAAM,CAAC;YACP,mDAAmD;QACrD,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,SAAS,CAAC,KAAiB;IAClC,OAAO,YAAY,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,YAAY,CAAC;AACnD,CAAC;AAED,SAAS,QAAQ,CAAC,MAAqC;IACrD,OAAO,IAAI,GAAG,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,207 @@
1
+ /** Ethereum address in lowercase or EIP-55 checksummed `0x` hex. */
2
+ export type HexAddress = `0x${string}`;
3
+ /** `0x`-prefixed hex string (any even byte length). */
4
+ export type Hex = `0x${string}`;
5
+ /** Protocol category, closed set per the `metadata.category` enum. */
6
+ export type PimCategory = 'dex' | 'lending' | 'staking' | 'bridge' | 'vault' | 'nft' | 'governance' | 'other';
7
+ /** Functional role of a contract, closed set per the `contracts.*.role` enum. */
8
+ export type ContractRole = 'router' | 'factory' | 'pool' | 'quoter' | 'registry' | 'gateway' | 'oracle' | 'vault' | 'token' | 'other';
9
+ /** Shape of a named `types` entry, per the "Tuple kinds" table. */
10
+ export type TypeKind = 'tuple' | 'array' | 'primitive';
11
+ /** `lookups.*.select` — reduction applied to a filtered result set. */
12
+ export type SelectMode = 'all' | 'max' | 'min';
13
+ /** Operators allowed inside `lookups.*.filter`. */
14
+ export type FilterOperator = 'notEqual' | 'greaterThan' | 'lessThan' | 'equals';
15
+ /** Operators allowed inside a `lookups.*.validate` assertion. */
16
+ export type ValidateOperator = 'notEqual' | 'equals' | 'greaterThan' | 'lessThan';
17
+ /** Numeric kind of a `calculations.*` result. */
18
+ export type CalculationPrecision = 'float' | 'integer';
19
+ /** The three step actions an intent can declare. */
20
+ export type StepAction = 'lookup' | 'calculate' | 'buildTransaction';
21
+ /** Signature schemes the standard names today ("ecdsa"; fips-204/205 are future). */
22
+ export type SignatureType = string;
23
+ /**
24
+ * `metadata` — protocol identity, chain scope and validity window.
25
+ *
26
+ * `validFrom`, `validUntil` and `notes` are OPTIONAL at the schema level (the
27
+ * standard RECOMMENDs the two timestamps); every other field is REQUIRED.
28
+ */
29
+ export interface PimMetadata {
30
+ protocol: string;
31
+ description: string;
32
+ category: PimCategory;
33
+ website: string;
34
+ author: string;
35
+ chainId: number[];
36
+ pimVersion: string;
37
+ validFrom?: number;
38
+ validUntil?: number;
39
+ notes?: string;
40
+ }
41
+ /**
42
+ * One entry in `contracts`.
43
+ *
44
+ * Exactly one of `address` / `lookup` MUST be present (the standard forbids
45
+ * having both). `role` and `description` are REQUIRED.
46
+ */
47
+ export interface PimContract {
48
+ address?: HexAddress;
49
+ /** Logical name of a `lookups` entry that resolves the contract address. */
50
+ lookup?: string;
51
+ role: ContractRole;
52
+ description: string;
53
+ }
54
+ /** A field inside a named `types` entry. */
55
+ export interface PimField {
56
+ type: string;
57
+ description?: string;
58
+ unit?: string;
59
+ }
60
+ /** One entry in `types` — a Solidity-struct-shaped tuple or array. */
61
+ export interface PimType {
62
+ kind: TypeKind;
63
+ description?: string;
64
+ fields: Record<string, PimField>;
65
+ }
66
+ /**
67
+ * One field-level assertion inside `lookups.*.validate`.
68
+ *
69
+ * By convention at least one operator MUST be present; operator values MUST be
70
+ * strings.
71
+ */
72
+ export interface PimValidateAssertion {
73
+ field: string;
74
+ notEqual?: string;
75
+ equals?: string;
76
+ greaterThan?: string;
77
+ lessThan?: string;
78
+ }
79
+ /** One entry in `lookups` — a named on-chain read (or simulated write). */
80
+ export interface PimLookup {
81
+ description: string;
82
+ /** Logical contract name; MUST match a key in `contracts`. */
83
+ contract: string;
84
+ function: string;
85
+ /** Literal values, `{{template}}` references, or iterate values. */
86
+ args: unknown;
87
+ /** Named type (from `types`) or Solidity base unit type. */
88
+ returns: string;
89
+ iterate?: Record<string, unknown>;
90
+ filter?: Partial<Record<FilterOperator, string>>;
91
+ select?: SelectMode;
92
+ selectCriterion?: string;
93
+ validate?: PimValidateAssertion[];
94
+ }
95
+ /** One entry in `calculations` — a named off-chain computation. */
96
+ export interface PimCalculation {
97
+ description: string;
98
+ /** Instruction object chain; MUST contain a `set` instruction. */
99
+ formula: Record<string, unknown>;
100
+ inputs?: string[];
101
+ outputUnit?: string;
102
+ precision?: CalculationPrecision;
103
+ }
104
+ /**
105
+ * One step inside an intent's ordering.
106
+ *
107
+ * Fields are shared by all actions except the `buildTransaction`-only ones
108
+ * (`contract`, `function`, `args`, `value`), which are optional on the type and
109
+ * validated contextually.
110
+ */
111
+ export interface PimStep {
112
+ /** Unique within the intent; MUST start at 1 and not skip. */
113
+ id: number;
114
+ action: StepAction;
115
+ description?: string;
116
+ condition?: string;
117
+ skipIf?: string;
118
+ storeAs?: string;
119
+ /** `buildTransaction` only — logical contract name from `contracts`. */
120
+ contract?: string;
121
+ /** `buildTransaction` only. */
122
+ function?: string;
123
+ /** `buildTransaction` only — map of parameter name to value/template. */
124
+ args?: Record<string, unknown>;
125
+ /** `buildTransaction` only — wei sent with the call. */
126
+ value?: string;
127
+ /**
128
+ * `lookup` only — the named lookup this step runs.
129
+ *
130
+ * NOTE (unverified): the draft says lookups "are referenced by name in intent
131
+ * steps" but its all-step-types field table does not name the field. We use
132
+ * `lookup` to mirror the action; the validator only warns on a dangling name,
133
+ * it never rejects for it. See the README's "Unverified fields".
134
+ */
135
+ lookup?: string;
136
+ }
137
+ /** One entry in `intents` — a named, executable workflow. */
138
+ export interface PimIntent {
139
+ description: string;
140
+ requiredInputs: string[];
141
+ optionalInputs?: string[];
142
+ notes?: string;
143
+ steps: PimStep[];
144
+ }
145
+ /**
146
+ * `ui` — display strings for wallets and agent interfaces.
147
+ *
148
+ * `intentDescriptions` is REQUIRED and MUST cover every named intent; `labels`
149
+ * and `iterateLabels` are RECOMMENDED/OPTIONAL.
150
+ */
151
+ export interface PimUi {
152
+ labels?: Record<string, string>;
153
+ intentDescriptions: Record<string, string>;
154
+ iterateLabels?: Record<string, unknown>;
155
+ }
156
+ /** One entry in `signatures`. */
157
+ export interface PimSignature {
158
+ /** Ethereum address that produced the signature; MUST be present for ecdsa. */
159
+ signer?: HexAddress;
160
+ /** keccak256 of the public key, for schemes with large keys (future). */
161
+ signerHashed?: Hex;
162
+ type: SignatureType;
163
+ signature: Hex;
164
+ signerLabel?: string;
165
+ }
166
+ /**
167
+ * One diagnostic emitted by {@link validatePim}. `path` is a dotted/bracketed
168
+ * locator into the document (empty for the root). An `error` MUST block
169
+ * execution; a `warning` MUST be surfaced but does not.
170
+ */
171
+ export interface PimIssue {
172
+ path: string;
173
+ message: string;
174
+ severity: 'error' | 'warning';
175
+ }
176
+ /** A complete ERC-8313 Protocol Interaction Manifest. */
177
+ export interface Pim {
178
+ schemaVersion: string;
179
+ metadata: PimMetadata;
180
+ contracts: Record<string, PimContract>;
181
+ types: Record<string, PimType>;
182
+ lookups: Record<string, PimLookup>;
183
+ calculations: Record<string, PimCalculation>;
184
+ intents: Record<string, PimIntent>;
185
+ ui: PimUi;
186
+ signatures: PimSignature[];
187
+ }
188
+ /** The nine mandatory top-level sections, in the standard's own order. */
189
+ export declare const PIM_SECTIONS: readonly ["schemaVersion", "metadata", "contracts", "types", "lookups", "calculations", "intents", "ui", "signatures"];
190
+ export type PimSection = (typeof PIM_SECTIONS)[number];
191
+ /** Allowed values for `metadata.category`. */
192
+ export declare const PIM_CATEGORIES: readonly PimCategory[];
193
+ /** Allowed values for `contracts.*.role`. */
194
+ export declare const CONTRACT_ROLES: readonly ContractRole[];
195
+ /** Allowed values for `types.*.kind`. */
196
+ export declare const TYPE_KINDS: readonly TypeKind[];
197
+ /** Allowed values for `lookups.*.select`. */
198
+ export declare const SELECT_MODES: readonly SelectMode[];
199
+ /** Allowed operators for `lookups.*.filter`. */
200
+ export declare const FILTER_OPERATORS: readonly FilterOperator[];
201
+ /** Allowed operators for a `lookups.*.validate` assertion. */
202
+ export declare const VALIDATE_OPERATORS: readonly ValidateOperator[];
203
+ /** Allowed values for `calculations.*.precision`. */
204
+ export declare const CALCULATION_PRECISIONS: readonly CalculationPrecision[];
205
+ /** Allowed values for a step's `action`. */
206
+ export declare const STEP_ACTIONS: readonly StepAction[];
207
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAcA,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAAG,KAAK,MAAM,EAAE,CAAC;AAEvC,uDAAuD;AACvD,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAEhC,sEAAsE;AACtE,MAAM,MAAM,WAAW,GACnB,KAAK,GACL,SAAS,GACT,SAAS,GACT,QAAQ,GACR,OAAO,GACP,KAAK,GACL,YAAY,GACZ,OAAO,CAAC;AAEZ,iFAA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AAM,gBAAgB,EAAE,SAAS,cAAc,EAKrD,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAKzD,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,EAAE,SAAS,oBAAoB,EAAyB,CAAC;AAE5F,4CAA4C;AAC5C,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAAgD,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,72 @@
1
+ // ============================================================================
2
+ // ERC-8313 Protocol Interaction Manifest (PIM) — TypeScript model.
3
+ //
4
+ // A PIM is a machine-readable JSON document describing *how* to interact with a
5
+ // smart-contract protocol: not just its ABI, but the ordered workflow that
6
+ // fulfils a user intent. This module mirrors the nine mandatory top-level
7
+ // objects one-to-one, using the field names of the standard verbatim so a
8
+ // serialised `Pim` is valid by construction.
9
+ //
10
+ // Aligned with the draft of 2026-06-19 (author Paul Angus Bark, PR #1836).
11
+ // Field-level citations live next to each interface; where the draft is silent
12
+ // or contradictory the comment says so explicitly rather than guessing.
13
+ // ============================================================================
14
+ /** The nine mandatory top-level sections, in the standard's own order. */
15
+ export const PIM_SECTIONS = [
16
+ 'schemaVersion',
17
+ 'metadata',
18
+ 'contracts',
19
+ 'types',
20
+ 'lookups',
21
+ 'calculations',
22
+ 'intents',
23
+ 'ui',
24
+ 'signatures',
25
+ ];
26
+ /** Allowed values for `metadata.category`. */
27
+ export const PIM_CATEGORIES = [
28
+ 'dex',
29
+ 'lending',
30
+ 'staking',
31
+ 'bridge',
32
+ 'vault',
33
+ 'nft',
34
+ 'governance',
35
+ 'other',
36
+ ];
37
+ /** Allowed values for `contracts.*.role`. */
38
+ export const CONTRACT_ROLES = [
39
+ 'router',
40
+ 'factory',
41
+ 'pool',
42
+ 'quoter',
43
+ 'registry',
44
+ 'gateway',
45
+ 'oracle',
46
+ 'vault',
47
+ 'token',
48
+ 'other',
49
+ ];
50
+ /** Allowed values for `types.*.kind`. */
51
+ export const TYPE_KINDS = ['tuple', 'array', 'primitive'];
52
+ /** Allowed values for `lookups.*.select`. */
53
+ export const SELECT_MODES = ['all', 'max', 'min'];
54
+ /** Allowed operators for `lookups.*.filter`. */
55
+ export const FILTER_OPERATORS = [
56
+ 'notEqual',
57
+ 'greaterThan',
58
+ 'lessThan',
59
+ 'equals',
60
+ ];
61
+ /** Allowed operators for a `lookups.*.validate` assertion. */
62
+ export const VALIDATE_OPERATORS = [
63
+ 'notEqual',
64
+ 'equals',
65
+ 'greaterThan',
66
+ 'lessThan',
67
+ ];
68
+ /** Allowed values for `calculations.*.precision`. */
69
+ export const CALCULATION_PRECISIONS = ['float', 'integer'];
70
+ /** Allowed values for a step's `action`. */
71
+ export const STEP_ACTIONS = ['lookup', 'calculate', 'buildTransaction'];
72
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,EAAE;AACF,gFAAgF;AAChF,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,6CAA6C;AAC7C,EAAE;AACF,2EAA2E;AAC3E,+EAA+E;AAC/E,wEAAwE;AACxE,+EAA+E;AAuO/E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,eAAe;IACf,UAAU;IACV,WAAW;IACX,OAAO;IACP,SAAS;IACT,cAAc;IACd,SAAS;IACT,IAAI;IACJ,YAAY;CACJ,CAAC;AAIX,8CAA8C;AAC9C,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,KAAK;IACL,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,KAAK;IACL,YAAY;IACZ,OAAO;CACR,CAAC;AAEF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;IACR,UAAU;IACV,SAAS;IACT,QAAQ;IACR,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAC;AAEF,yCAAyC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAE/E,6CAA6C;AAC7C,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEzE,gDAAgD;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD,UAAU;IACV,aAAa;IACb,UAAU;IACV,QAAQ;CACT,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAgC;IAC7D,UAAU;IACV,QAAQ;IACR,aAAa;IACb,UAAU;CACX,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAoC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE5F,4CAA4C;AAC5C,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,QAAQ,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type PimIssue } from './types.js';
2
+ export type { PimIssue } from './types.js';
3
+ /** The spec revision this validator was written against. */
4
+ export declare const PIM_DRAFT = "2026-06-19";
5
+ export interface PimValidationOptions {
6
+ /**
7
+ * Current unix time (seconds). When provided, an expired `validUntil` or a
8
+ * not-yet-reached `validFrom` is an error — the standard says execution
9
+ * engines MUST reject such manifests.
10
+ */
11
+ now?: number;
12
+ /**
13
+ * The network the execution engine is on. When provided and absent from
14
+ * `metadata.chainId`, it is an error (chain mismatch).
15
+ */
16
+ chainId?: number;
17
+ }
18
+ export interface PimValidationResult {
19
+ valid: boolean;
20
+ /** Issues that MUST block execution. */
21
+ errors: PimIssue[];
22
+ /** Issues that do not block execution but should be surfaced. */
23
+ warnings: PimIssue[];
24
+ }
25
+ /**
26
+ * Validate an untrusted value as an ERC-8313 PIM.
27
+ *
28
+ * @param input - parsed JSON (or any value) to check.
29
+ * @param options - optional execution context (clock, chain).
30
+ */
31
+ export declare function validatePim(input: unknown, options?: PimValidationOptions): PimValidationResult;
32
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAeA,OAAO,EAUL,KAAK,QAAQ,EACd,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,4DAA4D;AAC5D,eAAO,MAAM,SAAS,eAAe,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,wCAAwC;IACxC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,iEAAiE;IACjE,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAeD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,oBAAyB,GAAG,mBAAmB,CAgCnG"}