@agenticprimitives/agent-account 1.0.0-alpha.4 → 1.0.0-alpha.41
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/README.md +17 -8
- package/dist/abis.d.ts +114 -10
- package/dist/abis.d.ts.map +1 -1
- package/dist/abis.js +37 -4
- package/dist/abis.js.map +1 -1
- package/dist/approved-hash.d.ts +108 -0
- package/dist/approved-hash.d.ts.map +1 -0
- package/dist/approved-hash.js +139 -0
- package/dist/approved-hash.js.map +1 -0
- package/dist/bundler-client.d.ts +6 -0
- package/dist/bundler-client.d.ts.map +1 -1
- package/dist/bundler-client.js +72 -11
- package/dist/bundler-client.js.map +1 -1
- package/dist/client.d.ts +20 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +54 -10
- package/dist/client.js.map +1 -1
- package/dist/erc20.d.ts +27 -0
- package/dist/erc20.d.ts.map +1 -0
- package/dist/erc20.js +41 -0
- package/dist/erc20.js.map +1 -0
- package/dist/execute.js +1 -1
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/quorum.d.ts +0 -26
- package/dist/quorum.d.ts.map +1 -1
- package/dist/quorum.js +7 -59
- package/dist/quorum.js.map +1 -1
- package/package.json +20 -11
package/README.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# @agenticprimitives/agent-account
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Part of **[Agentic Primitives](https://agenticprimitives.dev)** — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. [Developer kit](https://github.com/agentictrustlabs/agentic-primitives) · [All packages](https://agenticprimitives.dev/developers)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
address (`0x…` / CAIP-10 `eip155:<chainId>:<address>`). This package deploys
|
|
7
|
-
that account, derives its address, builds UserOps, and verifies ERC-1271
|
|
8
|
-
signatures. Names, profiles, and passkeys are **facets** handled by sibling
|
|
9
|
-
packages.
|
|
5
|
+
**The address IS the identity.**
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
Every person, organization, service agent, and treasury in this stack is an ERC-4337 Smart Agent address (`0x…` / CAIP-10 `eip155:<chainId>:<address>`). Not a username with a wallet attached — the address itself is the canonical identity, and everything else (names, passkeys, profiles, registry entries) is a replaceable facet pointing at it. This package is where that anchor comes from: it derives the address counterfactually, deploys the account, builds UserOperations, and verifies ERC-1271 signatures.
|
|
8
|
+
|
|
9
|
+
That design choice has a consequence most smart-account SDKs cannot offer: the CREATE2 salt derives from auth methods and user scope — never from a name, never from credential material ([ADR-0010](../../docs/architecture/decisions/0010-smart-agent-canonical-identifier.md), [spec 220](../../specs/220-agent-identity-bootstrap.md)). Lose a passkey, rotate a signer, change your name — the address never moves, and every delegation it ever issued stays valid ([ADR-0011](../../docs/architecture/decisions/0011-credential-recovery-and-re-association.md)).
|
|
10
|
+
|
|
11
|
+
> Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
|
|
13
12
|
|
|
14
13
|
## Use This When
|
|
15
14
|
|
|
@@ -60,6 +59,8 @@ if (!(await account.isDeployed(address))) {
|
|
|
60
59
|
}
|
|
61
60
|
```
|
|
62
61
|
|
|
62
|
+
The address exists before the account does. You can name it, fund it, and issue authority to it counterfactually; deployment happens when it first acts.
|
|
63
|
+
|
|
63
64
|
## Main Concepts
|
|
64
65
|
|
|
65
66
|
- **Smart Agent address**: the canonical identifier; stable across credential
|
|
@@ -87,6 +88,10 @@ import { encodeWebAuthnSignature, SIG_TYPE_WEBAUTHN } from '@agenticprimitives/a
|
|
|
87
88
|
// WebAuthn ceremony output is produced by connect-auth; on-chain wire format here.
|
|
88
89
|
```
|
|
89
90
|
|
|
91
|
+
## How it's different
|
|
92
|
+
|
|
93
|
+
Safe, ZeroDev, and Alchemy Account Kit ship excellent smart accounts — and stop there. The account is a container; who it is, what it may do, and how to prove it are someone else's integration problem. Here the account is the anchor of a substrate: the same address that `agent-account` derives is what `agent-naming` resolves, `account-custody` governs, `delegation` issues authority from, and `audit` attributes evidence to. The account contract itself is a thin ERC-7579 modular core ([spec 209](../../specs/209-erc7579-module-taxonomy.md)) — custody, threshold, and session machinery are modules, not inlined features. We ported the patterns worth porting (Safe-style signature packing) without taking a runtime dependency on anyone else's account stack.
|
|
94
|
+
|
|
90
95
|
## Runtime Support
|
|
91
96
|
|
|
92
97
|
Node and browser via `viem`. Requires RPC URL for chain reads and transaction
|
|
@@ -117,6 +122,10 @@ pnpm check:agent-account
|
|
|
117
122
|
pnpm check:forbidden-terms
|
|
118
123
|
```
|
|
119
124
|
|
|
125
|
+
## Status
|
|
126
|
+
|
|
127
|
+
Testnet/pilot-ready. Production launch is gated on the public checklist in the root README — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml).
|
|
128
|
+
|
|
120
129
|
## License
|
|
121
130
|
|
|
122
131
|
UNLICENSED.
|
package/dist/abis.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export declare const agentAccountFactoryAbi: readonly [{
|
|
|
23
23
|
}, {
|
|
24
24
|
readonly name: "initialPasskeyY";
|
|
25
25
|
readonly type: "uint256";
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "initialPasskeyRpIdHash";
|
|
28
|
+
readonly type: "bytes32";
|
|
26
29
|
}];
|
|
27
30
|
}, {
|
|
28
31
|
readonly name: "timelockOverrides";
|
|
@@ -60,7 +63,13 @@ export declare const agentAccountFactoryAbi: readonly [{
|
|
|
60
63
|
}, {
|
|
61
64
|
readonly name: "initialPasskeyY";
|
|
62
65
|
readonly type: "uint256";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "initialPasskeyRpIdHash";
|
|
68
|
+
readonly type: "bytes32";
|
|
63
69
|
}];
|
|
70
|
+
}, {
|
|
71
|
+
readonly name: "timelockOverrides";
|
|
72
|
+
readonly type: "uint32[7]";
|
|
64
73
|
}, {
|
|
65
74
|
readonly name: "salt";
|
|
66
75
|
readonly type: "uint256";
|
|
@@ -193,6 +202,85 @@ export declare const agentAccountAbi: readonly [{
|
|
|
193
202
|
readonly outputs: readonly [{
|
|
194
203
|
readonly type: "uint256";
|
|
195
204
|
}];
|
|
205
|
+
}, {
|
|
206
|
+
readonly type: "function";
|
|
207
|
+
readonly name: "custodyEpoch";
|
|
208
|
+
readonly stateMutability: "view";
|
|
209
|
+
readonly inputs: readonly [];
|
|
210
|
+
readonly outputs: readonly [{
|
|
211
|
+
readonly type: "uint64";
|
|
212
|
+
}];
|
|
213
|
+
}, {
|
|
214
|
+
readonly type: "function";
|
|
215
|
+
readonly name: "approvedHashKey";
|
|
216
|
+
readonly stateMutability: "view";
|
|
217
|
+
readonly inputs: readonly [{
|
|
218
|
+
readonly name: "hash";
|
|
219
|
+
readonly type: "bytes32";
|
|
220
|
+
}];
|
|
221
|
+
readonly outputs: readonly [{
|
|
222
|
+
readonly type: "bytes32";
|
|
223
|
+
}];
|
|
224
|
+
}, {
|
|
225
|
+
readonly type: "event";
|
|
226
|
+
readonly name: "CustodyEpochBumped";
|
|
227
|
+
readonly inputs: readonly [{
|
|
228
|
+
readonly name: "epoch";
|
|
229
|
+
readonly type: "uint64";
|
|
230
|
+
readonly indexed: false;
|
|
231
|
+
}];
|
|
232
|
+
}, {
|
|
233
|
+
readonly type: "function";
|
|
234
|
+
readonly name: "approveDigest";
|
|
235
|
+
readonly stateMutability: "nonpayable";
|
|
236
|
+
readonly inputs: readonly [{
|
|
237
|
+
readonly name: "digest";
|
|
238
|
+
readonly type: "bytes32";
|
|
239
|
+
}];
|
|
240
|
+
readonly outputs: readonly [];
|
|
241
|
+
}, {
|
|
242
|
+
readonly type: "function";
|
|
243
|
+
readonly name: "revokeDigest";
|
|
244
|
+
readonly stateMutability: "nonpayable";
|
|
245
|
+
readonly inputs: readonly [{
|
|
246
|
+
readonly name: "digest";
|
|
247
|
+
readonly type: "bytes32";
|
|
248
|
+
}];
|
|
249
|
+
readonly outputs: readonly [];
|
|
250
|
+
}, {
|
|
251
|
+
readonly type: "function";
|
|
252
|
+
readonly name: "revokeAllApprovedDigests";
|
|
253
|
+
readonly stateMutability: "nonpayable";
|
|
254
|
+
readonly inputs: readonly [];
|
|
255
|
+
readonly outputs: readonly [];
|
|
256
|
+
}, {
|
|
257
|
+
readonly type: "event";
|
|
258
|
+
readonly name: "DigestApproved";
|
|
259
|
+
readonly inputs: readonly [{
|
|
260
|
+
readonly name: "digest";
|
|
261
|
+
readonly type: "bytes32";
|
|
262
|
+
readonly indexed: true;
|
|
263
|
+
}, {
|
|
264
|
+
readonly name: "epoch";
|
|
265
|
+
readonly type: "uint64";
|
|
266
|
+
readonly indexed: false;
|
|
267
|
+
}];
|
|
268
|
+
}, {
|
|
269
|
+
readonly type: "event";
|
|
270
|
+
readonly name: "DigestRevoked";
|
|
271
|
+
readonly inputs: readonly [{
|
|
272
|
+
readonly name: "digest";
|
|
273
|
+
readonly type: "bytes32";
|
|
274
|
+
readonly indexed: true;
|
|
275
|
+
}, {
|
|
276
|
+
readonly name: "epoch";
|
|
277
|
+
readonly type: "uint64";
|
|
278
|
+
readonly indexed: false;
|
|
279
|
+
}];
|
|
280
|
+
}, {
|
|
281
|
+
readonly type: "event";
|
|
282
|
+
readonly name: "AllDigestsRevoked";
|
|
283
|
+
readonly inputs: readonly [];
|
|
196
284
|
}, {
|
|
197
285
|
readonly type: "function";
|
|
198
286
|
readonly name: "factory";
|
|
@@ -212,7 +300,7 @@ export declare const agentAccountAbi: readonly [{
|
|
|
212
300
|
}, {
|
|
213
301
|
readonly type: "function";
|
|
214
302
|
readonly name: "passkeyIdentity";
|
|
215
|
-
readonly stateMutability: "
|
|
303
|
+
readonly stateMutability: "view";
|
|
216
304
|
readonly inputs: readonly [{
|
|
217
305
|
readonly name: "x";
|
|
218
306
|
readonly type: "uint256";
|
|
@@ -270,6 +358,9 @@ export declare const agentAccountAbi: readonly [{
|
|
|
270
358
|
}, {
|
|
271
359
|
readonly name: "y";
|
|
272
360
|
readonly type: "uint256";
|
|
361
|
+
}, {
|
|
362
|
+
readonly name: "rpIdHash";
|
|
363
|
+
readonly type: "bytes32";
|
|
273
364
|
}];
|
|
274
365
|
readonly outputs: readonly [];
|
|
275
366
|
}, {
|
|
@@ -356,14 +447,6 @@ export declare const agentAccountAbi: readonly [{
|
|
|
356
447
|
readonly name: "credentialIdDigest";
|
|
357
448
|
readonly type: "bytes32";
|
|
358
449
|
readonly indexed: true;
|
|
359
|
-
}, {
|
|
360
|
-
readonly name: "x";
|
|
361
|
-
readonly type: "uint256";
|
|
362
|
-
readonly indexed: false;
|
|
363
|
-
}, {
|
|
364
|
-
readonly name: "y";
|
|
365
|
-
readonly type: "uint256";
|
|
366
|
-
readonly indexed: false;
|
|
367
450
|
}];
|
|
368
451
|
}, {
|
|
369
452
|
readonly type: "event";
|
|
@@ -381,6 +464,10 @@ export declare const agentAccountAbi: readonly [{
|
|
|
381
464
|
* ECDSA sig. `QuorumEnforcer.beforeHook` (and the
|
|
382
465
|
* `_verifyQuorum(..., guardianMode=true)` path in AgentAccount) check
|
|
383
466
|
* `isApproved(signer, hash)` for v=1 slots in the packed blob.
|
|
467
|
+
*
|
|
468
|
+
* R917-C-2 (spec 408 §1.2): an AgentAccount's `0x03` ERC-1271 sentinel consults
|
|
469
|
+
* `isApproved(account, approvedHashKey(hash))` — the EPOCH-BOUND key, never the raw
|
|
470
|
+
* hash. Approve with `approvedHashKey(hash, epoch)` from `./approved-hash.js`.
|
|
384
471
|
*/
|
|
385
472
|
export declare const approvedHashRegistryAbi: readonly [{
|
|
386
473
|
readonly type: "function";
|
|
@@ -414,9 +501,26 @@ export declare const approvedHashRegistryAbi: readonly [{
|
|
|
414
501
|
readonly outputs: readonly [{
|
|
415
502
|
readonly type: "bool";
|
|
416
503
|
}];
|
|
504
|
+
}, {
|
|
505
|
+
readonly type: "function";
|
|
506
|
+
readonly name: "revokeAll";
|
|
507
|
+
readonly stateMutability: "nonpayable";
|
|
508
|
+
readonly inputs: readonly [];
|
|
509
|
+
readonly outputs: readonly [];
|
|
510
|
+
}, {
|
|
511
|
+
readonly type: "function";
|
|
512
|
+
readonly name: "epochOf";
|
|
513
|
+
readonly stateMutability: "view";
|
|
514
|
+
readonly inputs: readonly [{
|
|
515
|
+
readonly name: "signer";
|
|
516
|
+
readonly type: "address";
|
|
517
|
+
}];
|
|
518
|
+
readonly outputs: readonly [{
|
|
519
|
+
readonly type: "uint64";
|
|
520
|
+
}];
|
|
417
521
|
}];
|
|
418
522
|
/** ERC-1271 magic value returned by isValidSignature on success. */
|
|
419
|
-
export
|
|
523
|
+
export { ERC1271_MAGIC_VALUE } from '@agenticprimitives/types';
|
|
420
524
|
/**
|
|
421
525
|
* Minimal EntryPoint ABI for our bundler client + UserOp hashing.
|
|
422
526
|
* Source: account-abstraction/contracts/core/EntryPoint.sol (v0.9).
|
package/dist/abis.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6EzB,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8DlB,CAAC;AAKX;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4B1B,CAAC;AAEX,oEAAoE;AAIpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8EhB,CAAC"}
|
package/dist/abis.js
CHANGED
|
@@ -14,6 +14,11 @@ const initParamsTuple = {
|
|
|
14
14
|
{ name: 'initialPasskeyCredentialIdDigest', type: 'bytes32' },
|
|
15
15
|
{ name: 'initialPasskeyX', type: 'uint256' },
|
|
16
16
|
{ name: 'initialPasskeyY', type: 'uint256' },
|
|
17
|
+
// H7-C.1 / CON-WEBAUTHN-001: rpIdHash binds the passkey to a specific
|
|
18
|
+
// Relying Party at registration. Required by the on-chain struct
|
|
19
|
+
// since the binding was added; the TS ABI mirror was previously
|
|
20
|
+
// out-of-sync, causing factory reverts with a 6-field tuple.
|
|
21
|
+
{ name: 'initialPasskeyRpIdHash', type: 'bytes32' },
|
|
17
22
|
],
|
|
18
23
|
};
|
|
19
24
|
export const agentAccountFactoryAbi = [
|
|
@@ -35,6 +40,10 @@ export const agentAccountFactoryAbi = [
|
|
|
35
40
|
stateMutability: 'view',
|
|
36
41
|
inputs: [
|
|
37
42
|
initParamsTuple,
|
|
43
|
+
// CA-F1 (audit 2026-06-10): the counterfactual address commits to the full
|
|
44
|
+
// custody config, so the view takes timelockOverrides too. Predict with the
|
|
45
|
+
// SAME (params, timelockOverrides, salt) you will deploy with.
|
|
46
|
+
{ name: 'timelockOverrides', type: 'uint32[7]' },
|
|
38
47
|
{ name: 'salt', type: 'uint256' },
|
|
39
48
|
],
|
|
40
49
|
outputs: [{ name: '', type: 'address' }],
|
|
@@ -115,14 +124,27 @@ export const agentAccountAbi = [
|
|
|
115
124
|
},
|
|
116
125
|
{ type: 'function', name: 'isCustodian', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }], outputs: [{ type: 'bool' }] },
|
|
117
126
|
{ type: 'function', name: 'custodianCount', stateMutability: 'view', inputs: [], outputs: [{ type: 'uint256' }] },
|
|
127
|
+
// R917-C-2 (spec 408 §1.2) — the custody epoch and the epoch-bound key the 0x03 sentinel consults.
|
|
128
|
+
{ type: 'function', name: 'custodyEpoch', stateMutability: 'view', inputs: [], outputs: [{ type: 'uint64' }] },
|
|
129
|
+
{ type: 'function', name: 'approvedHashKey', stateMutability: 'view', inputs: [{ name: 'hash', type: 'bytes32' }], outputs: [{ type: 'bytes32' }] },
|
|
130
|
+
{ type: 'event', name: 'CustodyEpochBumped', inputs: [{ name: 'epoch', type: 'uint64', indexed: false }] },
|
|
131
|
+
// Spec 410 §1 (generation 3, THESIS-1a) — the account derives the approved-hash key itself; the registry is
|
|
132
|
+
// never an execute target. `approveDigest` / `revokeDigest` are onlySelf; `revokeAllApprovedDigests` is
|
|
133
|
+
// custody-gated on a governed account and the last step of every recovery path.
|
|
134
|
+
{ type: 'function', name: 'approveDigest', stateMutability: 'nonpayable', inputs: [{ name: 'digest', type: 'bytes32' }], outputs: [] },
|
|
135
|
+
{ type: 'function', name: 'revokeDigest', stateMutability: 'nonpayable', inputs: [{ name: 'digest', type: 'bytes32' }], outputs: [] },
|
|
136
|
+
{ type: 'function', name: 'revokeAllApprovedDigests', stateMutability: 'nonpayable', inputs: [], outputs: [] },
|
|
137
|
+
{ type: 'event', name: 'DigestApproved', inputs: [{ name: 'digest', type: 'bytes32', indexed: true }, { name: 'epoch', type: 'uint64', indexed: false }] },
|
|
138
|
+
{ type: 'event', name: 'DigestRevoked', inputs: [{ name: 'digest', type: 'bytes32', indexed: true }, { name: 'epoch', type: 'uint64', indexed: false }] },
|
|
139
|
+
{ type: 'event', name: 'AllDigestsRevoked', inputs: [] },
|
|
118
140
|
{ type: 'function', name: 'factory', stateMutability: 'view', inputs: [], outputs: [{ type: 'address' }] },
|
|
119
141
|
{ type: 'function', name: 'delegationManager', stateMutability: 'view', inputs: [], outputs: [{ type: 'address' }] },
|
|
120
142
|
// Phase 6f.4 — passkey-direct custody surface.
|
|
121
|
-
{ type: 'function', name: 'passkeyIdentity', stateMutability: '
|
|
143
|
+
{ type: 'function', name: 'passkeyIdentity', stateMutability: 'view', inputs: [{ name: 'x', type: 'uint256' }, { name: 'y', type: 'uint256' }], outputs: [{ type: 'address' }] },
|
|
122
144
|
{ type: 'function', name: 'hasPasskey', stateMutability: 'view', inputs: [{ name: 'credentialIdDigest', type: 'bytes32' }], outputs: [{ type: 'bool' }] },
|
|
123
145
|
{ type: 'function', name: 'getPasskey', stateMutability: 'view', inputs: [{ name: 'credentialIdDigest', type: 'bytes32' }], outputs: [{ name: 'x', type: 'uint256' }, { name: 'y', type: 'uint256' }] },
|
|
124
146
|
{ type: 'function', name: 'passkeyCount', stateMutability: 'view', inputs: [], outputs: [{ type: 'uint256' }] },
|
|
125
|
-
{ type: 'function', name: 'addPasskey', stateMutability: 'nonpayable', inputs: [{ name: 'credentialIdDigest', type: 'bytes32' }, { name: 'x', type: 'uint256' }, { name: 'y', type: 'uint256' }], outputs: [] },
|
|
147
|
+
{ type: 'function', name: 'addPasskey', stateMutability: 'nonpayable', inputs: [{ name: 'credentialIdDigest', type: 'bytes32' }, { name: 'x', type: 'uint256' }, { name: 'y', type: 'uint256' }, { name: 'rpIdHash', type: 'bytes32' }], outputs: [] },
|
|
126
148
|
{ type: 'function', name: 'removePasskey', stateMutability: 'nonpayable', inputs: [{ name: 'credentialIdDigest', type: 'bytes32' }], outputs: [] },
|
|
127
149
|
{ type: 'function', name: 'addCustodian', stateMutability: 'nonpayable', inputs: [{ name: 'owner', type: 'address' }], outputs: [] },
|
|
128
150
|
{ type: 'function', name: 'removeCustodian', stateMutability: 'nonpayable', inputs: [{ name: 'owner', type: 'address' }], outputs: [] },
|
|
@@ -134,7 +156,8 @@ export const agentAccountAbi = [
|
|
|
134
156
|
// Events.
|
|
135
157
|
{ type: 'event', name: 'CustodianAdded', inputs: [{ name: 'owner', type: 'address', indexed: true }] },
|
|
136
158
|
{ type: 'event', name: 'CustodianRemoved', inputs: [{ name: 'owner', type: 'address', indexed: true }] },
|
|
137
|
-
|
|
159
|
+
// Spec 302 W1 — the event carries ONLY the digest (raw pubkey coords removed: cross-account correlator).
|
|
160
|
+
{ type: 'event', name: 'PasskeyAdded', inputs: [{ name: 'credentialIdDigest', type: 'bytes32', indexed: true }] },
|
|
138
161
|
{ type: 'event', name: 'PasskeyRemoved', inputs: [{ name: 'credentialIdDigest', type: 'bytes32', indexed: true }] },
|
|
139
162
|
];
|
|
140
163
|
// custodyPolicyAbi was relocated to `@agenticprimitives/account-custody` per
|
|
@@ -146,6 +169,10 @@ export const agentAccountAbi = [
|
|
|
146
169
|
* ECDSA sig. `QuorumEnforcer.beforeHook` (and the
|
|
147
170
|
* `_verifyQuorum(..., guardianMode=true)` path in AgentAccount) check
|
|
148
171
|
* `isApproved(signer, hash)` for v=1 slots in the packed blob.
|
|
172
|
+
*
|
|
173
|
+
* R917-C-2 (spec 408 §1.2): an AgentAccount's `0x03` ERC-1271 sentinel consults
|
|
174
|
+
* `isApproved(account, approvedHashKey(hash))` — the EPOCH-BOUND key, never the raw
|
|
175
|
+
* hash. Approve with `approvedHashKey(hash, epoch)` from `./approved-hash.js`.
|
|
149
176
|
*/
|
|
150
177
|
export const approvedHashRegistryAbi = [
|
|
151
178
|
{
|
|
@@ -172,9 +199,15 @@ export const approvedHashRegistryAbi = [
|
|
|
172
199
|
],
|
|
173
200
|
outputs: [{ type: 'bool' }],
|
|
174
201
|
},
|
|
202
|
+
// R917-C-2 — void every approval the signer ever made, in one call; `epochOf` is informational.
|
|
203
|
+
{ type: 'function', name: 'revokeAll', stateMutability: 'nonpayable', inputs: [], outputs: [] },
|
|
204
|
+
{ type: 'function', name: 'epochOf', stateMutability: 'view', inputs: [{ name: 'signer', type: 'address' }], outputs: [{ type: 'uint64' }] },
|
|
175
205
|
];
|
|
176
206
|
/** ERC-1271 magic value returned by isValidSignature on success. */
|
|
177
|
-
|
|
207
|
+
// The protocol constant lives in `types` — the one package everything may import, including
|
|
208
|
+
// `connect-auth`, which cannot reach here without creating a cycle. Re-exported so existing
|
|
209
|
+
// consumers of `agent-account` are unaffected.
|
|
210
|
+
export { ERC1271_MAGIC_VALUE } from '@agenticprimitives/types';
|
|
178
211
|
/**
|
|
179
212
|
* Minimal EntryPoint ABI for our bundler client + UserOp hashing.
|
|
180
213
|
* Source: account-abstraction/contracts/core/EntryPoint.sol (v0.9).
|
package/dist/abis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abis.js","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,sFAAsF;AACtF,yEAAyE;AACzE,6EAA6E;AAC7E,yEAAyE;AACzE,0CAA0C;AAE1C,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACV,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE;QAC/B,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE;QACzC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE;QACvC,EAAE,IAAI,EAAE,kCAAkC,EAAE,IAAI,EAAE,SAAS,EAAE;QAC7D,EAAE,IAAI,EAAE,iBAAiB,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S,EAAE;SACzC;QACD,OAAO,EAAE,EAAE;KACZ;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YACnC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;SACjC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC9C;IACD,iEAAiE;IACjE,sEAAsE;IACtE,yDAAyD;IACzD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;SACnC;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;YAClC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;SACjC;KACF;CACO,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import { agentAccountAbi } from './abis.js';
|
|
3
|
+
import type { ContractCall } from './execute.js';
|
|
4
|
+
/** Which contracts an estate runs: 1 = pre-spec-408 (raw approved hashes, 32-byte digest-binding args,
|
|
5
|
+
* `anchorOf(digest)`); 2 = spec 408 (epoch-bound keys, per-step nonces, `anchorOf(agent, digest)`);
|
|
6
|
+
* 3 = spec 410 (`approveDigest` on the account, the registry never an execute target, `RotateCredential`,
|
|
7
|
+
* `revokeAll` at the end of every recovery path). */
|
|
8
|
+
export type ContractsGeneration = 1 | 2 | 3;
|
|
9
|
+
/** The generation a deployments JSON records; absent ⇒ 1 (the field arrived with spec 408). Anything else throws. */
|
|
10
|
+
export declare function contractsGenerationOf(deployments: {
|
|
11
|
+
contractsGeneration?: unknown;
|
|
12
|
+
} | null | undefined): ContractsGeneration;
|
|
13
|
+
/** How an approval is keyed on this estate: generation 1 approves the raw digest; generation 2 the epoch-bound
|
|
14
|
+
* key, computed here; generation 3 approves the DIGEST through the account, which derives the key itself —
|
|
15
|
+
* the scheme names the account because the approval is a self-call on it. */
|
|
16
|
+
export type ApprovalScheme = {
|
|
17
|
+
generation: 1;
|
|
18
|
+
} | {
|
|
19
|
+
generation: 2;
|
|
20
|
+
epoch: bigint | number;
|
|
21
|
+
} | {
|
|
22
|
+
generation: 3;
|
|
23
|
+
account: Address;
|
|
24
|
+
};
|
|
25
|
+
/** The 32 bytes the account approves for `digest` under `scheme`. On generation 3 there is nothing for a caller
|
|
26
|
+
* to compute — the account derives the key on chain — so this throws rather than guess an epoch (ADR-0013). */
|
|
27
|
+
export declare function approvalKey(digest: Hex, scheme: ApprovalScheme): Hex;
|
|
28
|
+
/** The scheme for `account` on an estate of `generation`: generation 1 needs no read; generation 2 reads the
|
|
29
|
+
* account's custody epoch (0 for an address with no code); generation 3 needs no read either — the account
|
|
30
|
+
* will derive the key under whatever epoch it is in when the call lands. */
|
|
31
|
+
export declare function readApprovalScheme(client: {
|
|
32
|
+
getCode(args: {
|
|
33
|
+
address: Address;
|
|
34
|
+
}): Promise<Hex | undefined>;
|
|
35
|
+
readContract(args: {
|
|
36
|
+
address: Address;
|
|
37
|
+
abi: typeof agentAccountAbi;
|
|
38
|
+
functionName: 'custodyEpoch';
|
|
39
|
+
}): Promise<bigint>;
|
|
40
|
+
}, account: Address, generation: ContractsGeneration): Promise<ApprovalScheme>;
|
|
41
|
+
/** The 32 bytes an account must approve for `digest` to validate through its `0x03` sentinel at `epoch`. */
|
|
42
|
+
export declare function approvedHashKey(digest: Hex, epoch: bigint | number): Hex;
|
|
43
|
+
/** The one read: a deployed account answers `custodyEpoch()`; an address with no code is at epoch 0. */
|
|
44
|
+
export declare function readCustodyEpoch(client: {
|
|
45
|
+
getCode(args: {
|
|
46
|
+
address: Address;
|
|
47
|
+
}): Promise<Hex | undefined>;
|
|
48
|
+
readContract(args: {
|
|
49
|
+
address: Address;
|
|
50
|
+
abi: typeof agentAccountAbi;
|
|
51
|
+
functionName: 'custodyEpoch';
|
|
52
|
+
}): Promise<bigint>;
|
|
53
|
+
}, account: Address): Promise<bigint>;
|
|
54
|
+
/** `ApprovedHashRegistry.approveHash(approvalKey(digest, scheme))` as a `ContractCall` for the account's own
|
|
55
|
+
* execute/executeBatch. The scheme is REQUIRED so a caller states which estate generation and (on generation 2)
|
|
56
|
+
* which custody set it is approving under — `{ generation: 2, epoch: 0n }` for a counterfactual account being
|
|
57
|
+
* deployed in the same batch. */
|
|
58
|
+
export declare function buildApproveHashCall(registry: Address, digest: Hex, scheme: ApprovalScheme): ContractCall;
|
|
59
|
+
/** `ApprovedHashRegistry.revokeAll()` as a `ContractCall`: void every approval the account ever made.
|
|
60
|
+
* Generations 1 and 2 only — on generation 3 the registry is not an execute target; use
|
|
61
|
+
* `buildRevokeAllApprovedDigestsCall(account)`. */
|
|
62
|
+
export declare function buildRevokeAllApprovedHashesCall(registry: Address): ContractCall;
|
|
63
|
+
/** Spec 410 §1 (generation 3) — `AgentAccount.revokeAllApprovedDigests()` as a self-call: void every approval
|
|
64
|
+
* the account ever made, under any epoch, including one planted for a future epoch. The last step of a
|
|
65
|
+
* mode-0 self-recovery batch; `CustodyPolicy` does the same for every governed recovery. */
|
|
66
|
+
export declare function buildRevokeAllApprovedDigestsCall(account: Address): ContractCall;
|
|
67
|
+
/** A credential to register or retire. */
|
|
68
|
+
export type CredentialRef = {
|
|
69
|
+
kind: 'custodian';
|
|
70
|
+
address: Address;
|
|
71
|
+
} | {
|
|
72
|
+
kind: 'passkey';
|
|
73
|
+
credentialIdDigest: Hex;
|
|
74
|
+
x: bigint;
|
|
75
|
+
y: bigint;
|
|
76
|
+
rpIdHash: Hex;
|
|
77
|
+
};
|
|
78
|
+
/** Spec 410 §1.2 — the mode-0 ROTATION batch: `add → retire → approveDigest × N`. Order is the builder's, not
|
|
79
|
+
* the caller's: the account is never credential-less, and every re-approval lands after the retirement so
|
|
80
|
+
* the account derives each key under the NEW epoch. Generation 3 only — an older estate has no
|
|
81
|
+
* `approveDigest`, and pretending with a computed future-epoch key is the exact hole this closes. */
|
|
82
|
+
export declare function buildRotationBatch(args: {
|
|
83
|
+
scheme: ApprovalScheme;
|
|
84
|
+
add: CredentialRef;
|
|
85
|
+
retire: {
|
|
86
|
+
kind: 'custodian';
|
|
87
|
+
address: Address;
|
|
88
|
+
} | {
|
|
89
|
+
kind: 'passkey';
|
|
90
|
+
credentialIdDigest: Hex;
|
|
91
|
+
};
|
|
92
|
+
/** Every standing approved-digest wire the account issued — the reviewed list. */
|
|
93
|
+
reapprove: readonly Hex[];
|
|
94
|
+
}): ContractCall[];
|
|
95
|
+
/** Spec 410 §1.2 — the mode-0 SELF-RECOVERY batch: `add → retire → revokeAllApprovedDigests`. It carries no
|
|
96
|
+
* re-approval list — the type has no field for one. Generation 3 only. */
|
|
97
|
+
export declare function buildSelfRecoveryBatch(args: {
|
|
98
|
+
scheme: ApprovalScheme;
|
|
99
|
+
add: CredentialRef;
|
|
100
|
+
retire: {
|
|
101
|
+
kind: 'custodian';
|
|
102
|
+
address: Address;
|
|
103
|
+
} | {
|
|
104
|
+
kind: 'passkey';
|
|
105
|
+
credentialIdDigest: Hex;
|
|
106
|
+
};
|
|
107
|
+
}): ContractCall[];
|
|
108
|
+
//# sourceMappingURL=approved-hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approved-hash.d.ts","sourceRoot":"","sources":["../src/approved-hash.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAsD,KAAK,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GAAG;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,kBAAkB,EAAE,GAAG,CAAA;KAAE,CAAC;IAC/F,kFAAkF;IAClF,SAAS,EAAE,SAAS,GAAG,EAAE,CAAC;CAC3B,GAAG,YAAY,EAAE,CASjB;AAED;2EAC2E;AAC3E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,MAAM,EAAE,cAAc,CAAC;IACvB,GAAG,EAAE,aAAa,CAAC;IACnB,MAAM,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,kBAAkB,EAAE,GAAG,CAAA;KAAE,CAAC;CAChG,GAAG,YAAY,EAAE,CAIjB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// R917-C-2 (spec 408 §1.2) — THE EPOCH-BOUND APPROVED-HASH KEY.
|
|
2
|
+
//
|
|
3
|
+
// An AgentAccount's `0x03` ERC-1271 sentinel does not ask the ApprovedHashRegistry about the raw digest;
|
|
4
|
+
// it asks about `keccak256(abi.encode(digest, custodyEpoch))`, where the custody epoch increments every
|
|
5
|
+
// time the account retires a credential (`removeCustodian`, `removePasskey` — recovery and rotation
|
|
6
|
+
// remove through these). So an approval planted by a custodian who is later removed is void the moment
|
|
7
|
+
// the custody set no longer contains that custodian: an ECDSA signature dies with its key, and an
|
|
8
|
+
// approved hash dies with its custody set.
|
|
9
|
+
//
|
|
10
|
+
// What an SDK does: read the account's epoch (0 for a counterfactual account — a deploy-and-approve
|
|
11
|
+
// batch, spec 253, is computable before the address has code) and approve the KEY. After a custodian
|
|
12
|
+
// removal the account's standing approved-hash wires are re-approved under the new epoch — in one batch,
|
|
13
|
+
// as the ceremony already does.
|
|
14
|
+
//
|
|
15
|
+
// THREE CONTRACT GENERATIONS. An estate whose contracts predate spec 408 (`contractsGeneration` absent from its
|
|
16
|
+
// deployments JSON = generation 1) has accounts with no epoch: the sentinel there consults the RAW digest.
|
|
17
|
+
// Generation 2 (spec 408) approves the epoch-bound KEY, computed here and sent to the registry. Generation 3
|
|
18
|
+
// (spec 410 §1, THESIS-1a) closes the hole generation 2 left — a caller who can compute the key can compute it
|
|
19
|
+
// for a FUTURE epoch, and the registry stores whatever it is sent — by making the ACCOUNT derive the key on
|
|
20
|
+
// chain (`approveDigest`) and refusing the registry as an execute target for every caller. On generation 3 an
|
|
21
|
+
// SDK never computes a key: it asks the account to approve the DIGEST. The generation is a DEPLOYMENT FACT the
|
|
22
|
+
// app states (`CONTRACTS_GENERATION`), never inferred from a failed read (ADR-0013): one mechanism per
|
|
23
|
+
// generation, chosen by configuration.
|
|
24
|
+
import { encodeAbiParameters, encodeFunctionData, keccak256 } from 'viem';
|
|
25
|
+
import { agentAccountAbi, approvedHashRegistryAbi } from './abis.js';
|
|
26
|
+
/** The generation a deployments JSON records; absent ⇒ 1 (the field arrived with spec 408). Anything else throws. */
|
|
27
|
+
export function contractsGenerationOf(deployments) {
|
|
28
|
+
const g = deployments?.contractsGeneration;
|
|
29
|
+
if (g === undefined || g === null || g === 1 || g === '1')
|
|
30
|
+
return 1;
|
|
31
|
+
if (g === 2 || g === '2')
|
|
32
|
+
return 2;
|
|
33
|
+
if (g === 3 || g === '3')
|
|
34
|
+
return 3;
|
|
35
|
+
throw new Error(`contractsGeneration ${String(g)} is not a generation this SDK knows (1, 2 or 3)`);
|
|
36
|
+
}
|
|
37
|
+
/** The 32 bytes the account approves for `digest` under `scheme`. On generation 3 there is nothing for a caller
|
|
38
|
+
* to compute — the account derives the key on chain — so this throws rather than guess an epoch (ADR-0013). */
|
|
39
|
+
export function approvalKey(digest, scheme) {
|
|
40
|
+
if (!/^0x[0-9a-fA-F]{64}$/.test(digest))
|
|
41
|
+
throw new Error('approvalKey: digest must be a bytes32 hex string');
|
|
42
|
+
if (scheme.generation === 1)
|
|
43
|
+
return digest;
|
|
44
|
+
if (scheme.generation === 2)
|
|
45
|
+
return approvedHashKey(digest, scheme.epoch);
|
|
46
|
+
throw new Error('approvalKey: on generation 3 the account derives the key on chain (approveDigest); read approvedHashKey(digest) from the account if you need the stored key');
|
|
47
|
+
}
|
|
48
|
+
/** The scheme for `account` on an estate of `generation`: generation 1 needs no read; generation 2 reads the
|
|
49
|
+
* account's custody epoch (0 for an address with no code); generation 3 needs no read either — the account
|
|
50
|
+
* will derive the key under whatever epoch it is in when the call lands. */
|
|
51
|
+
export async function readApprovalScheme(client, account, generation) {
|
|
52
|
+
if (generation === 1)
|
|
53
|
+
return { generation: 1 };
|
|
54
|
+
if (generation === 3)
|
|
55
|
+
return { generation: 3, account };
|
|
56
|
+
return { generation: 2, epoch: await readCustodyEpoch(client, account) };
|
|
57
|
+
}
|
|
58
|
+
/** The 32 bytes an account must approve for `digest` to validate through its `0x03` sentinel at `epoch`. */
|
|
59
|
+
export function approvedHashKey(digest, epoch) {
|
|
60
|
+
if (!/^0x[0-9a-fA-F]{64}$/.test(digest))
|
|
61
|
+
throw new Error('approvedHashKey: digest must be a bytes32 hex string');
|
|
62
|
+
const e = BigInt(epoch);
|
|
63
|
+
if (e < 0n || e > 0xffffffffffffffffn)
|
|
64
|
+
throw new Error('approvedHashKey: epoch must fit uint64');
|
|
65
|
+
return keccak256(encodeAbiParameters([{ type: 'bytes32' }, { type: 'uint64' }], [digest, e]));
|
|
66
|
+
}
|
|
67
|
+
/** The one read: a deployed account answers `custodyEpoch()`; an address with no code is at epoch 0. */
|
|
68
|
+
export async function readCustodyEpoch(client, account) {
|
|
69
|
+
const code = await client.getCode({ address: account });
|
|
70
|
+
if (!code || code === '0x')
|
|
71
|
+
return 0n;
|
|
72
|
+
return BigInt(await client.readContract({ address: account, abi: agentAccountAbi, functionName: 'custodyEpoch' }));
|
|
73
|
+
}
|
|
74
|
+
/** `ApprovedHashRegistry.approveHash(approvalKey(digest, scheme))` as a `ContractCall` for the account's own
|
|
75
|
+
* execute/executeBatch. The scheme is REQUIRED so a caller states which estate generation and (on generation 2)
|
|
76
|
+
* which custody set it is approving under — `{ generation: 2, epoch: 0n }` for a counterfactual account being
|
|
77
|
+
* deployed in the same batch. */
|
|
78
|
+
export function buildApproveHashCall(registry, digest, scheme) {
|
|
79
|
+
if (scheme.generation === 3) {
|
|
80
|
+
// Spec 410 §1: a self-call — the account computes the key under the epoch it is in. `registry` is not a
|
|
81
|
+
// target on this generation (the account refuses it), so it is deliberately unused here.
|
|
82
|
+
if (!/^0x[0-9a-fA-F]{64}$/.test(digest))
|
|
83
|
+
throw new Error('buildApproveHashCall: digest must be a bytes32 hex string');
|
|
84
|
+
return { to: scheme.account, value: 0n, data: encodeFunctionData({ abi: agentAccountAbi, functionName: 'approveDigest', args: [digest] }) };
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
to: registry,
|
|
88
|
+
value: 0n,
|
|
89
|
+
data: encodeFunctionData({ abi: approvedHashRegistryAbi, functionName: 'approveHash', args: [approvalKey(digest, scheme)] }),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** `ApprovedHashRegistry.revokeAll()` as a `ContractCall`: void every approval the account ever made.
|
|
93
|
+
* Generations 1 and 2 only — on generation 3 the registry is not an execute target; use
|
|
94
|
+
* `buildRevokeAllApprovedDigestsCall(account)`. */
|
|
95
|
+
export function buildRevokeAllApprovedHashesCall(registry) {
|
|
96
|
+
return { to: registry, value: 0n, data: encodeFunctionData({ abi: approvedHashRegistryAbi, functionName: 'revokeAll' }) };
|
|
97
|
+
}
|
|
98
|
+
/** Spec 410 §1 (generation 3) — `AgentAccount.revokeAllApprovedDigests()` as a self-call: void every approval
|
|
99
|
+
* the account ever made, under any epoch, including one planted for a future epoch. The last step of a
|
|
100
|
+
* mode-0 self-recovery batch; `CustodyPolicy` does the same for every governed recovery. */
|
|
101
|
+
export function buildRevokeAllApprovedDigestsCall(account) {
|
|
102
|
+
return { to: account, value: 0n, data: encodeFunctionData({ abi: agentAccountAbi, functionName: 'revokeAllApprovedDigests' }) };
|
|
103
|
+
}
|
|
104
|
+
function credentialAddCall(account, c) {
|
|
105
|
+
return c.kind === 'custodian'
|
|
106
|
+
? { to: account, value: 0n, data: encodeFunctionData({ abi: agentAccountAbi, functionName: 'addCustodian', args: [c.address] }) }
|
|
107
|
+
: { to: account, value: 0n, data: encodeFunctionData({ abi: agentAccountAbi, functionName: 'addPasskey', args: [c.credentialIdDigest, c.x, c.y, c.rpIdHash] }) };
|
|
108
|
+
}
|
|
109
|
+
function credentialRetireCall(account, c) {
|
|
110
|
+
return c.kind === 'custodian'
|
|
111
|
+
? { to: account, value: 0n, data: encodeFunctionData({ abi: agentAccountAbi, functionName: 'removeCustodian', args: [c.address] }) }
|
|
112
|
+
: { to: account, value: 0n, data: encodeFunctionData({ abi: agentAccountAbi, functionName: 'removePasskey', args: [c.credentialIdDigest] }) };
|
|
113
|
+
}
|
|
114
|
+
/** Spec 410 §1.2 — the mode-0 ROTATION batch: `add → retire → approveDigest × N`. Order is the builder's, not
|
|
115
|
+
* the caller's: the account is never credential-less, and every re-approval lands after the retirement so
|
|
116
|
+
* the account derives each key under the NEW epoch. Generation 3 only — an older estate has no
|
|
117
|
+
* `approveDigest`, and pretending with a computed future-epoch key is the exact hole this closes. */
|
|
118
|
+
export function buildRotationBatch(args) {
|
|
119
|
+
if (args.scheme.generation !== 3)
|
|
120
|
+
throw new Error('buildRotationBatch: the rotation ceremony needs contracts generation 3 (spec 410 §1); this estate runs ' + args.scheme.generation);
|
|
121
|
+
const account = args.scheme.account;
|
|
122
|
+
for (const d of args.reapprove)
|
|
123
|
+
if (!/^0x[0-9a-fA-F]{64}$/.test(d))
|
|
124
|
+
throw new Error('buildRotationBatch: every reapprove entry must be a bytes32 digest');
|
|
125
|
+
return [
|
|
126
|
+
credentialAddCall(account, args.add),
|
|
127
|
+
credentialRetireCall(account, args.retire),
|
|
128
|
+
...args.reapprove.map((d) => buildApproveHashCall(account, d, args.scheme)),
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
/** Spec 410 §1.2 — the mode-0 SELF-RECOVERY batch: `add → retire → revokeAllApprovedDigests`. It carries no
|
|
132
|
+
* re-approval list — the type has no field for one. Generation 3 only. */
|
|
133
|
+
export function buildSelfRecoveryBatch(args) {
|
|
134
|
+
if (args.scheme.generation !== 3)
|
|
135
|
+
throw new Error('buildSelfRecoveryBatch: needs contracts generation 3 (spec 410 §1); this estate runs ' + args.scheme.generation);
|
|
136
|
+
const account = args.scheme.account;
|
|
137
|
+
return [credentialAddCall(account, args.add), credentialRetireCall(account, args.retire), buildRevokeAllApprovedDigestsCall(account)];
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=approved-hash.js.map
|