@account-kit/wallet-client 4.65.0 → 4.66.0

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.
@@ -2,6 +2,7 @@ import { AccountNotFoundError } from "@aa-sdk/core";
2
2
  import { toHex } from "viem";
3
3
  import { wallet_prepareCalls } from "@alchemy/wallet-api-types/rpc";
4
4
  import { metrics } from "../../metrics.js";
5
+ import { mergeClientCapabilities } from "../../internal/capabilities.js";
5
6
  /**
6
7
  * Prepares a set of contract calls for execution by building a user operation.
7
8
  * Returns the built user operation and a signature request that needs to be signed
@@ -38,12 +39,7 @@ export async function prepareCalls(client, params) {
38
39
  if (!from) {
39
40
  throw new AccountNotFoundError();
40
41
  }
41
- if (client.policyIds && !params.capabilities?.paymasterService) {
42
- params.capabilities = {
43
- ...params.capabilities,
44
- paymasterService: { policyIds: client.policyIds },
45
- };
46
- }
42
+ const capabilities = mergeClientCapabilities(client, params.capabilities);
47
43
  return await client.request({
48
44
  method: "wallet_prepareCalls",
49
45
  params: [
@@ -51,6 +47,7 @@ export async function prepareCalls(client, params) {
51
47
  ...params,
52
48
  chainId: toHex(client.chain.id),
53
49
  from,
50
+ capabilities,
54
51
  },
55
52
  ],
56
53
  });
@@ -1 +1 @@
1
- {"version":3,"file":"prepareCalls.js","sourceRoot":"","sources":["../../../../src/client/actions/prepareCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,KAAK,EAAkC,MAAM,MAAM,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAqB3C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAGhC,MAA4B,EAC5B,MAAoC;IAEpC,OAAO,CAAC,UAAU,CAAC;QACjB,IAAI,EAAE,eAAe;KACtB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IACpD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,gBAAgB,EAAE,CAAC;QAC/D,MAAM,CAAC,YAAY,GAAG;YACpB,GAAG,MAAM,CAAC,YAAY;YACtB,gBAAgB,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE;SAClD,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QAC1B,MAAM,EAAE,qBAAqB;QAC7B,MAAM,EAAE;YACN;gBACE,GAAG,MAAM;gBACT,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/B,IAAI;aACL;SACF;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { AccountNotFoundError } from \"@aa-sdk/core\";\nimport { toHex, type Address, type IsUndefined } from \"viem\";\nimport type { InnerWalletApiClient } from \"../../types.ts\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { wallet_prepareCalls } from \"@alchemy/wallet-api-types/rpc\";\nimport { metrics } from \"../../metrics.js\";\n\nexport type GetAccountParam<TAccount> =\n IsUndefined<TAccount> extends true\n ? { account: Address }\n : { account?: Address };\n\nexport type PrepareCallsParams<\n TAccount extends Address | undefined = Address | undefined,\n> = Omit<\n Static<\n (typeof wallet_prepareCalls)[\"properties\"][\"Request\"][\"properties\"][\"params\"]\n >[0],\n \"from\" | \"chainId\"\n> &\n (IsUndefined<TAccount> extends true ? { from: Address } : { from?: never });\n\nexport type PrepareCallsResult = Static<\n typeof wallet_prepareCalls\n>[\"ReturnType\"];\n\n/**\n * Prepares a set of contract calls for execution by building a user operation.\n * Returns the built user operation and a signature request that needs to be signed\n * before submitting to sendPreparedCalls.\n *\n * @param {InnerWalletApiClient<TAccount>} client - The wallet API client to use for the request\n * @param {PrepareCallsParams<TAccount>} params - Parameters for preparing calls\n * @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute\n * @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)\n * @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.\n * @returns {Promise<PrepareCallsResult>} A Promise that resolves to the prepared calls result containing\n * the user operation data and signature request\n *\n * @example\n * ```ts\n * // Prepare a sponsored user operation call\n * const result = await client.prepareCalls({\n * calls: [{\n * to: \"0x1234...\",\n * data: \"0xabcdef...\",\n * value: \"0x0\"\n * }],\n * capabilities: {\n * paymasterService: { policyId: \"your-policy-id\" }\n * }\n * });\n * ```\n */\nexport async function prepareCalls<\n TAccount extends Address | undefined = Address | undefined,\n>(\n client: InnerWalletApiClient,\n params: PrepareCallsParams<TAccount>,\n): Promise<PrepareCallsResult> {\n metrics.trackEvent({\n name: \"prepare_calls\",\n });\n\n const from = params.from ?? client.account?.address;\n if (!from) {\n throw new AccountNotFoundError();\n }\n\n if (client.policyIds && !params.capabilities?.paymasterService) {\n params.capabilities = {\n ...params.capabilities,\n paymasterService: { policyIds: client.policyIds },\n };\n }\n\n return await client.request({\n method: \"wallet_prepareCalls\",\n params: [\n {\n ...params,\n chainId: toHex(client.chain.id),\n from,\n },\n ],\n });\n}\n"]}
1
+ {"version":3,"file":"prepareCalls.js","sourceRoot":"","sources":["../../../../src/client/actions/prepareCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,KAAK,EAAkC,MAAM,MAAM,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAqBzE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAGhC,MAA4B,EAC5B,MAAoC;IAEpC,OAAO,CAAC,UAAU,CAAC;QACjB,IAAI,EAAE,eAAe;KACtB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IACpD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,YAAY,GAAG,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAE1E,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QAC1B,MAAM,EAAE,qBAAqB;QAC7B,MAAM,EAAE;YACN;gBACE,GAAG,MAAM;gBACT,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/B,IAAI;gBACJ,YAAY;aACb;SACF;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { AccountNotFoundError } from \"@aa-sdk/core\";\nimport { toHex, type Address, type IsUndefined } from \"viem\";\nimport type { InnerWalletApiClient } from \"../../types.ts\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { wallet_prepareCalls } from \"@alchemy/wallet-api-types/rpc\";\nimport { metrics } from \"../../metrics.js\";\nimport { mergeClientCapabilities } from \"../../internal/capabilities.js\";\n\nexport type GetAccountParam<TAccount> =\n IsUndefined<TAccount> extends true\n ? { account: Address }\n : { account?: Address };\n\nexport type PrepareCallsParams<\n TAccount extends Address | undefined = Address | undefined,\n> = Omit<\n Static<\n (typeof wallet_prepareCalls)[\"properties\"][\"Request\"][\"properties\"][\"params\"]\n >[0],\n \"from\" | \"chainId\"\n> &\n (IsUndefined<TAccount> extends true ? { from: Address } : { from?: never });\n\nexport type PrepareCallsResult = Static<\n typeof wallet_prepareCalls\n>[\"ReturnType\"];\n\n/**\n * Prepares a set of contract calls for execution by building a user operation.\n * Returns the built user operation and a signature request that needs to be signed\n * before submitting to sendPreparedCalls.\n *\n * @param {InnerWalletApiClient<TAccount>} client - The wallet API client to use for the request\n * @param {PrepareCallsParams<TAccount>} params - Parameters for preparing calls\n * @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute\n * @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)\n * @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.\n * @returns {Promise<PrepareCallsResult>} A Promise that resolves to the prepared calls result containing\n * the user operation data and signature request\n *\n * @example\n * ```ts\n * // Prepare a sponsored user operation call\n * const result = await client.prepareCalls({\n * calls: [{\n * to: \"0x1234...\",\n * data: \"0xabcdef...\",\n * value: \"0x0\"\n * }],\n * capabilities: {\n * paymasterService: { policyId: \"your-policy-id\" }\n * }\n * });\n * ```\n */\nexport async function prepareCalls<\n TAccount extends Address | undefined = Address | undefined,\n>(\n client: InnerWalletApiClient,\n params: PrepareCallsParams<TAccount>,\n): Promise<PrepareCallsResult> {\n metrics.trackEvent({\n name: \"prepare_calls\",\n });\n\n const from = params.from ?? client.account?.address;\n if (!from) {\n throw new AccountNotFoundError();\n }\n\n const capabilities = mergeClientCapabilities(client, params.capabilities);\n\n return await client.request({\n method: \"wallet_prepareCalls\",\n params: [\n {\n ...params,\n chainId: toHex(client.chain.id),\n from,\n capabilities,\n },\n ],\n });\n}\n"]}
@@ -2,10 +2,10 @@ import type { Static } from "@sinclair/typebox";
2
2
  import { type Address, type IsUndefined, type Prettify, type UnionOmit } from "viem";
3
3
  import type { wallet_requestQuote_v0 } from "@alchemy/wallet-api-types/rpc";
4
4
  import type { InnerWalletApiClientBase } from "../../types.js";
5
- export type RequestQuoteV0Params<TAccount extends Address | undefined = Address | undefined> = Prettify<UnionOmit<Static<(typeof wallet_requestQuote_v0)["properties"]["Request"]["properties"]["params"]>[0], "from" | "chainId"> & (IsUndefined<TAccount> extends true ? {
5
+ export type RequestQuoteV0Params<TAccount extends Address | undefined = Address | undefined> = Prettify<UnionOmit<Static<(typeof wallet_requestQuote_v0)["properties"]["Request"]["properties"]["params"]>[0], "from" | "chainId">> & (IsUndefined<TAccount> extends true ? {
6
6
  from: Address;
7
7
  } : {
8
8
  from?: never;
9
- })>;
9
+ });
10
10
  export type RequestQuoteV0Result = Prettify<Static<typeof wallet_requestQuote_v0>["ReturnType"]>;
11
11
  export declare function requestQuoteV0<TAccount extends Address | undefined = Address | undefined>(client: InnerWalletApiClientBase, params: RequestQuoteV0Params<TAccount>): Promise<RequestQuoteV0Result>;
@@ -1,10 +1,14 @@
1
1
  import { toHex, } from "viem";
2
2
  import { AccountNotFoundError } from "@aa-sdk/core";
3
+ import { mergeClientCapabilities } from "../../internal/capabilities.js";
3
4
  export async function requestQuoteV0(client, params) {
4
5
  const from = params.from ?? client.account?.address;
5
6
  if (!from) {
6
7
  throw new AccountNotFoundError();
7
8
  }
9
+ const capabilities = params.returnRawCalls
10
+ ? undefined
11
+ : mergeClientCapabilities(client, params.capabilities);
8
12
  return await client.request({
9
13
  method: "wallet_requestQuote_v0",
10
14
  params: [
@@ -12,6 +16,7 @@ export async function requestQuoteV0(client, params) {
12
16
  ...params,
13
17
  chainId: toHex(client.chain.id),
14
18
  from,
19
+ ...(capabilities && { capabilities }),
15
20
  },
16
21
  ],
17
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"requestQuoteV0.js","sourceRoot":"","sources":["../../../../src/experimental/actions/requestQuoteV0.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,GAKN,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAkBpD,MAAM,CAAC,KAAK,UAAU,cAAc,CAGlC,MAAgC,EAChC,MAAsC;IAEtC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IACpD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QAC1B,MAAM,EAAE,wBAAwB;QAChC,MAAM,EAAE;YACN;gBACE,GAAG,MAAM;gBACT,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/B,IAAI;aACL;SACF;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Static } from \"@sinclair/typebox\";\nimport {\n toHex,\n type Address,\n type IsUndefined,\n type Prettify,\n type UnionOmit,\n} from \"viem\";\nimport type { wallet_requestQuote_v0 } from \"@alchemy/wallet-api-types/rpc\";\nimport type { InnerWalletApiClientBase } from \"../../types.js\";\nimport { AccountNotFoundError } from \"@aa-sdk/core\";\n\nexport type RequestQuoteV0Params<\n TAccount extends Address | undefined = Address | undefined,\n> = Prettify<\n UnionOmit<\n Static<\n (typeof wallet_requestQuote_v0)[\"properties\"][\"Request\"][\"properties\"][\"params\"]\n >[0],\n \"from\" | \"chainId\"\n > &\n (IsUndefined<TAccount> extends true ? { from: Address } : { from?: never })\n>;\n\nexport type RequestQuoteV0Result = Prettify<\n Static<typeof wallet_requestQuote_v0>[\"ReturnType\"]\n>;\n\nexport async function requestQuoteV0<\n TAccount extends Address | undefined = Address | undefined,\n>(\n client: InnerWalletApiClientBase,\n params: RequestQuoteV0Params<TAccount>,\n): Promise<RequestQuoteV0Result> {\n const from = params.from ?? client.account?.address;\n if (!from) {\n throw new AccountNotFoundError();\n }\n\n return await client.request({\n method: \"wallet_requestQuote_v0\",\n params: [\n {\n ...params,\n chainId: toHex(client.chain.id),\n from,\n },\n ],\n });\n}\n"]}
1
+ {"version":3,"file":"requestQuoteV0.js","sourceRoot":"","sources":["../../../../src/experimental/actions/requestQuoteV0.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,GAKN,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAkBzE,MAAM,CAAC,KAAK,UAAU,cAAc,CAGlC,MAAgC,EAChC,MAAsC;IAEtC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IACpD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc;QACxC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAEzD,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QAC1B,MAAM,EAAE,wBAAwB;QAChC,MAAM,EAAE;YACN;gBACE,GAAG,MAAM;gBACT,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/B,IAAI;gBACJ,GAAG,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,CAAC;aACtC;SACF;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Static } from \"@sinclair/typebox\";\nimport {\n toHex,\n type Address,\n type IsUndefined,\n type Prettify,\n type UnionOmit,\n} from \"viem\";\nimport type { wallet_requestQuote_v0 } from \"@alchemy/wallet-api-types/rpc\";\nimport type { InnerWalletApiClientBase } from \"../../types.js\";\nimport { AccountNotFoundError } from \"@aa-sdk/core\";\nimport { mergeClientCapabilities } from \"../../internal/capabilities.js\";\n\nexport type RequestQuoteV0Params<\n TAccount extends Address | undefined = Address | undefined,\n> = Prettify<\n UnionOmit<\n Static<\n (typeof wallet_requestQuote_v0)[\"properties\"][\"Request\"][\"properties\"][\"params\"]\n >[0],\n \"from\" | \"chainId\"\n >\n> &\n (IsUndefined<TAccount> extends true ? { from: Address } : { from?: never });\n\nexport type RequestQuoteV0Result = Prettify<\n Static<typeof wallet_requestQuote_v0>[\"ReturnType\"]\n>;\n\nexport async function requestQuoteV0<\n TAccount extends Address | undefined = Address | undefined,\n>(\n client: InnerWalletApiClientBase,\n params: RequestQuoteV0Params<TAccount>,\n): Promise<RequestQuoteV0Result> {\n const from = params.from ?? client.account?.address;\n if (!from) {\n throw new AccountNotFoundError();\n }\n\n const capabilities = params.returnRawCalls\n ? undefined\n : mergeClientCapabilities(client, params.capabilities);\n\n return await client.request({\n method: \"wallet_requestQuote_v0\",\n params: [\n {\n ...params,\n chainId: toHex(client.chain.id),\n from,\n ...(capabilities && { capabilities }),\n },\n ],\n });\n}\n"]}
@@ -1,16 +1,30 @@
1
1
  export { createSmartWalletClient, type SmartWalletClient, type SmartWalletClientParams, } from "../client/index.js";
2
2
  export { WalletServerRpcSchema, type WalletServerRpcSchemaType, } from "@alchemy/wallet-api-types/rpc";
3
+ export type * from "../client/actions/getCallsStatus.js";
3
4
  export { getCallsStatus } from "../client/actions/getCallsStatus.js";
5
+ export type * from "../client/actions/grantPermissions.js";
4
6
  export { grantPermissions } from "../client/actions/grantPermissions.js";
7
+ export type * from "../client/actions/listAccounts.js";
5
8
  export { listAccounts } from "../client/actions/listAccounts.js";
9
+ export type * from "../client/actions/prepareCalls.js";
6
10
  export { prepareCalls } from "../client/actions/prepareCalls.js";
11
+ export type * from "../client/actions/requestAccount.js";
7
12
  export { requestAccount } from "../client/actions/requestAccount.js";
13
+ export type * from "../client/actions/signSignatureRequest.js";
8
14
  export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
15
+ export type * from "../client/actions/signPreparedCalls.js";
9
16
  export { signPreparedCalls } from "../client/actions/signPreparedCalls.js";
17
+ export type * from "../client/actions/signMessage.js";
10
18
  export { signMessage } from "../client/actions/signMessage.js";
19
+ export type * from "../client/actions/signTypedData.js";
11
20
  export { signTypedData } from "../client/actions/signTypedData.js";
21
+ export type * from "../client/actions/sendPreparedCalls.js";
12
22
  export { sendPreparedCalls } from "../client/actions/sendPreparedCalls.js";
23
+ export type * from "../client/actions/sendCalls.js";
13
24
  export { sendCalls } from "../client/actions/sendCalls.js";
25
+ export type * from "../client/actions/waitForCallsStatus.js";
14
26
  export { waitForCallsStatus } from "../client/actions/waitForCallsStatus.js";
27
+ export type * from "../client/actions/prepareSign.js";
15
28
  export { prepareSign } from "../client/actions/prepareSign.js";
29
+ export type * from "../client/actions/formatSign.js";
16
30
  export { formatSign } from "../client/actions/formatSign.js";
@@ -2,7 +2,6 @@
2
2
  // and we shouldn't export * for the sake of tree-shaking
3
3
  export { createSmartWalletClient, } from "../client/index.js";
4
4
  export { WalletServerRpcSchema, } from "@alchemy/wallet-api-types/rpc";
5
- // client actions
6
5
  export { getCallsStatus } from "../client/actions/getCallsStatus.js";
7
6
  export { grantPermissions } from "../client/actions/grantPermissions.js";
8
7
  export { listAccounts } from "../client/actions/listAccounts.js";
@@ -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,GAEtB,MAAM,+BAA+B,CAAC;AAEvC,iBAAiB;AACjB,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;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,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} from \"@alchemy/wallet-api-types/rpc\";\n\n// client actions\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\";\nexport { sendPreparedCalls } from \"../client/actions/sendPreparedCalls.js\";\nexport { sendCalls } from \"../client/actions/sendCalls.js\";\nexport { waitForCallsStatus } from \"../client/actions/waitForCallsStatus.js\";\nexport { prepareSign } from \"../client/actions/prepareSign.js\";\nexport { formatSign } from \"../client/actions/formatSign.js\";\n"]}
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,GAEtB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,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} from \"@alchemy/wallet-api-types/rpc\";\n\n// client actions\nexport type * from \"../client/actions/getCallsStatus.js\";\nexport { getCallsStatus } from \"../client/actions/getCallsStatus.js\";\nexport type * from \"../client/actions/grantPermissions.js\";\nexport { grantPermissions } from \"../client/actions/grantPermissions.js\";\nexport type * from \"../client/actions/listAccounts.js\";\nexport { listAccounts } from \"../client/actions/listAccounts.js\";\nexport type * from \"../client/actions/prepareCalls.js\";\nexport { prepareCalls } from \"../client/actions/prepareCalls.js\";\nexport type * from \"../client/actions/requestAccount.js\";\nexport { requestAccount } from \"../client/actions/requestAccount.js\";\nexport type * from \"../client/actions/signSignatureRequest.js\";\nexport { signSignatureRequest } from \"../client/actions/signSignatureRequest.js\";\nexport type * from \"../client/actions/signPreparedCalls.js\";\nexport { signPreparedCalls } from \"../client/actions/signPreparedCalls.js\";\nexport type * from \"../client/actions/signMessage.js\";\nexport { signMessage } from \"../client/actions/signMessage.js\";\nexport type * from \"../client/actions/signTypedData.js\";\nexport { signTypedData } from \"../client/actions/signTypedData.js\";\nexport type * from \"../client/actions/sendPreparedCalls.js\";\nexport { sendPreparedCalls } from \"../client/actions/sendPreparedCalls.js\";\nexport type * from \"../client/actions/sendCalls.js\";\nexport { sendCalls } from \"../client/actions/sendCalls.js\";\nexport type * from \"../client/actions/waitForCallsStatus.js\";\nexport { waitForCallsStatus } from \"../client/actions/waitForCallsStatus.js\";\nexport type * from \"../client/actions/prepareSign.js\";\nexport { prepareSign } from \"../client/actions/prepareSign.js\";\nexport type * from \"../client/actions/formatSign.js\";\nexport { formatSign } from \"../client/actions/formatSign.js\";\n"]}
@@ -0,0 +1,10 @@
1
+ import type { Capabilities } from "@alchemy/wallet-api-types/capabilities";
2
+ import type { InnerWalletApiClientBase } from "../types.js";
3
+ /**
4
+ * Merges client capabilities with capabilities from the request.
5
+ *
6
+ * @param {InnerWalletApiClientBase} client - The inner wallet API client (potentially including global capabilities like policy IDs)
7
+ * @param {Capabilities | undefined} capabilities - Request capabilities to merge with, if any
8
+ * @returns {Capabilities | undefined} The merged capabilities object, or original capabilities if no capability configuration exists on the client
9
+ */
10
+ export declare const mergeClientCapabilities: (client: InnerWalletApiClientBase, capabilities: Capabilities | undefined) => Capabilities | undefined;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Merges client capabilities with capabilities from the request.
3
+ *
4
+ * @param {InnerWalletApiClientBase} client - The inner wallet API client (potentially including global capabilities like policy IDs)
5
+ * @param {Capabilities | undefined} capabilities - Request capabilities to merge with, if any
6
+ * @returns {Capabilities | undefined} The merged capabilities object, or original capabilities if no capability configuration exists on the client
7
+ */
8
+ export const mergeClientCapabilities = (client, capabilities) => {
9
+ return client.policyIds?.length
10
+ ? {
11
+ ...capabilities,
12
+ paymasterService: {
13
+ policyIds: client.policyIds,
14
+ ...capabilities?.paymasterService,
15
+ },
16
+ }
17
+ : capabilities;
18
+ };
19
+ //# sourceMappingURL=capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/internal/capabilities.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,MAAgC,EAChC,YAAsC,EACZ,EAAE;IAC5B,OAAO,MAAM,CAAC,SAAS,EAAE,MAAM;QAC7B,CAAC,CAAC;YACE,GAAG,YAAY;YACf,gBAAgB,EAAE;gBAChB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,GAAG,YAAY,EAAE,gBAAgB;aAClC;SACF;QACH,CAAC,CAAC,YAAY,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import type { Capabilities } from \"@alchemy/wallet-api-types/capabilities\";\nimport type { InnerWalletApiClientBase } from \"../types.js\";\n\n/**\n * Merges client capabilities with capabilities from the request.\n *\n * @param {InnerWalletApiClientBase} client - The inner wallet API client (potentially including global capabilities like policy IDs)\n * @param {Capabilities | undefined} capabilities - Request capabilities to merge with, if any\n * @returns {Capabilities | undefined} The merged capabilities object, or original capabilities if no capability configuration exists on the client\n */\nexport const mergeClientCapabilities = (\n client: InnerWalletApiClientBase,\n capabilities: Capabilities | undefined,\n): Capabilities | undefined => {\n return client.policyIds?.length\n ? {\n ...capabilities,\n paymasterService: {\n policyIds: client.policyIds,\n ...capabilities?.paymasterService,\n },\n }\n : capabilities;\n};\n"]}
@@ -1 +1 @@
1
- export declare const VERSION = "4.65.0";
1
+ export declare const VERSION = "4.66.0";
@@ -1,4 +1,4 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "4.65.0";
3
+ export const VERSION = "4.66.0";
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.65.0\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.66.0\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"prepareCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/prepareCalls.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGpE,MAAM,MAAM,eAAe,CAAC,QAAQ,IAClC,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAC9B;IAAE,OAAO,EAAE,OAAO,CAAA;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AC9B;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GACpB;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5B,MAAM,MAAM,kBAAkB,CAC5B,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD,IAAI,CACN,MAAM,CACJ,CAAC,OAAO,mBAAmB,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAC9E,CAAC,CAAC,CAAC,EACJ,MAAM,GAAG,SAAS,CACnB,GACC,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAE9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CACrC,OAAO,mBAAmB,CAC3B,CAAC,YAAY,CAAC,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAE1D,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GACnC,OAAO,CAAC,kBAAkB,CAAC,CAuB7B"}
@@ -2,11 +2,11 @@ import type { Static } from "@sinclair/typebox";
2
2
  import { type Address, type IsUndefined, type Prettify, type UnionOmit } from "viem";
3
3
  import type { wallet_requestQuote_v0 } from "@alchemy/wallet-api-types/rpc";
4
4
  import type { InnerWalletApiClientBase } from "../../types.js";
5
- export type RequestQuoteV0Params<TAccount extends Address | undefined = Address | undefined> = Prettify<UnionOmit<Static<(typeof wallet_requestQuote_v0)["properties"]["Request"]["properties"]["params"]>[0], "from" | "chainId"> & (IsUndefined<TAccount> extends true ? {
5
+ export type RequestQuoteV0Params<TAccount extends Address | undefined = Address | undefined> = Prettify<UnionOmit<Static<(typeof wallet_requestQuote_v0)["properties"]["Request"]["properties"]["params"]>[0], "from" | "chainId">> & (IsUndefined<TAccount> extends true ? {
6
6
  from: Address;
7
7
  } : {
8
8
  from?: never;
9
- })>;
9
+ });
10
10
  export type RequestQuoteV0Result = Prettify<Static<typeof wallet_requestQuote_v0>["ReturnType"]>;
11
11
  export declare function requestQuoteV0<TAccount extends Address | undefined = Address | undefined>(client: InnerWalletApiClientBase, params: RequestQuoteV0Params<TAccount>): Promise<RequestQuoteV0Result>;
12
12
  //# sourceMappingURL=requestQuoteV0.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestQuoteV0.d.ts","sourceRoot":"","sources":["../../../../src/experimental/actions/requestQuoteV0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAG/D,MAAM,MAAM,oBAAoB,CAC9B,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD,QAAQ,CACV,SAAS,CACP,MAAM,CACJ,CAAC,OAAO,sBAAsB,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CACjF,CAAC,CAAC,CAAC,EACJ,MAAM,GAAG,SAAS,CACnB,GACC,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,IAAI,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAC9E,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,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,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAE1D,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GACrC,OAAO,CAAC,oBAAoB,CAAC,CAqB/B"}
@@ -1,17 +1,31 @@
1
1
  export { createSmartWalletClient, type SmartWalletClient, type SmartWalletClientParams, } from "../client/index.js";
2
2
  export { WalletServerRpcSchema, type WalletServerRpcSchemaType, } from "@alchemy/wallet-api-types/rpc";
3
+ export type * from "../client/actions/getCallsStatus.js";
3
4
  export { getCallsStatus } from "../client/actions/getCallsStatus.js";
5
+ export type * from "../client/actions/grantPermissions.js";
4
6
  export { grantPermissions } from "../client/actions/grantPermissions.js";
7
+ export type * from "../client/actions/listAccounts.js";
5
8
  export { listAccounts } from "../client/actions/listAccounts.js";
9
+ export type * from "../client/actions/prepareCalls.js";
6
10
  export { prepareCalls } from "../client/actions/prepareCalls.js";
11
+ export type * from "../client/actions/requestAccount.js";
7
12
  export { requestAccount } from "../client/actions/requestAccount.js";
13
+ export type * from "../client/actions/signSignatureRequest.js";
8
14
  export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
15
+ export type * from "../client/actions/signPreparedCalls.js";
9
16
  export { signPreparedCalls } from "../client/actions/signPreparedCalls.js";
17
+ export type * from "../client/actions/signMessage.js";
10
18
  export { signMessage } from "../client/actions/signMessage.js";
19
+ export type * from "../client/actions/signTypedData.js";
11
20
  export { signTypedData } from "../client/actions/signTypedData.js";
21
+ export type * from "../client/actions/sendPreparedCalls.js";
12
22
  export { sendPreparedCalls } from "../client/actions/sendPreparedCalls.js";
23
+ export type * from "../client/actions/sendCalls.js";
13
24
  export { sendCalls } from "../client/actions/sendCalls.js";
25
+ export type * from "../client/actions/waitForCallsStatus.js";
14
26
  export { waitForCallsStatus } from "../client/actions/waitForCallsStatus.js";
27
+ export type * from "../client/actions/prepareSign.js";
15
28
  export { prepareSign } from "../client/actions/prepareSign.js";
29
+ export type * from "../client/actions/formatSign.js";
16
30
  export { formatSign } from "../client/actions/formatSign.js";
17
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,KAAK,yBAAyB,GAC/B,MAAM,+BAA+B,CAAC;AAGvC,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;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAE5B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 import type { Capabilities } from "@alchemy/wallet-api-types/capabilities";
2
+ import type { InnerWalletApiClientBase } from "../types.js";
3
+ /**
4
+ * Merges client capabilities with capabilities from the request.
5
+ *
6
+ * @param {InnerWalletApiClientBase} client - The inner wallet API client (potentially including global capabilities like policy IDs)
7
+ * @param {Capabilities | undefined} capabilities - Request capabilities to merge with, if any
8
+ * @returns {Capabilities | undefined} The merged capabilities object, or original capabilities if no capability configuration exists on the client
9
+ */
10
+ export declare const mergeClientCapabilities: (client: InnerWalletApiClientBase, capabilities: Capabilities | undefined) => Capabilities | undefined;
11
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/internal/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,wBAAwB,EAChC,cAAc,YAAY,GAAG,SAAS,KACrC,YAAY,GAAG,SAUjB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.65.0";
1
+ export declare const VERSION = "4.66.0";
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.65.0",
3
+ "version": "4.66.0",
4
4
  "description": "Wallet Client for Alchemy Account Kit",
5
5
  "author": "Alchemy",
6
6
  "license": "MIT",
@@ -41,13 +41,12 @@
41
41
  "build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
42
42
  "build:types": "tsc --project tsconfig.build.json --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
43
43
  "clean": "rm -rf ./dist",
44
- "fern:gen": "node ../../doc-gen/dist/esm/cli.js generate --in ./src/exports/index.ts --out ../../docs/pages/reference/account-kit/wallet-client",
45
44
  "test:e2e": "bun test ./src/**/*.e2e.test.*"
46
45
  },
47
46
  "dependencies": {
48
- "@aa-sdk/core": "^4.65.0",
49
- "@account-kit/infra": "^4.65.0",
50
- "@account-kit/smart-contracts": "^4.65.0",
47
+ "@aa-sdk/core": "^4.66.0",
48
+ "@account-kit/infra": "^4.66.0",
49
+ "@account-kit/smart-contracts": "^4.66.0",
51
50
  "@alchemy/wallet-api-types": "0.1.0-alpha.16",
52
51
  "deep-equal": "^2.2.3",
53
52
  "ox": "^0.6.12"
@@ -74,5 +73,5 @@
74
73
  "url": "https://github.com/alchemyplatform/aa-sdk/issues"
75
74
  },
76
75
  "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
77
- "gitHead": "5433a77a6f488b7ba30d2be844374d87d388dd7b"
76
+ "gitHead": "e82c14b7d477a925e7340d614f321affb7cda782"
78
77
  }
@@ -4,6 +4,7 @@ import type { InnerWalletApiClient } from "../../types.ts";
4
4
  import type { Static } from "@sinclair/typebox";
5
5
  import { wallet_prepareCalls } from "@alchemy/wallet-api-types/rpc";
6
6
  import { metrics } from "../../metrics.js";
7
+ import { mergeClientCapabilities } from "../../internal/capabilities.js";
7
8
 
8
9
  export type GetAccountParam<TAccount> =
9
10
  IsUndefined<TAccount> extends true
@@ -67,12 +68,7 @@ export async function prepareCalls<
67
68
  throw new AccountNotFoundError();
68
69
  }
69
70
 
70
- if (client.policyIds && !params.capabilities?.paymasterService) {
71
- params.capabilities = {
72
- ...params.capabilities,
73
- paymasterService: { policyIds: client.policyIds },
74
- };
75
- }
71
+ const capabilities = mergeClientCapabilities(client, params.capabilities);
76
72
 
77
73
  return await client.request({
78
74
  method: "wallet_prepareCalls",
@@ -81,6 +77,7 @@ export async function prepareCalls<
81
77
  ...params,
82
78
  chainId: toHex(client.chain.id),
83
79
  from,
80
+ capabilities,
84
81
  },
85
82
  ],
86
83
  });
@@ -9,6 +9,7 @@ import {
9
9
  import type { wallet_requestQuote_v0 } from "@alchemy/wallet-api-types/rpc";
10
10
  import type { InnerWalletApiClientBase } from "../../types.js";
11
11
  import { AccountNotFoundError } from "@aa-sdk/core";
12
+ import { mergeClientCapabilities } from "../../internal/capabilities.js";
12
13
 
13
14
  export type RequestQuoteV0Params<
14
15
  TAccount extends Address | undefined = Address | undefined,
@@ -18,9 +19,9 @@ export type RequestQuoteV0Params<
18
19
  (typeof wallet_requestQuote_v0)["properties"]["Request"]["properties"]["params"]
19
20
  >[0],
20
21
  "from" | "chainId"
21
- > &
22
- (IsUndefined<TAccount> extends true ? { from: Address } : { from?: never })
23
- >;
22
+ >
23
+ > &
24
+ (IsUndefined<TAccount> extends true ? { from: Address } : { from?: never });
24
25
 
25
26
  export type RequestQuoteV0Result = Prettify<
26
27
  Static<typeof wallet_requestQuote_v0>["ReturnType"]
@@ -37,6 +38,10 @@ export async function requestQuoteV0<
37
38
  throw new AccountNotFoundError();
38
39
  }
39
40
 
41
+ const capabilities = params.returnRawCalls
42
+ ? undefined
43
+ : mergeClientCapabilities(client, params.capabilities);
44
+
40
45
  return await client.request({
41
46
  method: "wallet_requestQuote_v0",
42
47
  params: [
@@ -44,6 +49,7 @@ export async function requestQuoteV0<
44
49
  ...params,
45
50
  chainId: toHex(client.chain.id),
46
51
  from,
52
+ ...(capabilities && { capabilities }),
47
53
  },
48
54
  ],
49
55
  });
@@ -12,17 +12,31 @@ export {
12
12
  } from "@alchemy/wallet-api-types/rpc";
13
13
 
14
14
  // client actions
15
+ export type * from "../client/actions/getCallsStatus.js";
15
16
  export { getCallsStatus } from "../client/actions/getCallsStatus.js";
17
+ export type * from "../client/actions/grantPermissions.js";
16
18
  export { grantPermissions } from "../client/actions/grantPermissions.js";
19
+ export type * from "../client/actions/listAccounts.js";
17
20
  export { listAccounts } from "../client/actions/listAccounts.js";
21
+ export type * from "../client/actions/prepareCalls.js";
18
22
  export { prepareCalls } from "../client/actions/prepareCalls.js";
23
+ export type * from "../client/actions/requestAccount.js";
19
24
  export { requestAccount } from "../client/actions/requestAccount.js";
25
+ export type * from "../client/actions/signSignatureRequest.js";
20
26
  export { signSignatureRequest } from "../client/actions/signSignatureRequest.js";
27
+ export type * from "../client/actions/signPreparedCalls.js";
21
28
  export { signPreparedCalls } from "../client/actions/signPreparedCalls.js";
29
+ export type * from "../client/actions/signMessage.js";
22
30
  export { signMessage } from "../client/actions/signMessage.js";
31
+ export type * from "../client/actions/signTypedData.js";
23
32
  export { signTypedData } from "../client/actions/signTypedData.js";
33
+ export type * from "../client/actions/sendPreparedCalls.js";
24
34
  export { sendPreparedCalls } from "../client/actions/sendPreparedCalls.js";
35
+ export type * from "../client/actions/sendCalls.js";
25
36
  export { sendCalls } from "../client/actions/sendCalls.js";
37
+ export type * from "../client/actions/waitForCallsStatus.js";
26
38
  export { waitForCallsStatus } from "../client/actions/waitForCallsStatus.js";
39
+ export type * from "../client/actions/prepareSign.js";
27
40
  export { prepareSign } from "../client/actions/prepareSign.js";
41
+ export type * from "../client/actions/formatSign.js";
28
42
  export { formatSign } from "../client/actions/formatSign.js";
@@ -0,0 +1,24 @@
1
+ import type { Capabilities } from "@alchemy/wallet-api-types/capabilities";
2
+ import type { InnerWalletApiClientBase } from "../types.js";
3
+
4
+ /**
5
+ * Merges client capabilities with capabilities from the request.
6
+ *
7
+ * @param {InnerWalletApiClientBase} client - The inner wallet API client (potentially including global capabilities like policy IDs)
8
+ * @param {Capabilities | undefined} capabilities - Request capabilities to merge with, if any
9
+ * @returns {Capabilities | undefined} The merged capabilities object, or original capabilities if no capability configuration exists on the client
10
+ */
11
+ export const mergeClientCapabilities = (
12
+ client: InnerWalletApiClientBase,
13
+ capabilities: Capabilities | undefined,
14
+ ): Capabilities | undefined => {
15
+ return client.policyIds?.length
16
+ ? {
17
+ ...capabilities,
18
+ paymasterService: {
19
+ policyIds: client.policyIds,
20
+ ...capabilities?.paymasterService,
21
+ },
22
+ }
23
+ : capabilities;
24
+ };
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "4.65.0";
3
+ export const VERSION = "4.66.0";