@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/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,8DAA8D;AAE9D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,8DAA8D;AAE9D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGlE,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAqB,MAAM,cAAc,CAAC;AAClG,gEAAgE;AAChE,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpF,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,iFAAiF;AACjF,2FAA2F;AAC3F,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,kBAAkB,EAAE,sBAAsB,EAAqE,MAAM,oBAAoB,CAAC;AAEzU,yDAAyD;AACzD,OAAO,EACL,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAGrB,sDAAsD;AACtD,wEAAwE;AACxE,mEAAmE;AACnE,wDAAwD;AACxD,wCAAwC;AACxC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,uBAAuB,GACxB,MAAM,yBAAyB,CAAC"}
|
package/dist/quorum.d.ts
CHANGED
|
@@ -33,30 +33,4 @@ export interface SafeSignatureSlot {
|
|
|
33
33
|
* the per-slot conventions documented in `SafeSignatureSlot.v`.
|
|
34
34
|
*/
|
|
35
35
|
export declare function packSafeSignatures(slots: SafeSignatureSlot[]): Hex;
|
|
36
|
-
/**
|
|
37
|
-
* Verbs used in `AgentAccount._adminPayloadHash` (packages/contracts/src/
|
|
38
|
-
* AgentAccount.sol). Bound to the payload alongside (proposalId,
|
|
39
|
-
* action, args, eta, address, chainid) so a propose sig can't be
|
|
40
|
-
* replayed as an execute sig + sigs don't cross-replay between
|
|
41
|
-
* accounts or chains.
|
|
42
|
-
*/
|
|
43
|
-
export declare const ADMIN_VERB_PROPOSE: Hex;
|
|
44
|
-
export declare const ADMIN_VERB_EXECUTE: Hex;
|
|
45
|
-
export declare const ADMIN_VERB_CANCEL: Hex;
|
|
46
|
-
/**
|
|
47
|
-
* Match `AgentAccount._adminPayloadHash` exactly. Verbs are
|
|
48
|
-
* `bytes32("ADMIN_PROPOSE" | "ADMIN_EXECUTE" | "ADMIN_CANCEL")` —
|
|
49
|
-
* use the `ADMIN_VERB_*` constants below, NOT raw strings, because
|
|
50
|
-
* `bytes32(stringLiteral)` packs from the LEFT in Solidity and the
|
|
51
|
-
* SDK must match the exact byte layout.
|
|
52
|
-
*/
|
|
53
|
-
export declare function computeAdminPayloadHash(args: {
|
|
54
|
-
verb: 'PROPOSE' | 'EXECUTE' | 'CANCEL';
|
|
55
|
-
proposalId: bigint;
|
|
56
|
-
action: number;
|
|
57
|
-
callArgs: Hex;
|
|
58
|
-
eta: bigint;
|
|
59
|
-
account: Address;
|
|
60
|
-
chainId: bigint;
|
|
61
|
-
}): Hex;
|
|
62
36
|
//# sourceMappingURL=quorum.d.ts.map
|
package/dist/quorum.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quorum.d.ts","sourceRoot":"","sources":["../src/quorum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quorum.d.ts","sourceRoot":"","sources":["../src/quorum.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAI9C;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;IAChB;;8DAE0D;IAC1D,SAAS,EAAE,GAAG,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,GAAG,CA8BlE"}
|
package/dist/quorum.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
// `packSafeSignatures` produces the Safe-compatible 65-byte-per-slot
|
|
4
4
|
// signature blob that both `QuorumEnforcer.beforeHook` (caveat path)
|
|
5
5
|
// and `AgentAccount._verifyQuorum` (admin/recovery path) expect.
|
|
6
|
-
// `computeAdminPayloadHash` mirrors `AgentAccount._adminPayloadHash`
|
|
7
|
-
// off-chain so SDK callers can derive the digest they need to sign
|
|
8
|
-
// without a chain round-trip.
|
|
9
6
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
|
|
7
|
+
// Pure — no providers, no chain reads.
|
|
8
|
+
//
|
|
9
|
+
// F-3 (seam audit): the former `computeAdminPayloadHash` + `ADMIN_VERB_*` exports
|
|
10
|
+
// were REMOVED. They mirrored `AgentAccount._adminPayloadHash`, a signing scheme the
|
|
11
|
+
// contracts deleted — the live custody-admin scheme is CustodyPolicy's EIP-712
|
|
12
|
+
// typehashes (see account-custody). Keeping the mirror let a consumer mint digests no
|
|
13
|
+
// contract accepts; per doctrine (deletes > deprecations) it is gone, not deprecated.
|
|
14
14
|
/**
|
|
15
15
|
* Pack signature slots into Safe's `checkSignatures` blob format
|
|
16
16
|
* (sorted-ascending by signer address — the anti-duplicate scheme).
|
|
@@ -48,56 +48,4 @@ export function packSafeSignatures(slots) {
|
|
|
48
48
|
}
|
|
49
49
|
return out;
|
|
50
50
|
}
|
|
51
|
-
// ─── Admin payload-hash derivation ───────────────────────────────────
|
|
52
|
-
/**
|
|
53
|
-
* Verbs used in `AgentAccount._adminPayloadHash` (packages/contracts/src/
|
|
54
|
-
* AgentAccount.sol). Bound to the payload alongside (proposalId,
|
|
55
|
-
* action, args, eta, address, chainid) so a propose sig can't be
|
|
56
|
-
* replayed as an execute sig + sigs don't cross-replay between
|
|
57
|
-
* accounts or chains.
|
|
58
|
-
*/
|
|
59
|
-
export const ADMIN_VERB_PROPOSE = '0x41444d494e5f50524f504f5345'; // bytes32("ADMIN_PROPOSE") — viem encodes properly
|
|
60
|
-
export const ADMIN_VERB_EXECUTE = '0x41444d494e5f455845435554'; // bytes32("ADMIN_EXECUTE")
|
|
61
|
-
export const ADMIN_VERB_CANCEL = '0x41444d494e5f43414e43454c'; // bytes32("ADMIN_CANCEL")
|
|
62
|
-
/**
|
|
63
|
-
* Match `AgentAccount._adminPayloadHash` exactly. Verbs are
|
|
64
|
-
* `bytes32("ADMIN_PROPOSE" | "ADMIN_EXECUTE" | "ADMIN_CANCEL")` —
|
|
65
|
-
* use the `ADMIN_VERB_*` constants below, NOT raw strings, because
|
|
66
|
-
* `bytes32(stringLiteral)` packs from the LEFT in Solidity and the
|
|
67
|
-
* SDK must match the exact byte layout.
|
|
68
|
-
*/
|
|
69
|
-
export function computeAdminPayloadHash(args) {
|
|
70
|
-
// bytes32(string) in Solidity: left-justified, zero-padded right.
|
|
71
|
-
// Compute via encodePacked + hex-padding.
|
|
72
|
-
const verbBytes = new TextEncoder().encode(`ADMIN_${args.verb}`);
|
|
73
|
-
if (verbBytes.length > 32) {
|
|
74
|
-
throw new Error(`computeAdminPayloadHash: verb too long: ADMIN_${args.verb}`);
|
|
75
|
-
}
|
|
76
|
-
const padded = new Uint8Array(32);
|
|
77
|
-
padded.set(verbBytes, 0);
|
|
78
|
-
let verbHex = '0x';
|
|
79
|
-
for (const b of padded)
|
|
80
|
-
verbHex += b.toString(16).padStart(2, '0');
|
|
81
|
-
const callArgsHash = keccak256(args.callArgs);
|
|
82
|
-
return keccak256(encodeAbiParameters([
|
|
83
|
-
{ type: 'bytes32' }, // verb
|
|
84
|
-
{ type: 'uint256' }, // proposalId
|
|
85
|
-
{ type: 'uint8' }, // action
|
|
86
|
-
{ type: 'bytes32' }, // keccak256(args)
|
|
87
|
-
{ type: 'uint64' }, // eta
|
|
88
|
-
{ type: 'address' }, // address(account)
|
|
89
|
-
{ type: 'uint256' }, // chainId
|
|
90
|
-
], [
|
|
91
|
-
verbHex,
|
|
92
|
-
args.proposalId,
|
|
93
|
-
args.action,
|
|
94
|
-
callArgsHash,
|
|
95
|
-
args.eta,
|
|
96
|
-
args.account,
|
|
97
|
-
args.chainId,
|
|
98
|
-
]));
|
|
99
|
-
}
|
|
100
|
-
// Suppress unused-import warning while the encodePacked path stays
|
|
101
|
-
// reserved for future v=0 / v=1 slot helpers.
|
|
102
|
-
void encodePacked;
|
|
103
51
|
//# sourceMappingURL=quorum.js.map
|
package/dist/quorum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quorum.js","sourceRoot":"","sources":["../src/quorum.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,qEAAqE;AACrE,qEAAqE;AACrE,iEAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"quorum.js","sourceRoot":"","sources":["../src/quorum.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,qEAAqE;AACrE,qEAAqE;AACrE,iEAAiE;AACjE,EAAE;AACF,uCAAuC;AACvC,EAAE;AACF,kFAAkF;AAClF,qFAAqF;AACrF,+EAA+E;AAC/E,sFAAsF;AACtF,sFAAsF;AA8BtF;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA0B;IAC3D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,sCAAsC;IACtC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAChF,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,qCAAqC,CAAC,CAAC,MAAM,0CAA0C,KAAK,CAAC,MAAM,EAAE,CACtG,CAAC;QACJ,CAAC;IACH,CAAC;IACD,qEAAqE;IACrE,oDAAoD;IACpD,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACtC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACzD,CAAC;IACF,oEAAoE;IACpE,2CAA2C;IAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,MAAM,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;YAC5E,MAAM,IAAI,KAAK,CAAC,wCAAwC,MAAM,CAAC,CAAC,CAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IACD,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,GAAG,IAAI,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,GAAU,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/agent-account",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.41",
|
|
4
4
|
"description": "ERC-4337 smart-account substrate: deterministic addressing, factory deployment, ERC-1271 signing, UserOp building.",
|
|
5
|
+
"homepage": "https://agenticprimitives.dev",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
8
|
+
},
|
|
9
|
+
"author": {
|
|
10
|
+
"name": "Agentic Trust Labs",
|
|
11
|
+
"url": "https://agenticprimitives.dev"
|
|
12
|
+
},
|
|
5
13
|
"license": "MIT",
|
|
6
14
|
"repository": {
|
|
7
15
|
"type": "git",
|
|
8
16
|
"url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
|
|
9
17
|
"directory": "packages/agent-account"
|
|
10
18
|
},
|
|
11
|
-
"homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/agent-account",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
14
|
-
},
|
|
15
19
|
"type": "module",
|
|
16
20
|
"main": "./dist/index.js",
|
|
17
21
|
"types": "./dist/index.d.ts",
|
|
@@ -31,25 +35,30 @@
|
|
|
31
35
|
"access": "public"
|
|
32
36
|
},
|
|
33
37
|
"peerDependencies": {
|
|
34
|
-
"viem": "^2.
|
|
35
|
-
"@agenticprimitives/connect-auth": "1.0.0-alpha.
|
|
36
|
-
"@agenticprimitives/types": "1.0.0-alpha.
|
|
38
|
+
"viem": "^2.52.2",
|
|
39
|
+
"@agenticprimitives/connect-auth": "^1.0.0-alpha.41",
|
|
40
|
+
"@agenticprimitives/types": "^1.0.0-alpha.41"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
|
-
"vitest": "^
|
|
43
|
+
"vitest": "^4.1.11"
|
|
40
44
|
},
|
|
41
45
|
"keywords": [
|
|
42
46
|
"erc-4337",
|
|
43
47
|
"smart-account",
|
|
44
48
|
"account-abstraction",
|
|
45
49
|
"erc-1271",
|
|
46
|
-
"agentic"
|
|
50
|
+
"agentic",
|
|
51
|
+
"agentic-primitives",
|
|
52
|
+
"agenticprimitives",
|
|
53
|
+
"ai-agents",
|
|
54
|
+
"agent-authority",
|
|
55
|
+
"agentic-trust"
|
|
47
56
|
],
|
|
48
57
|
"scripts": {
|
|
49
58
|
"build": "tsc -p tsconfig.build.json",
|
|
50
59
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
51
60
|
"test": "vitest run",
|
|
52
|
-
"test:unit": "vitest run test/unit",
|
|
61
|
+
"test:unit": "vitest run test/unit --passWithNoTests",
|
|
53
62
|
"test:integration": "vitest run test/integration --passWithNoTests",
|
|
54
63
|
"test:watch": "vitest",
|
|
55
64
|
"clean": "rm -rf dist"
|