@alchemy/smart-accounts 5.0.0-beta.24 → 5.0.0-beta.25

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/README.md CHANGED
@@ -10,6 +10,49 @@ Viem-compatible smart account implementations for Alchemy's smart contract accou
10
10
  npm install @alchemy/smart-accounts @alchemy/common viem
11
11
  ```
12
12
 
13
+ ## Example Usage
14
+
15
+ ```ts
16
+ import { createPublicClient } from "viem";
17
+ import {
18
+ createBundlerClient,
19
+ createPaymasterClient,
20
+ } from "viem/account-abstraction";
21
+ import { sepolia } from "viem/chains";
22
+ import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
23
+ import { alchemyTransport } from "@alchemy/common";
24
+ import { estimateFeesPerGas } from "@alchemy/aa-infra";
25
+ import { toModularAccountV2 } from "@alchemy/smart-accounts";
26
+
27
+ const transport = alchemyTransport({ apiKey: "YOUR_API_KEY" });
28
+
29
+ // 1. Create a MAv2 smart account
30
+ const account = await toModularAccountV2({
31
+ client: createPublicClient({ chain: sepolia, transport }),
32
+ owner: privateKeyToAccount(generatePrivateKey()),
33
+ });
34
+
35
+ // 2. Create a bundler client with the account
36
+ const bundlerClient = createBundlerClient({
37
+ account,
38
+ chain: sepolia,
39
+ transport,
40
+ userOperation: {
41
+ estimateFeesPerGas,
42
+ },
43
+ // Optional: sponsor gas with a paymaster
44
+ paymaster: createPaymasterClient({ transport }),
45
+ paymasterContext: { policyId: "YOUR_POLICY_ID" },
46
+ });
47
+
48
+ // 3. Send a user operation
49
+ const hash = await bundlerClient.sendUserOperation({
50
+ calls: [{ to: "0x...", value: 0n, data: "0x" }],
51
+ });
52
+
53
+ const receipt = await bundlerClient.waitForUserOperationReceipt({ hash });
54
+ ```
55
+
13
56
  ## Key Exports
14
57
 
15
58
  ### LightAccount
@@ -1 +1 @@
1
- export declare const VERSION = "5.0.0-beta.23";
1
+ export declare const VERSION = "5.0.0-beta.24";
@@ -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 = "5.0.0-beta.23";
3
+ export const VERSION = "5.0.0-beta.24";
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,eAAe,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"5.0.0-beta.23\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"5.0.0-beta.24\";\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.0.0-beta.23";
1
+ export declare const VERSION = "5.0.0-beta.24";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy/smart-accounts",
3
- "version": "5.0.0-beta.24",
3
+ "version": "5.0.0-beta.25",
4
4
  "description": "This package contains all of the viem interfaces for Alchemy's Smart Contract Accounts",
5
5
  "author": "Alchemy",
6
6
  "license": "MIT",
@@ -39,12 +39,12 @@
39
39
  "test:run": "vitest run"
40
40
  },
41
41
  "devDependencies": {
42
- "@alchemy/aa-infra": "5.0.0-beta.24",
42
+ "@alchemy/aa-infra": "5.0.0-beta.25",
43
43
  "typescript-template": "workspace:*",
44
44
  "viem": "^2.45.0"
45
45
  },
46
46
  "dependencies": {
47
- "@alchemy/common": "5.0.0-beta.24"
47
+ "@alchemy/common": "5.0.0-beta.25"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "viem": "^2.45.0"
@@ -61,5 +61,5 @@
61
61
  "url": "https://github.com/alchemyplatform/aa-sdk/issues"
62
62
  },
63
63
  "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
64
- "gitHead": "f30a06d06c9601f55681307c331b690d51978af9"
64
+ "gitHead": "0eb4e1f1d586317a5f2c189e2ddef139d7348412"
65
65
  }
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 = "5.0.0-beta.24";
3
+ export const VERSION = "5.0.0-beta.25";