@account-kit/wallet-client 0.1.0-alpha.10 → 0.1.0-alpha.12
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/client/actions/getCallsStatus.d.ts +4 -3
- package/dist/esm/client/actions/getCallsStatus.js +1 -0
- package/dist/esm/client/actions/getCallsStatus.js.map +1 -1
- package/dist/esm/client/actions/grantPermissions.d.ts +5 -4
- package/dist/esm/client/actions/grantPermissions.js +21 -5
- package/dist/esm/client/actions/grantPermissions.js.map +1 -1
- package/dist/esm/client/actions/prepareCalls.d.ts +4 -3
- package/dist/esm/client/actions/prepareCalls.js +1 -0
- package/dist/esm/client/actions/prepareCalls.js.map +1 -1
- package/dist/esm/client/actions/prepareSign.d.ts +4 -3
- package/dist/esm/client/actions/prepareSign.js +1 -0
- package/dist/esm/client/actions/prepareSign.js.map +1 -1
- package/dist/esm/client/actions/requestAccount.js +3 -3
- package/dist/esm/client/actions/requestAccount.js.map +1 -1
- package/dist/esm/client/actions/signSignatureRequest.d.ts +3 -3
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/client/client.e2e-test.js +190 -329
- package/dist/esm/client/client.e2e-test.js.map +1 -1
- package/dist/esm/client/index.d.ts +1 -4
- package/dist/esm/client/index.js +13 -18
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/{isomorphic/utils/createAccount.d.ts → internal/account.d.ts} +3 -7
- package/dist/esm/{isomorphic/utils/createAccount.js → internal/account.js} +9 -33
- package/dist/esm/internal/account.js.map +1 -0
- package/dist/esm/types.d.ts +2 -8
- package/dist/esm/types.js.map +1 -1
- package/dist/types/client/actions/getCallsStatus.d.ts +4 -3
- package/dist/types/client/actions/getCallsStatus.d.ts.map +1 -1
- package/dist/types/client/actions/grantPermissions.d.ts +5 -4
- package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
- package/dist/types/client/actions/prepareCalls.d.ts +4 -3
- package/dist/types/client/actions/prepareCalls.d.ts.map +1 -1
- package/dist/types/client/actions/prepareSign.d.ts +4 -3
- package/dist/types/client/actions/prepareSign.d.ts.map +1 -1
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts +3 -3
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +1 -4
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/{isomorphic/utils/createAccount.d.ts → internal/account.d.ts} +4 -8
- package/dist/types/internal/account.d.ts.map +1 -0
- package/dist/types/types.d.ts +2 -8
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +3 -8
- package/src/client/actions/getCallsStatus.ts +8 -6
- package/src/client/actions/grantPermissions.ts +41 -10
- package/src/client/actions/prepareCalls.ts +11 -6
- package/src/client/actions/prepareSign.ts +9 -6
- package/src/client/actions/requestAccount.ts +3 -3
- package/src/client/actions/signSignatureRequest.ts +8 -8
- package/src/client/client.e2e-test.ts +143 -298
- package/src/client/index.ts +22 -23
- package/src/{isomorphic/utils/createAccount.ts → internal/account.ts} +11 -51
- package/src/types.ts +4 -15
- package/dist/esm/exports/internal.d.ts +0 -4
- package/dist/esm/exports/internal.js +0 -3
- package/dist/esm/exports/internal.js.map +0 -1
- package/dist/esm/isomorphic/actions/createSession.d.ts +0 -13
- package/dist/esm/isomorphic/actions/createSession.js +0 -94
- package/dist/esm/isomorphic/actions/createSession.js.map +0 -1
- package/dist/esm/isomorphic/actions/formatSign.d.ts +0 -8
- package/dist/esm/isomorphic/actions/formatSign.js +0 -42
- package/dist/esm/isomorphic/actions/formatSign.js.map +0 -1
- package/dist/esm/isomorphic/actions/getCallsStatus.d.ts +0 -7
- package/dist/esm/isomorphic/actions/getCallsStatus.js +0 -71
- package/dist/esm/isomorphic/actions/getCallsStatus.js.map +0 -1
- package/dist/esm/isomorphic/actions/prepareCalls.d.ts +0 -7
- package/dist/esm/isomorphic/actions/prepareCalls.js +0 -116
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +0 -1
- package/dist/esm/isomorphic/actions/prepareSign.d.ts +0 -7
- package/dist/esm/isomorphic/actions/prepareSign.js +0 -49
- package/dist/esm/isomorphic/actions/prepareSign.js.map +0 -1
- package/dist/esm/isomorphic/actions/sendPreparedCalls.d.ts +0 -7
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +0 -156
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +0 -1
- package/dist/esm/isomorphic/client.d.ts +0 -275
- package/dist/esm/isomorphic/client.js +0 -41
- package/dist/esm/isomorphic/client.js.map +0 -1
- package/dist/esm/isomorphic/utils/7702.d.ts +0 -19
- package/dist/esm/isomorphic/utils/7702.js +0 -70
- package/dist/esm/isomorphic/utils/7702.js.map +0 -1
- package/dist/esm/isomorphic/utils/createAccount.js.map +0 -1
- package/dist/esm/isomorphic/utils/createDummySigner.d.ts +0 -3
- package/dist/esm/isomorphic/utils/createDummySigner.js +0 -17
- package/dist/esm/isomorphic/utils/createDummySigner.js.map +0 -1
- package/dist/esm/isomorphic/utils/decodeSignature.d.ts +0 -3
- package/dist/esm/isomorphic/utils/decodeSignature.js +0 -15
- package/dist/esm/isomorphic/utils/decodeSignature.js.map +0 -1
- package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +0 -21
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js +0 -34
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +0 -1
- package/dist/esm/isomorphic/utils/supportsFeature.d.ts +0 -4
- package/dist/esm/isomorphic/utils/supportsFeature.js +0 -21
- package/dist/esm/isomorphic/utils/supportsFeature.js.map +0 -1
- package/dist/esm/local/client.d.ts +0 -3
- package/dist/esm/local/client.js +0 -97
- package/dist/esm/local/client.js.map +0 -1
- package/dist/esm/remote/client.d.ts +0 -9
- package/dist/esm/remote/client.js +0 -41
- package/dist/esm/remote/client.js.map +0 -1
- package/dist/types/exports/internal.d.ts +0 -5
- package/dist/types/exports/internal.d.ts.map +0 -1
- package/dist/types/isomorphic/actions/createSession.d.ts +0 -14
- package/dist/types/isomorphic/actions/createSession.d.ts.map +0 -1
- package/dist/types/isomorphic/actions/formatSign.d.ts +0 -9
- package/dist/types/isomorphic/actions/formatSign.d.ts.map +0 -1
- package/dist/types/isomorphic/actions/getCallsStatus.d.ts +0 -8
- package/dist/types/isomorphic/actions/getCallsStatus.d.ts.map +0 -1
- package/dist/types/isomorphic/actions/prepareCalls.d.ts +0 -8
- package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +0 -1
- package/dist/types/isomorphic/actions/prepareSign.d.ts +0 -8
- package/dist/types/isomorphic/actions/prepareSign.d.ts.map +0 -1
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts +0 -8
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +0 -1
- package/dist/types/isomorphic/client.d.ts +0 -276
- package/dist/types/isomorphic/client.d.ts.map +0 -1
- package/dist/types/isomorphic/utils/7702.d.ts +0 -20
- package/dist/types/isomorphic/utils/7702.d.ts.map +0 -1
- package/dist/types/isomorphic/utils/createAccount.d.ts.map +0 -1
- package/dist/types/isomorphic/utils/createDummySigner.d.ts +0 -4
- package/dist/types/isomorphic/utils/createDummySigner.d.ts.map +0 -1
- package/dist/types/isomorphic/utils/decodeSignature.d.ts +0 -4
- package/dist/types/isomorphic/utils/decodeSignature.d.ts.map +0 -1
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +0 -22
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +0 -1
- package/dist/types/isomorphic/utils/supportsFeature.d.ts +0 -5
- package/dist/types/isomorphic/utils/supportsFeature.d.ts.map +0 -1
- package/dist/types/local/client.d.ts +0 -4
- package/dist/types/local/client.d.ts.map +0 -1
- package/dist/types/remote/client.d.ts +0 -10
- package/dist/types/remote/client.d.ts.map +0 -1
- package/src/exports/internal.ts +0 -8
- package/src/isomorphic/actions/createSession.ts +0 -163
- package/src/isomorphic/actions/formatSign.ts +0 -76
- package/src/isomorphic/actions/getCallsStatus.ts +0 -112
- package/src/isomorphic/actions/prepareCalls.ts +0 -172
- package/src/isomorphic/actions/prepareSign.ts +0 -91
- package/src/isomorphic/actions/sendPreparedCalls.ts +0 -234
- package/src/isomorphic/client.ts +0 -102
- package/src/isomorphic/utils/7702.ts +0 -135
- package/src/isomorphic/utils/createDummySigner.ts +0 -27
- package/src/isomorphic/utils/decodeSignature.ts +0 -21
- package/src/isomorphic/utils/parsePermissionsContext.ts +0 -51
- package/src/isomorphic/utils/supportsFeature.ts +0 -34
- package/src/local/client.ts +0 -136
- package/src/remote/client.ts +0 -67
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ChainNotFoundError, custom, toHex, } from "viem";
|
|
2
|
-
import { TypeSignableMessage, jsonSafeTypedData, } from "@alchemy/wallet-api-types";
|
|
3
|
-
import { createAccount } from "../utils/createAccount.js";
|
|
4
|
-
import { createDummySigner } from "../utils/createDummySigner.js";
|
|
5
|
-
import { Value } from "@sinclair/typebox/value";
|
|
6
|
-
export async function prepareSign(client, params) {
|
|
7
|
-
if (!client.chain) {
|
|
8
|
-
throw new ChainNotFoundError();
|
|
9
|
-
}
|
|
10
|
-
const { counterfactualInfo, delegation } = await client.request({
|
|
11
|
-
method: "wallet_requestAccount",
|
|
12
|
-
params: [
|
|
13
|
-
{
|
|
14
|
-
accountAddress: params.from,
|
|
15
|
-
includeCounterfactualInfo: true,
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
});
|
|
19
|
-
const account = await createAccount({
|
|
20
|
-
chain: client.chain,
|
|
21
|
-
transport: custom(client.transport),
|
|
22
|
-
signer: createDummySigner(params.from),
|
|
23
|
-
accountAddress: params.from,
|
|
24
|
-
counterfactualInfo,
|
|
25
|
-
permissions: params.capabilities?.permissions,
|
|
26
|
-
delegation,
|
|
27
|
-
});
|
|
28
|
-
const signatureRequest = await account.prepareSign(params.signatureRequest);
|
|
29
|
-
if (signatureRequest.type === "personal_sign") {
|
|
30
|
-
return {
|
|
31
|
-
chainId: toHex(client.chain.id),
|
|
32
|
-
signatureRequest: {
|
|
33
|
-
type: signatureRequest.type,
|
|
34
|
-
data: Value.Encode(TypeSignableMessage, signatureRequest.data),
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const typedData = signatureRequest.data;
|
|
40
|
-
return {
|
|
41
|
-
chainId: toHex(client.chain.id),
|
|
42
|
-
signatureRequest: {
|
|
43
|
-
type: signatureRequest.type,
|
|
44
|
-
data: jsonSafeTypedData(typedData),
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=prepareSign.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepareSign.js","sourceRoot":"","sources":["../../../../src/isomorphic/actions/prepareSign.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,KAAK,GAGN,MAAM,MAAM,CAAC;AAKd,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAUhD,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAMC,EACD,MAAyB;IAEzB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAC9D,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE;YACN;gBACE,cAAc,EAAE,MAAM,CAAC,IAAI;gBAC3B,yBAAyB,EAAE,IAAI;aAChC;SACF;KACF,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC;QAClC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QACnC,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC;QACtC,cAAc,EAAE,MAAM,CAAC,IAAI;QAC3B,kBAAkB;QAClB,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,WAAW;QAC7C,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAChD,MAAM,CAAC,gBAAoC,CAC5C,CAAC;IAEF,IAAI,gBAAgB,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QAC9C,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,gBAAgB,EAAE;gBAChB,IAAI,EAAE,gBAAgB,CAAC,IAAI;gBAC3B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,IAAI,CAAC;aAC/D;SACF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAExC,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,gBAAgB,EAAE;gBAChB,IAAI,EAAE,gBAAgB,CAAC,IAAI;gBAC3B,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAAC;aACnC;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type { Static } from \"@sinclair/typebox\";\nimport type {\n SignatureRequest,\n SmartAccountClient,\n SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport {\n ChainNotFoundError,\n custom,\n toHex,\n type Chain,\n type Transport,\n} from \"viem\";\nimport type {\n wallet_prepareSign,\n WalletServerViemRpcSchema,\n} from \"@alchemy/wallet-api-types/rpc\";\nimport {\n TypeSignableMessage,\n jsonSafeTypedData,\n} from \"@alchemy/wallet-api-types\";\nimport { createAccount } from \"../utils/createAccount.js\";\nimport { createDummySigner } from \"../utils/createDummySigner.js\";\nimport { Value } from \"@sinclair/typebox/value\";\n\nexport type PrepareSignParams = Static<\n (typeof wallet_prepareSign)[\"properties\"][\"Request\"][\"properties\"][\"params\"]\n>[0];\n\nexport type PrepareSignResult = Static<\n (typeof wallet_prepareSign)[\"properties\"][\"ReturnType\"]\n>;\n\nexport async function prepareSign(\n client: SmartAccountClient<\n Transport,\n Chain,\n SmartContractAccount | undefined,\n Record<string, unknown>,\n WalletServerViemRpcSchema\n >,\n params: PrepareSignParams,\n): Promise<PrepareSignResult> {\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n const { counterfactualInfo, delegation } = await client.request({\n method: \"wallet_requestAccount\",\n params: [\n {\n accountAddress: params.from,\n includeCounterfactualInfo: true,\n },\n ],\n });\n\n const account = await createAccount({\n chain: client.chain,\n transport: custom(client.transport),\n signer: createDummySigner(params.from),\n accountAddress: params.from,\n counterfactualInfo,\n permissions: params.capabilities?.permissions,\n delegation,\n });\n\n const signatureRequest = await account.prepareSign(\n params.signatureRequest as SignatureRequest,\n );\n\n if (signatureRequest.type === \"personal_sign\") {\n return {\n chainId: toHex(client.chain.id),\n signatureRequest: {\n type: signatureRequest.type,\n data: Value.Encode(TypeSignableMessage, signatureRequest.data),\n },\n };\n } else {\n const typedData = signatureRequest.data;\n\n return {\n chainId: toHex(client.chain.id),\n signatureRequest: {\n type: signatureRequest.type,\n data: jsonSafeTypedData(typedData),\n },\n };\n }\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type SmartAccountClient, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
|
-
import { type Chain, type Transport } from "viem";
|
|
3
|
-
import type { wallet_sendPreparedCalls, WalletServerViemRpcSchema } from "@alchemy/wallet-api-types/rpc";
|
|
4
|
-
import type { Static } from "@sinclair/typebox";
|
|
5
|
-
export type SendPreparedCallsParams = Static<(typeof wallet_sendPreparedCalls)["properties"]["Request"]["properties"]["params"]>[0];
|
|
6
|
-
export type SendPreparedCallsResult = Static<(typeof wallet_sendPreparedCalls)["properties"]["ReturnType"]>;
|
|
7
|
-
export declare function sendPreparedCalls(client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>, params: SendPreparedCallsParams): Promise<SendPreparedCallsResult>;
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { getEntryPoint, } from "@aa-sdk/core";
|
|
2
|
-
import { Value } from "@sinclair/typebox/value";
|
|
3
|
-
import { BaseError, ChainNotFoundError, concat, concatHex, numberToHex, parseSignature, toHex, } from "viem";
|
|
4
|
-
import { decodePermissionsContext } from "@alchemy/wallet-api-types/capabilities";
|
|
5
|
-
import { TypeCallId } from "@alchemy/wallet-api-types";
|
|
6
|
-
import { isSupportedDelegationAddress7702 } from "../utils/7702.js";
|
|
7
|
-
import { InvalidRequestError } from "ox/RpcResponse";
|
|
8
|
-
import { assertNever } from "../../utils.js";
|
|
9
|
-
import { decodeSignature } from "../utils/decodeSignature.js";
|
|
10
|
-
// TODO: this only supports MAv2 right now, we need to fix this
|
|
11
|
-
export async function sendPreparedCalls(client, params) {
|
|
12
|
-
if (!client.chain) {
|
|
13
|
-
throw new ChainNotFoundError();
|
|
14
|
-
}
|
|
15
|
-
const deferredAction = (() => {
|
|
16
|
-
if (!params.capabilities?.permissions) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const decodedContext = decodePermissionsContext(params.capabilities.permissions);
|
|
20
|
-
if (decodedContext.contextVersion === "REMOTE_MODE_DEFERRED_ACTION") {
|
|
21
|
-
throw new InvalidRequestError({
|
|
22
|
-
message: "Remote mode deferred action not supported in isomorphic client",
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return decodedContext.deferredAction;
|
|
26
|
-
})();
|
|
27
|
-
const userOps = params.type === "array"
|
|
28
|
-
? params.data.filter((it) => {
|
|
29
|
-
const isUserOp = it.type === "user-operation-v060" ||
|
|
30
|
-
it.type === "user-operation-v070";
|
|
31
|
-
if (isUserOp && it.chainId !== toHex(client.chain.id)) {
|
|
32
|
-
throw new InvalidRequestError({
|
|
33
|
-
message: "Multiple chain IDs in a single request are not currently supported.",
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return isUserOp;
|
|
37
|
-
})
|
|
38
|
-
: [params];
|
|
39
|
-
if (!userOps.length) {
|
|
40
|
-
throw new InvalidRequestError({
|
|
41
|
-
message: "Calls must include at least one user operation",
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
const authorizations = params.type === "array"
|
|
45
|
-
? params.data.filter((it) => it.type === "authorization")
|
|
46
|
-
: [];
|
|
47
|
-
if (authorizations.length > 1) {
|
|
48
|
-
throw new InvalidRequestError({
|
|
49
|
-
message: "Multiple authorizations in a single request are not currently supported",
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
const [authorization] = authorizations;
|
|
53
|
-
// One last safety check to be sure the UO wasn't modified to include an unsupported 7702 delegation address.
|
|
54
|
-
if (authorization &&
|
|
55
|
-
!isSupportedDelegationAddress7702(authorization.data.address)) {
|
|
56
|
-
throw new InvalidRequestError({
|
|
57
|
-
message: `Unsupported 7702 delegation address: ${authorization.data.address}`,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const hashes = await Promise.all(userOps.map(async (userOp, idx) => {
|
|
61
|
-
const ep = userOp.type === "user-operation-v060"
|
|
62
|
-
? getEntryPoint(client.chain, { version: "0.6.0" })
|
|
63
|
-
: userOp.type === "user-operation-v070"
|
|
64
|
-
? getEntryPoint(client.chain, { version: "0.7.0" })
|
|
65
|
-
: assertNever(userOp, "Unexpected user op type");
|
|
66
|
-
const authSig = authorization
|
|
67
|
-
? parseSignature(decodeSignature(authorization.signature).data)
|
|
68
|
-
: undefined;
|
|
69
|
-
const uoSigHex = decodeSignature(userOp.signature).data;
|
|
70
|
-
const { counterfactualInfo, delegation } = await client.request({
|
|
71
|
-
method: "wallet_requestAccount",
|
|
72
|
-
params: [
|
|
73
|
-
{
|
|
74
|
-
accountAddress: userOp.data.sender,
|
|
75
|
-
includeCounterfactualInfo: true,
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
});
|
|
79
|
-
if (!counterfactualInfo && !delegation) {
|
|
80
|
-
throw new InvalidRequestError({
|
|
81
|
-
message: "No counterfactual info or delegated implementation address found.",
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
const factoryType = counterfactualInfo?.factoryType;
|
|
85
|
-
// build signature based on account type
|
|
86
|
-
const signature = (() => {
|
|
87
|
-
switch (factoryType) {
|
|
88
|
-
// light accounts
|
|
89
|
-
case "LightAccountV1.0.1":
|
|
90
|
-
case "LightAccountV1.0.2":
|
|
91
|
-
case "LightAccountV1.1.0":
|
|
92
|
-
case "MAv1.0.0-MultiOwner":
|
|
93
|
-
// For LAv1 and MAv1-MultiOwner, we always just pass the signature.
|
|
94
|
-
return uoSigHex;
|
|
95
|
-
case "LightAccountV2.0.0":
|
|
96
|
-
// for LAv2, we need to prepend the "SignatureType.EOA" byte.
|
|
97
|
-
// TODO: Once we support nested smart accounts, switch this byte depending on the signature type.
|
|
98
|
-
return concat(["0x00", uoSigHex]);
|
|
99
|
-
case undefined: // undefined defaults to sma-b
|
|
100
|
-
case "MAv2.0.0-sma-b":
|
|
101
|
-
// For sma-b, we need to handle deferred actions if needed and prepend the "Reserved
|
|
102
|
-
// Signature Segment" and "SignatureType.EOA" bytes
|
|
103
|
-
return deferredAction != null
|
|
104
|
-
? concatHex([
|
|
105
|
-
`0x${deferredAction.slice(68)}`, // Cuts off stuff prepended to the digest (nonce, etc.).
|
|
106
|
-
"0xFF",
|
|
107
|
-
"0x00",
|
|
108
|
-
uoSigHex,
|
|
109
|
-
])
|
|
110
|
-
: concat(["0xFF", "0x00", uoSigHex]);
|
|
111
|
-
case "LightAccountV2.0.0-MultiOwner":
|
|
112
|
-
// for LAv2-MultiOwner, we need to prepend the "SignatureType.EOA" byte
|
|
113
|
-
// TODO: Once we support nested smart accounts, switch this byte depending on the signature type, and add the smart account signer's address.
|
|
114
|
-
return concat(["0x00", uoSigHex]);
|
|
115
|
-
case "MAv2.0.0-ma-ssv":
|
|
116
|
-
case "MAv2.0.0-ma-webauthn":
|
|
117
|
-
case "MAv1.0.0-MultiSig":
|
|
118
|
-
case "unknown":
|
|
119
|
-
throw new InvalidRequestError({
|
|
120
|
-
message: `Unsupported factory type: ${factoryType}`,
|
|
121
|
-
});
|
|
122
|
-
default:
|
|
123
|
-
return assertNever(factoryType, "Unsupported factory type");
|
|
124
|
-
}
|
|
125
|
-
})();
|
|
126
|
-
return client
|
|
127
|
-
.sendRawUserOperation({
|
|
128
|
-
...userOp.data,
|
|
129
|
-
signature,
|
|
130
|
-
eip7702Auth: idx === 0 && authorization && authSig
|
|
131
|
-
? {
|
|
132
|
-
...authorization.data,
|
|
133
|
-
chainId: authorization.chainId,
|
|
134
|
-
...{
|
|
135
|
-
...authSig,
|
|
136
|
-
yParity: numberToHex(authSig.yParity),
|
|
137
|
-
},
|
|
138
|
-
}
|
|
139
|
-
: undefined,
|
|
140
|
-
}, ep.address)
|
|
141
|
-
.catch((err) => {
|
|
142
|
-
if (err instanceof BaseError &&
|
|
143
|
-
err.details.endsWith("is not a contract and initCode is empty")) {
|
|
144
|
-
throw new BaseError(`${err.details} (If using 7702, be sure you include the signed authorization in the request parameters)`);
|
|
145
|
-
}
|
|
146
|
-
throw err;
|
|
147
|
-
});
|
|
148
|
-
}));
|
|
149
|
-
return {
|
|
150
|
-
preparedCallIds: hashes.map((hash) => Value.Encode(TypeCallId, {
|
|
151
|
-
chainId: toHex(client.chain.id),
|
|
152
|
-
hash,
|
|
153
|
-
})),
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=sendPreparedCalls.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sendPreparedCalls.js","sourceRoot":"","sources":["../../../../src/isomorphic/actions/sendPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,WAAW,EACX,cAAc,EACd,KAAK,GAKN,MAAM,MAAM,CAAC;AAKd,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAU9D,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAMC,EACD,MAA+B;IAE/B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,cAAc,GAAoB,CAAC,GAAG,EAAE;QAC5C,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;YACtC,OAAO;QACT,CAAC;QAED,MAAM,cAAc,GAAG,wBAAwB,CAC7C,MAAM,CAAC,YAAY,CAAC,WAAW,CAChC,CAAC;QAEF,IAAI,cAAc,CAAC,cAAc,KAAK,6BAA6B,EAAE,CAAC;YACpE,MAAM,IAAI,mBAAmB,CAAC;gBAC5B,OAAO,EACL,gEAAgE;aACnE,CAAC,CAAC;QACL,CAAC;QAED,OAAO,cAAc,CAAC,cAAc,CAAC;IACvC,CAAC,CAAC,EAAE,CAAC;I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AAa,IAAI,OAAO;gBACnC,CAAC,CAAC;oBACE,GAAG,aAAa,CAAC,IAAI;oBACrB,OAAO,EAAE,aAAa,CAAC,OAAO;oBAC9B,GAAG;wBACD,GAAG,OAAO;wBACV,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;qBACtC;iBACF;gBACH,CAAC,CAAC,SAAS;SAChB,EACD,EAAE,CAAC,OAAO,CACX;aACA,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,IACE,GAAG,YAAY,SAAS;gBACxB,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,yCAAyC,CAAC,EAC/D,CAAC;gBACD,MAAM,IAAI,SAAS,CACjB,GAAG,GAAG,CAAC,OAAO,0FAA0F,CACzG,CAAC;YACJ,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CACH,CAAC;IAEF,OAAO;QACL,eAAe,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACnC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE;YACvB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,IAAI;SACL,CAAC,CACH;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n getEntryPoint,\n type SmartAccountClient,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { Value } from \"@sinclair/typebox/value\";\nimport {\n BaseError,\n ChainNotFoundError,\n concat,\n concatHex,\n numberToHex,\n parseSignature,\n toHex,\n type Address,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport type {\n wallet_sendPreparedCalls,\n WalletServerViemRpcSchema,\n} from \"@alchemy/wallet-api-types/rpc\";\nimport { decodePermissionsContext } from \"@alchemy/wallet-api-types/capabilities\";\nimport { TypeCallId } from \"@alchemy/wallet-api-types\";\nimport { isSupportedDelegationAddress7702 } from \"../utils/7702.js\";\nimport { InvalidRequestError } from \"ox/RpcResponse\";\nimport { assertNever } from \"../../utils.js\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { decodeSignature } from \"../utils/decodeSignature.js\";\n\nexport type SendPreparedCallsParams = Static<\n (typeof wallet_sendPreparedCalls)[\"properties\"][\"Request\"][\"properties\"][\"params\"]\n>[0];\n\nexport type SendPreparedCallsResult = Static<\n (typeof wallet_sendPreparedCalls)[\"properties\"][\"ReturnType\"]\n>;\n\n// TODO: this only supports MAv2 right now, we need to fix this\nexport async function sendPreparedCalls(\n client: SmartAccountClient<\n Transport,\n Chain,\n SmartContractAccount | undefined,\n Record<string, unknown>,\n WalletServerViemRpcSchema\n >,\n params: SendPreparedCallsParams,\n): Promise<SendPreparedCallsResult> {\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n const deferredAction: Hex | undefined = (() => {\n if (!params.capabilities?.permissions) {\n return;\n }\n\n const decodedContext = decodePermissionsContext(\n params.capabilities.permissions,\n );\n\n if (decodedContext.contextVersion === \"REMOTE_MODE_DEFERRED_ACTION\") {\n throw new InvalidRequestError({\n message:\n \"Remote mode deferred action not supported in isomorphic client\",\n });\n }\n\n return decodedContext.deferredAction;\n })();\n\n const userOps =\n params.type === \"array\"\n ? params.data.filter((it) => {\n const isUserOp =\n it.type === \"user-operation-v060\" ||\n it.type === \"user-operation-v070\";\n if (isUserOp && it.chainId !== toHex(client.chain.id)) {\n throw new InvalidRequestError({\n message:\n \"Multiple chain IDs in a single request are not currently supported.\",\n });\n }\n return isUserOp;\n })\n : [params];\n\n if (!userOps.length) {\n throw new InvalidRequestError({\n message: \"Calls must include at least one user operation\",\n });\n }\n\n const authorizations =\n params.type === \"array\"\n ? params.data.filter((it) => it.type === \"authorization\")\n : [];\n\n if (authorizations.length > 1) {\n throw new InvalidRequestError({\n message:\n \"Multiple authorizations in a single request are not currently supported\",\n });\n }\n const [authorization] = authorizations;\n\n // One last safety check to be sure the UO wasn't modified to include an unsupported 7702 delegation address.\n if (\n authorization &&\n !isSupportedDelegationAddress7702(authorization.data.address)\n ) {\n throw new InvalidRequestError({\n message: `Unsupported 7702 delegation address: ${authorization.data.address}`,\n });\n }\n\n const hashes = await Promise.all(\n userOps.map(async (userOp, idx) => {\n const ep: { address: Address } =\n userOp.type === \"user-operation-v060\"\n ? getEntryPoint(client.chain, { version: \"0.6.0\" })\n : userOp.type === \"user-operation-v070\"\n ? getEntryPoint(client.chain, { version: \"0.7.0\" })\n : assertNever(userOp, \"Unexpected user op type\");\n const authSig = authorization\n ? parseSignature(decodeSignature(authorization.signature).data)\n : undefined;\n const uoSigHex = decodeSignature(userOp.signature).data;\n\n const { counterfactualInfo, delegation } = await client.request({\n method: \"wallet_requestAccount\",\n params: [\n {\n accountAddress: userOp.data.sender,\n includeCounterfactualInfo: true,\n },\n ],\n });\n\n if (!counterfactualInfo && !delegation) {\n throw new InvalidRequestError({\n message:\n \"No counterfactual info or delegated implementation address found.\",\n });\n }\n\n const factoryType = counterfactualInfo?.factoryType;\n\n // build signature based on account type\n const signature = (() => {\n switch (factoryType) {\n // light accounts\n case \"LightAccountV1.0.1\":\n case \"LightAccountV1.0.2\":\n case \"LightAccountV1.1.0\":\n case \"MAv1.0.0-MultiOwner\":\n // For LAv1 and MAv1-MultiOwner, we always just pass the signature.\n return uoSigHex;\n case \"LightAccountV2.0.0\":\n // for LAv2, we need to prepend the \"SignatureType.EOA\" byte.\n // TODO: Once we support nested smart accounts, switch this byte depending on the signature type.\n return concat([\"0x00\", uoSigHex]);\n case undefined: // undefined defaults to sma-b\n case \"MAv2.0.0-sma-b\":\n // For sma-b, we need to handle deferred actions if needed and prepend the \"Reserved\n // Signature Segment\" and \"SignatureType.EOA\" bytes\n return deferredAction != null\n ? concatHex([\n `0x${deferredAction.slice(68)}`, // Cuts off stuff prepended to the digest (nonce, etc.).\n \"0xFF\",\n \"0x00\",\n uoSigHex,\n ])\n : concat([\"0xFF\", \"0x00\", uoSigHex]);\n case \"LightAccountV2.0.0-MultiOwner\":\n // for LAv2-MultiOwner, we need to prepend the \"SignatureType.EOA\" byte\n // TODO: Once we support nested smart accounts, switch this byte depending on the signature type, and add the smart account signer's address.\n return concat([\"0x00\", uoSigHex]);\n case \"MAv2.0.0-ma-ssv\":\n case \"MAv2.0.0-ma-webauthn\":\n case \"MAv1.0.0-MultiSig\":\n case \"unknown\":\n throw new InvalidRequestError({\n message: `Unsupported factory type: ${factoryType}`,\n });\n default:\n return assertNever(factoryType, \"Unsupported factory type\");\n }\n })();\n\n return client\n .sendRawUserOperation(\n {\n ...userOp.data,\n signature,\n eip7702Auth:\n idx === 0 && authorization && authSig\n ? {\n ...authorization.data,\n chainId: authorization.chainId,\n ...{\n ...authSig,\n yParity: numberToHex(authSig.yParity),\n },\n }\n : undefined,\n },\n ep.address,\n )\n .catch((err) => {\n if (\n err instanceof BaseError &&\n err.details.endsWith(\"is not a contract and initCode is empty\")\n ) {\n throw new BaseError(\n `${err.details} (If using 7702, be sure you include the signed authorization in the request parameters)`,\n );\n }\n throw err;\n });\n }),\n );\n\n return {\n preparedCallIds: hashes.map((hash) =>\n Value.Encode(TypeCallId, {\n chainId: toHex(client.chain.id),\n hash,\n }),\n ),\n };\n}\n"]}
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { type ClientMiddlewareFn, type SmartAccountClient, type SmartAccountClientRpcSchema, type SmartContractAccount } from "@aa-sdk/core";
|
|
2
|
-
import { type Chain, type Transport } from "viem";
|
|
3
|
-
import type { WalletServerViemRpcSchema } from "@alchemy/wallet-api-types/rpc";
|
|
4
|
-
import { type CreateSessionParams } from "./actions/createSession.js";
|
|
5
|
-
import { type GetCallsStatusParams } from "./actions/getCallsStatus.js";
|
|
6
|
-
import { type PrepareCallsParams } from "./actions/prepareCalls.js";
|
|
7
|
-
import { type SendPreparedCallsParams } from "./actions/sendPreparedCalls.js";
|
|
8
|
-
import { type PrepareSignParams } from "./actions/prepareSign.js";
|
|
9
|
-
import { type FormatSignParams } from "./actions/formatSign.js";
|
|
10
|
-
type ClientParams = {
|
|
11
|
-
chain: Chain;
|
|
12
|
-
transport: Transport;
|
|
13
|
-
policyId?: string;
|
|
14
|
-
useErc7677middleware?: boolean;
|
|
15
|
-
feeEstimator?: ClientMiddlewareFn;
|
|
16
|
-
};
|
|
17
|
-
export declare function isomorphicClientActions(client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>): {
|
|
18
|
-
prepareCalls: (params: PrepareCallsParams) => Promise<{
|
|
19
|
-
type: "array";
|
|
20
|
-
data: ({
|
|
21
|
-
type: "user-operation-v060";
|
|
22
|
-
data: {
|
|
23
|
-
nonce: `0x${string}`;
|
|
24
|
-
initCode: `0x${string}`;
|
|
25
|
-
maxFeePerGas: `0x${string}`;
|
|
26
|
-
maxPriorityFeePerGas: `0x${string}`;
|
|
27
|
-
paymasterAndData: `0x${string}`;
|
|
28
|
-
sender: `0x${string}`;
|
|
29
|
-
callData: `0x${string}`;
|
|
30
|
-
callGasLimit: `0x${string}`;
|
|
31
|
-
verificationGasLimit: `0x${string}`;
|
|
32
|
-
preVerificationGas: `0x${string}`;
|
|
33
|
-
};
|
|
34
|
-
chainId: `0x${string}`;
|
|
35
|
-
signatureRequest: {
|
|
36
|
-
type: "personal_sign";
|
|
37
|
-
data: string | {
|
|
38
|
-
raw: `0x${string}`;
|
|
39
|
-
};
|
|
40
|
-
rawPayload: `0x${string}`;
|
|
41
|
-
} | {
|
|
42
|
-
type: "eth_signTypedData_v4";
|
|
43
|
-
data: {
|
|
44
|
-
domain?: {
|
|
45
|
-
name?: string | undefined;
|
|
46
|
-
chainId?: number | undefined;
|
|
47
|
-
salt?: `0x${string}` | undefined;
|
|
48
|
-
version?: string | undefined;
|
|
49
|
-
verifyingContract?: `0x${string}` | undefined;
|
|
50
|
-
} | undefined;
|
|
51
|
-
message: {
|
|
52
|
-
[x: string]: unknown;
|
|
53
|
-
};
|
|
54
|
-
primaryType: string;
|
|
55
|
-
types: {
|
|
56
|
-
[x: string]: {
|
|
57
|
-
type: string;
|
|
58
|
-
name: string;
|
|
59
|
-
}[];
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
rawPayload: `0x${string}`;
|
|
63
|
-
};
|
|
64
|
-
} | {
|
|
65
|
-
type: "user-operation-v070";
|
|
66
|
-
data: {
|
|
67
|
-
factoryData?: `0x${string}` | undefined;
|
|
68
|
-
paymasterVerificationGasLimit?: `0x${string}` | undefined;
|
|
69
|
-
paymasterPostOpGasLimit?: `0x${string}` | undefined;
|
|
70
|
-
factory?: `0x${string}` | undefined;
|
|
71
|
-
paymaster?: `0x${string}` | undefined;
|
|
72
|
-
paymasterData?: `0x${string}` | undefined;
|
|
73
|
-
nonce: `0x${string}`;
|
|
74
|
-
maxFeePerGas: `0x${string}`;
|
|
75
|
-
maxPriorityFeePerGas: `0x${string}`;
|
|
76
|
-
sender: `0x${string}`;
|
|
77
|
-
callData: `0x${string}`;
|
|
78
|
-
callGasLimit: `0x${string}`;
|
|
79
|
-
verificationGasLimit: `0x${string}`;
|
|
80
|
-
preVerificationGas: `0x${string}`;
|
|
81
|
-
};
|
|
82
|
-
chainId: `0x${string}`;
|
|
83
|
-
signatureRequest: {
|
|
84
|
-
type: "personal_sign";
|
|
85
|
-
data: string | {
|
|
86
|
-
raw: `0x${string}`;
|
|
87
|
-
};
|
|
88
|
-
rawPayload: `0x${string}`;
|
|
89
|
-
} | {
|
|
90
|
-
type: "eth_signTypedData_v4";
|
|
91
|
-
data: {
|
|
92
|
-
domain?: {
|
|
93
|
-
name?: string | undefined;
|
|
94
|
-
chainId?: number | undefined;
|
|
95
|
-
salt?: `0x${string}` | undefined;
|
|
96
|
-
version?: string | undefined;
|
|
97
|
-
verifyingContract?: `0x${string}` | undefined;
|
|
98
|
-
} | undefined;
|
|
99
|
-
message: {
|
|
100
|
-
[x: string]: unknown;
|
|
101
|
-
};
|
|
102
|
-
primaryType: string;
|
|
103
|
-
types: {
|
|
104
|
-
[x: string]: {
|
|
105
|
-
type: string;
|
|
106
|
-
name: string;
|
|
107
|
-
}[];
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
rawPayload: `0x${string}`;
|
|
111
|
-
};
|
|
112
|
-
} | {
|
|
113
|
-
type: "authorization";
|
|
114
|
-
data: {
|
|
115
|
-
address: `0x${string}`;
|
|
116
|
-
nonce: `0x${string}`;
|
|
117
|
-
};
|
|
118
|
-
chainId: `0x${string}`;
|
|
119
|
-
signatureRequest: {
|
|
120
|
-
type: "eip7702Auth";
|
|
121
|
-
rawPayload: `0x${string}`;
|
|
122
|
-
};
|
|
123
|
-
})[];
|
|
124
|
-
} | {
|
|
125
|
-
type: "user-operation-v060";
|
|
126
|
-
data: {
|
|
127
|
-
nonce: `0x${string}`;
|
|
128
|
-
initCode: `0x${string}`;
|
|
129
|
-
maxFeePerGas: `0x${string}`;
|
|
130
|
-
maxPriorityFeePerGas: `0x${string}`;
|
|
131
|
-
paymasterAndData: `0x${string}`;
|
|
132
|
-
sender: `0x${string}`;
|
|
133
|
-
callData: `0x${string}`;
|
|
134
|
-
callGasLimit: `0x${string}`;
|
|
135
|
-
verificationGasLimit: `0x${string}`;
|
|
136
|
-
preVerificationGas: `0x${string}`;
|
|
137
|
-
};
|
|
138
|
-
chainId: `0x${string}`;
|
|
139
|
-
signatureRequest: {
|
|
140
|
-
type: "personal_sign";
|
|
141
|
-
data: string | {
|
|
142
|
-
raw: `0x${string}`;
|
|
143
|
-
};
|
|
144
|
-
rawPayload: `0x${string}`;
|
|
145
|
-
} | {
|
|
146
|
-
type: "eth_signTypedData_v4";
|
|
147
|
-
data: {
|
|
148
|
-
domain?: {
|
|
149
|
-
name?: string | undefined;
|
|
150
|
-
chainId?: number | undefined;
|
|
151
|
-
salt?: `0x${string}` | undefined;
|
|
152
|
-
version?: string | undefined;
|
|
153
|
-
verifyingContract?: `0x${string}` | undefined;
|
|
154
|
-
} | undefined;
|
|
155
|
-
message: {
|
|
156
|
-
[x: string]: unknown;
|
|
157
|
-
};
|
|
158
|
-
primaryType: string;
|
|
159
|
-
types: {
|
|
160
|
-
[x: string]: {
|
|
161
|
-
type: string;
|
|
162
|
-
name: string;
|
|
163
|
-
}[];
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
rawPayload: `0x${string}`;
|
|
167
|
-
};
|
|
168
|
-
} | {
|
|
169
|
-
type: "user-operation-v070";
|
|
170
|
-
data: {
|
|
171
|
-
factoryData?: `0x${string}` | undefined;
|
|
172
|
-
paymasterVerificationGasLimit?: `0x${string}` | undefined;
|
|
173
|
-
paymasterPostOpGasLimit?: `0x${string}` | undefined;
|
|
174
|
-
factory?: `0x${string}` | undefined;
|
|
175
|
-
paymaster?: `0x${string}` | undefined;
|
|
176
|
-
paymasterData?: `0x${string}` | undefined;
|
|
177
|
-
nonce: `0x${string}`;
|
|
178
|
-
maxFeePerGas: `0x${string}`;
|
|
179
|
-
maxPriorityFeePerGas: `0x${string}`;
|
|
180
|
-
sender: `0x${string}`;
|
|
181
|
-
callData: `0x${string}`;
|
|
182
|
-
callGasLimit: `0x${string}`;
|
|
183
|
-
verificationGasLimit: `0x${string}`;
|
|
184
|
-
preVerificationGas: `0x${string}`;
|
|
185
|
-
};
|
|
186
|
-
chainId: `0x${string}`;
|
|
187
|
-
signatureRequest: {
|
|
188
|
-
type: "personal_sign";
|
|
189
|
-
data: string | {
|
|
190
|
-
raw: `0x${string}`;
|
|
191
|
-
};
|
|
192
|
-
rawPayload: `0x${string}`;
|
|
193
|
-
} | {
|
|
194
|
-
type: "eth_signTypedData_v4";
|
|
195
|
-
data: {
|
|
196
|
-
domain?: {
|
|
197
|
-
name?: string | undefined;
|
|
198
|
-
chainId?: number | undefined;
|
|
199
|
-
salt?: `0x${string}` | undefined;
|
|
200
|
-
version?: string | undefined;
|
|
201
|
-
verifyingContract?: `0x${string}` | undefined;
|
|
202
|
-
} | undefined;
|
|
203
|
-
message: {
|
|
204
|
-
[x: string]: unknown;
|
|
205
|
-
};
|
|
206
|
-
primaryType: string;
|
|
207
|
-
types: {
|
|
208
|
-
[x: string]: {
|
|
209
|
-
type: string;
|
|
210
|
-
name: string;
|
|
211
|
-
}[];
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
rawPayload: `0x${string}`;
|
|
215
|
-
};
|
|
216
|
-
}>;
|
|
217
|
-
sendPreparedCalls: (params: SendPreparedCallsParams) => Promise<{
|
|
218
|
-
preparedCallIds: `0x${string}`[];
|
|
219
|
-
}>;
|
|
220
|
-
getCallsStatus: (params: GetCallsStatusParams) => Promise<{
|
|
221
|
-
receipts?: {
|
|
222
|
-
blockHash: `0x${string}`;
|
|
223
|
-
blockNumber: `0x${string}`;
|
|
224
|
-
gasUsed: `0x${string}`;
|
|
225
|
-
status: `0x${string}`;
|
|
226
|
-
logs: {
|
|
227
|
-
address: `0x${string}`;
|
|
228
|
-
data: `0x${string}`;
|
|
229
|
-
topics: `0x${string}`[];
|
|
230
|
-
}[];
|
|
231
|
-
transactionHash: `0x${string}`;
|
|
232
|
-
}[] | undefined;
|
|
233
|
-
chainId: `0x${string}`;
|
|
234
|
-
id: `0x${string}`;
|
|
235
|
-
atomic: boolean;
|
|
236
|
-
status: 200 | 100 | 400 | 500 | 600;
|
|
237
|
-
}>;
|
|
238
|
-
createSession: (params: CreateSessionParams) => Promise<import("./actions/createSession.js").CreateSessionResult>;
|
|
239
|
-
prepareSign: (params: PrepareSignParams) => Promise<{
|
|
240
|
-
chainId: `0x${string}`;
|
|
241
|
-
signatureRequest: {
|
|
242
|
-
type: "personal_sign";
|
|
243
|
-
data: string | {
|
|
244
|
-
raw: `0x${string}`;
|
|
245
|
-
};
|
|
246
|
-
} | {
|
|
247
|
-
type: "eth_signTypedData_v4";
|
|
248
|
-
data: {
|
|
249
|
-
domain?: {
|
|
250
|
-
name?: string | undefined;
|
|
251
|
-
chainId?: number | undefined;
|
|
252
|
-
salt?: `0x${string}` | undefined;
|
|
253
|
-
version?: string | undefined;
|
|
254
|
-
verifyingContract?: `0x${string}` | undefined;
|
|
255
|
-
} | undefined;
|
|
256
|
-
message: {
|
|
257
|
-
[x: string]: unknown;
|
|
258
|
-
};
|
|
259
|
-
primaryType: string;
|
|
260
|
-
types: {
|
|
261
|
-
[x: string]: {
|
|
262
|
-
type: string;
|
|
263
|
-
name: string;
|
|
264
|
-
}[];
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
}>;
|
|
269
|
-
formatSign: (params: FormatSignParams) => Promise<{
|
|
270
|
-
signature: `0x${string}`;
|
|
271
|
-
}>;
|
|
272
|
-
};
|
|
273
|
-
export declare function createIsomorphicClient({ chain, transport, policyId, useErc7677middleware, feeEstimator, }: ClientParams): SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, ReturnType<typeof isomorphicClientActions>, WalletServerViemRpcSchema & SmartAccountClientRpcSchema>;
|
|
274
|
-
export type IsomorphicClient = ReturnType<typeof createIsomorphicClient>;
|
|
275
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { createSmartAccountClient, } from "@aa-sdk/core";
|
|
2
|
-
import { alchemyFeeEstimator, alchemyGasAndPaymasterAndDataMiddleware, alchemyGasManagerMiddleware, } from "@account-kit/infra";
|
|
3
|
-
import {} from "viem";
|
|
4
|
-
import { createSession, } from "./actions/createSession.js";
|
|
5
|
-
import { getCallsStatus, } from "./actions/getCallsStatus.js";
|
|
6
|
-
import { prepareCalls, } from "./actions/prepareCalls.js";
|
|
7
|
-
import { sendPreparedCalls, } from "./actions/sendPreparedCalls.js";
|
|
8
|
-
import { prepareSign } from "./actions/prepareSign.js";
|
|
9
|
-
import { formatSign } from "./actions/formatSign.js";
|
|
10
|
-
export function isomorphicClientActions(client) {
|
|
11
|
-
return {
|
|
12
|
-
prepareCalls: (params) => prepareCalls(client, params),
|
|
13
|
-
sendPreparedCalls: (params) => sendPreparedCalls(client, params),
|
|
14
|
-
getCallsStatus: (params) => getCallsStatus(client, params),
|
|
15
|
-
createSession: (params) => createSession(client, params),
|
|
16
|
-
prepareSign: (params) => prepareSign(client, params),
|
|
17
|
-
formatSign: (params) => formatSign(client, params),
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
// the isomorphic client likely won't be exposed directly. This client contains the business logic that can be run on the wallet server or on the client
|
|
21
|
-
// if the dev chooses to run the client in "local" mode.
|
|
22
|
-
export function createIsomorphicClient({ chain, transport, policyId, useErc7677middleware = true, feeEstimator, }) {
|
|
23
|
-
// This must be a smart account client since as of now we use it to build UOs under the hood
|
|
24
|
-
const client = createSmartAccountClient({
|
|
25
|
-
transport,
|
|
26
|
-
chain,
|
|
27
|
-
// TODO: we will want to enforce alchemy transport here probably
|
|
28
|
-
feeEstimator: feeEstimator ?? alchemyFeeEstimator(transport),
|
|
29
|
-
...(policyId
|
|
30
|
-
? useErc7677middleware
|
|
31
|
-
? alchemyGasManagerMiddleware(policyId)
|
|
32
|
-
: // NOTE: DO NOT USE THIS MIDDLEWARE in the server, currently we require using the erc7677 middleware
|
|
33
|
-
alchemyGasAndPaymasterAndDataMiddleware({
|
|
34
|
-
policyId,
|
|
35
|
-
transport: transport,
|
|
36
|
-
})
|
|
37
|
-
: {}),
|
|
38
|
-
}).extend(isomorphicClientActions);
|
|
39
|
-
return client;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/isomorphic/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAKzB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,uCAAuC,EACvC,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA8B,MAAM,MAAM,CAAC;AAElD,OAAO,EACL,aAAa,GAEd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,GAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,YAAY,GAEb,MAAM,2BAA2B,CAAC;AACnC,OAAO,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CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAEnC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n type ClientMiddlewareFn,\n type SmartAccountClient,\n type SmartAccountClientRpcSchema,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport {\n alchemyFeeEstimator,\n alchemyGasAndPaymasterAndDataMiddleware,\n alchemyGasManagerMiddleware,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\nimport { type Chain, type Transport } from \"viem\";\nimport type { WalletServerViemRpcSchema } from \"@alchemy/wallet-api-types/rpc\";\nimport {\n createSession,\n type CreateSessionParams,\n} from \"./actions/createSession.js\";\nimport {\n getCallsStatus,\n type GetCallsStatusParams,\n} from \"./actions/getCallsStatus.js\";\nimport {\n prepareCalls,\n type PrepareCallsParams,\n} from \"./actions/prepareCalls.js\";\nimport {\n sendPreparedCalls,\n type SendPreparedCallsParams,\n} from \"./actions/sendPreparedCalls.js\";\nimport { prepareSign, type PrepareSignParams } from \"./actions/prepareSign.js\";\nimport { formatSign, type FormatSignParams } from \"./actions/formatSign.js\";\n\n// let's start with something that takes in as many params as possible, then we can eliminate them as we don't need them\ntype ClientParams = {\n chain: Chain;\n transport: Transport;\n policyId?: string;\n useErc7677middleware?: boolean;\n feeEstimator?: ClientMiddlewareFn;\n};\n\nexport function isomorphicClientActions(\n client: SmartAccountClient<\n Transport,\n Chain,\n SmartContractAccount | undefined,\n Record<string, unknown>,\n WalletServerViemRpcSchema\n >,\n) {\n return {\n prepareCalls: (params: PrepareCallsParams) => prepareCalls(client, params),\n sendPreparedCalls: (params: SendPreparedCallsParams) =>\n sendPreparedCalls(client, params),\n getCallsStatus: (params: GetCallsStatusParams) =>\n getCallsStatus(client, params),\n createSession: (params: CreateSessionParams) =>\n createSession(client, params),\n prepareSign: (params: PrepareSignParams) => prepareSign(client, params),\n formatSign: (params: FormatSignParams) => formatSign(client, params),\n };\n}\n\n// the isomorphic client likely won't be exposed directly. This client contains the business logic that can be run on the wallet server or on the client\n// if the dev chooses to run the client in \"local\" mode.\nexport function createIsomorphicClient({\n chain,\n transport,\n policyId,\n useErc7677middleware = true,\n feeEstimator,\n}: ClientParams): SmartAccountClient<\n Transport,\n Chain,\n SmartContractAccount | undefined,\n ReturnType<typeof isomorphicClientActions>,\n WalletServerViemRpcSchema & SmartAccountClientRpcSchema\n> {\n // This must be a smart account client since as of now we use it to build UOs under the hood\n const client = createSmartAccountClient({\n transport,\n chain,\n // TODO: we will want to enforce alchemy transport here probably\n feeEstimator:\n feeEstimator ?? alchemyFeeEstimator(transport as AlchemyTransport),\n ...(policyId\n ? useErc7677middleware\n ? alchemyGasManagerMiddleware(policyId)\n : // NOTE: DO NOT USE THIS MIDDLEWARE in the server, currently we require using the erc7677 middleware\n alchemyGasAndPaymasterAndDataMiddleware({\n policyId,\n transport: transport as AlchemyTransport,\n })\n : {}),\n }).extend(isomorphicClientActions);\n\n return client;\n}\n\nexport type IsomorphicClient = ReturnType<typeof createIsomorphicClient>;\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { SmartAccountClient, SmartContractAccount } from "@aa-sdk/core";
|
|
2
|
-
import { type Address, type Chain, type Transport } from "viem";
|
|
3
|
-
import type { WalletServerViemRpcSchema } from "@alchemy/wallet-api-types/rpc";
|
|
4
|
-
import { type Supported7702AccountType, type Eip7702AuthCapability } from "@alchemy/wallet-api-types/capabilities";
|
|
5
|
-
import type { PreparedCall_Authorization } from "@alchemy/wallet-api-types";
|
|
6
|
-
/** Checks if an address is actively delegated on-chain. */
|
|
7
|
-
export declare const isDelegated: (client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>, params: {
|
|
8
|
-
address: Address;
|
|
9
|
-
delegation: Address;
|
|
10
|
-
}) => Promise<boolean>;
|
|
11
|
-
export declare const createAuthorizationRequest: (client: SmartAccountClient<Transport, Chain, SmartContractAccount | undefined, Record<string, unknown>, WalletServerViemRpcSchema>, params: {
|
|
12
|
-
address: Address;
|
|
13
|
-
delegation: Address;
|
|
14
|
-
}) => Promise<PreparedCall_Authorization>;
|
|
15
|
-
export declare const DelegationAddressToAccountType: Record<Address, Supported7702AccountType>;
|
|
16
|
-
export declare const isSupportedDelegationAddress7702: (address: Address) => boolean;
|
|
17
|
-
export declare const getAccountTypeForDelegationAddress7702: (address: Address) => Supported7702AccountType | undefined;
|
|
18
|
-
export declare const parseDelegation: (eip7702AuthCapability: Eip7702AuthCapability) => "0x69007702764179f14F51cdce752f4f775d74E139";
|
|
19
|
-
export declare const assertValid7702AccountAddress: (fromAddress: Address, eip7702AuthCapability: Eip7702AuthCapability | undefined) => void;
|