@account-kit/wallet-client 0.1.0-alpha.5 → 0.1.0-alpha.7
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/dist/esm/capabilities/eip7702Auth.js +3 -1
- package/dist/esm/capabilities/eip7702Auth.js.map +1 -1
- package/dist/esm/capabilities/overrides.js +8 -8
- package/dist/esm/capabilities/overrides.js.map +1 -1
- package/dist/esm/capabilities/permissions/index.d.ts +1 -1
- package/dist/esm/capabilities/permissions/index.js +6 -3
- package/dist/esm/capabilities/permissions/index.js.map +1 -1
- package/dist/esm/client/actions/grantPermissions.d.ts +5 -60
- package/dist/esm/client/actions/grantPermissions.js +5 -58
- package/dist/esm/client/actions/grantPermissions.js.map +1 -1
- package/dist/esm/client/actions/requestAccount.js +5 -2
- package/dist/esm/client/actions/requestAccount.js.map +1 -1
- package/dist/esm/client/actions/sendPreparedCalls.d.ts +6 -14
- package/dist/esm/client/actions/sendPreparedCalls.js +11 -12
- package/dist/esm/client/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/client/actions/signPreparedCalls.d.ts +14 -0
- package/dist/esm/client/actions/signPreparedCalls.js +54 -0
- package/dist/esm/client/actions/signPreparedCalls.js.map +1 -0
- package/dist/esm/client/actions/signSignatureRequest.d.ts +8 -7
- package/dist/esm/client/actions/signSignatureRequest.js +69 -31
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/client/client.e2e-test.js +80 -24
- package/dist/esm/client/client.e2e-test.js.map +1 -1
- package/dist/esm/client/decorator.d.ts +3 -1
- package/dist/esm/client/decorator.js +3 -1
- package/dist/esm/client/decorator.js.map +1 -1
- package/dist/esm/exports/index.d.ts +2 -1
- package/dist/esm/exports/index.js +2 -1
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/isomorphic/actions/createSession.js +18 -32
- package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
- package/dist/esm/isomorphic/actions/prepareCalls.js +22 -16
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
- package/dist/esm/isomorphic/actions/sendPreparedCalls.d.ts +3 -3
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +76 -36
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/isomorphic/client.d.ts +139 -13
- package/dist/esm/isomorphic/utils/7702.d.ts +4 -3
- package/dist/esm/isomorphic/utils/7702.js +14 -6
- package/dist/esm/isomorphic/utils/7702.js.map +1 -1
- package/dist/esm/isomorphic/utils/decodeSignature.d.ts +3 -0
- package/dist/esm/isomorphic/utils/decodeSignature.js +13 -0
- package/dist/esm/isomorphic/utils/decodeSignature.js.map +1 -0
- package/dist/esm/local/client.js +2 -3
- package/dist/esm/local/client.js.map +1 -1
- package/dist/esm/remote/client.js +3 -7
- package/dist/esm/remote/client.js.map +1 -1
- package/dist/esm/rpc/examples.d.ts +3 -3
- package/dist/esm/rpc/examples.js +3 -3
- package/dist/esm/rpc/examples.js.map +1 -1
- package/dist/esm/rpc/request.d.ts +357 -49
- package/dist/esm/rpc/request.js +26 -53
- package/dist/esm/rpc/request.js.map +1 -1
- package/dist/esm/rpc/schema.d.ts +323 -57
- package/dist/esm/rpc/schema.js.map +1 -1
- package/dist/esm/schemas.d.ts +451 -13
- package/dist/esm/schemas.js +165 -52
- package/dist/esm/schemas.js.map +1 -1
- package/dist/esm/types.d.ts +3 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/types/capabilities/eip7702Auth.d.ts.map +1 -1
- package/dist/types/capabilities/permissions/index.d.ts +1 -1
- package/dist/types/capabilities/permissions/index.d.ts.map +1 -1
- package/dist/types/client/actions/grantPermissions.d.ts +5 -60
- package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
- package/dist/types/client/actions/sendPreparedCalls.d.ts +6 -14
- package/dist/types/client/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/client/actions/signPreparedCalls.d.ts +15 -0
- package/dist/types/client/actions/signPreparedCalls.d.ts.map +1 -0
- package/dist/types/client/actions/signSignatureRequest.d.ts +8 -7
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/client/decorator.d.ts +3 -1
- package/dist/types/client/decorator.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +2 -1
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/createSession.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts +3 -3
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +1 -1
- package/dist/types/isomorphic/client.d.ts +139 -13
- package/dist/types/isomorphic/client.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/7702.d.ts +4 -3
- package/dist/types/isomorphic/utils/7702.d.ts.map +1 -1
- package/dist/types/isomorphic/utils/decodeSignature.d.ts +4 -0
- package/dist/types/isomorphic/utils/decodeSignature.d.ts.map +1 -0
- package/dist/types/remote/client.d.ts.map +1 -1
- package/dist/types/rpc/examples.d.ts +3 -3
- package/dist/types/rpc/examples.d.ts.map +1 -1
- package/dist/types/rpc/request.d.ts +357 -49
- package/dist/types/rpc/request.d.ts.map +1 -1
- package/dist/types/rpc/schema.d.ts +323 -57
- package/dist/types/rpc/schema.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +451 -13
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/types.d.ts +3 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/capabilities/eip7702Auth.ts +17 -10
- package/src/capabilities/overrides.ts +8 -8
- package/src/capabilities/permissions/index.ts +8 -3
- package/src/client/actions/grantPermissions.ts +5 -60
- package/src/client/actions/requestAccount.ts +10 -8
- package/src/client/actions/sendPreparedCalls.ts +17 -17
- package/src/client/actions/signPreparedCalls.ts +72 -0
- package/src/client/actions/signSignatureRequest.ts +50 -46
- package/src/client/client.e2e-test.ts +101 -33
- package/src/client/decorator.ts +14 -5
- package/src/exports/index.ts +2 -1
- package/src/isomorphic/actions/createSession.ts +20 -42
- package/src/isomorphic/actions/prepareCalls.ts +25 -17
- package/src/isomorphic/actions/sendPreparedCalls.ts +104 -54
- package/src/isomorphic/utils/7702.ts +18 -8
- package/src/isomorphic/utils/decodeSignature.ts +18 -0
- package/src/local/client.ts +2 -6
- package/src/remote/client.ts +3 -10
- package/src/rpc/examples.ts +3 -4
- package/src/rpc/request.ts +41 -63
- package/src/rpc/schema.ts +2 -2
- package/src/schemas.ts +227 -53
- package/src/types.ts +4 -0
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import type { Static } from "@sinclair/typebox";
|
|
3
3
|
import { type Hex } from "viem";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
export type SignSignatureRequestParams = Static<typeof
|
|
4
|
+
import { TypeAuthorizationSignatureRequest, TypePersonalSignSignatureRequest, TypeTypedDataSignatureRequest } from "../../schemas.js";
|
|
5
|
+
import { TypeEip7702UnsignedAuth } from "../../schemas.js";
|
|
6
|
+
export type SignSignatureRequestParams = Static<typeof TypePersonalSignSignatureRequest> | Static<typeof TypeTypedDataSignatureRequest> | (Static<typeof TypeAuthorizationSignatureRequest> & {
|
|
7
|
+
data: Static<typeof TypeEip7702UnsignedAuth>;
|
|
8
|
+
});
|
|
7
9
|
export type SignSignatureRequestResult = {
|
|
8
|
-
type:
|
|
9
|
-
|
|
10
|
-
signedAuthorization?: Eip7702ExtendedFields["eip7702Auth"];
|
|
10
|
+
type: "secp256k1";
|
|
11
|
+
data: Hex;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* Signs a signature request using the provided signer.
|
|
14
|
-
* This method handles different types of signature requests including personal_sign and
|
|
15
|
+
* This method handles different types of signature requests including personal_sign, eth_signTypedData_v4, and authorization.
|
|
15
16
|
*
|
|
16
17
|
* @param {SmartAccountSigner} signer - The signer to use for signing the request
|
|
17
18
|
* @param {SignSignatureRequestParams} params - The signature request parameters
|
|
@@ -1,36 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TypeSignatureRequest } from "../../schemas.js";
|
|
1
|
+
import { hexToNumber, serializeSignature } from "viem";
|
|
3
2
|
import { assertNever } from "../../utils.js";
|
|
3
|
+
import { TypeAuthorizationSignatureRequest, TypePersonalSignSignatureRequest, TypeTypedDataSignatureRequest, } from "../../schemas.js";
|
|
4
|
+
import { TypeEip7702UnsignedAuth } from "../../schemas.js";
|
|
5
|
+
import { vToYParity } from "ox/Signature";
|
|
6
|
+
/**
|
|
7
|
+
* Signs a signature request using the provided signer.
|
|
8
|
+
* This method handles different types of signature requests including personal_sign, eth_signTypedData_v4, and authorization.
|
|
9
|
+
*
|
|
10
|
+
* @param {SmartAccountSigner} signer - The signer to use for signing the request
|
|
11
|
+
* @param {SignSignatureRequestParams} params - The signature request parameters
|
|
12
|
+
* @param {string} params.type - The type of signature request ('personal_sign', 'eth_signTypedData_v4', or 'signature_with_authorization')
|
|
13
|
+
* @param {any} params.data - The data to sign, format depends on the signature type
|
|
14
|
+
* @returns {Promise<SignSignatureRequestResult>} A Promise that resolves to the signature result
|
|
15
|
+
* @returns {string} result.type - The signature type (currently only 'secp256k1' is supported)
|
|
16
|
+
* @returns {Hex} result.signature - The hex-encoded signature
|
|
17
|
+
* @returns {Eip7702ExtendedFields["eip7702Auth"]} result.signedAuthorization - The signed EIP-7702 authorization, if applicable
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Sign a personal message
|
|
21
|
+
* const result = await client.signSignatureRequest({
|
|
22
|
+
* type: 'personal_sign',
|
|
23
|
+
* data: 'Hello, world!'
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Sign typed data (EIP-712)
|
|
28
|
+
* const result = await client.signSignatureRequest({
|
|
29
|
+
* type: 'eth_signTypedData_v4',
|
|
30
|
+
* data: {
|
|
31
|
+
* domain: { ... },
|
|
32
|
+
* types: { ... },
|
|
33
|
+
* primaryType: '...',
|
|
34
|
+
* message: { ... }
|
|
35
|
+
* }
|
|
36
|
+
* });
|
|
37
|
+
*/
|
|
4
38
|
export async function signSignatureRequest(signer, params) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
39
|
+
switch (params.type) {
|
|
40
|
+
case "personal_sign": {
|
|
41
|
+
return {
|
|
42
|
+
type: "secp256k1",
|
|
43
|
+
data: await signer.signMessage(params.data),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
case "eth_signTypedData_v4": {
|
|
47
|
+
return {
|
|
48
|
+
type: "secp256k1",
|
|
49
|
+
data: await signer.signTypedData(params.data),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
case "eip7702Auth": {
|
|
53
|
+
if (!signer.signAuthorization) {
|
|
54
|
+
throw new Error("Signer does not implement signAuthorization");
|
|
55
|
+
}
|
|
56
|
+
const { r, s, v, yParity } = await signer.signAuthorization({
|
|
57
|
+
...params.data,
|
|
58
|
+
chainId: hexToNumber(params.data.chainId),
|
|
59
|
+
nonce: hexToNumber(params.data.nonce),
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
type: "secp256k1",
|
|
63
|
+
data: serializeSignature({
|
|
64
|
+
r,
|
|
65
|
+
s,
|
|
66
|
+
yParity: yParity ?? vToYParity(Number(v)),
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
default:
|
|
71
|
+
return assertNever(params, `Unexpected signature request type.`);
|
|
15
72
|
}
|
|
16
|
-
if (!signer.signAuthorization) {
|
|
17
|
-
throw new Error("Signer does not implement signAuthorization");
|
|
18
|
-
}
|
|
19
|
-
const authSig = await signer.signAuthorization(params.authorizationRequest);
|
|
20
|
-
const { r, s } = authSig;
|
|
21
|
-
const yParity = toHex(authSig.yParity ?? authSig.v - 27n);
|
|
22
|
-
const signedAuthorization = {
|
|
23
|
-
chainId: toHex(params.authorizationRequest.chainId),
|
|
24
|
-
nonce: toHex(params.authorizationRequest.nonce),
|
|
25
|
-
address: params.authorizationRequest.address,
|
|
26
|
-
r,
|
|
27
|
-
s,
|
|
28
|
-
yParity,
|
|
29
|
-
};
|
|
30
|
-
return {
|
|
31
|
-
type: "secp256k1",
|
|
32
|
-
signature,
|
|
33
|
-
signedAuthorization,
|
|
34
|
-
};
|
|
35
73
|
}
|
|
36
74
|
//# sourceMappingURL=signSignatureRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signSignatureRequest.js","sourceRoot":"","sources":["../../../../src/client/actions/signSignatureRequest.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,
|
|
1
|
+
{"version":3,"file":"signSignatureRequest.js","sourceRoot":"","sources":["../../../../src/client/actions/signSignatureRequest.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,WAAW,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,iCAAiC,EACjC,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAc1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAA0B,EAC1B,MAAkC;IAElC,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,OAAO;gBACL,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC;aAC5C,CAAC;QACJ,CAAC;QACD,KAAK,sBAAsB,CAAC,CAAC,CAAC;YAC5B,OAAO;gBACL,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,MAAM,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;aAC9C,CAAC;QACJ,CAAC;QACD,KAAK,aAAa,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;YACjE,CAAC;YACD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;gBAC1D,GAAG,MAAM,CAAC,IAAI;gBACd,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;gBACzC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;aACtC,CAAC,CAAC;YAEH,OAAO;gBACL,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,kBAAkB,CAAC;oBACvB,CAAC;oBACD,CAAC;oBACD,OAAO,EAAE,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;iBAC1C,CAAC;aACH,CAAC;QACJ,CAAC;QACD;YACE,OAAO,WAAW,CAAC,MAAM,EAAE,oCAAoC,CAAC,CAAC;IACrE,CAAC;AACH,CAAC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { type Hex, hexToNumber, serializeSignature } from \"viem\";\nimport { assertNever } from \"../../utils.js\";\nimport {\n TypeAuthorizationSignatureRequest,\n TypePersonalSignSignatureRequest,\n TypeTypedDataSignatureRequest,\n} from \"../../schemas.js\";\nimport { TypeEip7702UnsignedAuth } from \"../../schemas.js\";\nimport { vToYParity } from \"ox/Signature\";\n\nexport type SignSignatureRequestParams =\n | Static<typeof TypePersonalSignSignatureRequest>\n | Static<typeof TypeTypedDataSignatureRequest>\n | (Static<typeof TypeAuthorizationSignatureRequest> & {\n data: Static<typeof TypeEip7702UnsignedAuth>;\n });\n\nexport type SignSignatureRequestResult = {\n type: \"secp256k1\";\n data: Hex;\n};\n\n/**\n * Signs a signature request using the provided signer.\n * This method handles different types of signature requests including personal_sign, eth_signTypedData_v4, and authorization.\n *\n * @param {SmartAccountSigner} signer - The signer to use for signing the request\n * @param {SignSignatureRequestParams} params - The signature request parameters\n * @param {string} params.type - The type of signature request ('personal_sign', 'eth_signTypedData_v4', or 'signature_with_authorization')\n * @param {any} params.data - The data to sign, format depends on the signature type\n * @returns {Promise<SignSignatureRequestResult>} A Promise that resolves to the signature result\n * @returns {string} result.type - The signature type (currently only 'secp256k1' is supported)\n * @returns {Hex} result.signature - The hex-encoded signature\n * @returns {Eip7702ExtendedFields[\"eip7702Auth\"]} result.signedAuthorization - The signed EIP-7702 authorization, if applicable\n *\n * @example\n * // Sign a personal message\n * const result = await client.signSignatureRequest({\n * type: 'personal_sign',\n * data: 'Hello, world!'\n * });\n *\n * @example\n * // Sign typed data (EIP-712)\n * const result = await client.signSignatureRequest({\n * type: 'eth_signTypedData_v4',\n * data: {\n * domain: { ... },\n * types: { ... },\n * primaryType: '...',\n * message: { ... }\n * }\n * });\n */\n\nexport async function signSignatureRequest(\n signer: SmartAccountSigner,\n params: SignSignatureRequestParams,\n): Promise<SignSignatureRequestResult> {\n switch (params.type) {\n case \"personal_sign\": {\n return {\n type: \"secp256k1\",\n data: await signer.signMessage(params.data),\n };\n }\n case \"eth_signTypedData_v4\": {\n return {\n type: \"secp256k1\",\n data: await signer.signTypedData(params.data),\n };\n }\n case \"eip7702Auth\": {\n if (!signer.signAuthorization) {\n throw new Error(\"Signer does not implement signAuthorization\");\n }\n const { r, s, v, yParity } = await signer.signAuthorization({\n ...params.data,\n chainId: hexToNumber(params.data.chainId),\n nonce: hexToNumber(params.data.nonce),\n });\n\n return {\n type: \"secp256k1\",\n data: serializeSignature({\n r,\n s,\n yParity: yParity ?? vToYParity(Number(v)),\n }),\n };\n }\n default:\n return assertNever(params, `Unexpected signature request type.`);\n }\n}\n"]}
|
|
@@ -2,7 +2,6 @@ import { LocalAccountSigner } from "@aa-sdk/core";
|
|
|
2
2
|
import { alchemy, arbitrumSepolia } from "@account-kit/infra";
|
|
3
3
|
import { describe, expect, it } from "bun:test";
|
|
4
4
|
import { createPublicClient, zeroAddress } from "viem";
|
|
5
|
-
import { signSignatureRequest } from "./actions/signSignatureRequest.js";
|
|
6
5
|
import { createSmartWalletClient } from "./index.js";
|
|
7
6
|
describe("Client E2E Tests", () => {
|
|
8
7
|
const transport = alchemy(process.env.ALCHEMY_PROXY_RPC_URL
|
|
@@ -97,9 +96,35 @@ describe("Client E2E Tests", () => {
|
|
|
97
96
|
});
|
|
98
97
|
expect(isValid).toBeTrue();
|
|
99
98
|
});
|
|
99
|
+
it("should successfully send a UO with paymaster using 7702", async () => {
|
|
100
|
+
const _signer = LocalAccountSigner.privateKeyToAccountSigner("0x49daf21e92c997093e9ffdf7e7ddbf8970e9eadc5d4847d0f690db25d5128e1f");
|
|
101
|
+
const _client = createSmartWalletClient({
|
|
102
|
+
transport,
|
|
103
|
+
chain: arbitrumSepolia,
|
|
104
|
+
mode: "local",
|
|
105
|
+
signer: _signer,
|
|
106
|
+
});
|
|
107
|
+
const account = await _client.requestAccount({
|
|
108
|
+
creationHint: {
|
|
109
|
+
accountType: "7702",
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
const preparedCalls = await _client.prepareCalls({
|
|
113
|
+
calls: [{ to: zeroAddress, value: "0x0" }],
|
|
114
|
+
from: account.address,
|
|
115
|
+
capabilities: {
|
|
116
|
+
paymasterService: {
|
|
117
|
+
policyId: process.env.TEST_PAYMASTER_POLICY_ID,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
const signedCalls = await _client.signPreparedCalls(preparedCalls);
|
|
122
|
+
const result = await _client.sendPreparedCalls(signedCalls);
|
|
123
|
+
expect(result.preparedCallIds).toBeArrayOfSize(1);
|
|
124
|
+
});
|
|
100
125
|
it("should successfully send a UO with paymaster", async () => {
|
|
101
126
|
const account = await client.requestAccount();
|
|
102
|
-
const
|
|
127
|
+
const preparedCalls = await client.prepareCalls({
|
|
103
128
|
calls: [{ to: zeroAddress, value: "0x0" }],
|
|
104
129
|
from: account.address,
|
|
105
130
|
capabilities: {
|
|
@@ -108,11 +133,8 @@ describe("Client E2E Tests", () => {
|
|
|
108
133
|
},
|
|
109
134
|
},
|
|
110
135
|
});
|
|
111
|
-
const
|
|
112
|
-
const result = await client.sendPreparedCalls(
|
|
113
|
-
...preparedCall,
|
|
114
|
-
signature,
|
|
115
|
-
});
|
|
136
|
+
const signedCalls = await client.signPreparedCalls(preparedCalls);
|
|
137
|
+
const result = await client.sendPreparedCalls(signedCalls);
|
|
116
138
|
expect(result.preparedCallIds).toBeArrayOfSize(1);
|
|
117
139
|
});
|
|
118
140
|
it("should successfully create a session with grantPermissions and send a UO", async () => {
|
|
@@ -120,14 +142,20 @@ describe("Client E2E Tests", () => {
|
|
|
120
142
|
const sessionKey = LocalAccountSigner.generatePrivateKeySigner();
|
|
121
143
|
const permissions = await client.grantPermissions({
|
|
122
144
|
account: account.address,
|
|
123
|
-
|
|
145
|
+
expirySec: Math.floor(Date.now() / 1000) + 60 * 60,
|
|
124
146
|
key: {
|
|
125
147
|
publicKey: await sessionKey.getAddress(),
|
|
126
148
|
type: "secp256k1",
|
|
127
149
|
},
|
|
128
150
|
permissions: [{ type: "root" }],
|
|
129
151
|
});
|
|
130
|
-
const
|
|
152
|
+
const sessionKeyClient = createSmartWalletClient({
|
|
153
|
+
transport,
|
|
154
|
+
chain: arbitrumSepolia,
|
|
155
|
+
mode: "local",
|
|
156
|
+
signer: sessionKey,
|
|
157
|
+
});
|
|
158
|
+
const preparedCalls = await sessionKeyClient.prepareCalls({
|
|
131
159
|
calls: [{ to: zeroAddress, value: "0x0" }],
|
|
132
160
|
from: account.address,
|
|
133
161
|
capabilities: {
|
|
@@ -137,10 +165,9 @@ describe("Client E2E Tests", () => {
|
|
|
137
165
|
permissions,
|
|
138
166
|
},
|
|
139
167
|
});
|
|
140
|
-
const
|
|
141
|
-
const result = await
|
|
142
|
-
...
|
|
143
|
-
signature,
|
|
168
|
+
const signedCalls = await sessionKeyClient.signPreparedCalls(preparedCalls);
|
|
169
|
+
const result = await sessionKeyClient.sendPreparedCalls({
|
|
170
|
+
...signedCalls,
|
|
144
171
|
capabilities: {
|
|
145
172
|
permissions,
|
|
146
173
|
},
|
|
@@ -235,7 +262,7 @@ describe("Client E2E Tests", () => {
|
|
|
235
262
|
});
|
|
236
263
|
it("should successfully send a UO with paymaster", async () => {
|
|
237
264
|
const account = await client.requestAccount();
|
|
238
|
-
const
|
|
265
|
+
const preparedCalls = await client.prepareCalls({
|
|
239
266
|
calls: [{ to: zeroAddress, value: "0x0" }],
|
|
240
267
|
from: account.address,
|
|
241
268
|
capabilities: {
|
|
@@ -244,11 +271,35 @@ describe("Client E2E Tests", () => {
|
|
|
244
271
|
},
|
|
245
272
|
},
|
|
246
273
|
});
|
|
247
|
-
const
|
|
248
|
-
const result = await client.sendPreparedCalls(
|
|
249
|
-
|
|
250
|
-
|
|
274
|
+
const signedCalls = await client.signPreparedCalls(preparedCalls);
|
|
275
|
+
const result = await client.sendPreparedCalls(signedCalls);
|
|
276
|
+
expect(result.preparedCallIds).toBeArrayOfSize(1);
|
|
277
|
+
});
|
|
278
|
+
it("should successfully send a UO with paymaster using 7702", async () => {
|
|
279
|
+
const _signer = LocalAccountSigner.privateKeyToAccountSigner("0x00d35c6d307b5cddeb70aeed96ee27a551fee58bf1a43858477e6c11f9172ba8");
|
|
280
|
+
const _client = createSmartWalletClient({
|
|
281
|
+
transport,
|
|
282
|
+
chain: arbitrumSepolia,
|
|
283
|
+
mode: "remote",
|
|
284
|
+
signer: _signer,
|
|
285
|
+
});
|
|
286
|
+
const account = await _client.requestAccount({
|
|
287
|
+
creationHint: {
|
|
288
|
+
accountType: "7702",
|
|
289
|
+
},
|
|
290
|
+
});
|
|
291
|
+
expect(account.address).toBe(await _signer.getAddress());
|
|
292
|
+
const preparedCalls = await _client.prepareCalls({
|
|
293
|
+
calls: [{ to: zeroAddress, value: "0x0" }],
|
|
294
|
+
from: account.address,
|
|
295
|
+
capabilities: {
|
|
296
|
+
paymasterService: {
|
|
297
|
+
policyId: process.env.TEST_PAYMASTER_POLICY_ID,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
251
300
|
});
|
|
301
|
+
const signedCalls = await _client.signPreparedCalls(preparedCalls);
|
|
302
|
+
const result = await _client.sendPreparedCalls(signedCalls);
|
|
252
303
|
expect(result.preparedCallIds).toBeArrayOfSize(1);
|
|
253
304
|
});
|
|
254
305
|
it("should successfully create a session with grantPermissions and send a UO", async () => {
|
|
@@ -256,14 +307,20 @@ describe("Client E2E Tests", () => {
|
|
|
256
307
|
const sessionKey = LocalAccountSigner.generatePrivateKeySigner();
|
|
257
308
|
const permissions = await client.grantPermissions({
|
|
258
309
|
account: account.address,
|
|
259
|
-
|
|
310
|
+
expirySec: Math.floor(Date.now() / 1000) + 60 * 60,
|
|
260
311
|
key: {
|
|
261
312
|
publicKey: await sessionKey.getAddress(),
|
|
262
313
|
type: "secp256k1",
|
|
263
314
|
},
|
|
264
315
|
permissions: [{ type: "root" }],
|
|
265
316
|
});
|
|
266
|
-
const
|
|
317
|
+
const sessionKeyClient = createSmartWalletClient({
|
|
318
|
+
transport,
|
|
319
|
+
chain: arbitrumSepolia,
|
|
320
|
+
mode: "remote",
|
|
321
|
+
signer: sessionKey,
|
|
322
|
+
});
|
|
323
|
+
const preparedCalls = await sessionKeyClient.prepareCalls({
|
|
267
324
|
calls: [{ to: zeroAddress, value: "0x0" }],
|
|
268
325
|
from: account.address,
|
|
269
326
|
capabilities: {
|
|
@@ -273,10 +330,9 @@ describe("Client E2E Tests", () => {
|
|
|
273
330
|
permissions,
|
|
274
331
|
},
|
|
275
332
|
});
|
|
276
|
-
const
|
|
277
|
-
const result = await
|
|
278
|
-
...
|
|
279
|
-
signature,
|
|
333
|
+
const signedCalls = await sessionKeyClient.signPreparedCalls(preparedCalls);
|
|
334
|
+
const result = await sessionKeyClient.sendPreparedCalls({
|
|
335
|
+
...signedCalls,
|
|
280
336
|
capabilities: {
|
|
281
337
|
permissions,
|
|
282
338
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.e2e-test.js","sourceRoot":"","sources":["../../../src/client/client.e2e-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAgB,MAAM,MAAM,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,SAAS,GAAG,OAAO,CACvB,OAAO,CAAC,GAAG,CAAC,qBAAqB;QAC/B,CAAC,CAAC;YACE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;SAC1C;QACH,CAAC,CAAC;YACE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAqB;SAC1C,CACN,CAAC;IACF,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,MAAM,MAAM,GAAG,kBAAkB,CAAC,yBAAyB,CACzD,oEAAoE,CACrE,CAAC;QAEF,MAAM,MAAM,GAAG,uBAAuB,CAAC;YACrC,SAAS;YACT,KAAK,EAAE,eAAe;YACtB,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H,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAC1C,UAAU,EACV,YAAY,CAAC,gBAAgB,CAC9B,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;gBAC5C,GAAG,YAAY;gBACf,SAAS;gBACT,YAAY,EAAE;oBACZ,WAAW;iBACZ;aACF,CAAC,CAAC;YAEH,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG;QACrB,KAAK,EAAE;YACL,MAAM,EAAE;gBACN,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAChC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;aACpC;YACD,IAAI,EAAE;gBACJ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAChC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC9B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;aACrC;SACF;QACD,WAAW,EAAE,MAAe;QAC5B,MAAM,EAAE;YACN,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,CAAC;YACV,iBAAiB,EACf,4CAAuD;SAC1D;QACD,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,4CAA4C;aACrD;YACD,EAAE,EAAE;gBACF,IAAI,EAAE,KAAK;gBACX,MAAM,EAAE,4CAA4C;aACrD;YACD,QAAQ,EAAE,aAAa;SACxB;KACO,CAAC;AACb,CAAC,CAAC,CAAC","sourcesContent":["import { LocalAccountSigner } from \"@aa-sdk/core\";\nimport { alchemy, arbitrumSepolia } from \"@account-kit/infra\";\nimport { describe, expect, it } from \"bun:test\";\nimport { createPublicClient, zeroAddress, type Address } from \"viem\";\nimport { signSignatureRequest } from \"./actions/signSignatureRequest.js\";\nimport { createSmartWalletClient } from \"./index.js\";\n\ndescribe(\"Client E2E Tests\", () => {\n const transport = alchemy(\n process.env.ALCHEMY_PROXY_RPC_URL\n ? {\n rpcUrl: process.env.ALCHEMY_PROXY_RPC_URL,\n }\n : {\n apiKey: process.env.TEST_ALCHEMY_API_KEY!,\n },\n );\n describe(\"Local Mode Tests\", () => {\n const signer = LocalAccountSigner.privateKeyToAccountSigner(\n \"0xbaca22d9b6846ec09a4da378ffa07e2f14ce7d65675d135911b6fd281416bb03\",\n );\n\n const client = createSmartWalletClient({\n transport,\n chain: arbitrumSepolia,\n mode: \"local\",\n signer,\n });\n\n const publicClient = createPublicClient({\n chain: arbitrumSepolia,\n transport,\n });\n\n it(\"should successfully get a counterfactual address\", async () => {\n const account = await client.requestAccount();\n expect(account.address).toMatchInlineSnapshot(\n `\"0xa46944b7a39c35d931D514ACAc3ac77c226a81ff\"`,\n );\n });\n\n it(\"should successfully request account with different salt\", async () => {\n const account = await client.requestAccount({\n id: \"f4c1d956-24ef-4002-a141-2c9d6d92af1a\",\n creationHint: { salt: \"0x1\" },\n });\n\n expect(account.address).toMatchInlineSnapshot(\n `\"0xA692f0E5AfAD20F771443D89C635146C6A592f06\"`,\n );\n });\n\n it(\"should not cache account if different inputs provided\", async () => {\n const account = await client.requestAccount();\n const account2 = await client.requestAccount({\n id: \"52ab44be-b03e-47ed-ad65-43014ea5fbfc\",\n creationHint: { salt: \"0x2\" },\n });\n\n expect(account.address).not.toEqual(account2.address);\n });\n\n it(\"can correctly sign a message\", async () => {\n const account = await client.requestAccount();\n const message = \"hello world\";\n const signature = await client.signMessage({ message });\n const isValid = await publicClient.verifyMessage({\n address: account.address,\n message,\n signature,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign typed data\", async () => {\n const account = await client.requestAccount();\n const signature = await client.signTypedData(givenTypedData);\n const isValid = await publicClient.verifyTypedData({\n ...givenTypedData,\n signature,\n address: account.address,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign a message with a different account\", async () => {\n const account = await client.requestAccount({\n id: \"f4c1d956-24ef-4002-a141-2c9d6d92af1a\",\n creationHint: { salt: \"0x1\" },\n });\n const message = \"hello world\";\n\n const signature = await client.signMessage({\n message,\n account: account.address,\n });\n const isValid = await publicClient.verifyMessage({\n address: account.address,\n message,\n signature,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign typed data with a different account\", async () => {\n const account = await client.requestAccount({\n id: \"f4c1d956-24ef-4002-a141-2c9d6d92af1a\",\n creationHint: { salt: \"0x1\" },\n });\n\n const signature = await client.signTypedData({\n ...givenTypedData,\n account: account.address,\n });\n const isValid = await publicClient.verifyTypedData({\n ...givenTypedData,\n signature,\n address: account.address,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"should successfully send a UO with paymaster\", async () => {\n const account = await client.requestAccount();\n const preparedCall = await client.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n },\n });\n\n const signature = await client.signSignatureRequest(\n preparedCall.signatureRequest,\n );\n\n const result = await client.sendPreparedCalls({\n ...preparedCall,\n signature,\n });\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n\n it(\"should successfully create a session with grantPermissions and send a UO\", async () => {\n const account = await client.requestAccount();\n\n const sessionKey = LocalAccountSigner.generatePrivateKeySigner();\n\n const permissions = await client.grantPermissions({\n account: account.address,\n expiry: Math.floor(Date.now() / 1000) + 60 * 60,\n key: {\n publicKey: await sessionKey.getAddress(),\n type: \"secp256k1\",\n },\n permissions: [{ type: \"root\" }],\n });\n\n const preparedCall = await client.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n permissions,\n },\n });\n\n const signature = await signSignatureRequest(\n sessionKey,\n preparedCall.signatureRequest,\n );\n\n const result = await client.sendPreparedCalls({\n ...preparedCall,\n signature,\n capabilities: {\n permissions,\n },\n });\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n });\n\n describe(\"Remote Mode Tests\", () => {\n const signer = LocalAccountSigner.privateKeyToAccountSigner(\n \"0xd7b061ef04d29cf68b3c89356678eccec9988de8d5ed892c19461c4a9d65925d\",\n );\n\n const client = createSmartWalletClient({\n transport,\n chain: arbitrumSepolia,\n mode: \"remote\",\n signer,\n });\n\n const publicClient = createPublicClient({\n chain: arbitrumSepolia,\n transport,\n });\n\n it(\"should successfully get a counterfactual address\", async () => {\n const account = await client.requestAccount();\n expect(account.address).toMatchInlineSnapshot(\n `\"0x76E765e80FFAC96ac10Aa8908a8267A3B80d606D\"`,\n );\n });\n\n it(\"should successfully request account with different salt\", async () => {\n const account = await client.requestAccount({\n id: \"26b375e3-c94a-4e98-b6b7-5a97121aa583\",\n creationHint: { salt: \"0x1\" },\n });\n\n expect(account.address).toMatchInlineSnapshot(\n `\"0xdfdd407b9569D40BEFa503208753E59cAc9713fA\"`,\n );\n });\n\n it(\"should not cache account if different inputs provided\", async () => {\n const account = await client.requestAccount();\n const account2 = await client.requestAccount({\n id: \"2a3320b4-6ed2-4833-a488-5188e9bdd9d2\",\n creationHint: { salt: \"0x2\" },\n });\n\n expect(account.address).not.toEqual(account2.address);\n });\n\n it(\"can correctly sign a message\", async () => {\n const account = await client.requestAccount();\n const message = \"hello world\";\n const signature = await client.signMessage({ message });\n const isValid = await publicClient.verifyMessage({\n address: account.address,\n message: \"hello world\",\n signature,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign typed data\", async () => {\n const account = await client.requestAccount();\n const signature = await client.signTypedData(givenTypedData);\n const isValid = await publicClient.verifyTypedData({\n ...givenTypedData,\n signature,\n address: account.address,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign a message with a different account\", async () => {\n const account = await client.requestAccount({\n id: \"26b375e3-c94a-4e98-b6b7-5a97121aa583\",\n creationHint: { salt: \"0x1\" },\n });\n\n const message = \"hello world\";\n const signature = await client.signMessage({\n message,\n account: account.address,\n });\n const isValid = await publicClient.verifyMessage({\n address: account.address,\n message: \"hello world\",\n signature,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign typed data with a different account\", async () => {\n const account = await client.requestAccount({\n id: \"26b375e3-c94a-4e98-b6b7-5a97121aa583\",\n creationHint: { salt: \"0x1\" },\n });\n\n const signature = await client.signTypedData({\n ...givenTypedData,\n account: account.address,\n });\n\n const isValid = await publicClient.verifyTypedData({\n ...givenTypedData,\n signature,\n address: account.address,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"should successfully send a UO with paymaster\", async () => {\n const account = await client.requestAccount();\n const preparedCall = await client.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n },\n });\n\n const signature = await client.signSignatureRequest(\n preparedCall.signatureRequest,\n );\n\n const result = await client.sendPreparedCalls({\n ...preparedCall,\n signature,\n });\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n\n it(\"should successfully create a session with grantPermissions and send a UO\", async () => {\n const account = await client.requestAccount();\n\n const sessionKey = LocalAccountSigner.generatePrivateKeySigner();\n\n const permissions = await client.grantPermissions({\n account: account.address,\n expiry: Math.floor(Date.now() / 1000) + 60 * 60,\n key: {\n publicKey: await sessionKey.getAddress(),\n type: \"secp256k1\",\n },\n permissions: [{ type: \"root\" }],\n });\n\n const preparedCall = await client.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n permissions,\n },\n });\n\n const signature = await signSignatureRequest(\n sessionKey,\n preparedCall.signatureRequest,\n );\n\n const result = await client.sendPreparedCalls({\n ...preparedCall,\n signature,\n capabilities: {\n permissions,\n },\n });\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n });\n\n const givenTypedData = {\n types: {\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallet\", type: \"address\" },\n ],\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person\" },\n { name: \"contents\", type: \"string\" },\n ],\n },\n primaryType: \"Mail\" as const,\n domain: {\n name: \"Ether Mail\",\n version: \"1\",\n chainId: 1,\n verifyingContract:\n \"0xbbc68f94D29d52EE8D4994E54d6ED0fEAeb99C2c\" as Address,\n },\n message: {\n from: {\n name: \"Alice\",\n wallet: \"0xFC24e57486116026740634F629ffC4E5C95A6893\",\n },\n to: {\n name: \"Bob\",\n wallet: \"0xe7a26f006EAA562308C5df235C02BFB9a5849177\",\n },\n contents: \"Hello, Bob!\",\n },\n } as const;\n});\n"]}
|
|
1
|
+
{"version":3,"file":"client.e2e-test.js","sourceRoot":"","sources":["../../../src/client/client.e2e-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAgB,MAAM,MAAM,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,SAAS,GAAG,OAAO,CACvB,OAAO,CAAC,GAAG,CAAC,qBAAqB;QAC/B,CAAC,CAAC;YACE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;SAC1C;QACH,CAAC,CAAC;YACE,MAAM,EAAE,OAAO,CAAC,G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CAAC,aAAa,CAAC,CAAC;YAE1D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,iBAAiB,CAAC;gBACtD,GAAG,WAAW;gBACd,YAAY,EAAE;oBACZ,WAAW;iBACZ;aACF,CAAC,CAAC;YAEH,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG;QACrB,KAAK,EAAE;YACL,MAAM,EAAE;gBACN,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAChC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;aACpC;YACD,IAAI,EAAE;gBACJ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAChC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC9B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;aACrC;SACF;QACD,WAAW,EAAE,MAAe;QAC5B,MAAM,EAAE;YACN,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,CAAC;YACV,iBAAiB,EACf,4CAAuD;SAC1D;QACD,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,4CAA4C;aACrD;YACD,EAAE,EAAE;gBACF,IAAI,EAAE,KAAK;gBACX,MAAM,EAAE,4CAA4C;aACrD;YACD,QAAQ,EAAE,aAAa;SACxB;KACO,CAAC;AACb,CAAC,CAAC,CAAC","sourcesContent":["import { LocalAccountSigner } from \"@aa-sdk/core\";\nimport { alchemy, arbitrumSepolia } from \"@account-kit/infra\";\nimport { describe, expect, it } from \"bun:test\";\nimport { createPublicClient, zeroAddress, type Address } from \"viem\";\nimport { createSmartWalletClient } from \"./index.js\";\n\ndescribe(\"Client E2E Tests\", () => {\n const transport = alchemy(\n process.env.ALCHEMY_PROXY_RPC_URL\n ? {\n rpcUrl: process.env.ALCHEMY_PROXY_RPC_URL,\n }\n : {\n apiKey: process.env.TEST_ALCHEMY_API_KEY!,\n },\n );\n describe(\"Local Mode Tests\", () => {\n const signer = LocalAccountSigner.privateKeyToAccountSigner(\n \"0xbaca22d9b6846ec09a4da378ffa07e2f14ce7d65675d135911b6fd281416bb03\",\n );\n\n const client = createSmartWalletClient({\n transport,\n chain: arbitrumSepolia,\n mode: \"local\",\n signer,\n });\n\n const publicClient = createPublicClient({\n chain: arbitrumSepolia,\n transport,\n });\n\n it(\"should successfully get a counterfactual address\", async () => {\n const account = await client.requestAccount();\n expect(account.address).toMatchInlineSnapshot(\n `\"0xa46944b7a39c35d931D514ACAc3ac77c226a81ff\"`,\n );\n });\n\n it(\"should successfully request account with different salt\", async () => {\n const account = await client.requestAccount({\n id: \"f4c1d956-24ef-4002-a141-2c9d6d92af1a\",\n creationHint: { salt: \"0x1\" },\n });\n\n expect(account.address).toMatchInlineSnapshot(\n `\"0xA692f0E5AfAD20F771443D89C635146C6A592f06\"`,\n );\n });\n\n it(\"should not cache account if different inputs provided\", async () => {\n const account = await client.requestAccount();\n const account2 = await client.requestAccount({\n id: \"52ab44be-b03e-47ed-ad65-43014ea5fbfc\",\n creationHint: { salt: \"0x2\" },\n });\n\n expect(account.address).not.toEqual(account2.address);\n });\n\n it(\"can correctly sign a message\", async () => {\n const account = await client.requestAccount();\n const message = \"hello world\";\n const signature = await client.signMessage({ message });\n const isValid = await publicClient.verifyMessage({\n address: account.address,\n message,\n signature,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign typed data\", async () => {\n const account = await client.requestAccount();\n const signature = await client.signTypedData(givenTypedData);\n const isValid = await publicClient.verifyTypedData({\n ...givenTypedData,\n signature,\n address: account.address,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign a message with a different account\", async () => {\n const account = await client.requestAccount({\n id: \"f4c1d956-24ef-4002-a141-2c9d6d92af1a\",\n creationHint: { salt: \"0x1\" },\n });\n const message = \"hello world\";\n\n const signature = await client.signMessage({\n message,\n account: account.address,\n });\n const isValid = await publicClient.verifyMessage({\n address: account.address,\n message,\n signature,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign typed data with a different account\", async () => {\n const account = await client.requestAccount({\n id: \"f4c1d956-24ef-4002-a141-2c9d6d92af1a\",\n creationHint: { salt: \"0x1\" },\n });\n\n const signature = await client.signTypedData({\n ...givenTypedData,\n account: account.address,\n });\n const isValid = await publicClient.verifyTypedData({\n ...givenTypedData,\n signature,\n address: account.address,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"should successfully send a UO with paymaster using 7702\", async () => {\n const _signer = LocalAccountSigner.privateKeyToAccountSigner(\n \"0x49daf21e92c997093e9ffdf7e7ddbf8970e9eadc5d4847d0f690db25d5128e1f\",\n );\n\n const _client = createSmartWalletClient({\n transport,\n chain: arbitrumSepolia,\n mode: \"local\",\n signer: _signer,\n });\n\n const account = await _client.requestAccount({\n creationHint: {\n accountType: \"7702\",\n },\n });\n\n const preparedCalls = await _client.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n },\n });\n\n const signedCalls = await _client.signPreparedCalls(preparedCalls);\n\n const result = await _client.sendPreparedCalls(signedCalls);\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n\n it(\"should successfully send a UO with paymaster\", async () => {\n const account = await client.requestAccount();\n const preparedCalls = await client.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n },\n });\n\n const signedCalls = await client.signPreparedCalls(preparedCalls);\n\n const result = await client.sendPreparedCalls(signedCalls);\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n\n it(\"should successfully create a session with grantPermissions and send a UO\", async () => {\n const account = await client.requestAccount();\n\n const sessionKey = LocalAccountSigner.generatePrivateKeySigner();\n\n const permissions = await client.grantPermissions({\n account: account.address,\n expirySec: Math.floor(Date.now() / 1000) + 60 * 60,\n key: {\n publicKey: await sessionKey.getAddress(),\n type: \"secp256k1\",\n },\n permissions: [{ type: \"root\" }],\n });\n\n const sessionKeyClient = createSmartWalletClient({\n transport,\n chain: arbitrumSepolia,\n mode: \"local\",\n signer: sessionKey,\n });\n\n const preparedCalls = await sessionKeyClient.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n permissions,\n },\n });\n\n const signedCalls =\n await sessionKeyClient.signPreparedCalls(preparedCalls);\n\n const result = await sessionKeyClient.sendPreparedCalls({\n ...signedCalls,\n capabilities: {\n permissions,\n },\n });\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n });\n\n describe(\"Remote Mode Tests\", () => {\n const signer = LocalAccountSigner.privateKeyToAccountSigner(\n \"0xd7b061ef04d29cf68b3c89356678eccec9988de8d5ed892c19461c4a9d65925d\",\n );\n\n const client = createSmartWalletClient({\n transport,\n chain: arbitrumSepolia,\n mode: \"remote\",\n signer,\n });\n\n const publicClient = createPublicClient({\n chain: arbitrumSepolia,\n transport,\n });\n\n it(\"should successfully get a counterfactual address\", async () => {\n const account = await client.requestAccount();\n expect(account.address).toMatchInlineSnapshot(\n `\"0x76E765e80FFAC96ac10Aa8908a8267A3B80d606D\"`,\n );\n });\n\n it(\"should successfully request account with different salt\", async () => {\n const account = await client.requestAccount({\n id: \"26b375e3-c94a-4e98-b6b7-5a97121aa583\",\n creationHint: { salt: \"0x1\" },\n });\n\n expect(account.address).toMatchInlineSnapshot(\n `\"0xdfdd407b9569D40BEFa503208753E59cAc9713fA\"`,\n );\n });\n\n it(\"should not cache account if different inputs provided\", async () => {\n const account = await client.requestAccount();\n const account2 = await client.requestAccount({\n id: \"2a3320b4-6ed2-4833-a488-5188e9bdd9d2\",\n creationHint: { salt: \"0x2\" },\n });\n\n expect(account.address).not.toEqual(account2.address);\n });\n\n it(\"can correctly sign a message\", async () => {\n const account = await client.requestAccount();\n const message = \"hello world\";\n const signature = await client.signMessage({ message });\n const isValid = await publicClient.verifyMessage({\n address: account.address,\n message: \"hello world\",\n signature,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign typed data\", async () => {\n const account = await client.requestAccount();\n const signature = await client.signTypedData(givenTypedData);\n const isValid = await publicClient.verifyTypedData({\n ...givenTypedData,\n signature,\n address: account.address,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign a message with a different account\", async () => {\n const account = await client.requestAccount({\n id: \"26b375e3-c94a-4e98-b6b7-5a97121aa583\",\n creationHint: { salt: \"0x1\" },\n });\n\n const message = \"hello world\";\n const signature = await client.signMessage({\n message,\n account: account.address,\n });\n const isValid = await publicClient.verifyMessage({\n address: account.address,\n message: \"hello world\",\n signature,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"can correctly sign typed data with a different account\", async () => {\n const account = await client.requestAccount({\n id: \"26b375e3-c94a-4e98-b6b7-5a97121aa583\",\n creationHint: { salt: \"0x1\" },\n });\n\n const signature = await client.signTypedData({\n ...givenTypedData,\n account: account.address,\n });\n\n const isValid = await publicClient.verifyTypedData({\n ...givenTypedData,\n signature,\n address: account.address,\n });\n expect(isValid).toBeTrue();\n });\n\n it(\"should successfully send a UO with paymaster\", async () => {\n const account = await client.requestAccount();\n const preparedCalls = await client.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n },\n });\n\n const signedCalls = await client.signPreparedCalls(preparedCalls);\n\n const result = await client.sendPreparedCalls(signedCalls);\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n\n it(\"should successfully send a UO with paymaster using 7702\", async () => {\n const _signer = LocalAccountSigner.privateKeyToAccountSigner(\n \"0x00d35c6d307b5cddeb70aeed96ee27a551fee58bf1a43858477e6c11f9172ba8\",\n );\n\n const _client = createSmartWalletClient({\n transport,\n chain: arbitrumSepolia,\n mode: \"remote\",\n signer: _signer,\n });\n\n const account = await _client.requestAccount({\n creationHint: {\n accountType: \"7702\",\n },\n });\n expect(account.address).toBe(await _signer.getAddress());\n\n const preparedCalls = await _client.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n },\n });\n\n const signedCalls = await _client.signPreparedCalls(preparedCalls);\n\n const result = await _client.sendPreparedCalls(signedCalls);\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n\n it(\"should successfully create a session with grantPermissions and send a UO\", async () => {\n const account = await client.requestAccount();\n\n const sessionKey = LocalAccountSigner.generatePrivateKeySigner();\n\n const permissions = await client.grantPermissions({\n account: account.address,\n expirySec: Math.floor(Date.now() / 1000) + 60 * 60,\n key: {\n publicKey: await sessionKey.getAddress(),\n type: \"secp256k1\",\n },\n permissions: [{ type: \"root\" }],\n });\n\n const sessionKeyClient = createSmartWalletClient({\n transport,\n chain: arbitrumSepolia,\n mode: \"remote\",\n signer: sessionKey,\n });\n\n const preparedCalls = await sessionKeyClient.prepareCalls({\n calls: [{ to: zeroAddress, value: \"0x0\" }],\n from: account.address,\n capabilities: {\n paymasterService: {\n policyId: process.env.TEST_PAYMASTER_POLICY_ID!,\n },\n permissions,\n },\n });\n\n const signedCalls =\n await sessionKeyClient.signPreparedCalls(preparedCalls);\n\n const result = await sessionKeyClient.sendPreparedCalls({\n ...signedCalls,\n capabilities: {\n permissions,\n },\n });\n\n expect(result.preparedCallIds).toBeArrayOfSize(1);\n });\n });\n\n const givenTypedData = {\n types: {\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallet\", type: \"address\" },\n ],\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person\" },\n { name: \"contents\", type: \"string\" },\n ],\n },\n primaryType: \"Mail\" as const,\n domain: {\n name: \"Ether Mail\",\n version: \"1\",\n chainId: 1,\n verifyingContract:\n \"0xbbc68f94D29d52EE8D4994E54d6ED0fEAeb99C2c\" as Address,\n },\n message: {\n from: {\n name: \"Alice\",\n wallet: \"0xFC24e57486116026740634F629ffC4E5C95A6893\",\n },\n to: {\n name: \"Bob\",\n wallet: \"0xe7a26f006EAA562308C5df235C02BFB9a5849177\",\n },\n contents: \"Hello, Bob!\",\n },\n } as const;\n});\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
2
|
import type { Address, Hex } from "viem";
|
|
3
|
-
import type { SendPreparedCallsParams, SendPreparedCallsResult } from "../isomorphic/actions/sendPreparedCalls.ts";
|
|
4
3
|
import type { InnerWalletApiClient } from "../types.ts";
|
|
5
4
|
import { type CreateAccountParams, type CreateAccountResult } from "./actions/createAccount.js";
|
|
6
5
|
import { type GetCallsStatusParams, type GetCallsStatusResult } from "./actions/getCallsStatus.js";
|
|
@@ -8,9 +7,11 @@ import { type GrantPermissionsParams, type GrantPermissionsResult } from "./acti
|
|
|
8
7
|
import { type ListAccountsParams, type ListAccountsResult } from "./actions/listAccounts.js";
|
|
9
8
|
import { type PrepareCallsParams, type PrepareCallsResult } from "./actions/prepareCalls.js";
|
|
10
9
|
import { type RequestAccountParams, type RequestAccountResult } from "./actions/requestAccount.js";
|
|
10
|
+
import { type SendPreparedCallsParams, type SendPreparedCallsResult } from "./actions/sendPreparedCalls.js";
|
|
11
11
|
import { type SignMessageParams } from "./actions/signMessage.js";
|
|
12
12
|
import { type SignSignatureRequestParams, type SignSignatureRequestResult } from "./actions/signSignatureRequest.js";
|
|
13
13
|
import { type SignTypedDataParams } from "./actions/signTypedData.js";
|
|
14
|
+
import { type SignPreparedCallsParams, type SignPreparedCallsResult } from "./actions/signPreparedCalls.js";
|
|
14
15
|
export type SmartWalletActions<TAccount extends Address | undefined = Address | undefined> = {
|
|
15
16
|
requestAccount: (params?: RequestAccountParams) => Promise<RequestAccountResult>;
|
|
16
17
|
prepareCalls: (params: PrepareCallsParams<TAccount>) => Promise<PrepareCallsResult>;
|
|
@@ -19,6 +20,7 @@ export type SmartWalletActions<TAccount extends Address | undefined = Address |
|
|
|
19
20
|
listAccounts: (params: ListAccountsParams) => Promise<ListAccountsResult>;
|
|
20
21
|
getCallsStatus: (params: GetCallsStatusParams) => Promise<GetCallsStatusResult>;
|
|
21
22
|
signSignatureRequest: (params: SignSignatureRequestParams) => Promise<SignSignatureRequestResult>;
|
|
23
|
+
signPreparedCalls: (params: SignPreparedCallsParams) => Promise<SignPreparedCallsResult>;
|
|
22
24
|
signMessage: (params: SignMessageParams) => Promise<Hex>;
|
|
23
25
|
signTypedData: (params: SignTypedDataParams) => Promise<Hex>;
|
|
24
26
|
grantPermissions: (params: GrantPermissionsParams<TAccount>) => Promise<GrantPermissionsResult>;
|
|
@@ -4,10 +4,11 @@ import { grantPermissions, } from "./actions/grantPermissions.js";
|
|
|
4
4
|
import { listAccounts, } from "./actions/listAccounts.js";
|
|
5
5
|
import { prepareCalls, } from "./actions/prepareCalls.js";
|
|
6
6
|
import { requestAccount, } from "./actions/requestAccount.js";
|
|
7
|
-
import { sendPreparedCalls } from "./actions/sendPreparedCalls.js";
|
|
7
|
+
import { sendPreparedCalls, } from "./actions/sendPreparedCalls.js";
|
|
8
8
|
import { signMessage } from "./actions/signMessage.js";
|
|
9
9
|
import { signSignatureRequest, } from "./actions/signSignatureRequest.js";
|
|
10
10
|
import { signTypedData, } from "./actions/signTypedData.js";
|
|
11
|
+
import { signPreparedCalls, } from "./actions/signPreparedCalls.js";
|
|
11
12
|
export function smartWalletClientActions(client, signer) {
|
|
12
13
|
return {
|
|
13
14
|
requestAccount: (params) => requestAccount(client, signer, params),
|
|
@@ -17,6 +18,7 @@ export function smartWalletClientActions(client, signer) {
|
|
|
17
18
|
sendPreparedCalls: (params) => sendPreparedCalls(client, params),
|
|
18
19
|
getCallsStatus: (params) => getCallsStatus(client, params),
|
|
19
20
|
signSignatureRequest: (params) => signSignatureRequest(signer, params),
|
|
21
|
+
signPreparedCalls: (params) => signPreparedCalls(signer, params),
|
|
20
22
|
signMessage: (params) => signMessage(client, signer, params),
|
|
21
23
|
signTypedData: (params) => signTypedData(client, signer, params),
|
|
22
24
|
grantPermissions: (params) => grantPermissions(client, signer, params),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/client/decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/client/decorator.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,GAGd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,GAGf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,gBAAgB,GAGjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,YAAY,GAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,YAAY,GAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,cAAc,GAGf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,GAGlB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EACL,oBAAoB,GAGrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,aAAa,GAEd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iBAAiB,GAGlB,MAAM,gCAAgC,CAAC;AAgCxC,MAAM,UAAU,wBAAwB,CAGtC,MAA4B,EAC5B,MAA0B;IAE1B,OAAO;QACL,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAClE,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAChE,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;QACtD,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;QACtD,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC;QAChE,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC;QAC1D,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC;QACtE,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC;QAChE,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAC5D,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAChE,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KACvE,CAAC;AACJ,CAAC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { Address, Hex } from \"viem\";\nimport type { InnerWalletApiClient } from \"../types.ts\";\nimport {\n createAccount,\n type CreateAccountParams,\n type CreateAccountResult,\n} from \"./actions/createAccount.js\";\nimport {\n getCallsStatus,\n type GetCallsStatusParams,\n type GetCallsStatusResult,\n} from \"./actions/getCallsStatus.js\";\nimport {\n grantPermissions,\n type GrantPermissionsParams,\n type GrantPermissionsResult,\n} from \"./actions/grantPermissions.js\";\nimport {\n listAccounts,\n type ListAccountsParams,\n type ListAccountsResult,\n} from \"./actions/listAccounts.js\";\nimport {\n prepareCalls,\n type PrepareCallsParams,\n type PrepareCallsResult,\n} from \"./actions/prepareCalls.js\";\nimport {\n requestAccount,\n type RequestAccountParams,\n type RequestAccountResult,\n} from \"./actions/requestAccount.js\";\nimport {\n sendPreparedCalls,\n type SendPreparedCallsParams,\n type SendPreparedCallsResult,\n} from \"./actions/sendPreparedCalls.js\";\nimport { signMessage, type SignMessageParams } from \"./actions/signMessage.js\";\nimport {\n signSignatureRequest,\n type SignSignatureRequestParams,\n type SignSignatureRequestResult,\n} from \"./actions/signSignatureRequest.js\";\nimport {\n signTypedData,\n type SignTypedDataParams,\n} from \"./actions/signTypedData.js\";\nimport {\n signPreparedCalls,\n type SignPreparedCallsParams,\n type SignPreparedCallsResult,\n} from \"./actions/signPreparedCalls.js\";\n\nexport type SmartWalletActions<\n TAccount extends Address | undefined = Address | undefined,\n> = {\n requestAccount: (\n params?: RequestAccountParams,\n ) => Promise<RequestAccountResult>;\n prepareCalls: (\n params: PrepareCallsParams<TAccount>,\n ) => Promise<PrepareCallsResult>;\n sendPreparedCalls: (\n params: SendPreparedCallsParams,\n ) => Promise<SendPreparedCallsResult>;\n createAccount: (params: CreateAccountParams) => Promise<CreateAccountResult>;\n listAccounts: (params: ListAccountsParams) => Promise<ListAccountsResult>;\n getCallsStatus: (\n params: GetCallsStatusParams,\n ) => Promise<GetCallsStatusResult>;\n signSignatureRequest: (\n params: SignSignatureRequestParams,\n ) => Promise<SignSignatureRequestResult>;\n signPreparedCalls: (\n params: SignPreparedCallsParams,\n ) => Promise<SignPreparedCallsResult>;\n signMessage: (params: SignMessageParams) => Promise<Hex>;\n signTypedData: (params: SignTypedDataParams) => Promise<Hex>;\n grantPermissions: (\n params: GrantPermissionsParams<TAccount>,\n ) => Promise<GrantPermissionsResult>;\n};\n\nexport function smartWalletClientActions<\n TAccount extends Address | undefined = Address | undefined,\n>(\n client: InnerWalletApiClient,\n signer: SmartAccountSigner,\n): SmartWalletActions<TAccount> {\n return {\n requestAccount: (params) => requestAccount(client, signer, params),\n createAccount: (params) => createAccount(client, signer, params),\n prepareCalls: (params) => prepareCalls(client, params),\n listAccounts: (params) => listAccounts(client, params),\n sendPreparedCalls: (params) => sendPreparedCalls(client, params),\n getCallsStatus: (params) => getCallsStatus(client, params),\n signSignatureRequest: (params) => signSignatureRequest(signer, params),\n signPreparedCalls: (params) => signPreparedCalls(signer, params),\n signMessage: (params) => signMessage(client, signer, params),\n signTypedData: (params) => signTypedData(client, signer, params),\n grantPermissions: (params) => grantPermissions(client, signer, params),\n };\n}\n"]}
|
|
@@ -9,6 +9,7 @@ export { grantPermissions } from "../client/actions/grantPermissions.js";
|
|
|
9
9
|
export { listAccounts } from "../client/actions/listAccounts.js";
|
|
10
10
|
export { prepareCalls } from "../client/actions/prepareCalls.js";
|
|
11
11
|
export { requestAccount } from "../client/actions/requestAccount.js";
|
|
12
|
-
export { signMessage } from "../client/actions/signMessage.js";
|
|
13
12
|
export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
|
|
13
|
+
export { signPreparedCalls } from "../client/actions/signPreparedCalls.js";
|
|
14
|
+
export { signMessage } from "../client/actions/signMessage.js";
|
|
14
15
|
export { signTypedData } from "../client/actions/signTypedData.js";
|
|
@@ -13,7 +13,8 @@ export { grantPermissions } from "../client/actions/grantPermissions.js";
|
|
|
13
13
|
export { listAccounts } from "../client/actions/listAccounts.js";
|
|
14
14
|
export { prepareCalls } from "../client/actions/prepareCalls.js";
|
|
15
15
|
export { requestAccount } from "../client/actions/requestAccount.js";
|
|
16
|
-
export { signMessage } from "../client/actions/signMessage.js";
|
|
17
16
|
export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
|
|
17
|
+
export { signPreparedCalls } from "../client/actions/signPreparedCalls.js";
|
|
18
|
+
export { signMessage } from "../client/actions/signMessage.js";
|
|
18
19
|
export { signTypedData } from "../client/actions/signTypedData.js";
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,yDAAyD;AACzD,OAAO,EACL,uBAAuB,GAGxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,GAGtB,MAAM,kBAAkB,CAAC;AAE1B,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,iBAAiB;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,yDAAyD;AACzD,OAAO,EACL,uBAAuB,GAGxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,GAGtB,MAAM,kBAAkB,CAAC;AAE1B,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,iBAAiB;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["// TODO: anything that we want to expose publicly should be exported from `index.ts` files in the subdirectories\n// and we shouldn't export * for the sake of tree-shaking\nexport {\n createSmartWalletClient,\n type SmartWalletClient,\n type SmartWalletClientParams,\n} from \"../client/index.js\";\n\nexport {\n WalletServerRpcSchema,\n type WalletServerRpcSchemaType,\n type WalletServerViemRpcSchema,\n} from \"../rpc/schema.js\";\n\n// capabilities: TODO: should these actually just have the types exported?\nexport { Capabilities } from \"../capabilities/index.js\";\nexport { PaymasterCapability } from \"../capabilities/paymaster.js\";\nexport {\n PermissionsArray,\n PermissionsCapability,\n PermissionsContext,\n PermissionsData,\n} from \"../capabilities/permissions/index.js\";\n\n// client actions\nexport { createAccount } from \"../client/actions/createAccount.js\";\nexport { getCallsStatus } from \"../client/actions/getCallsStatus.js\";\nexport { grantPermissions } from \"../client/actions/grantPermissions.js\";\nexport { listAccounts } from \"../client/actions/listAccounts.js\";\nexport { prepareCalls } from \"../client/actions/prepareCalls.js\";\nexport { requestAccount } from \"../client/actions/requestAccount.js\";\nexport { signSignatureRequest } from \"../client/actions/signSignatureRequest.js\";\nexport { signPreparedCalls } from \"../client/actions/signPreparedCalls.js\";\nexport { signMessage } from \"../client/actions/signMessage.js\";\nexport { signTypedData } from \"../client/actions/signTypedData.js\";\n"]}
|