@account-kit/wallet-client 4.59.0 → 4.60.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/sendCalls.d.ts +6 -1
- package/dist/esm/client/actions/sendCalls.js +18 -1
- package/dist/esm/client/actions/sendCalls.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/sendCalls.d.ts +6 -1
- package/dist/types/client/actions/sendCalls.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +5 -5
- package/src/client/actions/sendCalls.ts +24 -2
- package/src/version.ts +1 -1
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { InnerWalletApiClient } from "../../types.js";
|
|
3
3
|
import { type PrepareCallsParams } from "./prepareCalls.js";
|
|
4
|
-
import type
|
|
4
|
+
import { type SmartAccountSigner } from "@aa-sdk/core";
|
|
5
5
|
import { type SendPreparedCallsResult } from "./sendPreparedCalls.js";
|
|
6
6
|
export type SendCallsParams<TAccount extends Address | undefined = Address | undefined> = PrepareCallsParams<TAccount>;
|
|
7
7
|
export type SendCallsResult = SendPreparedCallsResult;
|
|
8
8
|
/**
|
|
9
9
|
* Prepares, signs, and submits calls. This function internally calls `prepareCalls`, `signPreparedCalls`, and `sendPreparedCalls`.
|
|
10
10
|
*
|
|
11
|
+
* <Note>
|
|
12
|
+
* If using this action with an ERC-20 paymaster in pre-operation mode with `autoPermit`, the contents of the permit will be hidden
|
|
13
|
+
* from the user. It is recommended to use the `prepareCalls` action instead to manually handle the permit signature.
|
|
14
|
+
* </Note>
|
|
15
|
+
*
|
|
11
16
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
12
17
|
* @param {SmartAccountSigner} signer - The signer to use
|
|
13
18
|
* @param {PrepareCallsParams<TAccount>} params - Parameters for sending calls
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { prepareCalls } from "./prepareCalls.js";
|
|
2
2
|
import { metrics } from "../../metrics.js";
|
|
3
3
|
import { signPreparedCalls } from "./signPreparedCalls.js";
|
|
4
|
+
import {} from "@aa-sdk/core";
|
|
4
5
|
import { sendPreparedCalls, } from "./sendPreparedCalls.js";
|
|
6
|
+
import { signSignatureRequest } from "./signSignatureRequest.js";
|
|
5
7
|
/**
|
|
6
8
|
* Prepares, signs, and submits calls. This function internally calls `prepareCalls`, `signPreparedCalls`, and `sendPreparedCalls`.
|
|
7
9
|
*
|
|
10
|
+
* <Note>
|
|
11
|
+
* If using this action with an ERC-20 paymaster in pre-operation mode with `autoPermit`, the contents of the permit will be hidden
|
|
12
|
+
* from the user. It is recommended to use the `prepareCalls` action instead to manually handle the permit signature.
|
|
13
|
+
* </Note>
|
|
14
|
+
*
|
|
8
15
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
9
16
|
* @param {SmartAccountSigner} signer - The signer to use
|
|
10
17
|
* @param {PrepareCallsParams<TAccount>} params - Parameters for sending calls
|
|
@@ -34,7 +41,17 @@ export async function sendCalls(client, signer, params) {
|
|
|
34
41
|
metrics.trackEvent({
|
|
35
42
|
name: "send_calls",
|
|
36
43
|
});
|
|
37
|
-
|
|
44
|
+
let calls = await prepareCalls(client, params);
|
|
45
|
+
if (calls.type === "paymaster-permit") {
|
|
46
|
+
const signature = await signSignatureRequest(signer, calls.signatureRequest);
|
|
47
|
+
const secondCallParams = {
|
|
48
|
+
from: calls.modifiedRequest.from,
|
|
49
|
+
calls: calls.modifiedRequest.calls,
|
|
50
|
+
capabilities: calls.modifiedRequest.capabilities,
|
|
51
|
+
paymasterPermitSignature: signature,
|
|
52
|
+
};
|
|
53
|
+
calls = await prepareCalls(client, secondCallParams);
|
|
54
|
+
}
|
|
38
55
|
const signedCalls = await signPreparedCalls(signer, calls);
|
|
39
56
|
return await sendPreparedCalls(client, {
|
|
40
57
|
...signedCalls,
|
|
@@ -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;
|
|
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,EAA2B,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAQjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAG7B,MAA4B,EAC5B,MAA0B,EAC1B,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,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,OAAO,MAAM,iBAAiB,CAAC,MAAM,EAAE;QACrC,GAAG,WAAW;QACd,6EAA6E;QAC7E,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,IAAI,IAAI;YAC1C,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE;YACpE,CAAC,CAAC,EAAE,CAAC;KACR,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 { type SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n sendPreparedCalls,\n type SendPreparedCallsResult,\n} from \"./sendPreparedCalls.js\";\nimport { signSignatureRequest } from \"./signSignatureRequest.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} 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.\n * @returns {Promise<SendPreparedCallsResult>} A Promise that resolves to the result containing the prepared call IDs.\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 prepared call IDs\n * console.log(result.preparedCallIds);\n * ```\n */\nexport async function sendCalls<\n TAccount extends Address | undefined = Address | undefined,\n>(\n client: InnerWalletApiClient,\n signer: SmartAccountSigner,\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 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 return await sendPreparedCalls(client, {\n ...signedCalls,\n // The only capability that is supported in sendPreparedCalls is permissions.\n ...(params.capabilities?.permissions != null\n ? { capabilities: { permissions: params.capabilities.permissions } }\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.60.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.60.0\";\n"]}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { InnerWalletApiClient } from "../../types.js";
|
|
3
3
|
import { type PrepareCallsParams } from "./prepareCalls.js";
|
|
4
|
-
import type
|
|
4
|
+
import { type SmartAccountSigner } from "@aa-sdk/core";
|
|
5
5
|
import { type SendPreparedCallsResult } from "./sendPreparedCalls.js";
|
|
6
6
|
export type SendCallsParams<TAccount extends Address | undefined = Address | undefined> = PrepareCallsParams<TAccount>;
|
|
7
7
|
export type SendCallsResult = SendPreparedCallsResult;
|
|
8
8
|
/**
|
|
9
9
|
* Prepares, signs, and submits calls. This function internally calls `prepareCalls`, `signPreparedCalls`, and `sendPreparedCalls`.
|
|
10
10
|
*
|
|
11
|
+
* <Note>
|
|
12
|
+
* If using this action with an ERC-20 paymaster in pre-operation mode with `autoPermit`, the contents of the permit will be hidden
|
|
13
|
+
* from the user. It is recommended to use the `prepareCalls` action instead to manually handle the permit signature.
|
|
14
|
+
* </Note>
|
|
15
|
+
*
|
|
11
16
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
12
17
|
* @param {SmartAccountSigner} signer - The signer to use
|
|
13
18
|
* @param {PrepareCallsParams<TAccount>} params - Parameters for sending calls
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/sendCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sendCalls.d.ts","sourceRoot":"","sources":["../../../../src/client/actions/sendCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,eAAe,CACzB,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAE1D,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,GAChC,OAAO,CAAC,eAAe,CAAC,CAgC1B"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.60.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.60.0",
|
|
4
4
|
"description": "Wallet Client for Alchemy Account Kit",
|
|
5
5
|
"author": "Alchemy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"test:e2e": "bun test ./src/**/*.e2e.test.*"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@aa-sdk/core": "^4.
|
|
44
|
-
"@account-kit/infra": "^4.
|
|
45
|
-
"@account-kit/smart-contracts": "^4.
|
|
43
|
+
"@aa-sdk/core": "^4.60.0",
|
|
44
|
+
"@account-kit/infra": "^4.60.0",
|
|
45
|
+
"@account-kit/smart-contracts": "^4.60.0",
|
|
46
46
|
"@alchemy/wallet-api-types": "0.1.0-alpha.16",
|
|
47
47
|
"deep-equal": "^2.2.3",
|
|
48
48
|
"ox": "^0.6.12"
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
70
70
|
},
|
|
71
71
|
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f73c6ea7fe8a4f903c0a21776f02efa62799a689"
|
|
73
73
|
}
|
|
@@ -3,11 +3,12 @@ import type { InnerWalletApiClient } from "../../types.js";
|
|
|
3
3
|
import { prepareCalls, type PrepareCallsParams } from "./prepareCalls.js";
|
|
4
4
|
import { metrics } from "../../metrics.js";
|
|
5
5
|
import { signPreparedCalls } from "./signPreparedCalls.js";
|
|
6
|
-
import type
|
|
6
|
+
import { type SmartAccountSigner } from "@aa-sdk/core";
|
|
7
7
|
import {
|
|
8
8
|
sendPreparedCalls,
|
|
9
9
|
type SendPreparedCallsResult,
|
|
10
10
|
} from "./sendPreparedCalls.js";
|
|
11
|
+
import { signSignatureRequest } from "./signSignatureRequest.js";
|
|
11
12
|
|
|
12
13
|
export type SendCallsParams<
|
|
13
14
|
TAccount extends Address | undefined = Address | undefined,
|
|
@@ -18,6 +19,11 @@ export type SendCallsResult = SendPreparedCallsResult;
|
|
|
18
19
|
/**
|
|
19
20
|
* Prepares, signs, and submits calls. This function internally calls `prepareCalls`, `signPreparedCalls`, and `sendPreparedCalls`.
|
|
20
21
|
*
|
|
22
|
+
* <Note>
|
|
23
|
+
* If using this action with an ERC-20 paymaster in pre-operation mode with `autoPermit`, the contents of the permit will be hidden
|
|
24
|
+
* from the user. It is recommended to use the `prepareCalls` action instead to manually handle the permit signature.
|
|
25
|
+
* </Note>
|
|
26
|
+
*
|
|
21
27
|
* @param {InnerWalletApiClient} client - The wallet API client to use for the request
|
|
22
28
|
* @param {SmartAccountSigner} signer - The signer to use
|
|
23
29
|
* @param {PrepareCallsParams<TAccount>} params - Parameters for sending calls
|
|
@@ -54,7 +60,23 @@ export async function sendCalls<
|
|
|
54
60
|
name: "send_calls",
|
|
55
61
|
});
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
let calls = await prepareCalls(client, params);
|
|
64
|
+
|
|
65
|
+
if (calls.type === "paymaster-permit") {
|
|
66
|
+
const signature = await signSignatureRequest(
|
|
67
|
+
signer,
|
|
68
|
+
calls.signatureRequest,
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const secondCallParams = {
|
|
72
|
+
from: calls.modifiedRequest.from,
|
|
73
|
+
calls: calls.modifiedRequest.calls,
|
|
74
|
+
capabilities: calls.modifiedRequest.capabilities,
|
|
75
|
+
paymasterPermitSignature: signature,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
calls = await prepareCalls(client, secondCallParams);
|
|
79
|
+
}
|
|
58
80
|
|
|
59
81
|
const signedCalls = await signPreparedCalls(signer, calls);
|
|
60
82
|
|
package/src/version.ts
CHANGED