@account-kit/wallet-client 4.83.2 → 4.84.1
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 +2 -2
- package/dist/esm/client/actions/getCallsStatus.js +2 -2
- package/dist/esm/client/actions/getCallsStatus.js.map +1 -1
- package/dist/esm/client/actions/grantPermissions.d.ts +1 -1
- package/dist/esm/client/actions/grantPermissions.js +1 -5
- package/dist/esm/client/actions/grantPermissions.js.map +1 -1
- package/dist/esm/client/actions/listAccounts.d.ts +4 -8
- package/dist/esm/client/actions/listAccounts.js +6 -27
- package/dist/esm/client/actions/listAccounts.js.map +1 -1
- package/dist/esm/client/actions/requestAccount.d.ts +3 -6
- package/dist/esm/client/actions/requestAccount.js +5 -31
- package/dist/esm/client/actions/requestAccount.js.map +1 -1
- package/dist/esm/client/actions/sendCalls.d.ts +4 -4
- package/dist/esm/client/actions/sendCalls.js +4 -8
- package/dist/esm/client/actions/sendCalls.js.map +1 -1
- package/dist/esm/client/actions/sendPreparedCalls.d.ts +1 -1
- package/dist/esm/client/actions/sendPreparedCalls.js +1 -1
- package/dist/esm/client/actions/sendPreparedCalls.js.map +1 -1
- package/dist/esm/client/actions/signMessage.d.ts +1 -1
- package/dist/esm/client/actions/signMessage.js +1 -1
- package/dist/esm/client/actions/signMessage.js.map +1 -1
- package/dist/esm/client/actions/signPreparedCalls.d.ts +1 -1
- package/dist/esm/client/actions/signPreparedCalls.js +2 -5
- package/dist/esm/client/actions/signPreparedCalls.js.map +1 -1
- package/dist/esm/client/actions/signSignatureRequest.d.ts +34 -9
- package/dist/esm/client/actions/signSignatureRequest.js +2 -30
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
- package/dist/esm/client/actions/signTypedData.d.ts +1 -1
- package/dist/esm/client/actions/signTypedData.js +1 -1
- package/dist/esm/client/actions/signTypedData.js.map +1 -1
- package/dist/esm/client/decorator.js +1 -13
- package/dist/esm/client/decorator.js.map +1 -1
- package/dist/esm/client/index.d.ts +2 -8
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/internal/account.d.ts +1 -1
- package/dist/esm/internal/account.js +1 -19
- package/dist/esm/internal/account.js.map +1 -1
- package/dist/esm/utils.d.ts +0 -6
- package/dist/esm/utils.js +1 -14
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/client/actions/getCallsStatus.d.ts +2 -2
- package/dist/types/client/actions/grantPermissions.d.ts +1 -1
- package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
- package/dist/types/client/actions/listAccounts.d.ts +4 -8
- package/dist/types/client/actions/listAccounts.d.ts.map +1 -1
- package/dist/types/client/actions/requestAccount.d.ts +3 -6
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
- package/dist/types/client/actions/sendCalls.d.ts +4 -4
- package/dist/types/client/actions/sendCalls.d.ts.map +1 -1
- package/dist/types/client/actions/sendPreparedCalls.d.ts +1 -1
- package/dist/types/client/actions/signMessage.d.ts +1 -1
- package/dist/types/client/actions/signPreparedCalls.d.ts +1 -1
- package/dist/types/client/actions/signPreparedCalls.d.ts.map +1 -1
- package/dist/types/client/actions/signSignatureRequest.d.ts +34 -9
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
- package/dist/types/client/actions/signTypedData.d.ts +1 -1
- package/dist/types/client/decorator.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +2 -8
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/internal/account.d.ts +1 -1
- package/dist/types/internal/account.d.ts.map +1 -1
- package/dist/types/utils.d.ts +0 -6
- package/dist/types/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +6 -6
- package/src/client/actions/getCallsStatus.ts +2 -2
- package/src/client/actions/grantPermissions.ts +1 -8
- package/src/client/actions/listAccounts.ts +7 -35
- package/src/client/actions/requestAccount.ts +8 -51
- package/src/client/actions/sendCalls.ts +4 -10
- package/src/client/actions/sendPreparedCalls.ts +1 -1
- package/src/client/actions/signMessage.ts +1 -1
- package/src/client/actions/signPreparedCalls.ts +2 -7
- package/src/client/actions/signSignatureRequest.ts +5 -75
- package/src/client/actions/signTypedData.ts +1 -1
- package/src/client/decorator.ts +1 -19
- package/src/client/index.ts +2 -9
- package/src/internal/account.ts +2 -26
- package/src/utils.ts +1 -25
- package/src/version.ts +1 -1
|
@@ -13,7 +13,7 @@ export type SendPreparedCallsResult = RpcSchema["ReturnType"];
|
|
|
13
13
|
*
|
|
14
14
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
15
15
|
* @param {SendPreparedCallsParams} params - Parameters for sending prepared calls
|
|
16
|
-
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
16
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```ts
|
|
@@ -11,7 +11,7 @@ export type SignMessageResult = Hex;
|
|
|
11
11
|
* This method requests the account associated with the signer and uses it to sign the message.
|
|
12
12
|
*
|
|
13
13
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
14
|
-
* @param {SmartAccountSigner
|
|
14
|
+
* @param {SmartAccountSigner} signer - The signer of the smart account
|
|
15
15
|
* @param {SignMessageParams} params - Parameters for signing the message
|
|
16
16
|
* @param {SignableMessage} params.message - The message to sign using EIP-191. Can be a string, or object with raw bytes.
|
|
17
17
|
* @param {Address} [params.account] - Optional account address to use for signing. If not provided, uses the client's current account.
|
|
@@ -11,7 +11,7 @@ export type SignPreparedCallsResult = RpcSchema["Request"]["params"][0];
|
|
|
11
11
|
/**
|
|
12
12
|
* Signs prepared calls using the provided signer.
|
|
13
13
|
*
|
|
14
|
-
* @param {SmartAccountSigner
|
|
14
|
+
* @param {SmartAccountSigner} signer - The signer to use
|
|
15
15
|
* @param {SignPreparedCallsParams} params - The prepared calls with signature requests
|
|
16
16
|
* @returns {Promise<SignPreparedCallsResult>} A Promise that resolves to the signed calls
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signPreparedCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAQ/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,KAAK,SAAS,GAAG,OAAO,CACtB,yBAAyB,EACzB;IACE,OAAO,EAAE;QACP,MAAM,EAAE,0BAA0B,CAAC;KACpC,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,
|
|
1
|
+
{"version":3,"file":"signPreparedCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAQ/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,KAAK,SAAS,GAAG,OAAO,CACtB,yBAAyB,EACzB;IACE,OAAO,EAAE;QACP,MAAM,EAAE,0BAA0B,CAAC;KACpC,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAmElC"}
|
|
@@ -1,14 +1,39 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PersonalSignSignatureRequest, TypedDataSignatureRequest, AuthorizationSignatureRequest, Eip7702UnsignedAuth, UserOpSig, EcdsaSig, WebauthnSig } from "@alchemy/wallet-api-types";
|
|
1
|
+
import type { PersonalSignSignatureRequest, TypedDataSignatureRequest, AuthorizationSignatureRequest, Eip7702UnsignedAuth, EcdsaSig } from "@alchemy/wallet-api-types";
|
|
3
2
|
import type { WithoutRawPayload } from "../../types.ts";
|
|
4
|
-
import type {
|
|
3
|
+
import type { SmartWalletSigner } from "../index.js";
|
|
5
4
|
export type SignSignatureRequestParams = WithoutRawPayload<PersonalSignSignatureRequest | TypedDataSignatureRequest | (AuthorizationSignatureRequest & {
|
|
6
5
|
data: Eip7702UnsignedAuth;
|
|
7
6
|
})>;
|
|
8
|
-
export type SignSignatureRequestResult =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
export type SignSignatureRequestResult = EcdsaSig["signature"];
|
|
8
|
+
/**
|
|
9
|
+
* Signs a signature request using the provided signer.
|
|
10
|
+
* This method handles different types of signature requests including personal_sign, eth_signTypedData_v4, and authorization.
|
|
11
|
+
*
|
|
12
|
+
* @param {SmartAccountSigner} signer - The signer to use for signing the request
|
|
13
|
+
* @param {SignSignatureRequestParams} params - The signature request parameters
|
|
14
|
+
* @param {string} params.type - The type of signature request ('personal_sign', 'eth_signTypedData_v4', or 'signature_with_authorization')
|
|
15
|
+
* @param {SignSignatureRequestParams["data"]} params.data - The data to sign, format depends on the signature type
|
|
16
|
+
* @returns {Promise<SignSignatureRequestResult>} A Promise that resolves to the signature result
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Sign a personal message
|
|
21
|
+
* const result = await client.signSignatureRequest({
|
|
22
|
+
* type: 'personal_sign',
|
|
23
|
+
* data: 'Hello, world!'
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // Sign typed data (EIP-712)
|
|
27
|
+
* const result = await client.signSignatureRequest({
|
|
28
|
+
* type: 'eth_signTypedData_v4',
|
|
29
|
+
* data: {
|
|
30
|
+
* domain: { ... },
|
|
31
|
+
* types: { ... },
|
|
32
|
+
* primaryType: '...',
|
|
33
|
+
* message: { ... }
|
|
34
|
+
* }
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function signSignatureRequest(signer: SmartWalletSigner, params: SignSignatureRequestParams): Promise<EcdsaSig["signature"]>;
|
|
14
39
|
//# sourceMappingURL=signSignatureRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signSignatureRequest.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signSignatureRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signSignatureRequest.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/signSignatureRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACnB,QAAQ,EACT,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,CACtD,4BAA4B,GAC5B,yBAAyB,GACzB,CAAC,6BAA6B,GAAG;IAC/B,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC,CACL,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAkDhC"}
|
|
@@ -10,7 +10,7 @@ export type SignTypedDataResult = Hex;
|
|
|
10
10
|
* This method requests the account associated with the signer and uses it to sign the typed data.
|
|
11
11
|
*
|
|
12
12
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
13
|
-
* @param {SmartAccountSigner
|
|
13
|
+
* @param {SmartAccountSigner} signer - The signer of the smart account
|
|
14
14
|
* @param {TypedDataDefinition} params - The typed data to sign, following EIP-712 format
|
|
15
15
|
* @returns {Promise<SignTypedDataResult>} A Promise that resolves to the signature as a hex string
|
|
16
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../../src/client/decorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EACV,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC7B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../../src/client/decorator.ts"],"names":[],"mappings":"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"}
|
|
@@ -3,13 +3,7 @@ import type { AlchemyTransport } from "@account-kit/infra";
|
|
|
3
3
|
import { type Address, type Chain, type Prettify } from "viem";
|
|
4
4
|
import type { InnerWalletApiClientBase } from "../types.ts";
|
|
5
5
|
import { type SmartWalletActions } from "./decorator.js";
|
|
6
|
-
|
|
7
|
-
export type WebAuthnSigner = {
|
|
8
|
-
credential: ToWebAuthnAccountParameters["credential"];
|
|
9
|
-
getFn?: ToWebAuthnAccountParameters["getFn"] | undefined;
|
|
10
|
-
rpId?: ToWebAuthnAccountParameters["rpId"] | undefined;
|
|
11
|
-
};
|
|
12
|
-
export type SmartWalletSigner = SmartAccountSigner<any> | WebAuthnSigner;
|
|
6
|
+
export type SmartWalletSigner = SmartAccountSigner<any>;
|
|
13
7
|
export type SmartWalletClientParams<TAccount extends Address | undefined = Address | undefined> = Prettify<{
|
|
14
8
|
transport: AlchemyTransport;
|
|
15
9
|
chain: Chain;
|
|
@@ -29,7 +23,7 @@ export type SmartWalletClient<TAccount extends Address | undefined = Address | u
|
|
|
29
23
|
* @param {SmartWalletClientParams} params - The parameters for creating the smart wallet client
|
|
30
24
|
* @param {AlchemyTransport} params.transport - The Alchemy transport to use
|
|
31
25
|
* @param {Chain} params.chain - The chain to use
|
|
32
|
-
* @param {SmartAccountSigner
|
|
26
|
+
* @param {SmartAccountSigner} params.signer - The signer to use for the smart account
|
|
33
27
|
* @param {string} [params.policyId] - The policy ID for gas sponsorship (optional)
|
|
34
28
|
* @param {Address} [params.account] - The smart account address to use (optional)
|
|
35
29
|
* @returns {SmartWalletClient} - A viem-compatible client
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,QAAQ,EAKd,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,QAAQ,EAKd,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AASxB,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAExD,MAAM,MAAM,uBAAuB,CACjC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD,QAAQ,CACV;IACE,SAAS,EAAE,gBAAgB,CAAC;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;CAC1C,GAAG,CACA;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,KAAK,CAAA;CAAE,GACxC;IAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAC7C,CACF,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAC3B,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD,wBAAwB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAChD,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import { type Chain, type Transport, type Address } from "viem";
|
|
3
3
|
import type { SerializedInitcode } from "@alchemy/wallet-api-types";
|
|
4
4
|
import type { SmartWalletSigner } from "../client/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/internal/account.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/internal/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAOzD,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,OAAO,EAEb,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAIpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CA0F/B"}
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { type Hex } from "viem";
|
|
2
|
-
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
3
|
-
import type { WebAuthnPublicKey } from "@alchemy/wallet-api-types";
|
|
4
|
-
import type { ToWebAuthnAccountParameters } from "viem/account-abstraction";
|
|
5
|
-
import type { WebAuthnSigner } from "./client";
|
|
6
2
|
export type Expect<T extends true> = T;
|
|
7
3
|
export declare const assertNever: (_val: never, msg: string) => never;
|
|
8
4
|
/**
|
|
@@ -19,6 +15,4 @@ export declare const assertNever: (_val: never, msg: string) => never;
|
|
|
19
15
|
* ```
|
|
20
16
|
*/
|
|
21
17
|
export declare const castToHex: (val: string | number | bigint | Hex) => Hex;
|
|
22
|
-
export declare function isWebAuthnSigner(signer: SmartAccountSigner | WebAuthnSigner): signer is WebAuthnSigner;
|
|
23
|
-
export declare function credentialToWebAuthnPublicKey(credential: ToWebAuthnAccountParameters["credential"]): WebAuthnPublicKey;
|
|
24
18
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAE9C,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAEvC,eAAO,MAAM,WAAW,GAAI,MAAM,KAAK,EAAE,KAAK,MAAM,KAAG,KAEtD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,KAAG,GAK/D,CAAC"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.84.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@account-kit/wallet-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.84.1",
|
|
4
4
|
"description": "Wallet Client for Alchemy Account Kit",
|
|
5
5
|
"author": "Alchemy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"test:e2e": "bun test ./src/**/*.e2e.test.*"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@aa-sdk/core": "^4.
|
|
48
|
-
"@account-kit/infra": "^4.
|
|
49
|
-
"@account-kit/smart-contracts": "^4.
|
|
50
|
-
"@alchemy/wallet-api-types": "0.1.0-alpha.
|
|
47
|
+
"@aa-sdk/core": "^4.84.1",
|
|
48
|
+
"@account-kit/infra": "^4.84.1",
|
|
49
|
+
"@account-kit/smart-contracts": "^4.84.1",
|
|
50
|
+
"@alchemy/wallet-api-types": "0.1.0-alpha.25",
|
|
51
51
|
"deep-equal": "^2.2.3",
|
|
52
52
|
"ox": "^0.6.12"
|
|
53
53
|
},
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
73
73
|
},
|
|
74
74
|
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "9b40818f612068ad5e2e76b0dc3cc9de21caaacb"
|
|
76
76
|
}
|
|
@@ -32,8 +32,8 @@ export type GetCallsStatusResult = RpcSchema["ReturnType"];
|
|
|
32
32
|
* // After sending prepared calls
|
|
33
33
|
* const sendResult = await client.sendPreparedCalls({...});
|
|
34
34
|
*
|
|
35
|
-
* // Check the status of the
|
|
36
|
-
* const status = await client.getCallsStatus(sendResult.
|
|
35
|
+
* // Check the status of the call ID
|
|
36
|
+
* const status = await client.getCallsStatus(sendResult.id);
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
export async function getCallsStatus(
|
|
@@ -13,7 +13,6 @@ import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
|
|
|
13
13
|
import { signSignatureRequest } from "./signSignatureRequest.js";
|
|
14
14
|
import { metrics } from "../../metrics.js";
|
|
15
15
|
import type { SmartWalletSigner } from "../index.js";
|
|
16
|
-
import { isWebAuthnSigner } from "../../utils.js";
|
|
17
16
|
|
|
18
17
|
type RpcSchema = Extract<
|
|
19
18
|
WalletServerRpcSchemaType,
|
|
@@ -42,7 +41,7 @@ export type GrantPermissionsResult = {
|
|
|
42
41
|
* This allows another key to perform operations on behalf of the account.
|
|
43
42
|
*
|
|
44
43
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
45
|
-
* @param {SmartAccountSigner
|
|
44
|
+
* @param {SmartAccountSigner} signer - The signer of the smart account
|
|
46
45
|
* @param {GrantPermissionsParams} params - The parameters for granting permissions
|
|
47
46
|
* @param {Address} [params.account] - The account address (required if client was not initialized with an account)
|
|
48
47
|
* @param {number} params.expirySec - Unix timestamp when the permissions expire
|
|
@@ -108,12 +107,6 @@ export async function grantPermissions<
|
|
|
108
107
|
throw new AccountNotFoundError();
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
if (isWebAuthnSigner(signer)) {
|
|
112
|
-
throw new Error(
|
|
113
|
-
"WebAuthn signer is not currently supported for grantPermissions",
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
110
|
const { sessionId, signatureRequest } = await client.request({
|
|
118
111
|
method: "wallet_createSession",
|
|
119
112
|
params: [
|
|
@@ -3,11 +3,6 @@ import type { InnerWalletApiClient } from "../../types.ts";
|
|
|
3
3
|
import type { Address } from "viem";
|
|
4
4
|
import { metrics } from "../../metrics.js";
|
|
5
5
|
import type { SmartWalletSigner } from "../index.js";
|
|
6
|
-
import type { WebAuthnPublicKey } from "@alchemy/wallet-api-types";
|
|
7
|
-
import {
|
|
8
|
-
credentialToWebAuthnPublicKey,
|
|
9
|
-
isWebAuthnSigner,
|
|
10
|
-
} from "../../utils.js";
|
|
11
6
|
|
|
12
7
|
type RpcSchema = Extract<
|
|
13
8
|
WalletServerRpcSchemaType,
|
|
@@ -21,8 +16,7 @@ type RpcSchema = Extract<
|
|
|
21
16
|
export type ListAccountsParams = Omit<
|
|
22
17
|
RpcSchema["Request"]["params"][0],
|
|
23
18
|
"signerAddress" | "signerPublicKey"
|
|
24
|
-
> &
|
|
25
|
-
({ signerAddress: Address } | { signerPublicKey: WebAuthnPublicKey } | {});
|
|
19
|
+
> & { signerAddress?: Address };
|
|
26
20
|
|
|
27
21
|
export type ListAccountsResult = RpcSchema["ReturnType"];
|
|
28
22
|
|
|
@@ -30,10 +24,9 @@ export type ListAccountsResult = RpcSchema["ReturnType"];
|
|
|
30
24
|
* Lists all smart accounts for a given signer using the wallet API client.
|
|
31
25
|
*
|
|
32
26
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
33
|
-
* @param {SmartAccountSigner
|
|
27
|
+
* @param {SmartAccountSigner} signer - The signer for which to list accounts
|
|
34
28
|
* @param {ListAccountsParams} params - Parameters for listing accounts
|
|
35
29
|
* @param {Address} [params.signerAddress] - The address of the signer to list accounts for
|
|
36
|
-
* @param {WebAuthnPublicKey} [params.signerPublicKey] - The public key of the signer to list accounts for
|
|
37
30
|
* @param {number} [params.limit] - Optional maximum number of accounts to return (default: 100, max: 100)
|
|
38
31
|
* @param {string} [params.after] - Optional pagination cursor for fetching subsequent pages
|
|
39
32
|
* @returns {Promise<ListAccountsResult>} A Promise that resolves to the list of accounts and pagination metadata
|
|
@@ -63,37 +56,16 @@ export async function listAccounts(
|
|
|
63
56
|
name: "list_accounts",
|
|
64
57
|
});
|
|
65
58
|
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const signerArg =
|
|
71
|
-
"signerAddress" in params
|
|
72
|
-
? { signerAddress: params.signerAddress }
|
|
73
|
-
: "signerPublicKey" in params
|
|
74
|
-
? {
|
|
75
|
-
signerPublicKey: {
|
|
76
|
-
...params.signerPublicKey,
|
|
77
|
-
type: "webauthn-p256" as const,
|
|
78
|
-
},
|
|
79
|
-
}
|
|
80
|
-
: isWebAuthnSigner(signer)
|
|
81
|
-
? {
|
|
82
|
-
signerPublicKey: {
|
|
83
|
-
...credentialToWebAuthnPublicKey(signer.credential),
|
|
84
|
-
type: "webauthn-p256" as const,
|
|
85
|
-
},
|
|
86
|
-
}
|
|
87
|
-
: ({
|
|
88
|
-
signerAddress: await signer.getAddress(),
|
|
89
|
-
} satisfies RpcSchema["Request"]["params"][0]);
|
|
59
|
+
// signerAddress in params takes priority; otherwise fallback to client's attached signer
|
|
60
|
+
const signerAddress = params.signerAddress ?? (await signer.getAddress());
|
|
61
|
+
const { signerAddress: _signerAddress, ...rest } = params;
|
|
90
62
|
|
|
91
63
|
return client.request({
|
|
92
64
|
method: "wallet_listAccounts",
|
|
93
65
|
params: [
|
|
94
66
|
{
|
|
95
|
-
...
|
|
96
|
-
|
|
67
|
+
...rest,
|
|
68
|
+
signerAddress,
|
|
97
69
|
},
|
|
98
70
|
],
|
|
99
71
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import type { Address } from "abitype";
|
|
3
3
|
import deepEqual from "deep-equal";
|
|
4
4
|
import { custom } from "viem";
|
|
@@ -6,15 +6,6 @@ import type { WalletServerRpcSchemaType } from "@alchemy/wallet-api-types/rpc";
|
|
|
6
6
|
import type { InnerWalletApiClient } from "../../types.js";
|
|
7
7
|
import { createAccount } from "../../internal/account.js";
|
|
8
8
|
import type { SmartWalletSigner } from "../index.js";
|
|
9
|
-
import {
|
|
10
|
-
credentialToWebAuthnPublicKey,
|
|
11
|
-
isWebAuthnSigner,
|
|
12
|
-
} from "../../utils.js";
|
|
13
|
-
import type {
|
|
14
|
-
CreationOptionsByPublicKey,
|
|
15
|
-
CreationOptionsBySignerAddress,
|
|
16
|
-
WebAuthnPublicKey,
|
|
17
|
-
} from "@alchemy/wallet-api-types";
|
|
18
9
|
|
|
19
10
|
type RpcSchema = Extract<
|
|
20
11
|
WalletServerRpcSchemaType,
|
|
@@ -26,11 +17,8 @@ type RpcSchema = Extract<
|
|
|
26
17
|
>;
|
|
27
18
|
|
|
28
19
|
export type RequestAccountParams = Omit<
|
|
29
|
-
Extract<
|
|
30
|
-
|
|
31
|
-
{ signerAddress: Address } | { signerPublicKey: WebAuthnPublicKey }
|
|
32
|
-
>,
|
|
33
|
-
"signerAddress" | "signerPublicKey" | "includeCounterfactualInfo"
|
|
20
|
+
Extract<RpcSchema["Request"]["params"][0], { signerAddress: Address }>,
|
|
21
|
+
"signerAddress" | "includeCounterfactualInfo"
|
|
34
22
|
> & { accountAddress?: Address };
|
|
35
23
|
|
|
36
24
|
export type RequestAccountResult = SmartContractAccount;
|
|
@@ -41,7 +29,7 @@ export type RequestAccountResult = SmartContractAccount;
|
|
|
41
29
|
* If an account already exists, the creationHint will be ignored.
|
|
42
30
|
*
|
|
43
31
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
44
|
-
* @param {SmartAccountSigner
|
|
32
|
+
* @param {SmartAccountSigner} signer - The signer that will be associated with the account
|
|
45
33
|
* @param {RequestAccountParams} [params] - Optional parameters for requesting a specific account
|
|
46
34
|
* @param {string} [params.id] - Optional identifier for the account. If specified, a new account with this ID will be created even if one already exists for the signer
|
|
47
35
|
* @param {object} [params.creationHint] - Optional hints to guide account creation. These are ignored if an account already exists
|
|
@@ -61,24 +49,6 @@ export async function requestAccount(
|
|
|
61
49
|
): Promise<RequestAccountResult> {
|
|
62
50
|
const { creationHint = {} } = params ?? {};
|
|
63
51
|
|
|
64
|
-
if (isWebAuthnSigner(signer)) {
|
|
65
|
-
if (
|
|
66
|
-
creationHint.accountType &&
|
|
67
|
-
creationHint.accountType !== "mav2-webauthn"
|
|
68
|
-
) {
|
|
69
|
-
throw new BaseError(
|
|
70
|
-
"WebAuthn signers are only supported with mav2-webauthn account type",
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
} else {
|
|
74
|
-
// non-webauthn signers do not support the "mav2-webauthn" account type
|
|
75
|
-
if (creationHint.accountType === "mav2-webauthn") {
|
|
76
|
-
throw new BaseError(
|
|
77
|
-
"ECDSA (secp256k1) signers are not supported with mav2-webauthn account type",
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
52
|
const args = (
|
|
83
53
|
(client.account && !params) || params?.accountAddress
|
|
84
54
|
? {
|
|
@@ -86,25 +56,12 @@ export async function requestAccount(
|
|
|
86
56
|
includeCounterfactualInfo: true,
|
|
87
57
|
}
|
|
88
58
|
: {
|
|
89
|
-
|
|
59
|
+
signerAddress: await signer.getAddress(),
|
|
60
|
+
...(creationHint
|
|
90
61
|
? {
|
|
91
|
-
|
|
92
|
-
...credentialToWebAuthnPublicKey(signer.credential),
|
|
93
|
-
type: "webauthn-p256",
|
|
94
|
-
},
|
|
95
|
-
...(creationHint
|
|
96
|
-
? { creationHint: creationHint as CreationOptionsByPublicKey }
|
|
97
|
-
: {}),
|
|
62
|
+
creationHint,
|
|
98
63
|
}
|
|
99
|
-
: {
|
|
100
|
-
signerAddress: await signer.getAddress(),
|
|
101
|
-
...(creationHint
|
|
102
|
-
? {
|
|
103
|
-
creationHint:
|
|
104
|
-
creationHint as CreationOptionsBySignerAddress,
|
|
105
|
-
}
|
|
106
|
-
: {}),
|
|
107
|
-
}),
|
|
64
|
+
: {}),
|
|
108
65
|
includeCounterfactualInfo: true,
|
|
109
66
|
}
|
|
110
67
|
) satisfies RpcSchema["Request"]["params"][0];
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
} from "./sendPreparedCalls.js";
|
|
10
10
|
import { signSignatureRequest } from "./signSignatureRequest.js";
|
|
11
11
|
import type { SmartWalletSigner } from "../index.js";
|
|
12
|
-
import { isWebAuthnSigner } from "../../utils.js";
|
|
13
12
|
import { extractCapabilitiesForSending } from "../../internal/capabilities.js";
|
|
14
13
|
|
|
15
14
|
export type SendCallsParams<
|
|
@@ -27,12 +26,12 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
27
26
|
* </Note>
|
|
28
27
|
*
|
|
29
28
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
30
|
-
* @param {SmartAccountSigner
|
|
29
|
+
* @param {SmartAccountSigner} signer - The signer to use
|
|
31
30
|
* @param {PrepareCallsParams<TAccount>} params - Parameters for sending calls
|
|
32
31
|
* @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute
|
|
33
32
|
* @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)
|
|
34
33
|
* @param {object} [params.capabilities] - Optional capabilities to include with the request. See [API documentation](/wallets/api-reference/smart-wallets/wallet-api-endpoints/wallet-api-endpoints/wallet-prepare-calls#request.body.prepareCallsRequest.capabilities) for details.
|
|
35
|
-
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
34
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID.
|
|
36
35
|
*
|
|
37
36
|
* @example
|
|
38
37
|
* ```ts
|
|
@@ -47,8 +46,8 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
47
46
|
* }
|
|
48
47
|
* });
|
|
49
48
|
*
|
|
50
|
-
* // The result contains the
|
|
51
|
-
* console.log(result.
|
|
49
|
+
* // The result contains the call ID
|
|
50
|
+
* console.log(result.id);
|
|
52
51
|
* ```
|
|
53
52
|
*/
|
|
54
53
|
export async function sendCalls<
|
|
@@ -65,11 +64,6 @@ export async function sendCalls<
|
|
|
65
64
|
let calls = await prepareCalls(client, params);
|
|
66
65
|
|
|
67
66
|
if (calls.type === "paymaster-permit") {
|
|
68
|
-
if (isWebAuthnSigner(signer)) {
|
|
69
|
-
throw new Error(
|
|
70
|
-
"WebAuthn signer is not currently supported for signing paymaster permit signatures",
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
67
|
const signature = await signSignatureRequest(
|
|
74
68
|
signer,
|
|
75
69
|
calls.signatureRequest,
|
|
@@ -25,7 +25,7 @@ export type SendPreparedCallsResult = RpcSchema["ReturnType"];
|
|
|
25
25
|
*
|
|
26
26
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
27
27
|
* @param {SendPreparedCallsParams} params - Parameters for sending prepared calls
|
|
28
|
-
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
28
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```ts
|
|
@@ -13,7 +13,7 @@ export type SignMessageResult = Hex;
|
|
|
13
13
|
* This method requests the account associated with the signer and uses it to sign the message.
|
|
14
14
|
*
|
|
15
15
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
16
|
-
* @param {SmartAccountSigner
|
|
16
|
+
* @param {SmartAccountSigner} signer - The signer of the smart account
|
|
17
17
|
* @param {SignMessageParams} params - Parameters for signing the message
|
|
18
18
|
* @param {SignableMessage} params.message - The message to sign using EIP-191. Can be a string, or object with raw bytes.
|
|
19
19
|
* @param {Address} [params.account] - Optional account address to use for signing. If not provided, uses the client's current account.
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
PreparedCall_UserOpV070,
|
|
9
9
|
} from "@alchemy/wallet-api-types";
|
|
10
10
|
import { metrics } from "../../metrics.js";
|
|
11
|
-
import { assertNever
|
|
11
|
+
import { assertNever } from "../../utils.js";
|
|
12
12
|
import type { SmartWalletSigner } from "../index.js";
|
|
13
13
|
|
|
14
14
|
type RpcSchema = Extract<
|
|
@@ -27,7 +27,7 @@ export type SignPreparedCallsResult = RpcSchema["Request"]["params"][0];
|
|
|
27
27
|
/**
|
|
28
28
|
* Signs prepared calls using the provided signer.
|
|
29
29
|
*
|
|
30
|
-
* @param {SmartAccountSigner
|
|
30
|
+
* @param {SmartAccountSigner} signer - The signer to use
|
|
31
31
|
* @param {SignPreparedCallsParams} params - The prepared calls with signature requests
|
|
32
32
|
* @returns {Promise<SignPreparedCallsResult>} A Promise that resolves to the signed calls
|
|
33
33
|
*/
|
|
@@ -44,11 +44,6 @@ export async function signPreparedCalls(
|
|
|
44
44
|
|
|
45
45
|
const signAuthorizationCall = async (call: PreparedCall_Authorization) => {
|
|
46
46
|
const { signatureRequest: _signatureRequest, ...rest } = call;
|
|
47
|
-
if (isWebAuthnSigner(signer)) {
|
|
48
|
-
throw new Error(
|
|
49
|
-
"WebAuthn account cannot sign EIP-7702 authorization requests",
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
47
|
const signature = await signSignatureRequest(signer, {
|
|
53
48
|
type: "eip7702Auth",
|
|
54
49
|
data: {
|