@agenticprimitives/account-custody 0.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agentic Trust Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # @agenticprimitives/account-custody
2
+
3
+ Custody-layer SDK for Smart Agent account safety and recovery.
4
+
5
+ This package owns the TypeScript surface around `CustodyPolicy`: ABI exports,
6
+ `CustodyAction` argument builders, EIP-712 typed data, quorum signature packing,
7
+ and custody-domain types.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pnpm add @agenticprimitives/account-custody
13
+ ```
14
+
15
+ ## Use
16
+
17
+ ```ts
18
+ import {
19
+ CustodyAction,
20
+ buildRecoverAccountArgs,
21
+ custodyDomain,
22
+ packQuorumSigs,
23
+ } from '@agenticprimitives/account-custody';
24
+ ```
25
+
26
+ ## Boundary
27
+
28
+ This package speaks custody vocabulary only:
29
+
30
+ - `Custodian`
31
+ - `Trustee`
32
+ - `CustodyCouncil`
33
+ - `CustodyAction`
34
+ - `ScheduledChange`
35
+
36
+ It does not own delegation caveats, MCP transport, passkey ceremonies, account
37
+ deployment, or key-custody providers. See `CLAUDE.md` for routing.
38
+
39
+ ## Validate
40
+
41
+ ```bash
42
+ pnpm --filter @agenticprimitives/account-custody typecheck
43
+ pnpm --filter @agenticprimitives/account-custody test
44
+ ```
package/dist/abi.d.ts ADDED
@@ -0,0 +1,280 @@
1
+ export declare const custodyPolicyAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "scheduleCustodyChange";
4
+ readonly stateMutability: "nonpayable";
5
+ readonly inputs: readonly [{
6
+ readonly name: "account";
7
+ readonly type: "address";
8
+ }, {
9
+ readonly name: "action";
10
+ readonly type: "uint8";
11
+ }, {
12
+ readonly name: "args";
13
+ readonly type: "bytes";
14
+ }, {
15
+ readonly name: "quorumSigs";
16
+ readonly type: "bytes";
17
+ }];
18
+ readonly outputs: readonly [{
19
+ readonly name: "changeId";
20
+ readonly type: "uint256";
21
+ }];
22
+ }, {
23
+ readonly type: "function";
24
+ readonly name: "applyCustodyChange";
25
+ readonly stateMutability: "nonpayable";
26
+ readonly inputs: readonly [{
27
+ readonly name: "account";
28
+ readonly type: "address";
29
+ }, {
30
+ readonly name: "changeId";
31
+ readonly type: "uint256";
32
+ }, {
33
+ readonly name: "quorumSigs";
34
+ readonly type: "bytes";
35
+ }];
36
+ readonly outputs: readonly [];
37
+ }, {
38
+ readonly type: "function";
39
+ readonly name: "cancelScheduledChange";
40
+ readonly stateMutability: "nonpayable";
41
+ readonly inputs: readonly [{
42
+ readonly name: "account";
43
+ readonly type: "address";
44
+ }, {
45
+ readonly name: "changeId";
46
+ readonly type: "uint256";
47
+ }, {
48
+ readonly name: "quorumSigs";
49
+ readonly type: "bytes";
50
+ }];
51
+ readonly outputs: readonly [];
52
+ }, {
53
+ readonly type: "function";
54
+ readonly name: "isInstalledOn";
55
+ readonly stateMutability: "view";
56
+ readonly inputs: readonly [{
57
+ readonly name: "account";
58
+ readonly type: "address";
59
+ }];
60
+ readonly outputs: readonly [{
61
+ readonly type: "bool";
62
+ }];
63
+ }, {
64
+ readonly type: "function";
65
+ readonly name: "domainSeparator";
66
+ readonly stateMutability: "view";
67
+ readonly inputs: readonly [];
68
+ readonly outputs: readonly [{
69
+ readonly type: "bytes32";
70
+ }];
71
+ }, {
72
+ readonly type: "function";
73
+ readonly name: "custodyMode";
74
+ readonly stateMutability: "view";
75
+ readonly inputs: readonly [{
76
+ readonly name: "account";
77
+ readonly type: "address";
78
+ }];
79
+ readonly outputs: readonly [{
80
+ readonly type: "uint8";
81
+ }];
82
+ }, {
83
+ readonly type: "function";
84
+ readonly name: "approvalsRequired";
85
+ readonly stateMutability: "view";
86
+ readonly inputs: readonly [{
87
+ readonly name: "account";
88
+ readonly type: "address";
89
+ }, {
90
+ readonly name: "tier";
91
+ readonly type: "uint8";
92
+ }];
93
+ readonly outputs: readonly [{
94
+ readonly type: "uint8";
95
+ }];
96
+ }, {
97
+ readonly type: "function";
98
+ readonly name: "recoveryApprovals";
99
+ readonly stateMutability: "view";
100
+ readonly inputs: readonly [{
101
+ readonly name: "account";
102
+ readonly type: "address";
103
+ }];
104
+ readonly outputs: readonly [{
105
+ readonly type: "uint8";
106
+ }];
107
+ }, {
108
+ readonly type: "function";
109
+ readonly name: "t3HighValueCeiling";
110
+ readonly stateMutability: "view";
111
+ readonly inputs: readonly [{
112
+ readonly name: "account";
113
+ readonly type: "address";
114
+ }];
115
+ readonly outputs: readonly [{
116
+ readonly type: "uint256";
117
+ }];
118
+ }, {
119
+ readonly type: "function";
120
+ readonly name: "safetyDelay";
121
+ readonly stateMutability: "view";
122
+ readonly inputs: readonly [{
123
+ readonly name: "account";
124
+ readonly type: "address";
125
+ }, {
126
+ readonly name: "tier";
127
+ readonly type: "uint8";
128
+ }];
129
+ readonly outputs: readonly [{
130
+ readonly type: "uint32";
131
+ }];
132
+ }, {
133
+ readonly type: "function";
134
+ readonly name: "isTrustee";
135
+ readonly stateMutability: "view";
136
+ readonly inputs: readonly [{
137
+ readonly name: "account";
138
+ readonly type: "address";
139
+ }, {
140
+ readonly name: "signer";
141
+ readonly type: "address";
142
+ }];
143
+ readonly outputs: readonly [{
144
+ readonly type: "bool";
145
+ }];
146
+ }, {
147
+ readonly type: "function";
148
+ readonly name: "trusteeCount";
149
+ readonly stateMutability: "view";
150
+ readonly inputs: readonly [{
151
+ readonly name: "account";
152
+ readonly type: "address";
153
+ }];
154
+ readonly outputs: readonly [{
155
+ readonly type: "uint256";
156
+ }];
157
+ }, {
158
+ readonly type: "function";
159
+ readonly name: "scheduledChangeCount";
160
+ readonly stateMutability: "view";
161
+ readonly inputs: readonly [{
162
+ readonly name: "account";
163
+ readonly type: "address";
164
+ }];
165
+ readonly outputs: readonly [{
166
+ readonly type: "uint256";
167
+ }];
168
+ }, {
169
+ readonly type: "function";
170
+ readonly name: "defaultApprovals";
171
+ readonly stateMutability: "pure";
172
+ readonly inputs: readonly [{
173
+ readonly name: "nCustodians";
174
+ readonly type: "uint8";
175
+ }, {
176
+ readonly name: "tier";
177
+ readonly type: "uint8";
178
+ }];
179
+ readonly outputs: readonly [{
180
+ readonly type: "uint8";
181
+ }];
182
+ }, {
183
+ readonly type: "function";
184
+ readonly name: "getScheduledChange";
185
+ readonly stateMutability: "view";
186
+ readonly inputs: readonly [{
187
+ readonly name: "account";
188
+ readonly type: "address";
189
+ }, {
190
+ readonly name: "changeId";
191
+ readonly type: "uint256";
192
+ }];
193
+ readonly outputs: readonly [{
194
+ readonly name: "action";
195
+ readonly type: "uint8";
196
+ }, {
197
+ readonly name: "args";
198
+ readonly type: "bytes";
199
+ }, {
200
+ readonly name: "proposedAt";
201
+ readonly type: "uint64";
202
+ }, {
203
+ readonly name: "eta";
204
+ readonly type: "uint64";
205
+ }, {
206
+ readonly name: "proposer";
207
+ readonly type: "address";
208
+ }, {
209
+ readonly name: "executed";
210
+ readonly type: "bool";
211
+ }, {
212
+ readonly name: "cancelled";
213
+ readonly type: "bool";
214
+ }];
215
+ }, {
216
+ readonly type: "event";
217
+ readonly name: "CustodyChangeScheduled";
218
+ readonly inputs: readonly [{
219
+ readonly name: "account";
220
+ readonly type: "address";
221
+ readonly indexed: true;
222
+ }, {
223
+ readonly name: "changeId";
224
+ readonly type: "uint256";
225
+ readonly indexed: true;
226
+ }, {
227
+ readonly name: "action";
228
+ readonly type: "uint8";
229
+ readonly indexed: true;
230
+ }, {
231
+ readonly name: "eta";
232
+ readonly type: "uint64";
233
+ readonly indexed: false;
234
+ }, {
235
+ readonly name: "proposer";
236
+ readonly type: "address";
237
+ readonly indexed: false;
238
+ }];
239
+ }, {
240
+ readonly type: "event";
241
+ readonly name: "CustodyChangeApplied";
242
+ readonly inputs: readonly [{
243
+ readonly name: "account";
244
+ readonly type: "address";
245
+ readonly indexed: true;
246
+ }, {
247
+ readonly name: "changeId";
248
+ readonly type: "uint256";
249
+ readonly indexed: true;
250
+ }];
251
+ }, {
252
+ readonly type: "event";
253
+ readonly name: "ScheduledChangeCancelled";
254
+ readonly inputs: readonly [{
255
+ readonly name: "account";
256
+ readonly type: "address";
257
+ readonly indexed: true;
258
+ }, {
259
+ readonly name: "changeId";
260
+ readonly type: "uint256";
261
+ readonly indexed: true;
262
+ }];
263
+ }, {
264
+ readonly type: "event";
265
+ readonly name: "CustodyPolicyInstalled";
266
+ readonly inputs: readonly [{
267
+ readonly name: "account";
268
+ readonly type: "address";
269
+ readonly indexed: true;
270
+ }, {
271
+ readonly name: "mode";
272
+ readonly type: "uint8";
273
+ readonly indexed: false;
274
+ }, {
275
+ readonly name: "recoveryApprovals";
276
+ readonly type: "uint8";
277
+ readonly indexed: false;
278
+ }];
279
+ }];
280
+ //# sourceMappingURL=abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../src/abi.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoGnB,CAAC"}
package/dist/abi.js ADDED
@@ -0,0 +1,107 @@
1
+ // CustodyPolicy ABI — source of truth: packages/contracts/src/custody/CustodyPolicy.sol
2
+ // (spec 207 / 209 / 213).
3
+ //
4
+ // This is the typed-data + chain-call surface a custody UI needs. All
5
+ // callers should import from here rather than declaring the ABI inline.
6
+ export const custodyPolicyAbi = [
7
+ // ─── Mutating: schedule / apply / cancel ─────────────────────────────
8
+ {
9
+ type: 'function',
10
+ name: 'scheduleCustodyChange',
11
+ stateMutability: 'nonpayable',
12
+ inputs: [
13
+ { name: 'account', type: 'address' },
14
+ { name: 'action', type: 'uint8' },
15
+ { name: 'args', type: 'bytes' },
16
+ { name: 'quorumSigs', type: 'bytes' },
17
+ ],
18
+ outputs: [{ name: 'changeId', type: 'uint256' }],
19
+ },
20
+ {
21
+ type: 'function',
22
+ name: 'applyCustodyChange',
23
+ stateMutability: 'nonpayable',
24
+ inputs: [
25
+ { name: 'account', type: 'address' },
26
+ { name: 'changeId', type: 'uint256' },
27
+ { name: 'quorumSigs', type: 'bytes' },
28
+ ],
29
+ outputs: [],
30
+ },
31
+ {
32
+ type: 'function',
33
+ name: 'cancelScheduledChange',
34
+ stateMutability: 'nonpayable',
35
+ inputs: [
36
+ { name: 'account', type: 'address' },
37
+ { name: 'changeId', type: 'uint256' },
38
+ { name: 'quorumSigs', type: 'bytes' },
39
+ ],
40
+ outputs: [],
41
+ },
42
+ // ─── Views ──────────────────────────────────────────────────────────
43
+ { type: 'function', name: 'isInstalledOn', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }], outputs: [{ type: 'bool' }] },
44
+ { type: 'function', name: 'domainSeparator', stateMutability: 'view', inputs: [], outputs: [{ type: 'bytes32' }] },
45
+ { type: 'function', name: 'custodyMode', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }], outputs: [{ type: 'uint8' }] },
46
+ { type: 'function', name: 'approvalsRequired', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }, { name: 'tier', type: 'uint8' }], outputs: [{ type: 'uint8' }] },
47
+ { type: 'function', name: 'recoveryApprovals', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }], outputs: [{ type: 'uint8' }] },
48
+ { type: 'function', name: 't3HighValueCeiling', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }], outputs: [{ type: 'uint256' }] },
49
+ { type: 'function', name: 'safetyDelay', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }, { name: 'tier', type: 'uint8' }], outputs: [{ type: 'uint32' }] },
50
+ { type: 'function', name: 'isTrustee', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }, { name: 'signer', type: 'address' }], outputs: [{ type: 'bool' }] },
51
+ { type: 'function', name: 'trusteeCount', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }], outputs: [{ type: 'uint256' }] },
52
+ { type: 'function', name: 'scheduledChangeCount', stateMutability: 'view', inputs: [{ name: 'account', type: 'address' }], outputs: [{ type: 'uint256' }] },
53
+ { type: 'function', name: 'defaultApprovals', stateMutability: 'pure', inputs: [{ name: 'nCustodians', type: 'uint8' }, { name: 'tier', type: 'uint8' }], outputs: [{ type: 'uint8' }] },
54
+ {
55
+ type: 'function',
56
+ name: 'getScheduledChange',
57
+ stateMutability: 'view',
58
+ inputs: [{ name: 'account', type: 'address' }, { name: 'changeId', type: 'uint256' }],
59
+ outputs: [
60
+ { name: 'action', type: 'uint8' },
61
+ { name: 'args', type: 'bytes' },
62
+ { name: 'proposedAt', type: 'uint64' },
63
+ { name: 'eta', type: 'uint64' },
64
+ { name: 'proposer', type: 'address' },
65
+ { name: 'executed', type: 'bool' },
66
+ { name: 'cancelled', type: 'bool' },
67
+ ],
68
+ },
69
+ // ─── Events ─────────────────────────────────────────────────────────
70
+ {
71
+ type: 'event',
72
+ name: 'CustodyChangeScheduled',
73
+ inputs: [
74
+ { name: 'account', type: 'address', indexed: true },
75
+ { name: 'changeId', type: 'uint256', indexed: true },
76
+ { name: 'action', type: 'uint8', indexed: true },
77
+ { name: 'eta', type: 'uint64', indexed: false },
78
+ { name: 'proposer', type: 'address', indexed: false },
79
+ ],
80
+ },
81
+ {
82
+ type: 'event',
83
+ name: 'CustodyChangeApplied',
84
+ inputs: [
85
+ { name: 'account', type: 'address', indexed: true },
86
+ { name: 'changeId', type: 'uint256', indexed: true },
87
+ ],
88
+ },
89
+ {
90
+ type: 'event',
91
+ name: 'ScheduledChangeCancelled',
92
+ inputs: [
93
+ { name: 'account', type: 'address', indexed: true },
94
+ { name: 'changeId', type: 'uint256', indexed: true },
95
+ ],
96
+ },
97
+ {
98
+ type: 'event',
99
+ name: 'CustodyPolicyInstalled',
100
+ inputs: [
101
+ { name: 'account', type: 'address', indexed: true },
102
+ { name: 'mode', type: 'uint8', indexed: false },
103
+ { name: 'recoveryApprovals', type: 'uint8', indexed: false },
104
+ ],
105
+ },
106
+ ];
107
+ //# sourceMappingURL=abi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.js","sourceRoot":"","sources":["../src/abi.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,0BAA0B;AAC1B,EAAE;AACF,sEAAsE;AACtE,wEAAwE;AAExE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,wEAAwE;IACxE;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,uBAAu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K,EAAE;SACtD;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;YACnD,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;SACrD;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,0BAA0B;QAChC,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;YACnD,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;SACrD;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,wBAAwB;QAC9B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;YACnD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;YAC/C,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;SAC7D;KACF;CACO,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { type Address, type Hex } from 'viem';
2
+ export declare enum CustodyAction {
3
+ AddCustodian = 0,
4
+ RemoveCustodian = 1,
5
+ AddPasskeyCredential = 2,
6
+ RemovePasskeyCredential = 3,
7
+ AddTrustee = 4,
8
+ RemoveTrustee = 5,
9
+ ChangeCustodyMode = 6,
10
+ ApplySystemUpdate = 7,
11
+ RotateDelegationManager = 8,
12
+ RotatePaymaster = 9,
13
+ RotateSessionIssuer = 10,
14
+ RotateAllCustodians = 11,
15
+ ChangeValueCeiling = 12,
16
+ SetRecoveryApprovals = 13,
17
+ RecoverAccount = 14,
18
+ ChangeApprovalsRequired = 15
19
+ }
20
+ export declare function buildAddCustodianArgs(custodian: Address): Hex;
21
+ export declare function buildRemoveCustodianArgs(custodian: Address): Hex;
22
+ export declare function buildAddTrusteeArgs(trustee: Address): Hex;
23
+ export declare function buildRemoveTrusteeArgs(trustee: Address): Hex;
24
+ export declare function buildChangeCustodyModeArgs(newMode: 0 | 1 | 2 | 3): Hex;
25
+ export declare function buildChangeValueCeilingArgs(newCeilingWei: bigint): Hex;
26
+ /**
27
+ * Encode args for `SetRecoveryApprovals(newThreshold)`.
28
+ *
29
+ * The on-chain CustodyPolicy rejects `newThreshold == 0` (Wave 2C C-9)
30
+ * to prevent T4-quorum-induced silent recovery disable. The builder
31
+ * does NOT enforce that ceiling because the upper bound is the
32
+ * runtime trustee count; on-chain validation catches an over-threshold.
33
+ */
34
+ export declare function buildSetRecoveryApprovalsArgs(approvals: number): Hex;
35
+ export declare function buildApplySystemUpdateArgs(newImpl: Address): Hex;
36
+ /**
37
+ * Encode args for `ChangeApprovalsRequired(tier, newCount)`.
38
+ *
39
+ * `tier` is a RiskTier in [1, 5] — T6 (recovery) lives in a separate
40
+ * slot and is set via `buildSetRecoveryApprovalsArgs`. `newCount` must
41
+ * satisfy `1 <= newCount <= account.custodianCount()` at apply time.
42
+ */
43
+ export declare function buildChangeApprovalsRequiredArgs(tier: number, newCount: number): Hex;
44
+ /**
45
+ * Encode args for `AddPasskeyCredential(credentialIdDigest, x, y)`.
46
+ * Side effect on AgentAccount: also registers the PIA derived from
47
+ * `(x, y)` as a first-class custodian.
48
+ *
49
+ * Wave 2C C-6 hardening: on-chain initializer rejects credentialIdDigest
50
+ * == 0; this builder echoes that check at the wire-format boundary so
51
+ * the demo never spends gas on a guaranteed-revert tx.
52
+ */
53
+ export declare function buildAddPasskeyCredentialArgs(credentialIdDigest: Hex, x: bigint, y: bigint): Hex;
54
+ /** Encode args for `RemovePasskeyCredential(credentialIdDigest)`. */
55
+ export declare function buildRemovePasskeyCredentialArgs(credentialIdDigest: Hex): Hex;
56
+ /**
57
+ * Encode args for `RotateAllCustodians(addCustodians, removeCustodians)`
58
+ * (Wave 2C C-10). Adds the new set + removes the old in one atomic action;
59
+ * factory enforces that at-least-one custodian remains.
60
+ */
61
+ export declare function buildRotateAllCustodiansArgs(addCustodians: readonly Address[], removeCustodians: readonly Address[]): Hex;
62
+ /**
63
+ * One passkey to add inside a T6 recovery — mirrors the Solidity
64
+ * `AgentAccountRecoveryPasskeyAdd` struct.
65
+ */
66
+ export interface RecoveryPasskeyAdd {
67
+ credentialIdDigest: Hex;
68
+ x: bigint;
69
+ y: bigint;
70
+ }
71
+ /**
72
+ * Encode args for `RecoverAccount(args)` — atomic add/remove of owners
73
+ * and passkeys in one T6 action so the signer set doesn't pass through
74
+ * a half-rotated intermediate state.
75
+ *
76
+ * Solidity struct (from packages/contracts/src/IAgentAccount.sol):
77
+ * struct AgentAccountRecoveryArgs {
78
+ * address[] addOwners;
79
+ * address[] removeOwners;
80
+ * AgentAccountRecoveryPasskeyAdd[] addPasskeys;
81
+ * bytes32[] removePasskeyCredentialIdDigests;
82
+ * }
83
+ */
84
+ export declare function buildRecoverAccountArgs(args: {
85
+ addOwners?: readonly Address[];
86
+ removeOwners?: readonly Address[];
87
+ addPasskeys?: readonly RecoveryPasskeyAdd[];
88
+ removePasskeyCredentialIdDigests?: readonly Hex[];
89
+ }): Hex;
90
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAQA,OAAO,EAAuB,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAEnE,oBAAY,aAAa;IACvB,YAAY,IAAI;IAChB,eAAe,IAAI;IACnB,oBAAoB,IAAI;IACxB,uBAAuB,IAAI;IAC3B,UAAU,IAAI;IACd,aAAa,IAAI;IACjB,iBAAiB,IAAI;IACrB,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