@account-kit/wallet-client 4.83.1 → 4.84.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.
- 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/sendCalls.d.ts +3 -3
- package/dist/esm/client/actions/sendCalls.js +3 -3
- 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/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/sendCalls.d.ts +3 -3
- package/dist/types/client/actions/sendPreparedCalls.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +7 -7
- package/src/client/actions/getCallsStatus.ts +2 -2
- package/src/client/actions/sendCalls.ts +3 -3
- package/src/client/actions/sendPreparedCalls.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -24,8 +24,8 @@ export type GetCallsStatusResult = RpcSchema["ReturnType"];
|
|
|
24
24
|
* // After sending prepared calls
|
|
25
25
|
* const sendResult = await client.sendPreparedCalls({...});
|
|
26
26
|
*
|
|
27
|
-
* // Check the status of the
|
|
28
|
-
* const status = await client.getCallsStatus(sendResult.
|
|
27
|
+
* // Check the status of the call ID
|
|
28
|
+
* const status = await client.getCallsStatus(sendResult.id);
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export declare function getCallsStatus(client: InnerWalletApiClient, params: GetCallsStatusParams): Promise<GetCallsStatusResult>;
|
|
@@ -16,8 +16,8 @@ import { metrics } from "../../metrics.js";
|
|
|
16
16
|
* // After sending prepared calls
|
|
17
17
|
* const sendResult = await client.sendPreparedCalls({...});
|
|
18
18
|
*
|
|
19
|
-
* // Check the status of the
|
|
20
|
-
* const status = await client.getCallsStatus(sendResult.
|
|
19
|
+
* // Check the status of the call ID
|
|
20
|
+
* const status = await client.getCallsStatus(sendResult.id);
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export async function getCallsStatus(client, params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCallsStatus.js","sourceRoot":"","sources":["../../../../src/client/actions/getCallsStatus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAe3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA4B,EAC5B,MAA4B;IAE5B,OAAO,CAAC,UAAU,CAAC;QACjB,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAC;IAEH,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QAC1B,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE,CAAC,MAAM,CAAC;KACjB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { InnerWalletApiClient } from \"../../types.ts\";\nimport type { WalletServerRpcSchemaType } from \"@alchemy/wallet-api-types/rpc\";\nimport { metrics } from \"../../metrics.js\";\n\ntype RpcSchema = Extract<\n WalletServerRpcSchemaType,\n {\n Request: {\n method: \"wallet_getCallsStatus\";\n };\n }\n>;\n\nexport type GetCallsStatusParams = RpcSchema[\"Request\"][\"params\"][0];\n\nexport type GetCallsStatusResult = RpcSchema[\"ReturnType\"];\n\n/**\n * Gets the status of a prepared call by its ID.\n * This method is used to check the execution status of calls sent via sendPreparedCalls.\n *\n * @param {InnerWalletApiClient} client - The wallet API client to use for the request\n * @param {GetCallsStatusParams} params - The ID of the prepared call to check\n * @returns {Promise<GetCallsStatusResult>} A Promise that resolves to the status information including:\n * - id: The hex ID of the call\n * - chainId: The chain ID in hex format\n * - status: The current status of the batch execution\n * - receipts: Optional array of transaction receipts if the batch has been executed\n *\n * @example\n * ```ts\n * // After sending prepared calls\n * const sendResult = await client.sendPreparedCalls({...});\n *\n * // Check the status of the
|
|
1
|
+
{"version":3,"file":"getCallsStatus.js","sourceRoot":"","sources":["../../../../src/client/actions/getCallsStatus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAe3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA4B,EAC5B,MAA4B;IAE5B,OAAO,CAAC,UAAU,CAAC;QACjB,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAC;IAEH,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QAC1B,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE,CAAC,MAAM,CAAC;KACjB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { InnerWalletApiClient } from \"../../types.ts\";\nimport type { WalletServerRpcSchemaType } from \"@alchemy/wallet-api-types/rpc\";\nimport { metrics } from \"../../metrics.js\";\n\ntype RpcSchema = Extract<\n WalletServerRpcSchemaType,\n {\n Request: {\n method: \"wallet_getCallsStatus\";\n };\n }\n>;\n\nexport type GetCallsStatusParams = RpcSchema[\"Request\"][\"params\"][0];\n\nexport type GetCallsStatusResult = RpcSchema[\"ReturnType\"];\n\n/**\n * Gets the status of a prepared call by its ID.\n * This method is used to check the execution status of calls sent via sendPreparedCalls.\n *\n * @param {InnerWalletApiClient} client - The wallet API client to use for the request\n * @param {GetCallsStatusParams} params - The ID of the prepared call to check\n * @returns {Promise<GetCallsStatusResult>} A Promise that resolves to the status information including:\n * - id: The hex ID of the call\n * - chainId: The chain ID in hex format\n * - status: The current status of the batch execution\n * - receipts: Optional array of transaction receipts if the batch has been executed\n *\n * @example\n * ```ts\n * // After sending prepared calls\n * const sendResult = await client.sendPreparedCalls({...});\n *\n * // Check the status of the call ID\n * const status = await client.getCallsStatus(sendResult.id);\n * ```\n */\nexport async function getCallsStatus(\n client: InnerWalletApiClient,\n params: GetCallsStatusParams,\n): Promise<GetCallsStatusResult> {\n metrics.trackEvent({\n name: \"get_calls_status\",\n });\n\n return await client.request({\n method: \"wallet_getCallsStatus\",\n params: [params],\n });\n}\n"]}
|
|
@@ -19,7 +19,7 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
19
19
|
* @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute
|
|
20
20
|
* @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)
|
|
21
21
|
* @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.
|
|
22
|
-
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
22
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```ts
|
|
@@ -34,8 +34,8 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
34
34
|
* }
|
|
35
35
|
* });
|
|
36
36
|
*
|
|
37
|
-
* // The result contains the
|
|
38
|
-
* console.log(result.
|
|
37
|
+
* // The result contains the call ID
|
|
38
|
+
* console.log(result.id);
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
export declare function sendCalls<TAccount extends Address | undefined = Address | undefined>(client: InnerWalletApiClient, signer: SmartWalletSigner, params: SendCallsParams<TAccount>): Promise<SendCallsResult>;
|
|
@@ -19,7 +19,7 @@ import { extractCapabilitiesForSending } from "../../internal/capabilities.js";
|
|
|
19
19
|
* @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute
|
|
20
20
|
* @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)
|
|
21
21
|
* @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.
|
|
22
|
-
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
22
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```ts
|
|
@@ -34,8 +34,8 @@ import { extractCapabilitiesForSending } from "../../internal/capabilities.js";
|
|
|
34
34
|
* }
|
|
35
35
|
* });
|
|
36
36
|
*
|
|
37
|
-
* // The result contains the
|
|
38
|
-
* console.log(result.
|
|
37
|
+
* // The result contains the call ID
|
|
38
|
+
* console.log(result.id);
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
export async function sendCalls(client, signer, params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendCalls.js","sourceRoot":"","sources":["../../../../src/client/actions/sendCalls.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAQ/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAG7B,MAA4B,EAC5B,MAAyB,EACzB,MAAiC;IAEjC,OAAO,CAAC,UAAU,CAAC;QACjB,IAAI,EAAE,YAAY;KACnB,CAAC,CAAC;IAEH,IAAI,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/C,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QACtC,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;QACJ,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAC1C,MAAM,EACN,KAAK,CAAC,gBAAgB,CACvB,CAAC;QAEF,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI;YAChC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,KAAK;YAClC,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,YAAY;YAChD,wBAAwB,EAAE,SAAS;SACpC,CAAC;QAEF,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAG,6BAA6B,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAExE,OAAO,MAAM,iBAAiB,CAAC,MAAM,EAAE;QACrC,GAAG,WAAW;QACd,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Address } from \"viem\";\nimport type { InnerWalletApiClient } from \"../../types.js\";\nimport { prepareCalls, type PrepareCallsParams } from \"./prepareCalls.js\";\nimport { metrics } from \"../../metrics.js\";\nimport { signPreparedCalls } from \"./signPreparedCalls.js\";\nimport {\n sendPreparedCalls,\n type SendPreparedCallsResult,\n} from \"./sendPreparedCalls.js\";\nimport { signSignatureRequest } from \"./signSignatureRequest.js\";\nimport type { SmartWalletSigner } from \"../index.js\";\nimport { isWebAuthnSigner } from \"../../utils.js\";\nimport { extractCapabilitiesForSending } from \"../../internal/capabilities.js\";\n\nexport type SendCallsParams<\n TAccount extends Address | undefined = Address | undefined,\n> = PrepareCallsParams<TAccount>;\n\nexport type SendCallsResult = SendPreparedCallsResult;\n\n/**\n * Prepares, signs, and submits calls. This function internally calls `prepareCalls`, `signPreparedCalls`, and `sendPreparedCalls`.\n *\n * <Note>\n * If using this action with an ERC-20 paymaster in pre-operation mode with `autoPermit`, the contents of the permit will be hidden\n * from the user. It is recommended to use the `prepareCalls` action instead to manually handle the permit signature.\n * </Note>\n *\n * @param {InnerWalletApiClient} client - The wallet API client to use for the request\n * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer to use\n * @param {PrepareCallsParams<TAccount>} params - Parameters for sending 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<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
1
|
+
{"version":3,"file":"sendCalls.js","sourceRoot":"","sources":["../../../../src/client/actions/sendCalls.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAQ/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAG7B,MAA4B,EAC5B,MAAyB,EACzB,MAAiC;IAEjC,OAAO,CAAC,UAAU,CAAC;QACjB,IAAI,EAAE,YAAY;KACnB,CAAC,CAAC;IAEH,IAAI,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/C,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QACtC,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;QACJ,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAC1C,MAAM,EACN,KAAK,CAAC,gBAAgB,CACvB,CAAC;QAEF,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI;YAChC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,KAAK;YAClC,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,YAAY;YAChD,wBAAwB,EAAE,SAAS;SACpC,CAAC;QAEF,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAG,6BAA6B,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAExE,OAAO,MAAM,iBAAiB,CAAC,MAAM,EAAE;QACrC,GAAG,WAAW;QACd,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Address } from \"viem\";\nimport type { InnerWalletApiClient } from \"../../types.js\";\nimport { prepareCalls, type PrepareCallsParams } from \"./prepareCalls.js\";\nimport { metrics } from \"../../metrics.js\";\nimport { signPreparedCalls } from \"./signPreparedCalls.js\";\nimport {\n sendPreparedCalls,\n type SendPreparedCallsResult,\n} from \"./sendPreparedCalls.js\";\nimport { signSignatureRequest } from \"./signSignatureRequest.js\";\nimport type { SmartWalletSigner } from \"../index.js\";\nimport { isWebAuthnSigner } from \"../../utils.js\";\nimport { extractCapabilitiesForSending } from \"../../internal/capabilities.js\";\n\nexport type SendCallsParams<\n TAccount extends Address | undefined = Address | undefined,\n> = PrepareCallsParams<TAccount>;\n\nexport type SendCallsResult = SendPreparedCallsResult;\n\n/**\n * Prepares, signs, and submits calls. This function internally calls `prepareCalls`, `signPreparedCalls`, and `sendPreparedCalls`.\n *\n * <Note>\n * If using this action with an ERC-20 paymaster in pre-operation mode with `autoPermit`, the contents of the permit will be hidden\n * from the user. It is recommended to use the `prepareCalls` action instead to manually handle the permit signature.\n * </Note>\n *\n * @param {InnerWalletApiClient} client - The wallet API client to use for the request\n * @param {SmartAccountSigner | WebAuthnSigner} signer - The signer to use\n * @param {PrepareCallsParams<TAccount>} params - Parameters for sending 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<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID.\n *\n * @example\n * ```ts\n * const result = await client.sendCalls({\n * calls: [{\n * to: \"0x1234...\",\n * data: \"0xabcdef...\",\n * value: \"0x0\"\n * }],\n * capabilities: {\n * paymasterService: { policyId: \"your-policy-id\" }\n * }\n * });\n *\n * // The result contains the call ID\n * console.log(result.id);\n * ```\n */\nexport async function sendCalls<\n TAccount extends Address | undefined = Address | undefined,\n>(\n client: InnerWalletApiClient,\n signer: SmartWalletSigner,\n params: SendCallsParams<TAccount>,\n): Promise<SendCallsResult> {\n metrics.trackEvent({\n name: \"send_calls\",\n });\n\n let calls = await prepareCalls(client, params);\n\n if (calls.type === \"paymaster-permit\") {\n if (isWebAuthnSigner(signer)) {\n throw new Error(\n \"WebAuthn signer is not currently supported for signing paymaster permit signatures\",\n );\n }\n const signature = await signSignatureRequest(\n signer,\n calls.signatureRequest,\n );\n\n const secondCallParams = {\n from: calls.modifiedRequest.from,\n calls: calls.modifiedRequest.calls,\n capabilities: calls.modifiedRequest.capabilities,\n paymasterPermitSignature: signature,\n };\n\n calls = await prepareCalls(client, secondCallParams);\n }\n\n const signedCalls = await signPreparedCalls(signer, calls);\n\n const capabilities = extractCapabilitiesForSending(params.capabilities);\n\n return await sendPreparedCalls(client, {\n ...signedCalls,\n ...(capabilities != null ? { capabilities } : {}),\n });\n}\n"]}
|
|
@@ -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
|
|
@@ -7,7 +7,7 @@ import { mergeClientCapabilities } from "../../internal/capabilities.js";
|
|
|
7
7
|
*
|
|
8
8
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
9
9
|
* @param {SendPreparedCallsParams} params - Parameters for sending prepared calls
|
|
10
|
-
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
10
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendPreparedCalls.js","sourceRoot":"","sources":["../../../../src/client/actions/sendPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAiBzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAA4B,EAC5B,MAA+B;IAE/B,OAAO,CAAC,UAAU,CAAC;QACjB,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB;KACF,CAAC,CAAC;IAEH,MAAM,CAAC,YAAY,GAAG,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAE3E,OAAO,MAAM,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,0BAA0B;QAClC,MAAM,EAAE;YACN,MAAM,CAAC,IAAI,KAAK,OAAO;gBACrB,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC;oBACE,GAAG,MAAM;oBACT,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;iBAChC;SACN;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { toHex } from \"viem\";\nimport type { WalletServerRpcSchemaType } from \"@alchemy/wallet-api-types/rpc\";\nimport type { InnerWalletApiClient, WithoutChainId } from \"../../types.ts\";\nimport { metrics } from \"../../metrics.js\";\nimport { mergeClientCapabilities } from \"../../internal/capabilities.js\";\n\ntype RpcSchema = Extract<\n WalletServerRpcSchemaType,\n {\n Request: {\n method: \"wallet_sendPreparedCalls\";\n };\n }\n>;\n\nexport type SendPreparedCallsParams = WithoutChainId<\n RpcSchema[\"Request\"][\"params\"][0]\n>;\n\nexport type SendPreparedCallsResult = RpcSchema[\"ReturnType\"];\n\n/**\n * Sends prepared calls by submitting a signed user operation.\n * This method is used after signing the signature request returned from prepareCalls.\n *\n * @param {InnerWalletApiClient} client - The wallet API client to use for the request\n * @param {SendPreparedCallsParams} params - Parameters for sending prepared calls\n * @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
1
|
+
{"version":3,"file":"sendPreparedCalls.js","sourceRoot":"","sources":["../../../../src/client/actions/sendPreparedCalls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAiBzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAA4B,EAC5B,MAA+B;IAE/B,OAAO,CAAC,UAAU,CAAC;QACjB,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB;KACF,CAAC,CAAC;IAEH,MAAM,CAAC,YAAY,GAAG,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAE3E,OAAO,MAAM,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,0BAA0B;QAClC,MAAM,EAAE;YACN,MAAM,CAAC,IAAI,KAAK,OAAO;gBACrB,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC;oBACE,GAAG,MAAM;oBACT,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;iBAChC;SACN;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { toHex } from \"viem\";\nimport type { WalletServerRpcSchemaType } from \"@alchemy/wallet-api-types/rpc\";\nimport type { InnerWalletApiClient, WithoutChainId } from \"../../types.ts\";\nimport { metrics } from \"../../metrics.js\";\nimport { mergeClientCapabilities } from \"../../internal/capabilities.js\";\n\ntype RpcSchema = Extract<\n WalletServerRpcSchemaType,\n {\n Request: {\n method: \"wallet_sendPreparedCalls\";\n };\n }\n>;\n\nexport type SendPreparedCallsParams = WithoutChainId<\n RpcSchema[\"Request\"][\"params\"][0]\n>;\n\nexport type SendPreparedCallsResult = RpcSchema[\"ReturnType\"];\n\n/**\n * Sends prepared calls by submitting a signed user operation.\n * This method is used after signing the signature request returned from prepareCalls.\n *\n * @param {InnerWalletApiClient} client - The wallet API client to use for the request\n * @param {SendPreparedCallsParams} params - Parameters for sending prepared calls\n * @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID\n *\n * @example\n * ```ts\n * // First prepare the calls\n * const preparedCalls = 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 * // Then sign the calls\n * const signedCalls = await client.signPreparedCalls(preparedCalls);\n *\n * // Then send the prepared calls with the signature\n * const result = await client.sendPreparedCalls({\n * signedCalls,\n * });\n * ```\n */\nexport async function sendPreparedCalls(\n client: InnerWalletApiClient,\n params: SendPreparedCallsParams,\n): Promise<SendPreparedCallsResult> {\n metrics.trackEvent({\n name: \"send_prepared_calls\",\n data: {\n type: params.type,\n },\n });\n\n params.capabilities = mergeClientCapabilities(client, params.capabilities);\n\n return client.request({\n method: \"wallet_sendPreparedCalls\",\n params: [\n params.type === \"array\"\n ? params\n : {\n ...params,\n chainId: toHex(client.chain.id),\n },\n ],\n });\n}\n"]}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.84.0";
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -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.
|
|
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.84.0\";\n"]}
|
|
@@ -24,8 +24,8 @@ export type GetCallsStatusResult = RpcSchema["ReturnType"];
|
|
|
24
24
|
* // After sending prepared calls
|
|
25
25
|
* const sendResult = await client.sendPreparedCalls({...});
|
|
26
26
|
*
|
|
27
|
-
* // Check the status of the
|
|
28
|
-
* const status = await client.getCallsStatus(sendResult.
|
|
27
|
+
* // Check the status of the call ID
|
|
28
|
+
* const status = await client.getCallsStatus(sendResult.id);
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export declare function getCallsStatus(client: InnerWalletApiClient, params: GetCallsStatusParams): Promise<GetCallsStatusResult>;
|
|
@@ -19,7 +19,7 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
19
19
|
* @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute
|
|
20
20
|
* @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)
|
|
21
21
|
* @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.
|
|
22
|
-
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the
|
|
22
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```ts
|
|
@@ -34,8 +34,8 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
34
34
|
* }
|
|
35
35
|
* });
|
|
36
36
|
*
|
|
37
|
-
* // The result contains the
|
|
38
|
-
* console.log(result.
|
|
37
|
+
* // The result contains the call ID
|
|
38
|
+
* console.log(result.id);
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
export declare function sendCalls<TAccount extends Address | undefined = Address | undefined>(client: InnerWalletApiClient, signer: SmartWalletSigner, params: SendCallsParams<TAccount>): Promise<SendCallsResult>;
|
|
@@ -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
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.84.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.
|
|
3
|
+
"version": "4.84.0",
|
|
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.0",
|
|
48
|
+
"@account-kit/infra": "^4.84.0",
|
|
49
|
+
"@account-kit/smart-contracts": "^4.84.0",
|
|
50
|
+
"@alchemy/wallet-api-types": "0.1.0-alpha.23",
|
|
51
51
|
"deep-equal": "^2.2.3",
|
|
52
52
|
"ox": "^0.6.12"
|
|
53
53
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"bun-types": "^1.2.18"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"viem": "^2.
|
|
61
|
+
"viem": "^2.45.0"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public",
|
|
@@ -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": "d80fd19bb3cae4767898ecbfdef74c0c8623f7c4"
|
|
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(
|
|
@@ -32,7 +32,7 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
32
32
|
* @param {Array<{to: Address, data?: Hex, value?: Hex}>} params.calls - Array of contract calls to execute
|
|
33
33
|
* @param {Address} [params.from] - The address to execute the calls from (required if the client wasn't initialized with an account)
|
|
34
34
|
* @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
|
|
35
|
+
* @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the call ID.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* ```ts
|
|
@@ -47,8 +47,8 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
47
47
|
* }
|
|
48
48
|
* });
|
|
49
49
|
*
|
|
50
|
-
* // The result contains the
|
|
51
|
-
* console.log(result.
|
|
50
|
+
* // The result contains the call ID
|
|
51
|
+
* console.log(result.id);
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
export async function sendCalls<
|
|
@@ -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
|
package/src/version.ts
CHANGED