From 23c866315a4d97e8a2dcbc9b5088a27c89c9423b Mon Sep 17 00:00:00 2001 From: Michael Moldoveanu Date: Thu, 9 Nov 2023 21:55:42 -0500 Subject: [PATCH 01/49] chore: merge back into main after manual deploys [skip-ci] (#235) --- CHANGELOG.md | 29 ++++++++++++++++++---------- examples/aa-simple-dapp/CHANGELOG.md | 8 ++++++++ examples/aa-simple-dapp/package.json | 8 ++++---- examples/alchemy-daapp/CHANGELOG.md | 14 ++++++++++++++ examples/alchemy-daapp/package.json | 8 ++++---- packages/accounts/CHANGELOG.md | 13 ++++++++----- packages/alchemy/CHANGELOG.md | 10 ++++------ packages/core/CHANGELOG.md | 16 +++++++++------ packages/ethers/CHANGELOG.md | 8 ++------ site/CHANGELOG.md | 17 ++++++++++++++++ site/package.json | 2 +- templates/typescript/CHANGELOG.md | 8 ++++++++ templates/typescript/package.json | 2 +- 13 files changed, 100 insertions(+), 43 deletions(-) create mode 100644 examples/aa-simple-dapp/CHANGELOG.md create mode 100644 examples/alchemy-daapp/CHANGELOG.md create mode 100644 site/CHANGELOG.md create mode 100644 templates/typescript/CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d912fe65c..d6195e62ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,19 +3,28 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.3.0...v1.0.0) (2023-11-10) - -- feat!: publish breaking change ([f0c3497](https://github.com/alchemyplatform/aa-sdk/commit/f0c3497a0d9ceb2144cb20e64a8b04edaad2c4f5)) - -### BREAKING CHANGES - -- forcing breaking change - -# 0.3.0 (2023-11-10) +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) ### Features -- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([5170a6b](https://github.com/alchemyplatform/aa-sdk/commit/5170a6b689c9834a9a2489f054b767e190fa38f7)) +- aa-sdk with native arb sepolia support ([#231](https://github.com/alchemyplatform/aa-sdk/issues/231)) ([7580608](https://github.com/alchemyplatform/aa-sdk/commit/7580608623961155290a3010fb784a14aecd82af)) +- add sanity check on provider connect for clearer error message ([#181](https://github.com/alchemyplatform/aa-sdk/issues/181)) ([1739f13](https://github.com/alchemyplatform/aa-sdk/commit/1739f13981bf2289de5669b871843fd48ae3eb58)) +- add sanity check on provider connect for clearer error message ([#181](https://github.com/alchemyplatform/aa-sdk/issues/181)) ([490235a](https://github.com/alchemyplatform/aa-sdk/commit/490235af0066f2cb18b2c0abba294fc968a1cee3)) +- add support for overriding the initCode for an account ([#197](https://github.com/alchemyplatform/aa-sdk/issues/197)) ([a886853](https://github.com/alchemyplatform/aa-sdk/commit/a886853ce5628f7e252750f52d8ad8c38eeef0c0)) +- add zod runtime validation for base account ([#186](https://github.com/alchemyplatform/aa-sdk/issues/186)) ([ea85c96](https://github.com/alchemyplatform/aa-sdk/commit/ea85c961ee0140bf12151984324e4b2e7ed86d6a)) +- add zod runtime validation for base provider ([#171](https://github.com/alchemyplatform/aa-sdk/issues/171)) ([3032d23](https://github.com/alchemyplatform/aa-sdk/commit/3032d23744f73f703be2b79fae3b6b9ef93dcb5b)) +- add zod runtime validation for simple account ([#189](https://github.com/alchemyplatform/aa-sdk/issues/189)) ([f14016f](https://github.com/alchemyplatform/aa-sdk/commit/f14016f38777f1e629c1aaaaf16f81881ee5d7c9)) +- **arb-sepolia:** add arb sepolia to defaults ([#216](https://github.com/alchemyplatform/aa-sdk/issues/216)) ([9229fb5](https://github.com/alchemyplatform/aa-sdk/commit/9229fb529c479ca72d305da9452ad1456be2bc6e)) +- choosing your signer, light account, modular account doc update ([#215](https://github.com/alchemyplatform/aa-sdk/issues/215)) ([f05b92d](https://github.com/alchemyplatform/aa-sdk/commit/f05b92d1ecd7465a495c97bea692d38e11c6c1ae)) +- docs site formatting styling ([#217](https://github.com/alchemyplatform/aa-sdk/issues/217)) ([9815c9c](https://github.com/alchemyplatform/aa-sdk/commit/9815c9cb512591419e79570dc0d97c7dcf394fa3)) +- entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([4b62df0](https://github.com/alchemyplatform/aa-sdk/commit/4b62df069071d6e0bcaa533b146ecba5baa6d6d8)) +- entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([f5c378b](https://github.com/alchemyplatform/aa-sdk/commit/f5c378ba1cb04bdc1e41c3e6dd0eba1cb6ee7f2c)) +- light account doc update ([#219](https://github.com/alchemyplatform/aa-sdk/issues/219)) ([2e30c92](https://github.com/alchemyplatform/aa-sdk/commit/2e30c922f58de77f543b7f080750444efe17c6c1)) +- make entry point contract as an optional param to SCA class ([#182](https://github.com/alchemyplatform/aa-sdk/issues/182)) ([14019a4](https://github.com/alchemyplatform/aa-sdk/commit/14019a4b1dbd193158cd66a1e846d589f19a6670)) +- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([883c489](https://github.com/alchemyplatform/aa-sdk/commit/883c489b077d587b6c5b50c44d92b2a00f10e5ac)) +- **sepolia:** add min priority per bid ([#214](https://github.com/alchemyplatform/aa-sdk/issues/214)) ([075503e](https://github.com/alchemyplatform/aa-sdk/commit/075503e2b861c84838c115a7edb8e60ad38aec09)) +- support enhanced apis in alchemy provider ([#221](https://github.com/alchemyplatform/aa-sdk/issues/221)) ([83ea17f](https://github.com/alchemyplatform/aa-sdk/commit/83ea17f9c69123d9282871b6f3bb02ff64750625)) +- use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) # 0.2.0 (2023-11-03) diff --git a/examples/aa-simple-dapp/CHANGELOG.md b/examples/aa-simple-dapp/CHANGELOG.md new file mode 100644 index 0000000000..7c3cfb8615 --- /dev/null +++ b/examples/aa-simple-dapp/CHANGELOG.md @@ -0,0 +1,8 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) + +**Note:** Version bump only for package aa-simple-dapp diff --git a/examples/aa-simple-dapp/package.json b/examples/aa-simple-dapp/package.json index 8d8dea3492..768f889fd4 100644 --- a/examples/aa-simple-dapp/package.json +++ b/examples/aa-simple-dapp/package.json @@ -1,6 +1,6 @@ { "name": "aa-simple-dapp", - "version": "0.1.0", + "version": "1.0.0", "private": true, "scripts": { "dev": "next dev", @@ -9,9 +9,9 @@ "lint": "next lint" }, "dependencies": { - "@alchemy/aa-accounts": "^0.2.0", - "@alchemy/aa-alchemy": "^0.2.0", - "@alchemy/aa-core": "^0.2.0", + "@alchemy/aa-accounts": "^1.0.0", + "@alchemy/aa-alchemy": "^1.0.0", + "@alchemy/aa-core": "^1.0.0", "@t3-oss/env-core": "^0.7.1", "@t3-oss/env-nextjs": "^0.7.1", "magic-sdk": "^20.1.1", diff --git a/examples/alchemy-daapp/CHANGELOG.md b/examples/alchemy-daapp/CHANGELOG.md new file mode 100644 index 0000000000..c3926d2494 --- /dev/null +++ b/examples/alchemy-daapp/CHANGELOG.md @@ -0,0 +1,14 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) + + +### Features + +* add sanity check on provider connect for clearer error message ([#181](https://github.com/alchemyplatform/aa-sdk/issues/181)) ([1739f13](https://github.com/alchemyplatform/aa-sdk/commit/1739f13981bf2289de5669b871843fd48ae3eb58)) +* add sanity check on provider connect for clearer error message ([#181](https://github.com/alchemyplatform/aa-sdk/issues/181)) ([490235a](https://github.com/alchemyplatform/aa-sdk/commit/490235af0066f2cb18b2c0abba294fc968a1cee3)) +* entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([4b62df0](https://github.com/alchemyplatform/aa-sdk/commit/4b62df069071d6e0bcaa533b146ecba5baa6d6d8)) +* entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([f5c378b](https://github.com/alchemyplatform/aa-sdk/commit/f5c378ba1cb04bdc1e41c3e6dd0eba1cb6ee7f2c)) diff --git a/examples/alchemy-daapp/package.json b/examples/alchemy-daapp/package.json index 02bf0e2983..ef70b1ad3b 100644 --- a/examples/alchemy-daapp/package.json +++ b/examples/alchemy-daapp/package.json @@ -1,6 +1,6 @@ { "name": "alchemy-daapp", - "version": "0.1.0", + "version": "1.0.0", "private": true, "scripts": { "dev": "next dev", @@ -9,9 +9,9 @@ "lint": "next lint" }, "dependencies": { - "@alchemy/aa-accounts": "^0.2.0", - "@alchemy/aa-alchemy": "^0.2.0", - "@alchemy/aa-core": "^0.2.0", + "@alchemy/aa-accounts": "^1.0.0", + "@alchemy/aa-alchemy": "^1.0.0", + "@alchemy/aa-core": "^1.0.0", "@chakra-ui/react": "^2.6.1", "@emotion/react": "^11.11.0", "@emotion/styled": "^11.11.0", diff --git a/packages/accounts/CHANGELOG.md b/packages/accounts/CHANGELOG.md index 711ba8e71d..9d28769934 100644 --- a/packages/accounts/CHANGELOG.md +++ b/packages/accounts/CHANGELOG.md @@ -3,14 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.3.0...v1.0.0) (2023-11-10) - -**Note:** Version bump only for package @alchemy/aa-accounts - -# 0.3.0 (2023-11-10) +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) ### Features +- aa-sdk with native arb sepolia support ([#231](https://github.com/alchemyplatform/aa-sdk/issues/231)) ([7580608](https://github.com/alchemyplatform/aa-sdk/commit/7580608623961155290a3010fb784a14aecd82af)) +- add zod runtime validation for base provider ([#171](https://github.com/alchemyplatform/aa-sdk/issues/171)) ([3032d23](https://github.com/alchemyplatform/aa-sdk/commit/3032d23744f73f703be2b79fae3b6b9ef93dcb5b)) +- entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([4b62df0](https://github.com/alchemyplatform/aa-sdk/commit/4b62df069071d6e0bcaa533b146ecba5baa6d6d8)) +- entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([f5c378b](https://github.com/alchemyplatform/aa-sdk/commit/f5c378ba1cb04bdc1e41c3e6dd0eba1cb6ee7f2c)) +- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([883c489](https://github.com/alchemyplatform/aa-sdk/commit/883c489b077d587b6c5b50c44d92b2a00f10e5ac)) +- use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) + - remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([5170a6b](https://github.com/alchemyplatform/aa-sdk/commit/5170a6b689c9834a9a2489f054b767e190fa38f7)) # 0.2.0 (2023-11-03) diff --git a/packages/alchemy/CHANGELOG.md b/packages/alchemy/CHANGELOG.md index 10034f0045..f6e060e47c 100644 --- a/packages/alchemy/CHANGELOG.md +++ b/packages/alchemy/CHANGELOG.md @@ -3,15 +3,13 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.3.0...v1.0.0) (2023-11-10) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# 0.3.0 (2023-11-10) +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) ### Features -- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([5170a6b](https://github.com/alchemyplatform/aa-sdk/commit/5170a6b689c9834a9a2489f054b767e190fa38f7)) +- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([883c489](https://github.com/alchemyplatform/aa-sdk/commit/883c489b077d587b6c5b50c44d92b2a00f10e5ac)) +- support enhanced apis in alchemy provider ([#221](https://github.com/alchemyplatform/aa-sdk/issues/221)) ([83ea17f](https://github.com/alchemyplatform/aa-sdk/commit/83ea17f9c69123d9282871b6f3bb02ff64750625)) +- use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) # 0.2.0 (2023-11-03) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index fc3af3b7cf..64347b1bf7 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,15 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.3.0...v1.0.0) (2023-11-10) - -**Note:** Version bump only for package @alchemy/aa-core - -# 0.3.0 (2023-11-10) +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) ### Features -- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([5170a6b](https://github.com/alchemyplatform/aa-sdk/commit/5170a6b689c9834a9a2489f054b767e190fa38f7)) +- aa-sdk with native arb sepolia support ([#231](https://github.com/alchemyplatform/aa-sdk/issues/231)) ([7580608](https://github.com/alchemyplatform/aa-sdk/commit/7580608623961155290a3010fb784a14aecd82af)) +- add support for overriding the initCode for an account ([#197](https://github.com/alchemyplatform/aa-sdk/issues/197)) ([a886853](https://github.com/alchemyplatform/aa-sdk/commit/a886853ce5628f7e252750f52d8ad8c38eeef0c0)) +- add zod runtime validation for base account ([#186](https://github.com/alchemyplatform/aa-sdk/issues/186)) ([ea85c96](https://github.com/alchemyplatform/aa-sdk/commit/ea85c961ee0140bf12151984324e4b2e7ed86d6a)) +- add zod runtime validation for simple account ([#189](https://github.com/alchemyplatform/aa-sdk/issues/189)) ([f14016f](https://github.com/alchemyplatform/aa-sdk/commit/f14016f38777f1e629c1aaaaf16f81881ee5d7c9)) +- **arb-sepolia:** add arb sepolia to defaults ([#216](https://github.com/alchemyplatform/aa-sdk/issues/216)) ([9229fb5](https://github.com/alchemyplatform/aa-sdk/commit/9229fb529c479ca72d305da9452ad1456be2bc6e)) +- choosing your signer, light account, modular account doc update ([#215](https://github.com/alchemyplatform/aa-sdk/issues/215)) ([f05b92d](https://github.com/alchemyplatform/aa-sdk/commit/f05b92d1ecd7465a495c97bea692d38e11c6c1ae)) +- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([883c489](https://github.com/alchemyplatform/aa-sdk/commit/883c489b077d587b6c5b50c44d92b2a00f10e5ac)) +- **sepolia:** add min priority per bid ([#214](https://github.com/alchemyplatform/aa-sdk/issues/214)) ([075503e](https://github.com/alchemyplatform/aa-sdk/commit/075503e2b861c84838c115a7edb8e60ad38aec09)) +- use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) # 0.2.0 (2023-11-03) diff --git a/packages/ethers/CHANGELOG.md b/packages/ethers/CHANGELOG.md index 91afd1804a..f91792333c 100644 --- a/packages/ethers/CHANGELOG.md +++ b/packages/ethers/CHANGELOG.md @@ -3,15 +3,11 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.3.0...v1.0.0) (2023-11-10) - -**Note:** Version bump only for package @alchemy/aa-ethers - -# 0.3.0 (2023-11-10) +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) ### Features -- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([5170a6b](https://github.com/alchemyplatform/aa-sdk/commit/5170a6b689c9834a9a2489f054b767e190fa38f7)) +- use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) # 0.2.0 (2023-11-03) diff --git a/site/CHANGELOG.md b/site/CHANGELOG.md new file mode 100644 index 0000000000..1c435ea34c --- /dev/null +++ b/site/CHANGELOG.md @@ -0,0 +1,17 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) + +### Features + +- aa-sdk with native arb sepolia support ([#231](https://github.com/alchemyplatform/aa-sdk/issues/231)) ([7580608](https://github.com/alchemyplatform/aa-sdk/commit/7580608623961155290a3010fb784a14aecd82af)) +- choosing your signer, light account, modular account doc update ([#215](https://github.com/alchemyplatform/aa-sdk/issues/215)) ([f05b92d](https://github.com/alchemyplatform/aa-sdk/commit/f05b92d1ecd7465a495c97bea692d38e11c6c1ae)) +- docs site formatting styling ([#217](https://github.com/alchemyplatform/aa-sdk/issues/217)) ([9815c9c](https://github.com/alchemyplatform/aa-sdk/commit/9815c9cb512591419e79570dc0d97c7dcf394fa3)) +- entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([4b62df0](https://github.com/alchemyplatform/aa-sdk/commit/4b62df069071d6e0bcaa533b146ecba5baa6d6d8)) +- entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([f5c378b](https://github.com/alchemyplatform/aa-sdk/commit/f5c378ba1cb04bdc1e41c3e6dd0eba1cb6ee7f2c)) +- light account doc update ([#219](https://github.com/alchemyplatform/aa-sdk/issues/219)) ([2e30c92](https://github.com/alchemyplatform/aa-sdk/commit/2e30c922f58de77f543b7f080750444efe17c6c1)) +- make entry point contract as an optional param to SCA class ([#182](https://github.com/alchemyplatform/aa-sdk/issues/182)) ([14019a4](https://github.com/alchemyplatform/aa-sdk/commit/14019a4b1dbd193158cd66a1e846d589f19a6670)) +- use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) diff --git a/site/package.json b/site/package.json index 97ac17d42c..792d619cbc 100644 --- a/site/package.json +++ b/site/package.json @@ -1,7 +1,7 @@ { "name": "docs", "private": true, - "version": "0.0.0", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vitepress dev", diff --git a/templates/typescript/CHANGELOG.md b/templates/typescript/CHANGELOG.md new file mode 100644 index 0000000000..e2c23534fe --- /dev/null +++ b/templates/typescript/CHANGELOG.md @@ -0,0 +1,8 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) + +**Note:** Version bump only for package typescript-template diff --git a/templates/typescript/package.json b/templates/typescript/package.json index 30c43e9a22..eecbe16b05 100644 --- a/templates/typescript/package.json +++ b/templates/typescript/package.json @@ -1,6 +1,6 @@ { "name": "typescript-template", - "version": "0.0.2-alpha.1", + "version": "1.0.0", "description": "tsconfig base", "private": "false", "main": "index.js", From 2031f9bf94496ae848fb259de7c0d5c964273746 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 14:25:22 -0700 Subject: [PATCH 02/49] feat: entry point address as optional to SmartAccountProvider (#180) * feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../onboarding/OnboardingController.ts | 16 ++++++------ site/smart-accounts/signers/capsule.md | 1 - site/smart-accounts/signers/dynamic.md | 1 - site/smart-accounts/signers/turnkey.md | 1 - site/smart-accounts/signers/web3auth.md | 1 - yarn.lock | 25 +++++++++++++++++++ 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts index 2f88f9d0a5..9539d50199 100644 --- a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts +++ b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi"; import { localSmartContractStore } from "~/clients/localStorage"; import { NFTContractABI } from "../../clients/nftContract"; import { - DAAppConfiguration, - daappConfigurations, + DAAppConfiguration, + daappConfigurations, } from "../../configs/clientConfigs"; import { - MIN_ONBOARDING_WALLET_BALANCE, - OnboardingContext, - OnboardingStep, - OnboardingStepIdentifier, - initialStep, - metaForStepIdentifier, + MIN_ONBOARDING_WALLET_BALANCE, + OnboardingContext, + OnboardingStep, + OnboardingStepIdentifier, + initialStep, + metaForStepIdentifier, } from "./OnboardingDataModels"; async function pollForLambdaForComplete( diff --git a/site/smart-accounts/signers/capsule.md b/site/smart-accounts/signers/capsule.md index d81ee2e9f2..3737eda5f6 100644 --- a/site/smart-accounts/signers/capsule.md +++ b/site/smart-accounts/signers/capsule.md @@ -80,7 +80,6 @@ import { sepolia } from "viem/chains"; import { capsuleSigner } from "./capsule"; const chain = sepolia; - const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/dynamic.md b/site/smart-accounts/signers/dynamic.md index 4487871ac8..6a1a681fbc 100644 --- a/site/smart-accounts/signers/dynamic.md +++ b/site/smart-accounts/signers/dynamic.md @@ -91,7 +91,6 @@ import { sepolia } from "viem/chains"; import { dynamicSigner } from "./dynamic"; const chain = sepolia; - const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/turnkey.md b/site/smart-accounts/signers/turnkey.md index 6851fcf413..04d66eb00d 100644 --- a/site/smart-accounts/signers/turnkey.md +++ b/site/smart-accounts/signers/turnkey.md @@ -69,7 +69,6 @@ import { newTurnkeySigner } from "./turnkey"; async function main() { const owner = await newTurnkeySigner(); const chain = sepolia; - const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/web3auth.md b/site/smart-accounts/signers/web3auth.md index d1469591da..9ba91a60b4 100644 --- a/site/smart-accounts/signers/web3auth.md +++ b/site/smart-accounts/signers/web3auth.md @@ -61,7 +61,6 @@ import { sepolia } from "viem/chains"; import { web3authSigner } from "./web3auth"; const chain = sepolia; - const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/yarn.lock b/yarn.lock index c765ba9f96..541b10fc1f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,31 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== +"@alchemy/aa-accounts@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-0.1.1.tgz#7527e25fe2825eb91d80f6e4cb85d188606587a4" + integrity sha512-nHHnJuIHXGdvH5i+7DlTeSPa3RJtNLt4NpJP+G+T8G3QP/k6mxHNWFTybOhqxuCC798DACxKc4thOL2Lj8phgA== + dependencies: + "@alchemy/aa-core" "^0.1.1" + viem "^1.16.2" + +"@alchemy/aa-alchemy@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-0.1.1.tgz#f7f989b2aaae127a49a61e1dde6d6f52d40d0018" + integrity sha512-rVQZNb1QmfQoxDyaXuinB0pfrKENLydwH57TWXJn4wFW+3c+iM6xM/tsfx6zxzA7HTwodcRw8//wMvdF+5KQmg== + dependencies: + "@alchemy/aa-core" "^0.1.1" + viem "^1.16.2" + +"@alchemy/aa-core@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-0.1.1.tgz#2c81e34c0ca939897004c68d80250f1b4b423ff2" + integrity sha512-vEfCx9MJMTCMpmB3cY+TcM65znP8zcMTaiYE7By3+krhd7ViflWdEILe5HGGzCALGqdr6pUaBI7n08eVoyo6KQ== + dependencies: + abitype "^0.8.3" + eventemitter3 "^5.0.1" + viem "^1.16.2" + "@algolia/autocomplete-core@1.9.3": version "1.9.3" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" From 9d21fc92d837e670d02cbe523af8fbcdc4720a3c Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 22:58:13 -0700 Subject: [PATCH 03/49] feat: add sanity check on provider connect for clearer error message (#181) Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../surfaces/onboarding/OnboardingController.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts index 9539d50199..2f88f9d0a5 100644 --- a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts +++ b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi"; import { localSmartContractStore } from "~/clients/localStorage"; import { NFTContractABI } from "../../clients/nftContract"; import { - DAAppConfiguration, - daappConfigurations, + DAAppConfiguration, + daappConfigurations, } from "../../configs/clientConfigs"; import { - MIN_ONBOARDING_WALLET_BALANCE, - OnboardingContext, - OnboardingStep, - OnboardingStepIdentifier, - initialStep, - metaForStepIdentifier, + MIN_ONBOARDING_WALLET_BALANCE, + OnboardingContext, + OnboardingStep, + OnboardingStepIdentifier, + initialStep, + metaForStepIdentifier, } from "./OnboardingDataModels"; async function pollForLambdaForComplete( From 4e4040c479006a77f1d56e3f8a7dd80147f887e7 Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:10:05 -0400 Subject: [PATCH 04/49] feat: add zod runtime validation for base provider (#171) --- packages/accounts/src/light-account/__tests__/account.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/accounts/src/light-account/__tests__/account.test.ts b/packages/accounts/src/light-account/__tests__/account.test.ts index f385a69a6d..ea88ac085f 100644 --- a/packages/accounts/src/light-account/__tests__/account.test.ts +++ b/packages/accounts/src/light-account/__tests__/account.test.ts @@ -1,6 +1,7 @@ import { LocalAccountSigner, SmartAccountProvider, + type Address, type BatchUserOperationCallData, type SmartAccountSigner, } from "@alchemy/aa-core"; From ca38dcd66861516e40c900a13c043e6cbf03fb13 Mon Sep 17 00:00:00 2001 From: Michael Moldoveanu Date: Thu, 26 Oct 2023 14:23:16 -0400 Subject: [PATCH 05/49] docs: update the magic docs to highlight signer creation is async (#170) * docs: update the magic docs to highlight signer creation is async * docs: update the magic docs to highlight signer creation is async --- site/smart-accounts/signers/magic.md | 1 - 1 file changed, 1 deletion(-) diff --git a/site/smart-accounts/signers/magic.md b/site/smart-accounts/signers/magic.md index 4d0927a8a7..ddf0b24dc2 100644 --- a/site/smart-accounts/signers/magic.md +++ b/site/smart-accounts/signers/magic.md @@ -61,7 +61,6 @@ import { sepolia } from "viem/chains"; import { createMagicSigner } from "./magic"; const chain = sepolia; - // NOTE: the below is async because it depends on creating a magic signer. You can choose to break that up how you want // eg. use a useEffect + useState to create the signer and then pass it down to the provider const provider = new AlchemyProvider({ From 1add3396a0372080b80d4bfdb5684fed62bd55a7 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 14:25:22 -0700 Subject: [PATCH 06/49] feat: entry point address as optional to SmartAccountProvider (#180) * feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../surfaces/onboarding/OnboardingController.ts | 16 ++++++++-------- .../src/light-account/__tests__/account.test.ts | 1 - site/smart-accounts/signers/capsule.md | 2 ++ site/smart-accounts/signers/dynamic.md | 2 ++ site/smart-accounts/signers/magic.md | 3 +++ site/smart-accounts/signers/turnkey.md | 2 ++ site/smart-accounts/signers/web3auth.md | 2 ++ 7 files changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts index 2f88f9d0a5..9539d50199 100644 --- a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts +++ b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi"; import { localSmartContractStore } from "~/clients/localStorage"; import { NFTContractABI } from "../../clients/nftContract"; import { - DAAppConfiguration, - daappConfigurations, + DAAppConfiguration, + daappConfigurations, } from "../../configs/clientConfigs"; import { - MIN_ONBOARDING_WALLET_BALANCE, - OnboardingContext, - OnboardingStep, - OnboardingStepIdentifier, - initialStep, - metaForStepIdentifier, + MIN_ONBOARDING_WALLET_BALANCE, + OnboardingContext, + OnboardingStep, + OnboardingStepIdentifier, + initialStep, + metaForStepIdentifier, } from "./OnboardingDataModels"; async function pollForLambdaForComplete( diff --git a/packages/accounts/src/light-account/__tests__/account.test.ts b/packages/accounts/src/light-account/__tests__/account.test.ts index ea88ac085f..f385a69a6d 100644 --- a/packages/accounts/src/light-account/__tests__/account.test.ts +++ b/packages/accounts/src/light-account/__tests__/account.test.ts @@ -1,7 +1,6 @@ import { LocalAccountSigner, SmartAccountProvider, - type Address, type BatchUserOperationCallData, type SmartAccountSigner, } from "@alchemy/aa-core"; diff --git a/site/smart-accounts/signers/capsule.md b/site/smart-accounts/signers/capsule.md index 3737eda5f6..8fdfce7141 100644 --- a/site/smart-accounts/signers/capsule.md +++ b/site/smart-accounts/signers/capsule.md @@ -80,6 +80,8 @@ import { sepolia } from "viem/chains"; import { capsuleSigner } from "./capsule"; const chain = sepolia; +const entryPointAddress = getDefaultEntryPointAddress(chain); +const factoryAddress = getDefaultLightAccountFactoryAddress(chain); const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/dynamic.md b/site/smart-accounts/signers/dynamic.md index 6a1a681fbc..9ec3ccc7e8 100644 --- a/site/smart-accounts/signers/dynamic.md +++ b/site/smart-accounts/signers/dynamic.md @@ -91,6 +91,8 @@ import { sepolia } from "viem/chains"; import { dynamicSigner } from "./dynamic"; const chain = sepolia; +const entryPointAddress = getDefaultEntryPointAddress(chain); +const factoryAddress = getDefaultLightAccountFactoryAddress(chain); const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/magic.md b/site/smart-accounts/signers/magic.md index ddf0b24dc2..a7b7df20c0 100644 --- a/site/smart-accounts/signers/magic.md +++ b/site/smart-accounts/signers/magic.md @@ -61,6 +61,9 @@ import { sepolia } from "viem/chains"; import { createMagicSigner } from "./magic"; const chain = sepolia; +const entryPointAddress = getDefaultEntryPointContract(chain); +const factoryAddress = getDefaultLightAccountFactory(chain); + // NOTE: the below is async because it depends on creating a magic signer. You can choose to break that up how you want // eg. use a useEffect + useState to create the signer and then pass it down to the provider const provider = new AlchemyProvider({ diff --git a/site/smart-accounts/signers/turnkey.md b/site/smart-accounts/signers/turnkey.md index 04d66eb00d..d9a60bef4f 100644 --- a/site/smart-accounts/signers/turnkey.md +++ b/site/smart-accounts/signers/turnkey.md @@ -69,6 +69,8 @@ import { newTurnkeySigner } from "./turnkey"; async function main() { const owner = await newTurnkeySigner(); const chain = sepolia; + const entryPointAddress = getDefaultEntryPointAddress(chain); + const factoryAddress = getDefaultLightAccountFactoryAddress(chain); const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/web3auth.md b/site/smart-accounts/signers/web3auth.md index 9ba91a60b4..f7e360200d 100644 --- a/site/smart-accounts/signers/web3auth.md +++ b/site/smart-accounts/signers/web3auth.md @@ -61,6 +61,8 @@ import { sepolia } from "viem/chains"; import { web3authSigner } from "./web3auth"; const chain = sepolia; +const entryPointAddress = getDefaultEntryPointAddress(chain); +const factoryAddress = getDefaultLightAccountFactoryAddress(chain); const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, From 93ebb4958b2b06362093e9de364677d9f2f67ce8 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 18:54:21 -0700 Subject: [PATCH 07/49] feat: make entry point contract as an optional param to SCA class (#182) --- site/smart-accounts/signers/capsule.md | 3 +-- site/smart-accounts/signers/dynamic.md | 3 +-- site/smart-accounts/signers/magic.md | 2 -- site/smart-accounts/signers/turnkey.md | 3 +-- site/smart-accounts/signers/web3auth.md | 3 +-- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/site/smart-accounts/signers/capsule.md b/site/smart-accounts/signers/capsule.md index 8fdfce7141..d81ee2e9f2 100644 --- a/site/smart-accounts/signers/capsule.md +++ b/site/smart-accounts/signers/capsule.md @@ -80,8 +80,7 @@ import { sepolia } from "viem/chains"; import { capsuleSigner } from "./capsule"; const chain = sepolia; -const entryPointAddress = getDefaultEntryPointAddress(chain); -const factoryAddress = getDefaultLightAccountFactoryAddress(chain); + const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/dynamic.md b/site/smart-accounts/signers/dynamic.md index 9ec3ccc7e8..4487871ac8 100644 --- a/site/smart-accounts/signers/dynamic.md +++ b/site/smart-accounts/signers/dynamic.md @@ -91,8 +91,7 @@ import { sepolia } from "viem/chains"; import { dynamicSigner } from "./dynamic"; const chain = sepolia; -const entryPointAddress = getDefaultEntryPointAddress(chain); -const factoryAddress = getDefaultLightAccountFactoryAddress(chain); + const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/magic.md b/site/smart-accounts/signers/magic.md index a7b7df20c0..4d0927a8a7 100644 --- a/site/smart-accounts/signers/magic.md +++ b/site/smart-accounts/signers/magic.md @@ -61,8 +61,6 @@ import { sepolia } from "viem/chains"; import { createMagicSigner } from "./magic"; const chain = sepolia; -const entryPointAddress = getDefaultEntryPointContract(chain); -const factoryAddress = getDefaultLightAccountFactory(chain); // NOTE: the below is async because it depends on creating a magic signer. You can choose to break that up how you want // eg. use a useEffect + useState to create the signer and then pass it down to the provider diff --git a/site/smart-accounts/signers/turnkey.md b/site/smart-accounts/signers/turnkey.md index d9a60bef4f..6851fcf413 100644 --- a/site/smart-accounts/signers/turnkey.md +++ b/site/smart-accounts/signers/turnkey.md @@ -69,8 +69,7 @@ import { newTurnkeySigner } from "./turnkey"; async function main() { const owner = await newTurnkeySigner(); const chain = sepolia; - const entryPointAddress = getDefaultEntryPointAddress(chain); - const factoryAddress = getDefaultLightAccountFactoryAddress(chain); + const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/web3auth.md b/site/smart-accounts/signers/web3auth.md index f7e360200d..d1469591da 100644 --- a/site/smart-accounts/signers/web3auth.md +++ b/site/smart-accounts/signers/web3auth.md @@ -61,8 +61,7 @@ import { sepolia } from "viem/chains"; import { web3authSigner } from "./web3auth"; const chain = sepolia; -const entryPointAddress = getDefaultEntryPointAddress(chain); -const factoryAddress = getDefaultLightAccountFactoryAddress(chain); + const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, From f64559c969596fc71505d99777fb8b8cbb09b9b9 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 22:58:13 -0700 Subject: [PATCH 08/49] feat: add sanity check on provider connect for clearer error message (#181) Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../surfaces/onboarding/OnboardingController.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts index 9539d50199..2f88f9d0a5 100644 --- a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts +++ b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi"; import { localSmartContractStore } from "~/clients/localStorage"; import { NFTContractABI } from "../../clients/nftContract"; import { - DAAppConfiguration, - daappConfigurations, + DAAppConfiguration, + daappConfigurations, } from "../../configs/clientConfigs"; import { - MIN_ONBOARDING_WALLET_BALANCE, - OnboardingContext, - OnboardingStep, - OnboardingStepIdentifier, - initialStep, - metaForStepIdentifier, + MIN_ONBOARDING_WALLET_BALANCE, + OnboardingContext, + OnboardingStep, + OnboardingStepIdentifier, + initialStep, + metaForStepIdentifier, } from "./OnboardingDataModels"; async function pollForLambdaForComplete( From 9a81647208a1c0c22d939ce0fa5c2db2c1905bf0 Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:19:03 -0400 Subject: [PATCH 09/49] feat: add zod runtime validation for base account (#186) * feat: add zod runtime validation for base account * feat: add zod runtime validation for base account * feat: add zod runtime validation for simple account * refactor: clean up base schemas * refactor: rebase * refactor: rename abitype import --- packages/core/src/account/__tests__/simple.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/account/__tests__/simple.test.ts b/packages/core/src/account/__tests__/simple.test.ts index ef6fddb404..9ae1429456 100644 --- a/packages/core/src/account/__tests__/simple.test.ts +++ b/packages/core/src/account/__tests__/simple.test.ts @@ -1,5 +1,9 @@ import type { Address } from "viem"; +<<<<<<< HEAD import { polygonMumbai, sepolia, type Chain } from "viem/chains"; +======= +import { polygonMumbai, type Chain } from "viem/chains"; +>>>>>>> 1c5e368 (feat: add zod runtime validation for base account (#186)) import { describe, it } from "vitest"; import { getDefaultSimpleAccountFactoryAddress } from "../../index.js"; import { SmartAccountProvider } from "../../provider/base.js"; From 2aa1f1cbef5837f617049eff2c28f4ac888754bf Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:02:11 -0400 Subject: [PATCH 10/49] feat: add zod runtime validation for simple account (#189) --- packages/core/src/account/__tests__/simple.test.ts | 4 ---- packages/core/src/account/schema.ts | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/core/src/account/__tests__/simple.test.ts b/packages/core/src/account/__tests__/simple.test.ts index 9ae1429456..ef6fddb404 100644 --- a/packages/core/src/account/__tests__/simple.test.ts +++ b/packages/core/src/account/__tests__/simple.test.ts @@ -1,9 +1,5 @@ import type { Address } from "viem"; -<<<<<<< HEAD import { polygonMumbai, sepolia, type Chain } from "viem/chains"; -======= -import { polygonMumbai, type Chain } from "viem/chains"; ->>>>>>> 1c5e368 (feat: add zod runtime validation for base account (#186)) import { describe, it } from "vitest"; import { getDefaultSimpleAccountFactoryAddress } from "../../index.js"; import { SmartAccountProvider } from "../../provider/base.js"; diff --git a/packages/core/src/account/schema.ts b/packages/core/src/account/schema.ts index 183a8b60e7..a0d452e2c1 100644 --- a/packages/core/src/account/schema.ts +++ b/packages/core/src/account/schema.ts @@ -35,3 +35,11 @@ export const SimpleSmartAccountParamsSchema = < owner: SignerSchema, index: z.bigint().optional(), }); + +export const SimpleSmartAccountParamsSchema = < + TTransport extends SupportedTransports = Transport +>() => + createBaseSmartAccountParamsSchema().extend({ + owner: SignerSchema, + index: z.bigint().optional(), + }); From de3a8cc9ae10c6bba4e087adf2b02567ed520877 Mon Sep 17 00:00:00 2001 From: Michael Moldoveanu Date: Fri, 3 Nov 2023 15:19:20 -0400 Subject: [PATCH 11/49] feat: add support for overriding the initCode for an account (#197) --- packages/core/src/account/schema.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/core/src/account/schema.ts b/packages/core/src/account/schema.ts index a0d452e2c1..183a8b60e7 100644 --- a/packages/core/src/account/schema.ts +++ b/packages/core/src/account/schema.ts @@ -35,11 +35,3 @@ export const SimpleSmartAccountParamsSchema = < owner: SignerSchema, index: z.bigint().optional(), }); - -export const SimpleSmartAccountParamsSchema = < - TTransport extends SupportedTransports = Transport ->() => - createBaseSmartAccountParamsSchema().extend({ - owner: SignerSchema, - index: z.bigint().optional(), - }); From 4e71ee2d78cd4dbaaaf74fdb5ca1fd6e6faf2608 Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Sun, 5 Nov 2023 19:30:50 -0500 Subject: [PATCH 12/49] chore: bump dev dependencies and versions in examples (#211) --- packages/accounts/package.json | 1 - yarn.lock | 25 ------------------------- 2 files changed, 26 deletions(-) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index aea1bb4dfe..cd4d2eab37 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -39,7 +39,6 @@ "test:run-e2e": "vitest run --config vitest.config.e2e.ts" }, "devDependencies": { - "@alchemy/aa-alchemy": "^1.0.0", "@alchemy/aa-core": "^0.2.0", "typescript": "^5.0.4", "typescript-template": "*", diff --git a/yarn.lock b/yarn.lock index 541b10fc1f..c765ba9f96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,31 +12,6 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== -"@alchemy/aa-accounts@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-0.1.1.tgz#7527e25fe2825eb91d80f6e4cb85d188606587a4" - integrity sha512-nHHnJuIHXGdvH5i+7DlTeSPa3RJtNLt4NpJP+G+T8G3QP/k6mxHNWFTybOhqxuCC798DACxKc4thOL2Lj8phgA== - dependencies: - "@alchemy/aa-core" "^0.1.1" - viem "^1.16.2" - -"@alchemy/aa-alchemy@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-0.1.1.tgz#f7f989b2aaae127a49a61e1dde6d6f52d40d0018" - integrity sha512-rVQZNb1QmfQoxDyaXuinB0pfrKENLydwH57TWXJn4wFW+3c+iM6xM/tsfx6zxzA7HTwodcRw8//wMvdF+5KQmg== - dependencies: - "@alchemy/aa-core" "^0.1.1" - viem "^1.16.2" - -"@alchemy/aa-core@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-0.1.1.tgz#2c81e34c0ca939897004c68d80250f1b4b423ff2" - integrity sha512-vEfCx9MJMTCMpmB3cY+TcM65znP8zcMTaiYE7By3+krhd7ViflWdEILe5HGGzCALGqdr6pUaBI7n08eVoyo6KQ== - dependencies: - abitype "^0.8.3" - eventemitter3 "^5.0.1" - viem "^1.16.2" - "@algolia/autocomplete-core@1.9.3": version "1.9.3" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" From a4be7392a4625e5b2f0a08c46f44a3524b0b7542 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Sun, 5 Nov 2023 17:31:48 -0800 Subject: [PATCH 13/49] feat: use alchemy provider, light account for e2e tests (#209) --- packages/accounts/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index cd4d2eab37..784dfac71b 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -40,6 +40,7 @@ }, "devDependencies": { "@alchemy/aa-core": "^0.2.0", + "@alchemy/aa-alchemy": "^0.2.0", "typescript": "^5.0.4", "typescript-template": "*", "vitest": "^0.31.0" From 808e27a5eff1f727b3b421d774854a6ce706c744 Mon Sep 17 00:00:00 2001 From: JP <36560907+0xfourzerofour@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:18:06 -0500 Subject: [PATCH 14/49] feat(arb-sepolia): add arb sepolia to defaults (#216) --- packages/core/src/utils/defaults.ts | 2 ++ yarn.lock | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/packages/core/src/utils/defaults.ts b/packages/core/src/utils/defaults.ts index 2fbcc6ebac..a6322a4e22 100644 --- a/packages/core/src/utils/defaults.ts +++ b/packages/core/src/utils/defaults.ts @@ -67,6 +67,8 @@ export const getDefaultSimpleAccountFactoryAddress = ( case optimismGoerli.id: case arbitrumGoerli.id: return "0x9406Cc6185a346906296840746125a0E44976454"; + case arbitrumSepolia.id: + return "0x8d4CCBaa194ED721AC3e231a1A3863966c2D7921"; } throw new Error( diff --git a/yarn.lock b/yarn.lock index c765ba9f96..541b10fc1f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,31 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== +"@alchemy/aa-accounts@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-0.1.1.tgz#7527e25fe2825eb91d80f6e4cb85d188606587a4" + integrity sha512-nHHnJuIHXGdvH5i+7DlTeSPa3RJtNLt4NpJP+G+T8G3QP/k6mxHNWFTybOhqxuCC798DACxKc4thOL2Lj8phgA== + dependencies: + "@alchemy/aa-core" "^0.1.1" + viem "^1.16.2" + +"@alchemy/aa-alchemy@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-0.1.1.tgz#f7f989b2aaae127a49a61e1dde6d6f52d40d0018" + integrity sha512-rVQZNb1QmfQoxDyaXuinB0pfrKENLydwH57TWXJn4wFW+3c+iM6xM/tsfx6zxzA7HTwodcRw8//wMvdF+5KQmg== + dependencies: + "@alchemy/aa-core" "^0.1.1" + viem "^1.16.2" + +"@alchemy/aa-core@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-0.1.1.tgz#2c81e34c0ca939897004c68d80250f1b4b423ff2" + integrity sha512-vEfCx9MJMTCMpmB3cY+TcM65znP8zcMTaiYE7By3+krhd7ViflWdEILe5HGGzCALGqdr6pUaBI7n08eVoyo6KQ== + dependencies: + abitype "^0.8.3" + eventemitter3 "^5.0.1" + viem "^1.16.2" + "@algolia/autocomplete-core@1.9.3": version "1.9.3" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" From 1bb816a7f9106572745304ae8bd405d0aa9c6ab7 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Thu, 9 Nov 2023 10:34:18 -0800 Subject: [PATCH 15/49] feat: aa-sdk with native arb sepolia support (#231) --- packages/core/src/utils/defaults.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/core/src/utils/defaults.ts b/packages/core/src/utils/defaults.ts index a6322a4e22..2fbcc6ebac 100644 --- a/packages/core/src/utils/defaults.ts +++ b/packages/core/src/utils/defaults.ts @@ -67,8 +67,6 @@ export const getDefaultSimpleAccountFactoryAddress = ( case optimismGoerli.id: case arbitrumGoerli.id: return "0x9406Cc6185a346906296840746125a0E44976454"; - case arbitrumSepolia.id: - return "0x8d4CCBaa194ED721AC3e231a1A3863966c2D7921"; } throw new Error( From 07114ebd7370100cddf4ffacfc891121e05fa9b6 Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:50:48 -0500 Subject: [PATCH 16/49] feat!: extend SmartAccountSigner with authentication functionality (#227) --- .../e2e-tests/kernel-account.test.ts | 1 + yarn.lock | 25 ------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/packages/accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts b/packages/accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts index 5a69fab63f..99ae9973ca 100644 --- a/packages/accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts +++ b/packages/accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts @@ -1,4 +1,5 @@ import { + AA_SDK_TESTS_SIGNER_TYPE, getDefaultEntryPointAddress, type BatchUserOperationCallData, type SmartAccountSigner, diff --git a/yarn.lock b/yarn.lock index 541b10fc1f..c765ba9f96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,31 +12,6 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== -"@alchemy/aa-accounts@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-0.1.1.tgz#7527e25fe2825eb91d80f6e4cb85d188606587a4" - integrity sha512-nHHnJuIHXGdvH5i+7DlTeSPa3RJtNLt4NpJP+G+T8G3QP/k6mxHNWFTybOhqxuCC798DACxKc4thOL2Lj8phgA== - dependencies: - "@alchemy/aa-core" "^0.1.1" - viem "^1.16.2" - -"@alchemy/aa-alchemy@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-0.1.1.tgz#f7f989b2aaae127a49a61e1dde6d6f52d40d0018" - integrity sha512-rVQZNb1QmfQoxDyaXuinB0pfrKENLydwH57TWXJn4wFW+3c+iM6xM/tsfx6zxzA7HTwodcRw8//wMvdF+5KQmg== - dependencies: - "@alchemy/aa-core" "^0.1.1" - viem "^1.16.2" - -"@alchemy/aa-core@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-0.1.1.tgz#2c81e34c0ca939897004c68d80250f1b4b423ff2" - integrity sha512-vEfCx9MJMTCMpmB3cY+TcM65znP8zcMTaiYE7By3+krhd7ViflWdEILe5HGGzCALGqdr6pUaBI7n08eVoyo6KQ== - dependencies: - abitype "^0.8.3" - eventemitter3 "^5.0.1" - viem "^1.16.2" - "@algolia/autocomplete-core@1.9.3": version "1.9.3" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" From 0b934544ede75727b0491bedb6be4985030e8cf6 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Thu, 9 Nov 2023 14:41:25 -0800 Subject: [PATCH 17/49] feat: remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core (#232) --- .../accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts b/packages/accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts index 99ae9973ca..5a69fab63f 100644 --- a/packages/accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts +++ b/packages/accounts/src/kernel-zerodev/e2e-tests/kernel-account.test.ts @@ -1,5 +1,4 @@ import { - AA_SDK_TESTS_SIGNER_TYPE, getDefaultEntryPointAddress, type BatchUserOperationCallData, type SmartAccountSigner, From 41571df12335db72372a4302cda6046e147c9787 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Thu, 9 Nov 2023 18:34:01 -0800 Subject: [PATCH 18/49] chore(release): publish v1.0.0 [skip-ci] --- packages/accounts/CHANGELOG.md | 1 - packages/accounts/package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/accounts/CHANGELOG.md b/packages/accounts/CHANGELOG.md index 9d28769934..542adac954 100644 --- a/packages/accounts/CHANGELOG.md +++ b/packages/accounts/CHANGELOG.md @@ -13,7 +13,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline - entry point address as optional to SmartAccountProvider ([#180](https://github.com/alchemyplatform/aa-sdk/issues/180)) ([f5c378b](https://github.com/alchemyplatform/aa-sdk/commit/f5c378ba1cb04bdc1e41c3e6dd0eba1cb6ee7f2c)) - remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([883c489](https://github.com/alchemyplatform/aa-sdk/commit/883c489b077d587b6c5b50c44d92b2a00f10e5ac)) - use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) - - remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([5170a6b](https://github.com/alchemyplatform/aa-sdk/commit/5170a6b689c9834a9a2489f054b767e190fa38f7)) # 0.2.0 (2023-11-03) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index 784dfac71b..aea1bb4dfe 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -39,8 +39,8 @@ "test:run-e2e": "vitest run --config vitest.config.e2e.ts" }, "devDependencies": { + "@alchemy/aa-alchemy": "^1.0.0", "@alchemy/aa-core": "^0.2.0", - "@alchemy/aa-alchemy": "^0.2.0", "typescript": "^5.0.4", "typescript-template": "*", "vitest": "^0.31.0" From 356241b5f167aece8452a357d93597bc29bcda06 Mon Sep 17 00:00:00 2001 From: Alchemy Bot Date: Fri, 10 Nov 2023 02:23:26 +0000 Subject: [PATCH 19/49] chore(release): publish v0.3.0 [skip-ci] --- packages/accounts/package.json | 8 ++++++++ packages/alchemy/package.json | 4 ++++ packages/ethers/package.json | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index aea1bb4dfe..9d24b03df4 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -1,6 +1,10 @@ { "name": "@alchemy/aa-accounts", +<<<<<<< HEAD "version": "1.0.0", +======= + "version": "0.3.0", +>>>>>>> 34243f6 (chore(release): publish v0.3.0 [skip-ci]) "description": "A collection of ERC-4337 compliant smart contract account interfaces", "author": "Alchemy", "license": "MIT", @@ -59,7 +63,11 @@ "homepage": "https://github.com/alchemyplatform/aa-sdk#readme", "gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d", "dependencies": { +<<<<<<< HEAD "@alchemy/aa-core": "^1.0.0", +======= + "@alchemy/aa-core": "^0.3.0", +>>>>>>> 34243f6 (chore(release): publish v0.3.0 [skip-ci]) "viem": "^1.16.2" } } diff --git a/packages/alchemy/package.json b/packages/alchemy/package.json index 631945ca98..9f76b59c41 100644 --- a/packages/alchemy/package.json +++ b/packages/alchemy/package.json @@ -1,6 +1,10 @@ { "name": "@alchemy/aa-alchemy", +<<<<<<< HEAD "version": "1.0.0", +======= + "version": "0.3.0", +>>>>>>> 34243f6 (chore(release): publish v0.3.0 [skip-ci]) "description": "adapters for @alchemy/aa-core for interacting with alchemy services", "author": "Alchemy", "license": "MIT", diff --git a/packages/ethers/package.json b/packages/ethers/package.json index b2a2384e29..fa8a6c9dd3 100644 --- a/packages/ethers/package.json +++ b/packages/ethers/package.json @@ -49,7 +49,11 @@ "vitest": "^0.31.0" }, "dependencies": { +<<<<<<< HEAD "@alchemy/aa-core": "^1.0.0", +======= + "@alchemy/aa-core": "^0.3.0", +>>>>>>> 34243f6 (chore(release): publish v0.3.0 [skip-ci]) "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/bytes": "^5.7.0", From c7829db1561f47a6d976d84310e578a6cf5cd0b2 Mon Sep 17 00:00:00 2001 From: moldy Date: Thu, 9 Nov 2023 21:36:43 -0500 Subject: [PATCH 20/49] feat!: publish breaking change BREAKING CHANGE: forcing breaking change From 1ba4f91c0977183c81721ceff8b10ad7f32cd231 Mon Sep 17 00:00:00 2001 From: moldy Date: Thu, 9 Nov 2023 21:38:54 -0500 Subject: [PATCH 21/49] chore(release): publish v1.0.0 [skip-ci] --- packages/accounts/package.json | 8 -------- packages/alchemy/package.json | 4 ---- packages/ethers/package.json | 4 ---- 3 files changed, 16 deletions(-) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index 9d24b03df4..aea1bb4dfe 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -1,10 +1,6 @@ { "name": "@alchemy/aa-accounts", -<<<<<<< HEAD "version": "1.0.0", -======= - "version": "0.3.0", ->>>>>>> 34243f6 (chore(release): publish v0.3.0 [skip-ci]) "description": "A collection of ERC-4337 compliant smart contract account interfaces", "author": "Alchemy", "license": "MIT", @@ -63,11 +59,7 @@ "homepage": "https://github.com/alchemyplatform/aa-sdk#readme", "gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d", "dependencies": { -<<<<<<< HEAD "@alchemy/aa-core": "^1.0.0", -======= - "@alchemy/aa-core": "^0.3.0", ->>>>>>> 34243f6 (chore(release): publish v0.3.0 [skip-ci]) "viem": "^1.16.2" } } diff --git a/packages/alchemy/package.json b/packages/alchemy/package.json index 9f76b59c41..631945ca98 100644 --- a/packages/alchemy/package.json +++ b/packages/alchemy/package.json @@ -1,10 +1,6 @@ { "name": "@alchemy/aa-alchemy", -<<<<<<< HEAD "version": "1.0.0", -======= - "version": "0.3.0", ->>>>>>> 34243f6 (chore(release): publish v0.3.0 [skip-ci]) "description": "adapters for @alchemy/aa-core for interacting with alchemy services", "author": "Alchemy", "license": "MIT", diff --git a/packages/ethers/package.json b/packages/ethers/package.json index fa8a6c9dd3..b2a2384e29 100644 --- a/packages/ethers/package.json +++ b/packages/ethers/package.json @@ -49,11 +49,7 @@ "vitest": "^0.31.0" }, "dependencies": { -<<<<<<< HEAD "@alchemy/aa-core": "^1.0.0", -======= - "@alchemy/aa-core": "^0.3.0", ->>>>>>> 34243f6 (chore(release): publish v0.3.0 [skip-ci]) "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/bytes": "^5.7.0", From e3d179193930ad6d8b54ff512d041de2921dcd4a Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 14:25:22 -0700 Subject: [PATCH 22/49] feat: entry point address as optional to SmartAccountProvider (#180) * feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../onboarding/OnboardingController.ts | 16 ++++++------ site/smart-accounts/signers/capsule.md | 1 - site/smart-accounts/signers/dynamic.md | 1 - site/smart-accounts/signers/turnkey.md | 1 - site/smart-accounts/signers/web3auth.md | 1 - yarn.lock | 25 +++++++++++++++++++ 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts index 2f88f9d0a5..9539d50199 100644 --- a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts +++ b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi"; import { localSmartContractStore } from "~/clients/localStorage"; import { NFTContractABI } from "../../clients/nftContract"; import { - DAAppConfiguration, - daappConfigurations, + DAAppConfiguration, + daappConfigurations, } from "../../configs/clientConfigs"; import { - MIN_ONBOARDING_WALLET_BALANCE, - OnboardingContext, - OnboardingStep, - OnboardingStepIdentifier, - initialStep, - metaForStepIdentifier, + MIN_ONBOARDING_WALLET_BALANCE, + OnboardingContext, + OnboardingStep, + OnboardingStepIdentifier, + initialStep, + metaForStepIdentifier, } from "./OnboardingDataModels"; async function pollForLambdaForComplete( diff --git a/site/smart-accounts/signers/capsule.md b/site/smart-accounts/signers/capsule.md index d81ee2e9f2..3737eda5f6 100644 --- a/site/smart-accounts/signers/capsule.md +++ b/site/smart-accounts/signers/capsule.md @@ -80,7 +80,6 @@ import { sepolia } from "viem/chains"; import { capsuleSigner } from "./capsule"; const chain = sepolia; - const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/dynamic.md b/site/smart-accounts/signers/dynamic.md index 4487871ac8..6a1a681fbc 100644 --- a/site/smart-accounts/signers/dynamic.md +++ b/site/smart-accounts/signers/dynamic.md @@ -91,7 +91,6 @@ import { sepolia } from "viem/chains"; import { dynamicSigner } from "./dynamic"; const chain = sepolia; - const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/turnkey.md b/site/smart-accounts/signers/turnkey.md index 6851fcf413..04d66eb00d 100644 --- a/site/smart-accounts/signers/turnkey.md +++ b/site/smart-accounts/signers/turnkey.md @@ -69,7 +69,6 @@ import { newTurnkeySigner } from "./turnkey"; async function main() { const owner = await newTurnkeySigner(); const chain = sepolia; - const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/web3auth.md b/site/smart-accounts/signers/web3auth.md index d1469591da..9ba91a60b4 100644 --- a/site/smart-accounts/signers/web3auth.md +++ b/site/smart-accounts/signers/web3auth.md @@ -61,7 +61,6 @@ import { sepolia } from "viem/chains"; import { web3authSigner } from "./web3auth"; const chain = sepolia; - const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/yarn.lock b/yarn.lock index c765ba9f96..541b10fc1f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,31 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== +"@alchemy/aa-accounts@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-0.1.1.tgz#7527e25fe2825eb91d80f6e4cb85d188606587a4" + integrity sha512-nHHnJuIHXGdvH5i+7DlTeSPa3RJtNLt4NpJP+G+T8G3QP/k6mxHNWFTybOhqxuCC798DACxKc4thOL2Lj8phgA== + dependencies: + "@alchemy/aa-core" "^0.1.1" + viem "^1.16.2" + +"@alchemy/aa-alchemy@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-0.1.1.tgz#f7f989b2aaae127a49a61e1dde6d6f52d40d0018" + integrity sha512-rVQZNb1QmfQoxDyaXuinB0pfrKENLydwH57TWXJn4wFW+3c+iM6xM/tsfx6zxzA7HTwodcRw8//wMvdF+5KQmg== + dependencies: + "@alchemy/aa-core" "^0.1.1" + viem "^1.16.2" + +"@alchemy/aa-core@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-0.1.1.tgz#2c81e34c0ca939897004c68d80250f1b4b423ff2" + integrity sha512-vEfCx9MJMTCMpmB3cY+TcM65znP8zcMTaiYE7By3+krhd7ViflWdEILe5HGGzCALGqdr6pUaBI7n08eVoyo6KQ== + dependencies: + abitype "^0.8.3" + eventemitter3 "^5.0.1" + viem "^1.16.2" + "@algolia/autocomplete-core@1.9.3": version "1.9.3" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" From 514feb2feccfb5eb74f9a4319ee792786c193a99 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 22:58:13 -0700 Subject: [PATCH 23/49] feat: add sanity check on provider connect for clearer error message (#181) Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../surfaces/onboarding/OnboardingController.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts index 9539d50199..2f88f9d0a5 100644 --- a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts +++ b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi"; import { localSmartContractStore } from "~/clients/localStorage"; import { NFTContractABI } from "../../clients/nftContract"; import { - DAAppConfiguration, - daappConfigurations, + DAAppConfiguration, + daappConfigurations, } from "../../configs/clientConfigs"; import { - MIN_ONBOARDING_WALLET_BALANCE, - OnboardingContext, - OnboardingStep, - OnboardingStepIdentifier, - initialStep, - metaForStepIdentifier, + MIN_ONBOARDING_WALLET_BALANCE, + OnboardingContext, + OnboardingStep, + OnboardingStepIdentifier, + initialStep, + metaForStepIdentifier, } from "./OnboardingDataModels"; async function pollForLambdaForComplete( From f4420b020a13185bf652a91fbe5544861e788d03 Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:10:05 -0400 Subject: [PATCH 24/49] feat: add zod runtime validation for base provider (#171) --- packages/accounts/src/light-account/__tests__/account.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/accounts/src/light-account/__tests__/account.test.ts b/packages/accounts/src/light-account/__tests__/account.test.ts index f385a69a6d..ea88ac085f 100644 --- a/packages/accounts/src/light-account/__tests__/account.test.ts +++ b/packages/accounts/src/light-account/__tests__/account.test.ts @@ -1,6 +1,7 @@ import { LocalAccountSigner, SmartAccountProvider, + type Address, type BatchUserOperationCallData, type SmartAccountSigner, } from "@alchemy/aa-core"; From d858a90220ded267fc574c96457952943747cb9e Mon Sep 17 00:00:00 2001 From: Michael Moldoveanu Date: Thu, 26 Oct 2023 14:23:16 -0400 Subject: [PATCH 25/49] docs: update the magic docs to highlight signer creation is async (#170) * docs: update the magic docs to highlight signer creation is async * docs: update the magic docs to highlight signer creation is async --- site/smart-accounts/signers/magic.md | 1 - 1 file changed, 1 deletion(-) diff --git a/site/smart-accounts/signers/magic.md b/site/smart-accounts/signers/magic.md index 4d0927a8a7..ddf0b24dc2 100644 --- a/site/smart-accounts/signers/magic.md +++ b/site/smart-accounts/signers/magic.md @@ -61,7 +61,6 @@ import { sepolia } from "viem/chains"; import { createMagicSigner } from "./magic"; const chain = sepolia; - // NOTE: the below is async because it depends on creating a magic signer. You can choose to break that up how you want // eg. use a useEffect + useState to create the signer and then pass it down to the provider const provider = new AlchemyProvider({ From d9f79f6027be534f6a5a9fec3dd4c06df62e7fc1 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 14:25:22 -0700 Subject: [PATCH 26/49] feat: entry point address as optional to SmartAccountProvider (#180) * feat: abstract out entry point contract address from SCA provider params * feat: make entry point address as an optional param to SCA provider class * feat: update docs for the new utils methods * Update site/packages/aa-core/utils/getDefaultEntryPointContract.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * chore: nit error message update and refactoring --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../surfaces/onboarding/OnboardingController.ts | 16 ++++++++-------- .../src/light-account/__tests__/account.test.ts | 1 - site/smart-accounts/signers/capsule.md | 2 ++ site/smart-accounts/signers/dynamic.md | 2 ++ site/smart-accounts/signers/magic.md | 3 +++ site/smart-accounts/signers/turnkey.md | 2 ++ site/smart-accounts/signers/web3auth.md | 2 ++ 7 files changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts index 2f88f9d0a5..9539d50199 100644 --- a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts +++ b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi"; import { localSmartContractStore } from "~/clients/localStorage"; import { NFTContractABI } from "../../clients/nftContract"; import { - DAAppConfiguration, - daappConfigurations, + DAAppConfiguration, + daappConfigurations, } from "../../configs/clientConfigs"; import { - MIN_ONBOARDING_WALLET_BALANCE, - OnboardingContext, - OnboardingStep, - OnboardingStepIdentifier, - initialStep, - metaForStepIdentifier, + MIN_ONBOARDING_WALLET_BALANCE, + OnboardingContext, + OnboardingStep, + OnboardingStepIdentifier, + initialStep, + metaForStepIdentifier, } from "./OnboardingDataModels"; async function pollForLambdaForComplete( diff --git a/packages/accounts/src/light-account/__tests__/account.test.ts b/packages/accounts/src/light-account/__tests__/account.test.ts index ea88ac085f..f385a69a6d 100644 --- a/packages/accounts/src/light-account/__tests__/account.test.ts +++ b/packages/accounts/src/light-account/__tests__/account.test.ts @@ -1,7 +1,6 @@ import { LocalAccountSigner, SmartAccountProvider, - type Address, type BatchUserOperationCallData, type SmartAccountSigner, } from "@alchemy/aa-core"; diff --git a/site/smart-accounts/signers/capsule.md b/site/smart-accounts/signers/capsule.md index 3737eda5f6..8fdfce7141 100644 --- a/site/smart-accounts/signers/capsule.md +++ b/site/smart-accounts/signers/capsule.md @@ -80,6 +80,8 @@ import { sepolia } from "viem/chains"; import { capsuleSigner } from "./capsule"; const chain = sepolia; +const entryPointAddress = getDefaultEntryPointAddress(chain); +const factoryAddress = getDefaultLightAccountFactoryAddress(chain); const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/dynamic.md b/site/smart-accounts/signers/dynamic.md index 6a1a681fbc..9ec3ccc7e8 100644 --- a/site/smart-accounts/signers/dynamic.md +++ b/site/smart-accounts/signers/dynamic.md @@ -91,6 +91,8 @@ import { sepolia } from "viem/chains"; import { dynamicSigner } from "./dynamic"; const chain = sepolia; +const entryPointAddress = getDefaultEntryPointAddress(chain); +const factoryAddress = getDefaultLightAccountFactoryAddress(chain); const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/magic.md b/site/smart-accounts/signers/magic.md index ddf0b24dc2..a7b7df20c0 100644 --- a/site/smart-accounts/signers/magic.md +++ b/site/smart-accounts/signers/magic.md @@ -61,6 +61,9 @@ import { sepolia } from "viem/chains"; import { createMagicSigner } from "./magic"; const chain = sepolia; +const entryPointAddress = getDefaultEntryPointContract(chain); +const factoryAddress = getDefaultLightAccountFactory(chain); + // NOTE: the below is async because it depends on creating a magic signer. You can choose to break that up how you want // eg. use a useEffect + useState to create the signer and then pass it down to the provider const provider = new AlchemyProvider({ diff --git a/site/smart-accounts/signers/turnkey.md b/site/smart-accounts/signers/turnkey.md index 04d66eb00d..d9a60bef4f 100644 --- a/site/smart-accounts/signers/turnkey.md +++ b/site/smart-accounts/signers/turnkey.md @@ -69,6 +69,8 @@ import { newTurnkeySigner } from "./turnkey"; async function main() { const owner = await newTurnkeySigner(); const chain = sepolia; + const entryPointAddress = getDefaultEntryPointAddress(chain); + const factoryAddress = getDefaultLightAccountFactoryAddress(chain); const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/web3auth.md b/site/smart-accounts/signers/web3auth.md index 9ba91a60b4..f7e360200d 100644 --- a/site/smart-accounts/signers/web3auth.md +++ b/site/smart-accounts/signers/web3auth.md @@ -61,6 +61,8 @@ import { sepolia } from "viem/chains"; import { web3authSigner } from "./web3auth"; const chain = sepolia; +const entryPointAddress = getDefaultEntryPointAddress(chain); +const factoryAddress = getDefaultLightAccountFactoryAddress(chain); const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, From 129a3463d6a5a81eeed50139ac7e1aa5ffe5d20b Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 18:54:21 -0700 Subject: [PATCH 27/49] feat: make entry point contract as an optional param to SCA class (#182) --- site/smart-accounts/signers/capsule.md | 3 +-- site/smart-accounts/signers/dynamic.md | 3 +-- site/smart-accounts/signers/magic.md | 2 -- site/smart-accounts/signers/turnkey.md | 3 +-- site/smart-accounts/signers/web3auth.md | 3 +-- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/site/smart-accounts/signers/capsule.md b/site/smart-accounts/signers/capsule.md index 8fdfce7141..d81ee2e9f2 100644 --- a/site/smart-accounts/signers/capsule.md +++ b/site/smart-accounts/signers/capsule.md @@ -80,8 +80,7 @@ import { sepolia } from "viem/chains"; import { capsuleSigner } from "./capsule"; const chain = sepolia; -const entryPointAddress = getDefaultEntryPointAddress(chain); -const factoryAddress = getDefaultLightAccountFactoryAddress(chain); + const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/dynamic.md b/site/smart-accounts/signers/dynamic.md index 9ec3ccc7e8..4487871ac8 100644 --- a/site/smart-accounts/signers/dynamic.md +++ b/site/smart-accounts/signers/dynamic.md @@ -91,8 +91,7 @@ import { sepolia } from "viem/chains"; import { dynamicSigner } from "./dynamic"; const chain = sepolia; -const entryPointAddress = getDefaultEntryPointAddress(chain); -const factoryAddress = getDefaultLightAccountFactoryAddress(chain); + const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/magic.md b/site/smart-accounts/signers/magic.md index a7b7df20c0..4d0927a8a7 100644 --- a/site/smart-accounts/signers/magic.md +++ b/site/smart-accounts/signers/magic.md @@ -61,8 +61,6 @@ import { sepolia } from "viem/chains"; import { createMagicSigner } from "./magic"; const chain = sepolia; -const entryPointAddress = getDefaultEntryPointContract(chain); -const factoryAddress = getDefaultLightAccountFactory(chain); // NOTE: the below is async because it depends on creating a magic signer. You can choose to break that up how you want // eg. use a useEffect + useState to create the signer and then pass it down to the provider diff --git a/site/smart-accounts/signers/turnkey.md b/site/smart-accounts/signers/turnkey.md index d9a60bef4f..6851fcf413 100644 --- a/site/smart-accounts/signers/turnkey.md +++ b/site/smart-accounts/signers/turnkey.md @@ -69,8 +69,7 @@ import { newTurnkeySigner } from "./turnkey"; async function main() { const owner = await newTurnkeySigner(); const chain = sepolia; - const entryPointAddress = getDefaultEntryPointAddress(chain); - const factoryAddress = getDefaultLightAccountFactoryAddress(chain); + const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, diff --git a/site/smart-accounts/signers/web3auth.md b/site/smart-accounts/signers/web3auth.md index f7e360200d..d1469591da 100644 --- a/site/smart-accounts/signers/web3auth.md +++ b/site/smart-accounts/signers/web3auth.md @@ -61,8 +61,7 @@ import { sepolia } from "viem/chains"; import { web3authSigner } from "./web3auth"; const chain = sepolia; -const entryPointAddress = getDefaultEntryPointAddress(chain); -const factoryAddress = getDefaultLightAccountFactoryAddress(chain); + const provider = new AlchemyProvider({ apiKey: "ALCHEMY_API_KEY", chain, From 33798c2847e9515583224b0132fe460c7d367487 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 30 Oct 2023 22:58:13 -0700 Subject: [PATCH 28/49] feat: add sanity check on provider connect for clearer error message (#181) Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../surfaces/onboarding/OnboardingController.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts index 9539d50199..2f88f9d0a5 100644 --- a/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts +++ b/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi"; import { localSmartContractStore } from "~/clients/localStorage"; import { NFTContractABI } from "../../clients/nftContract"; import { - DAAppConfiguration, - daappConfigurations, + DAAppConfiguration, + daappConfigurations, } from "../../configs/clientConfigs"; import { - MIN_ONBOARDING_WALLET_BALANCE, - OnboardingContext, - OnboardingStep, - OnboardingStepIdentifier, - initialStep, - metaForStepIdentifier, + MIN_ONBOARDING_WALLET_BALANCE, + OnboardingContext, + OnboardingStep, + OnboardingStepIdentifier, + initialStep, + metaForStepIdentifier, } from "./OnboardingDataModels"; async function pollForLambdaForComplete( From 55c1c3eb72fdc63a39fa8a478c430ad6914ec4dd Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:19:03 -0400 Subject: [PATCH 29/49] feat: add zod runtime validation for base account (#186) * feat: add zod runtime validation for base account * feat: add zod runtime validation for base account * feat: add zod runtime validation for simple account * refactor: clean up base schemas * refactor: rebase * refactor: rename abitype import --- packages/core/src/account/__tests__/simple.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/account/__tests__/simple.test.ts b/packages/core/src/account/__tests__/simple.test.ts index ef6fddb404..9ae1429456 100644 --- a/packages/core/src/account/__tests__/simple.test.ts +++ b/packages/core/src/account/__tests__/simple.test.ts @@ -1,5 +1,9 @@ import type { Address } from "viem"; +<<<<<<< HEAD import { polygonMumbai, sepolia, type Chain } from "viem/chains"; +======= +import { polygonMumbai, type Chain } from "viem/chains"; +>>>>>>> 1c5e368 (feat: add zod runtime validation for base account (#186)) import { describe, it } from "vitest"; import { getDefaultSimpleAccountFactoryAddress } from "../../index.js"; import { SmartAccountProvider } from "../../provider/base.js"; From 82309c95beb901b5ab1ff9215686037ed78ab160 Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:02:11 -0400 Subject: [PATCH 30/49] feat: add zod runtime validation for simple account (#189) --- packages/core/src/account/__tests__/simple.test.ts | 4 ---- packages/core/src/account/schema.ts | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/core/src/account/__tests__/simple.test.ts b/packages/core/src/account/__tests__/simple.test.ts index 9ae1429456..ef6fddb404 100644 --- a/packages/core/src/account/__tests__/simple.test.ts +++ b/packages/core/src/account/__tests__/simple.test.ts @@ -1,9 +1,5 @@ import type { Address } from "viem"; -<<<<<<< HEAD import { polygonMumbai, sepolia, type Chain } from "viem/chains"; -======= -import { polygonMumbai, type Chain } from "viem/chains"; ->>>>>>> 1c5e368 (feat: add zod runtime validation for base account (#186)) import { describe, it } from "vitest"; import { getDefaultSimpleAccountFactoryAddress } from "../../index.js"; import { SmartAccountProvider } from "../../provider/base.js"; diff --git a/packages/core/src/account/schema.ts b/packages/core/src/account/schema.ts index 183a8b60e7..a0d452e2c1 100644 --- a/packages/core/src/account/schema.ts +++ b/packages/core/src/account/schema.ts @@ -35,3 +35,11 @@ export const SimpleSmartAccountParamsSchema = < owner: SignerSchema, index: z.bigint().optional(), }); + +export const SimpleSmartAccountParamsSchema = < + TTransport extends SupportedTransports = Transport +>() => + createBaseSmartAccountParamsSchema().extend({ + owner: SignerSchema, + index: z.bigint().optional(), + }); From 0121aad31e69c1b992d4c682abd32522b48c619f Mon Sep 17 00:00:00 2001 From: Michael Moldoveanu Date: Fri, 3 Nov 2023 15:19:20 -0400 Subject: [PATCH 31/49] feat: add support for overriding the initCode for an account (#197) --- packages/core/src/account/schema.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/core/src/account/schema.ts b/packages/core/src/account/schema.ts index a0d452e2c1..183a8b60e7 100644 --- a/packages/core/src/account/schema.ts +++ b/packages/core/src/account/schema.ts @@ -35,11 +35,3 @@ export const SimpleSmartAccountParamsSchema = < owner: SignerSchema, index: z.bigint().optional(), }); - -export const SimpleSmartAccountParamsSchema = < - TTransport extends SupportedTransports = Transport ->() => - createBaseSmartAccountParamsSchema().extend({ - owner: SignerSchema, - index: z.bigint().optional(), - }); From 565425778aac88ed69e611f776f9e21f58a40f4f Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Sun, 5 Nov 2023 19:30:50 -0500 Subject: [PATCH 32/49] chore: bump dev dependencies and versions in examples (#211) --- packages/accounts/package.json | 1 - yarn.lock | 25 ------------------------- 2 files changed, 26 deletions(-) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index aea1bb4dfe..cd4d2eab37 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -39,7 +39,6 @@ "test:run-e2e": "vitest run --config vitest.config.e2e.ts" }, "devDependencies": { - "@alchemy/aa-alchemy": "^1.0.0", "@alchemy/aa-core": "^0.2.0", "typescript": "^5.0.4", "typescript-template": "*", diff --git a/yarn.lock b/yarn.lock index 541b10fc1f..c765ba9f96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,31 +12,6 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== -"@alchemy/aa-accounts@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-0.1.1.tgz#7527e25fe2825eb91d80f6e4cb85d188606587a4" - integrity sha512-nHHnJuIHXGdvH5i+7DlTeSPa3RJtNLt4NpJP+G+T8G3QP/k6mxHNWFTybOhqxuCC798DACxKc4thOL2Lj8phgA== - dependencies: - "@alchemy/aa-core" "^0.1.1" - viem "^1.16.2" - -"@alchemy/aa-alchemy@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-0.1.1.tgz#f7f989b2aaae127a49a61e1dde6d6f52d40d0018" - integrity sha512-rVQZNb1QmfQoxDyaXuinB0pfrKENLydwH57TWXJn4wFW+3c+iM6xM/tsfx6zxzA7HTwodcRw8//wMvdF+5KQmg== - dependencies: - "@alchemy/aa-core" "^0.1.1" - viem "^1.16.2" - -"@alchemy/aa-core@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-0.1.1.tgz#2c81e34c0ca939897004c68d80250f1b4b423ff2" - integrity sha512-vEfCx9MJMTCMpmB3cY+TcM65znP8zcMTaiYE7By3+krhd7ViflWdEILe5HGGzCALGqdr6pUaBI7n08eVoyo6KQ== - dependencies: - abitype "^0.8.3" - eventemitter3 "^5.0.1" - viem "^1.16.2" - "@algolia/autocomplete-core@1.9.3": version "1.9.3" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" From 6e7d007dc72ce4990106d4e2ddd44f564fe79337 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Sun, 5 Nov 2023 17:31:48 -0800 Subject: [PATCH 33/49] feat: use alchemy provider, light account for e2e tests (#209) --- packages/accounts/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index cd4d2eab37..784dfac71b 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -40,6 +40,7 @@ }, "devDependencies": { "@alchemy/aa-core": "^0.2.0", + "@alchemy/aa-alchemy": "^0.2.0", "typescript": "^5.0.4", "typescript-template": "*", "vitest": "^0.31.0" From 12863a6f6ac8b727b055aa178231bea66642aa54 Mon Sep 17 00:00:00 2001 From: JP <36560907+0xfourzerofour@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:18:06 -0500 Subject: [PATCH 34/49] feat(arb-sepolia): add arb sepolia to defaults (#216) --- packages/core/src/utils/defaults.ts | 2 ++ yarn.lock | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/packages/core/src/utils/defaults.ts b/packages/core/src/utils/defaults.ts index 2fbcc6ebac..a6322a4e22 100644 --- a/packages/core/src/utils/defaults.ts +++ b/packages/core/src/utils/defaults.ts @@ -67,6 +67,8 @@ export const getDefaultSimpleAccountFactoryAddress = ( case optimismGoerli.id: case arbitrumGoerli.id: return "0x9406Cc6185a346906296840746125a0E44976454"; + case arbitrumSepolia.id: + return "0x8d4CCBaa194ED721AC3e231a1A3863966c2D7921"; } throw new Error( diff --git a/yarn.lock b/yarn.lock index c765ba9f96..541b10fc1f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,31 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== +"@alchemy/aa-accounts@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-0.1.1.tgz#7527e25fe2825eb91d80f6e4cb85d188606587a4" + integrity sha512-nHHnJuIHXGdvH5i+7DlTeSPa3RJtNLt4NpJP+G+T8G3QP/k6mxHNWFTybOhqxuCC798DACxKc4thOL2Lj8phgA== + dependencies: + "@alchemy/aa-core" "^0.1.1" + viem "^1.16.2" + +"@alchemy/aa-alchemy@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-0.1.1.tgz#f7f989b2aaae127a49a61e1dde6d6f52d40d0018" + integrity sha512-rVQZNb1QmfQoxDyaXuinB0pfrKENLydwH57TWXJn4wFW+3c+iM6xM/tsfx6zxzA7HTwodcRw8//wMvdF+5KQmg== + dependencies: + "@alchemy/aa-core" "^0.1.1" + viem "^1.16.2" + +"@alchemy/aa-core@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-0.1.1.tgz#2c81e34c0ca939897004c68d80250f1b4b423ff2" + integrity sha512-vEfCx9MJMTCMpmB3cY+TcM65znP8zcMTaiYE7By3+krhd7ViflWdEILe5HGGzCALGqdr6pUaBI7n08eVoyo6KQ== + dependencies: + abitype "^0.8.3" + eventemitter3 "^5.0.1" + viem "^1.16.2" + "@algolia/autocomplete-core@1.9.3": version "1.9.3" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" From 2e22ae828625ec9a1139ff3f94d510ea9a0a915a Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Tue, 7 Nov 2023 13:04:06 -0800 Subject: [PATCH 35/49] chore: update tests to use aa-sdk-tests as signerType to avoid confusion in telemetry (#222) --- packages/core/src/index.ts | 2 +- packages/core/src/signer/types.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 530ffd8227..58a73e8501 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -15,8 +15,8 @@ export type { BaseSmartAccountParams } from "./account/types.js"; export { LocalAccountSigner } from "./signer/local-account.js"; export { SignerSchema } from "./signer/schema.js"; export type { - SmartAccountSigner, SmartAccountAuthenticator, + SmartAccountSigner, } from "./signer/types.js"; export { verifyEIP6492Signature, diff --git a/packages/core/src/signer/types.ts b/packages/core/src/signer/types.ts index d19a9d7e6e..d8032d8004 100644 --- a/packages/core/src/signer/types.ts +++ b/packages/core/src/signer/types.ts @@ -41,3 +41,5 @@ export interface SmartAccountSigner { signTypedData: (params: SignTypedDataParams) => Promise; } + +export const AA_SDK_TESTS_SIGNER_TYPE = "aa-sdk-tests"; From 737f9c456de24bf52511dbde2ca480fc7e91b1ca Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Thu, 9 Nov 2023 10:34:18 -0800 Subject: [PATCH 36/49] feat: aa-sdk with native arb sepolia support (#231) --- packages/core/src/utils/defaults.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/core/src/utils/defaults.ts b/packages/core/src/utils/defaults.ts index a6322a4e22..2fbcc6ebac 100644 --- a/packages/core/src/utils/defaults.ts +++ b/packages/core/src/utils/defaults.ts @@ -67,8 +67,6 @@ export const getDefaultSimpleAccountFactoryAddress = ( case optimismGoerli.id: case arbitrumGoerli.id: return "0x9406Cc6185a346906296840746125a0E44976454"; - case arbitrumSepolia.id: - return "0x8d4CCBaa194ED721AC3e231a1A3863966c2D7921"; } throw new Error( From 0b35ec24f9ff24bd5f29c533525e26f16ac14da6 Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:50:48 -0500 Subject: [PATCH 37/49] feat!: extend SmartAccountSigner with authentication functionality (#227) --- yarn.lock | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/yarn.lock b/yarn.lock index 541b10fc1f..c765ba9f96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,31 +12,6 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== -"@alchemy/aa-accounts@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-accounts/-/aa-accounts-0.1.1.tgz#7527e25fe2825eb91d80f6e4cb85d188606587a4" - integrity sha512-nHHnJuIHXGdvH5i+7DlTeSPa3RJtNLt4NpJP+G+T8G3QP/k6mxHNWFTybOhqxuCC798DACxKc4thOL2Lj8phgA== - dependencies: - "@alchemy/aa-core" "^0.1.1" - viem "^1.16.2" - -"@alchemy/aa-alchemy@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-alchemy/-/aa-alchemy-0.1.1.tgz#f7f989b2aaae127a49a61e1dde6d6f52d40d0018" - integrity sha512-rVQZNb1QmfQoxDyaXuinB0pfrKENLydwH57TWXJn4wFW+3c+iM6xM/tsfx6zxzA7HTwodcRw8//wMvdF+5KQmg== - dependencies: - "@alchemy/aa-core" "^0.1.1" - viem "^1.16.2" - -"@alchemy/aa-core@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@alchemy/aa-core/-/aa-core-0.1.1.tgz#2c81e34c0ca939897004c68d80250f1b4b423ff2" - integrity sha512-vEfCx9MJMTCMpmB3cY+TcM65znP8zcMTaiYE7By3+krhd7ViflWdEILe5HGGzCALGqdr6pUaBI7n08eVoyo6KQ== - dependencies: - abitype "^0.8.3" - eventemitter3 "^5.0.1" - viem "^1.16.2" - "@algolia/autocomplete-core@1.9.3": version "1.9.3" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" From 05d0c432d5b9c970f1f3bc159648777c542d6201 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Thu, 9 Nov 2023 14:41:25 -0800 Subject: [PATCH 38/49] feat: remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core (#232) --- packages/core/src/signer/types.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/core/src/signer/types.ts b/packages/core/src/signer/types.ts index d8032d8004..d19a9d7e6e 100644 --- a/packages/core/src/signer/types.ts +++ b/packages/core/src/signer/types.ts @@ -41,5 +41,3 @@ export interface SmartAccountSigner { signTypedData: (params: SignTypedDataParams) => Promise; } - -export const AA_SDK_TESTS_SIGNER_TYPE = "aa-sdk-tests"; From 60a4baf2c24fee2d87004875bcaf2889010acb1d Mon Sep 17 00:00:00 2001 From: Alchemy Bot Date: Fri, 10 Nov 2023 02:23:26 +0000 Subject: [PATCH 39/49] chore(release): publish v0.3.0 [skip-ci] --- packages/accounts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index 784dfac71b..841910c2a3 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -39,8 +39,8 @@ "test:run-e2e": "vitest run --config vitest.config.e2e.ts" }, "devDependencies": { + "@alchemy/aa-alchemy": "^0.3.0", "@alchemy/aa-core": "^0.2.0", - "@alchemy/aa-alchemy": "^0.2.0", "typescript": "^5.0.4", "typescript-template": "*", "vitest": "^0.31.0" From b8c367553f51a48dbd5bcf3ea72c8519c92ab59b Mon Sep 17 00:00:00 2001 From: moldy Date: Thu, 9 Nov 2023 21:36:43 -0500 Subject: [PATCH 40/49] feat!: publish breaking change BREAKING CHANGE: forcing breaking change From 2b1fed63993def71ba6b726abb19cdbe14106f7e Mon Sep 17 00:00:00 2001 From: moldy Date: Thu, 9 Nov 2023 21:38:54 -0500 Subject: [PATCH 41/49] chore(release): publish v1.0.0 [skip-ci] --- packages/accounts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index 841910c2a3..aea1bb4dfe 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -39,7 +39,7 @@ "test:run-e2e": "vitest run --config vitest.config.e2e.ts" }, "devDependencies": { - "@alchemy/aa-alchemy": "^0.3.0", + "@alchemy/aa-alchemy": "^1.0.0", "@alchemy/aa-core": "^0.2.0", "typescript": "^5.0.4", "typescript-template": "*", From c7235fbb553b0945a1b2b77fc51413d97e6df1aa Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Fri, 10 Nov 2023 09:10:15 -0800 Subject: [PATCH 42/49] feat: paymasterAndData override to skip paymaster middleware (#236) --- packages/core/src/provider/base.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/provider/base.ts b/packages/core/src/provider/base.ts index f5ee105d55..a0702e2c9b 100644 --- a/packages/core/src/provider/base.ts +++ b/packages/core/src/provider/base.ts @@ -390,7 +390,9 @@ export class SmartAccountProvider< // run this before paymaster middleware async (struct) => ({ ...struct, ...overrides }), this.customMiddleware ?? noOpMiddleware, - this.paymasterDataMiddleware + overrides?.paymasterAndData + ? noOpMiddleware + : this.paymasterDataMiddleware )(uo); return resolveProperties(result); From f2f8ef2d0be2225c129e77a0574625fc12173699 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Sat, 11 Nov 2023 15:07:21 -0800 Subject: [PATCH 43/49] fix: fix e2e tests (#239) --- packages/accounts/package.json | 2 +- .../alchemy/e2e-tests/simple-account.test.ts | 18 ++++++++++++++++-- packages/alchemy/package.json | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/accounts/package.json b/packages/accounts/package.json index aea1bb4dfe..d6f3543b4a 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -40,7 +40,7 @@ }, "devDependencies": { "@alchemy/aa-alchemy": "^1.0.0", - "@alchemy/aa-core": "^0.2.0", + "@alchemy/aa-core": "^1.0.0", "typescript": "^5.0.4", "typescript-template": "*", "vitest": "^0.31.0" diff --git a/packages/alchemy/e2e-tests/simple-account.test.ts b/packages/alchemy/e2e-tests/simple-account.test.ts index b5174f154f..2e299c0fb7 100644 --- a/packages/alchemy/e2e-tests/simple-account.test.ts +++ b/packages/alchemy/e2e-tests/simple-account.test.ts @@ -4,7 +4,13 @@ import { type SmartAccountSigner, } from "@alchemy/aa-core"; import { Alchemy, Network } from "alchemy-sdk"; -import { toHex, type Address, type Chain, type Hash } from "viem"; +import { + toHex, + type Address, + type Chain, + type Hash, + type HDAccount, +} from "viem"; import { mnemonicToAccount } from "viem/accounts"; import { sepolia } from "viem/chains"; import { AlchemyProvider } from "../src/provider.js"; @@ -15,7 +21,7 @@ const network = Network.ETH_SEPOLIA; describe("Simple Account Tests", () => { const ownerAccount = mnemonicToAccount(OWNER_MNEMONIC); - const owner: SmartAccountSigner = { + const owner: SmartAccountSigner = { signMessage: async (msg) => ownerAccount.signMessage({ message: { raw: toHex(msg) }, @@ -23,6 +29,7 @@ describe("Simple Account Tests", () => { signTypedData: async () => "0xHash", getAddress: async () => ownerAccount.address, signerType: "aa-sdk-tests", + inner: ownerAccount, }; it("should successfully get counterfactual address", async () => { @@ -180,6 +187,10 @@ describe("Simple Account Tests", () => { "contractAddress": "0xdcf5d3e08c5007dececdb34808c49331bd82a247", "tokenBalance": "0x00000000000000000000000000000000000000000000000000000000000f423f", }, + { + "contractAddress": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14", + "tokenBalance": "0x0000000000000000000000000000000000000000000000000000000000000000", + }, ] `); }, 50000); @@ -223,6 +234,9 @@ const givenConnectedProvider = ({ apiKey: API_KEY!, chain, feeOpts, + opts: { + txMaxRetries: 10, + }, }).connect( (provider) => new SimpleSmartContractAccount({ diff --git a/packages/alchemy/package.json b/packages/alchemy/package.json index 631945ca98..1e88159371 100644 --- a/packages/alchemy/package.json +++ b/packages/alchemy/package.json @@ -39,7 +39,7 @@ "test:run-e2e": "vitest run --config vitest.config.e2e.ts" }, "devDependencies": { - "@alchemy/aa-core": "^0.2.0", + "@alchemy/aa-core": "^1.0.0", "typescript": "^5.0.4", "typescript-template": "*", "vitest": "^0.31.0" From 0be7fb0002ce6a4d3ec0254fe9a6d109f61c5238 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 13 Nov 2023 08:38:25 -0800 Subject: [PATCH 44/49] feat: optional maxPriorityFeePerGasEstimateBuffer to provider config (#241) --- packages/core/src/provider/base.ts | 9 ++++++++- packages/core/src/provider/schema.ts | 16 +++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/core/src/provider/base.ts b/packages/core/src/provider/base.ts index a0702e2c9b..86fe77739f 100644 --- a/packages/core/src/provider/base.ts +++ b/packages/core/src/provider/base.ts @@ -75,6 +75,7 @@ export class SmartAccountProvider< private txRetryMulitplier: number; private minPriorityFeePerBid: bigint; + private maxPriorityFeePerGasEstimateBuffer: number; readonly account?: ISmartContractAccount; @@ -104,6 +105,9 @@ export class SmartAccountProvider< minPriorityFeePerBidDefaults.get(chain.id) ?? 100_000_000n; + this.maxPriorityFeePerGasEstimateBuffer = + opts?.maxPriorityFeePerGasEstimateBuffer ?? 33; + this.rpcClient = typeof rpcProvider === "string" ? createPublicErc4337Client({ @@ -475,7 +479,10 @@ export class SmartAccountProvider< // set maxPriorityFeePerGasBid to the max between 33% added priority fee estimate and // the min priority fee per gas set for the provider const maxPriorityFeePerGasBid = bigIntMax( - bigIntPercent(maxPriorityFeePerGas, 133n), + bigIntPercent( + maxPriorityFeePerGas, + BigInt(100 + this.maxPriorityFeePerGasEstimateBuffer) + ), this.minPriorityFeePerBid ); diff --git a/packages/core/src/provider/schema.ts b/packages/core/src/provider/schema.ts index 119ba3c620..5dfa7f7ec0 100644 --- a/packages/core/src/provider/schema.ts +++ b/packages/core/src/provider/schema.ts @@ -9,22 +9,28 @@ export const SmartAccountProviderOptsSchema = z.object({ /** * The maximum number of times to try fetching a transaction receipt before giving up (default: 5) */ - txMaxRetries: z.number().optional(), + txMaxRetries: z.number().min(0).optional(), /** * The interval in milliseconds to wait between retries while waiting for tx receipts (default: 2_000) */ - txRetryIntervalMs: z.number().optional(), + txRetryIntervalMs: z.number().min(0).optional(), /** * The mulitplier on interval length to wait between retries while waiting for tx receipts (default: 1.5) */ - txRetryMulitplier: z.number().optional(), + txRetryMulitplier: z.number().min(0).optional(), /** - * used when computing the fees for a user operation (default: 100_000_000n) + * Used when computing the fees for a user operation (default: 100_000_000n) */ - minPriorityFeePerBid: z.bigint().optional(), + minPriorityFeePerBid: z.bigint().min(0n).optional(), + + /** + * Percent value for maxPriorityFeePerGas estimate added buffer. maxPriorityFeePerGasBid is set to the max + * between the buffer "added" priority fee estimate and the minPriorityFeePerBid (default: 33) + */ + maxPriorityFeePerGasEstimateBuffer: z.number().min(0).optional(), }); export const createSmartAccountProviderConfigSchema = < From c77c6c3b77bd38d1095c74008a9d9503b5f6d06e Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 13 Nov 2023 10:42:38 -0800 Subject: [PATCH 45/49] docs: details about batching user operations (#237) * docs: details about batching user operations * Update site/guides/batching-transactions.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/guides/batching-transactions.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/guides/batching-transactions.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- site/guides/batching-transactions.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/site/guides/batching-transactions.md b/site/guides/batching-transactions.md index 42e220e4ed..b49c452052 100644 --- a/site/guides/batching-transactions.md +++ b/site/guides/batching-transactions.md @@ -20,16 +20,28 @@ head: # How to Submit Batch Transactions -One benefit of Smart Contract Accounts is that it's possible to batch transactions in one User Operation. Not all Smart Contract Accounts support batching. But, if the account you're using does, then implementations of `SmartAccountProvider` will allow you to make those calls. +One benefit of Smart Contract Accounts is that it's possible to batch transactions in one User Operation. Not all Smart Contract Accounts support batching. But, if the `ISmartContractAccount` implementation you're using has the [`encodeBatchExecute`](/packages/aa-core/accounts/optional/encodeBatchExecute.md) method, then implementations of `SmartAccountProvider` will allow you to make those calls. There are two ways you can batch transactions using `SmartAccountProvider`: 1. via `sendUserOperation` 2. via `sendTransactions` -## `sendUserOperation` +:::tip Note 1: `SimpleSmartContractAccount` and `LightSmartContractAccount` +Both `SimpleSmartContractAccount` and `LightSmartContractAccount` implement `encodeBatchExecute`, thus supports batching `UserOperations` out of the box. +::: + +:::tip Note 2: Transactions Batched as a Single User Operation +When you batch transactions, the transaction actions (`target`s and `calldata`s) are batched into a single `UserOperation`, where the sender is the account itself. +::: + +:::tip Note 3: Batched Transactions Ordering +The batched `UserOperation` gets executed by the account calling the `executeBatch` method on the [`SimpleAccount`](https://github.com/eth-infinitism/account-abstraction/blob/ver0.6.0/contracts/samples/SimpleAccount.sol) or [`LightAccount`](https://github.com/alchemyplatform/light-account/blob/v1.0.2/src/LightAccount.sol) smart contracts. `executeBatch` processes the input array of transactions data linearly, guaranteeing the execution order of those transactions to be **sequential**. +::: + +## Batching using [`sendUserOperation`](/packages/aa-core/provider/sendUserOperation.md) -The `SmartAccountProvider` supports passing either a single `UserOperation` or an array of `UserOperation`s to `sendUserOperation`. If you pass an array, the provider will batch the transactions into a single User Operation and submit it to the network. Let's see an example: +The `SmartAccountProvider` supports passing either a single `UserOperation` or an array of `UserOperation`s to `sendUserOperation`. If you pass an array, the provider will batch the transactions into a single User Operation and submit it to the bundler. Let's see an example: ::: code-group @@ -53,7 +65,7 @@ const { hash } = await provider.sendUserOperation([ ::: -## `sendTransactions` +## Batching using [`sendTransactions`](/packages/aa-core/provider/sendTransactions.md) The `SmartAccountProvider` supports sending `UserOperation`s and waiting for them to be mined in a transaction via the `sendTransaction` and `sendTransactions` methods. The latter allows for batching in the same way `sendUserOperation`: From 5130e482921d1c1b17c2b60d6ac478ce5ee8607e Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 13 Nov 2023 10:48:01 -0800 Subject: [PATCH 46/49] docs: add readme to alchemy packages for npm (#240) * docs: add readme to alchemy packages for npm * Update site/snippets/ethers-provider.ts Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/snippets/ethers-signer.ts Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/ethers/README.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/ethers/README.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- packages/accounts/README.md | 12 ++++-- packages/alchemy/README.md | 51 ++++++++++++++++++++++++ packages/core/README.md | 57 ++++++++++++++++++++++++++ packages/ethers/README.md | 64 ++++++++++++++++++++++++++++++ site/packages/aa-accounts/index.md | 2 +- site/packages/aa-alchemy/index.md | 4 +- site/packages/aa-core/index.md | 4 +- site/packages/aa-ethers/index.md | 4 +- site/snippets/ethers-provider.ts | 1 + site/snippets/ethers-signer.ts | 1 + 10 files changed, 190 insertions(+), 10 deletions(-) create mode 100644 packages/alchemy/README.md create mode 100644 packages/core/README.md create mode 100644 packages/ethers/README.md diff --git a/packages/accounts/README.md b/packages/accounts/README.md index daa130effe..dd7fa680dd 100644 --- a/packages/accounts/README.md +++ b/packages/accounts/README.md @@ -1,10 +1,10 @@ # `@alchemy/aa-accounts` -This package contains various implementations of the [`BaseSmartContractAccount`](../core/src/account/base.ts) class defined in `aa-core`. This repo is community maintained and we welcome contributions! +This package contains various implementations of the [`BaseSmartContractAccount`](https://accountkit.alchemy.com/packages/aa-core/accounts/introduction.html#basesmartcontractaccount) class defined in `aa-core`. This repo is community maintained and we welcome contributions! ## Getting started -If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the accounts. If you are not using `@alchemy/aa-core`, you can install it and follow the instructions in the [README](../../README.md) to get started. +If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the accounts. If you are not using `@alchemy/aa-core`, you can install it and follow the instructions in the [Getting Started](https://accountkit.alchemy.com/packages/aa-accounts/) docs to get started. via `yarn` @@ -18,6 +18,12 @@ via `npm` npm i -s @alchemy/aa-accounts ``` +via `pnpm` + +```bash +pnpm i @alchemy/aa-accounts +``` + ## Contributing If you are looking to add a new account type, please follow the following structure. @@ -30,7 +36,7 @@ If you are looking to add a new account type, please follow the following struct export const MyContractAbi = [] as const; // the as const is important so we can get correct typing from viem ``` -4. If you need to extend the [`SmartAccountProvider`](../core/src/provider/base.ts) class, add a file called `provider.ts` and add your implementation for `SmartAccountProvider`. +4. If you need to extend the [`SmartAccountProvider`](https://accountkit.alchemy.com/packages/aa-core/provider/introduction.html) class, add a file called `provider.ts` and add your implementation for `SmartAccountProvider`. - Ideally, your `Account` impl should _just_ work with the base provider provided by `aa-core`. - If not, consider generalizing the use case and updating SmartAccountProvider diff --git a/packages/alchemy/README.md b/packages/alchemy/README.md new file mode 100644 index 0000000000..0213834c06 --- /dev/null +++ b/packages/alchemy/README.md @@ -0,0 +1,51 @@ +# `@alchemy/aa-alchemy` + +This package contains `AlchemyProvider`, an implementation of `SmartAccountProvider` class defined in `aa-core`. It also contains middleware for accessing the Alchemy Gas Manager (an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) Paymaster) and for doing Fee Estimates according to the expectations of the Alchemy [Rundler](https://github.com/alchemyplatform/rundler/tree/main) (an ERC-4337 Bundler). You may also find the util methods helpful. This repo is community maintained and we welcome contributions! + +## Getting started + +If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the `AlchemyProvider`. If you are not using `@alchemy/aa-core`, you can install it and follow the instructions in the ["Getting Started"](https://accountkit.alchemy.com/packages/aa-alchemy/) docs to get started. + +```bash [yarn] +yarn add @alchemy/aa-alchemy +``` + +```bash [npm] +npm i -s @alchemy/aa-alchemy +``` + +```bash [pnpm] +pnpm i @alchemy/aa-alchemy +``` + +## Usage + +You can create `AlchemyProvider` like so: + +```typescript +import { + LightSmartContractAccount, + getDefaultLightAccountFactoryAddress, +} from "@alchemy/aa-accounts"; +import { AlchemyProvider } from "@alchemy/aa-alchemy"; +import { LocalAccountSigner, type SmartAccountSigner } from "@alchemy/aa-core"; +import { sepolia } from "viem/chains"; + +const chain = sepolia; +const PRIVATE_KEY = "0xYourEOAPrivateKey"; +const eoaSigner: SmartAccountSigner = + LocalAccountSigner.privateKeyToAccountSigner(`0x${PRIVATE_KEY}`); + +export const provider = new AlchemyProvider({ + apiKey: "ALCHEMY_API_KEY", // replace with your alchemy api key of the Alchemy app associated with the Gas Manager, get yours at https://dashboard.alchemy.com/ + chain, +}).connect( + (rpcClient) => + new LightSmartContractAccount({ + chain, + owner: eoaSigner, + factoryAddress: getDefaultLightAccountFactoryAddress(chain), + rpcClient, + }) +); +``` diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 0000000000..4bc836d752 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,57 @@ +# `@alchemy/aa-core` + +This package contains the core interfaces and components for interacting with 4337 infrastructure. The primary interfaces that it exports are the `SmartAccountProvider` and `BaseSmartContractAccount`. + +The `SmartAccountProvider` is an [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) compliant Provider that wraps JSON RPC methods and some Wallet Methods (signing, sendTransaction, etc). With this Provider, you can submit User Operations to RPC providers, estimate gas, configure a Paymaster, send standard JSON RPC requests, and more. It is not opinionated about which RPC provider you are using and is configurable to work with any RPC provider. Because it implements EIP-1193, it can be used with any web3 library. + +The `BaseSmartContractAccount` interface defines how you would interact with your Smart Contract Account. Any class that extends `BaseSmartContractAccount` may also expose additional methods that allow its connecting `SmartAccountProvider` to provide ergonic utilities for building and submitting `User Operation`s. + +## Getting Started + +To get started, first install the package: + +```bash [yarn] +yarn add @alchemy/aa-core +``` + +```bash [npm] +npm i -s @alchemy/aa-core +``` + +```bash [pnpm] +pnpm i @alchemy/aa-core +``` + +## Usage + +You can create a provider like so: + +```typescript +import { + LightSmartContractAccount, + getDefaultLightAccountFactoryAddress, +} from "@alchemy/aa-accounts"; +import { + LocalAccountSigner, + SmartAccountProvider, + SmartAccountSigner, +} from "@alchemy/aa-core"; +import { polygonMumbai } from "viem/chains"; + +const chain = polygonMumbai; +const owner: SmartAccountSigner = + LocalAccountSigner.mnemonicToAccountSigner(YOUR_OWNER_MNEMONIC); + +export const provider = new SmartAccountProvider({ + rpcProvider: "https://polygon-mumbai.g.alchemy.com/v2/demo", + chain, +}).connect( + (rpcClient) => + new LightSmartContractAccount({ + chain, + factoryAddress: getDefaultLightAccountFactoryAddress(chain), + rpcClient, + owner, + }) +); +``` diff --git a/packages/ethers/README.md b/packages/ethers/README.md new file mode 100644 index 0000000000..938e66fdf4 --- /dev/null +++ b/packages/ethers/README.md @@ -0,0 +1,64 @@ +# `@alchemy/aa-ethers` + +This package contains `EthersProviderAdapter` and `AccountSigner`, respective extensions of the [`JsonRpcProvider`](https://docs.ethers.org/v5/api/providers/jsonrpc-provider/) and [`Signer`](https://docs.ethers.org/v5/api/signer/#Signer-getaddress) classes defined in [`ethers.js`](https://docs.ethers.org/v5/) external library. + +If you currently rely `ethers.js` for web3 development, you can use these `ethers.js`-compatible `JsonRpcProvider` and `Signer` to integrate Account Abstraction into your dApp. You may also find the [`util`](https://accountkit.alchemy.com/packages/aa-ethers/utils/introduction.html) methods helpful. + +This repo is community maintained and we welcome contributions! + +## Getting started + +If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the `EthersProviderAdapter` and `AccountSigner`. If you are not using `@alchemy/aa-core`, you can install it and follow the instructions in the ["Getting Started"](https://accountkit.alchemy.com/packages/aa-ethers/) docs to get started. + +```bash [yarn] +yarn add @alchemy/aa-ethers +``` + +```bash [npm] +npm i -s @alchemy/aa-ethers +``` + +```bash [pnpm] +pnpm i @alchemy/aa-ethers +``` + +## Usage + +You can create a provider and connect it to a signer account like so: + +```typescript ethers-provider.ts +import { + LightSmartContractAccount, + getDefaultLightAccountFactoryAddress, +} from "@alchemy/aa-accounts"; +import { EthersProviderAdapter } from "@alchemy/aa-ethers"; +import { LocalAccountSigner, SmartAccountSigner } from "@alchemy/aa-core"; +import { Alchemy, Network } from "alchemy-sdk"; +import { polygonMumbai } from "viem/chains"; + +const chain = polygonMumbai; + +// 1. Create a provider using EthersProviderAdapter +const alchemy = new Alchemy({ + apiKey: process.env.API_KEY!, + network: Network.MATIC_MUMBAI, +}); +const ethersProvider = await alchemy.config.getProvider(); + +const provider = EthersProviderAdapter.fromEthersProvider(ethersProvider); + +const owner: SmartAccountSigner = LocalAccountSigner.mnemonicToAccountSigner( + process.env.YOUR_OWNER_MNEMONIC! +); + +// 2. Connect the provider to the smart account signer +export const signer = provider.connectToAccount( + (rpcClient) => + new LightSmartContractAccount({ + chain, + factoryAddress: getDefaultLightAccountFactoryAddress(chain), + rpcClient, + owner, + }) +); +``` diff --git a/site/packages/aa-accounts/index.md b/site/packages/aa-accounts/index.md index 8bfbd5d5e7..fbb5c0b7c8 100644 --- a/site/packages/aa-accounts/index.md +++ b/site/packages/aa-accounts/index.md @@ -32,7 +32,7 @@ yarn add @alchemy/aa-accounts ``` ```bash [npm] -npm i @alchemy/aa-accounts +npm i -s @alchemy/aa-accounts ``` ```bash [pnpm] diff --git a/site/packages/aa-alchemy/index.md b/site/packages/aa-alchemy/index.md index ea3ee4b1a9..9452a90fb0 100644 --- a/site/packages/aa-alchemy/index.md +++ b/site/packages/aa-alchemy/index.md @@ -19,7 +19,7 @@ next: # `@alchemy/aa-alchemy` -This package contains `AlchemyProvider`, an implementation of `SmartAccountProvider` class defined in `aa-core`. It also contains middleware for accessing the Alchemy Gas Manager (an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) Paymaster) and for doing Fee Estimates according to the expectations of the Alchemy Rundler (an ERC-4337 Bundler). You may also find the util methods helpful. This repo is community maintained and we welcome contributions! +This package contains `AlchemyProvider`, an implementation of `SmartAccountProvider` class defined in `aa-core`. It also contains middleware for accessing the Alchemy Gas Manager (an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) Paymaster) and for doing Fee Estimates according to the expectations of the Alchemy [Rundler](https://github.com/alchemyplatform/rundler/tree/main) (an ERC-4337 Bundler). You may also find the util methods helpful. This repo is community maintained and we welcome contributions! ## Getting started @@ -32,7 +32,7 @@ yarn add @alchemy/aa-alchemy ``` ```bash [npm] -npm i @alchemy/aa-alchemy +npm i -s @alchemy/aa-alchemy ``` ```bash [pnpm] diff --git a/site/packages/aa-core/index.md b/site/packages/aa-core/index.md index 04949f2a54..06841407d6 100644 --- a/site/packages/aa-core/index.md +++ b/site/packages/aa-core/index.md @@ -20,7 +20,7 @@ This package contains the core interfaces and components for interacting with 43 The `SmartAccountProvider` is an [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) compliant Provider that wraps JSON RPC methods and some Wallet Methods (signing, sendTransaction, etc). With this Provider, you can submit User Operations to RPC providers, estimate gas, configure a Paymaster, send standard JSON RPC requests, and more. It is not opinionated about which RPC provider you are using and is configurable to work with any RPC provider. Because it implements EIP-1193, it can be used with any web3 library. -The `BaseSmartContractAccount` interface defines how you would interact with your Smart Contract Account. Any class that extends `BaseSmartContractAccount` may also expose additional methods that allow its connecting `SmartAccountProvider` to provide ergonic utilities for building and submitting User Operations. +The `BaseSmartContractAccount` interface defines how you would interact with your Smart Contract Account. Any class that extends `BaseSmartContractAccount` may also expose additional methods that allow its connecting `SmartAccountProvider` to provide ergonic utilities for building and submitting `User Operation`s. ## Getting Started @@ -33,7 +33,7 @@ yarn add @alchemy/aa-core ``` ```bash [npm] -npm i @alchemy/aa-core +npm i -s @alchemy/aa-core ``` ```bash [pnpm] diff --git a/site/packages/aa-ethers/index.md b/site/packages/aa-ethers/index.md index 124483866f..1eab23022c 100644 --- a/site/packages/aa-ethers/index.md +++ b/site/packages/aa-ethers/index.md @@ -19,7 +19,7 @@ next: # `@alchemy/aa-ethers` -This package contains `EthersProviderAdapter` and `AccountSigner`, respective extensions of the `JsonRpcProvider` and `Signer` classes defined in `ethers.js` external library. +This package contains `EthersProviderAdapter` and `AccountSigner`, respective extensions of the [`JsonRpcProvider`](https://docs.ethers.org/v5/api/providers/jsonrpc-provider/) and [`Signer`](https://docs.ethers.org/v5/api/signer/#Signer-getaddress) classes defined in [`ethers.js`](https://docs.ethers.org/v5/) external library. If you currently rely `ethers.js` for web3 development, you can use these `ethers.js`-compatible `JsonRpcProvider` and `Signer` to integrate Account Abstraction into your dApp. You may also find the [`util`](./utils/introduction.md) methods helpful. @@ -36,7 +36,7 @@ yarn add @alchemy/aa-ethers ``` ```bash [npm] -npm i @alchemy/aa-ethers +npm i -s @alchemy/aa-ethers ``` ```bash [pnpm] diff --git a/site/snippets/ethers-provider.ts b/site/snippets/ethers-provider.ts index e7f7349703..fb61984080 100644 --- a/site/snippets/ethers-provider.ts +++ b/site/snippets/ethers-provider.ts @@ -1,6 +1,7 @@ import { EthersProviderAdapter } from "@alchemy/aa-ethers"; import { Alchemy, Network } from "alchemy-sdk"; +// 1. Create a provider using EthersProviderAdapter const alchemy = new Alchemy({ apiKey: process.env.API_KEY!, network: Network.MATIC_MUMBAI, diff --git a/site/snippets/ethers-signer.ts b/site/snippets/ethers-signer.ts index 385f0e5f77..06d770e192 100644 --- a/site/snippets/ethers-signer.ts +++ b/site/snippets/ethers-signer.ts @@ -12,6 +12,7 @@ const owner: SmartAccountSigner = LocalAccountSigner.mnemonicToAccountSigner( const chain = polygonMumbai; +// 2. Connect the provider to the smart account signer export const signer = provider.connectToAccount( (rpcClient) => new LightSmartContractAccount({ From 83e55a0c906365c38c90f2c07cf60f1e647975e9 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 13 Nov 2023 10:55:13 -0800 Subject: [PATCH 47/49] feat: support overrides for all user operation methods on smart accont provider (#238) * feat: support overrides for all user operation methods on smart account provider * Update site/packages/aa-core/provider/sendUserOperation.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/provider/sendTransactions.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/provider/sendTransaction.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/provider/buildUserOperation.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/provider/buildUserOperationFromTx.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update site/packages/aa-core/provider/dropAndReplaceUserOperation.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- .../alchemy/e2e-tests/simple-account.test.ts | 28 ++++++++++ packages/core/src/provider/base.ts | 52 ++++++++++++------- .../aa-core/provider/buildUserOperation.md | 4 ++ .../provider/buildUserOperationFromTx.md | 4 ++ .../provider/dropAndReplaceUserOperation.md | 4 ++ .../aa-core/provider/sendTransaction.md | 4 ++ .../aa-core/provider/sendTransactions.md | 4 ++ .../aa-core/provider/sendUserOperation.md | 4 ++ 8 files changed, 84 insertions(+), 20 deletions(-) diff --git a/packages/alchemy/e2e-tests/simple-account.test.ts b/packages/alchemy/e2e-tests/simple-account.test.ts index 2e299c0fb7..466918429f 100644 --- a/packages/alchemy/e2e-tests/simple-account.test.ts +++ b/packages/alchemy/e2e-tests/simple-account.test.ts @@ -99,6 +99,34 @@ describe("Simple Account Tests", () => { ).rejects.toThrow(); }, 50000); + it("should support overrides for buildUserOperation", async () => { + const signer = givenConnectedProvider({ + owner, + chain, + }).withAlchemyGasManager({ + policyId: PAYMASTER_POLICY_ID, + }); + + const overrides = { + maxFeePerGas: 100000000n, + maxPriorityFeePerGas: 100000000n, + paymasterAndData: "0x", + }; + const uoStruct = await signer.buildUserOperation( + { + target: await signer.getAddress(), + data: "0x", + }, + overrides + ); + + expect(uoStruct.maxFeePerGas).toEqual(overrides.maxFeePerGas); + expect(uoStruct.maxPriorityFeePerGas).toEqual( + overrides.maxPriorityFeePerGas + ); + expect(uoStruct.paymasterAndData).toEqual(overrides.paymasterAndData); + }, 50000); + it("should successfully use paymaster with fee opts", async () => { const signer = givenConnectedProvider({ owner, diff --git a/packages/core/src/provider/base.ts b/packages/core/src/provider/base.ts index 86fe77739f..a0cd18a74e 100644 --- a/packages/core/src/provider/base.ts +++ b/packages/core/src/provider/base.ts @@ -202,8 +202,11 @@ export class SmartAccountProvider< return this.account.signTypedDataWith6492(params); }; - sendTransaction = async (request: RpcTransactionRequest): Promise => { - const uoStruct = await this.buildUserOperationFromTx(request); + sendTransaction = async ( + request: RpcTransactionRequest, + overrides?: UserOperationOverrides + ): Promise => { + const uoStruct = await this.buildUserOperationFromTx(request, overrides); const { hash } = await this._sendUserOperation(uoStruct); @@ -211,19 +214,22 @@ export class SmartAccountProvider< }; buildUserOperationFromTx = async ( - request: RpcTransactionRequest + request: RpcTransactionRequest, + overrides?: UserOperationOverrides ): Promise => { if (!request.to) { throw new Error("transaction is missing to address"); } - const overrides: UserOperationOverrides = {}; - if (request.maxFeePerGas) { - overrides.maxFeePerGas = request.maxFeePerGas; + const _overrides: UserOperationOverrides = {}; + if (overrides?.maxFeePerGas || request.maxFeePerGas) { + _overrides.maxFeePerGas = overrides?.maxFeePerGas ?? request.maxFeePerGas; } - if (request.maxPriorityFeePerGas) { - overrides.maxPriorityFeePerGas = request.maxPriorityFeePerGas; + if (overrides?.maxPriorityFeePerGas || request.maxPriorityFeePerGas) { + _overrides.maxPriorityFeePerGas = + overrides?.maxPriorityFeePerGas ?? request.maxPriorityFeePerGas; } + _overrides.paymasterAndData = overrides?.paymasterAndData; return this.buildUserOperation( { @@ -231,11 +237,14 @@ export class SmartAccountProvider< data: request.data ?? "0x", value: request.value ? fromHex(request.value, "bigint") : 0n, }, - overrides + _overrides ); }; - sendTransactions = async (requests: RpcTransactionRequest[]) => { + sendTransactions = async ( + requests: RpcTransactionRequest[], + overrides?: UserOperationOverrides + ) => { const batch = requests.map((request) => { if (!request.to) { throw new Error( @@ -261,16 +270,17 @@ export class SmartAccountProvider< .filter((x) => x.maxPriorityFeePerGas != null) .map((x) => fromHex(x.maxPriorityFeePerGas!, "bigint")) ); - const overrides: UserOperationOverrides = {}; - if (maxFeePerGas != null) { - overrides.maxFeePerGas = maxFeePerGas; + const _overrides: UserOperationOverrides = {}; + if (overrides?.maxFeePerGas || maxFeePerGas != null) { + _overrides.maxFeePerGas = overrides?.maxFeePerGas ?? maxFeePerGas; } - if (maxPriorityFeePerGas != null) { - overrides.maxPriorityFeePerGas = maxPriorityFeePerGas; + if (overrides?.maxPriorityFeePerGas || maxPriorityFeePerGas != null) { + _overrides.maxPriorityFeePerGas = + overrides?.maxPriorityFeePerGas ?? maxPriorityFeePerGas; } - const { hash } = await this.sendUserOperation(batch, overrides); + const { hash } = await this.sendUserOperation(batch, _overrides); return await this.waitForUserOperationTransaction(hash as Hash); }; @@ -353,7 +363,8 @@ export class SmartAccountProvider< }; dropAndReplaceUserOperation = async ( - uoToDrop: UserOperationRequest + uoToDrop: UserOperationRequest, + overrides?: UserOperationOverrides ): Promise => { const uoToSubmit = { initCode: uoToDrop.initCode, @@ -366,9 +377,9 @@ export class SmartAccountProvider< // Run once to get the fee estimates // This can happen at any part of the middleware stack, so we want to run it all const { maxFeePerGas, maxPriorityFeePerGas } = - await this._runMiddlewareStack(uoToSubmit); + await this._runMiddlewareStack(uoToSubmit, overrides); - const overrides: UserOperationOverrides = { + const _overrides: UserOperationOverrides = { maxFeePerGas: bigIntMax( BigInt(maxFeePerGas ?? 0n), bigIntPercent(uoToDrop.maxFeePerGas, 110n) @@ -377,9 +388,10 @@ export class SmartAccountProvider< BigInt(maxPriorityFeePerGas ?? 0n), bigIntPercent(uoToDrop.maxPriorityFeePerGas, 110n) ), + paymasterAndData: uoToDrop.paymasterAndData, }; - const uoToSend = await this._runMiddlewareStack(uoToSubmit, overrides); + const uoToSend = await this._runMiddlewareStack(uoToSubmit, _overrides); return this._sendUserOperation(uoToSend); }; diff --git a/site/packages/aa-core/provider/buildUserOperation.md b/site/packages/aa-core/provider/buildUserOperation.md index a9426c206f..29f4443e42 100644 --- a/site/packages/aa-core/provider/buildUserOperation.md +++ b/site/packages/aa-core/provider/buildUserOperation.md @@ -74,3 +74,7 @@ A Promise containing the _unsigned_ UserOperation struct resulting from the midd - `target: Address` - the target of the call (equivalent to `to` in a transaction) - `data: Hex` - can be either `0x` or a call data string - `value?: bigint` - optionally, set the value in wei you want to send to the target + +### `overrides?: UserOperationOverrides` + +Optional parameter where you can specify override values for `maxFeePerGas`, `maxPriorityFeePerGas` or `paymasterAndData` on the user operation request diff --git a/site/packages/aa-core/provider/buildUserOperationFromTx.md b/site/packages/aa-core/provider/buildUserOperationFromTx.md index a65472b695..9d14bc18a4 100644 --- a/site/packages/aa-core/provider/buildUserOperationFromTx.md +++ b/site/packages/aa-core/provider/buildUserOperationFromTx.md @@ -59,3 +59,7 @@ A Promise containing the _unsigned_ UserOperation struct converted from the inpu ### `tx: RpcTransactionRequest` The `RpcTransactionRequest` object representing a traditional ethereum transaction + +### `overrides?: UserOperationOverrides` + +Optional parameter where you can specify override values for `maxFeePerGas`, `maxPriorityFeePerGas` or `paymasterAndData` on the user operation request diff --git a/site/packages/aa-core/provider/dropAndReplaceUserOperation.md b/site/packages/aa-core/provider/dropAndReplaceUserOperation.md index 0029062a0c..907d7b0c1f 100644 --- a/site/packages/aa-core/provider/dropAndReplaceUserOperation.md +++ b/site/packages/aa-core/provider/dropAndReplaceUserOperation.md @@ -50,3 +50,7 @@ A Promise containing the hash of the user operation and the request that was sen ### `UserOperationRequest` A previously submitted UserOperation. + +### `overrides?: UserOperationOverrides` + +Optional parameter where you can specify override values for `maxFeePerGas`, `maxPriorityFeePerGas` or `paymasterAndData` on the user operation request diff --git a/site/packages/aa-core/provider/sendTransaction.md b/site/packages/aa-core/provider/sendTransaction.md index 9a31e2c237..f85dbd67c2 100644 --- a/site/packages/aa-core/provider/sendTransaction.md +++ b/site/packages/aa-core/provider/sendTransaction.md @@ -53,3 +53,7 @@ A Promise containing the transaction hash ### `request: RpcTransactionRequest` The `RpcTransactionRequest` object representing a traditional ethereum transaction + +### `overrides?: UserOperationOverrides` + +Optional parameter where you can specify override values for `maxFeePerGas`, `maxPriorityFeePerGas` or `paymasterAndData` on the user operation request diff --git a/site/packages/aa-core/provider/sendTransactions.md b/site/packages/aa-core/provider/sendTransactions.md index 10e8d893fd..4ad5c4d566 100644 --- a/site/packages/aa-core/provider/sendTransactions.md +++ b/site/packages/aa-core/provider/sendTransactions.md @@ -74,3 +74,7 @@ A Promise containing the transaction hash ### `request: RpcTransactionRequest[]` An `RpcTransactionRequest` array representing a traditional ethereum transaction + +### `overrides?: UserOperationOverrides` + +Optional parameter where you can specify override values for `maxFeePerGas`, `maxPriorityFeePerGas` or `paymasterAndData` on the user operation request diff --git a/site/packages/aa-core/provider/sendUserOperation.md b/site/packages/aa-core/provider/sendUserOperation.md index bed9d948f0..0a8c6e13b5 100644 --- a/site/packages/aa-core/provider/sendUserOperation.md +++ b/site/packages/aa-core/provider/sendUserOperation.md @@ -70,3 +70,7 @@ A Promise containing the hash of the user operation and the request that was sen - `target: Address` - the target of the call (equivalent to `to` in a transaction) - `data: Hex` - can be either `0x` or a call data string - `value?: bigint` - optionally, set the value in wei you want to send to the target + +### `overrides?: UserOperationOverrides` + +Optional parameter where you can specify override values for `maxFeePerGas`, `maxPriorityFeePerGas` or `paymasterAndData` on the user operation request From 81406f60a489fa2b2a72fe023165eef79b6e5702 Mon Sep 17 00:00:00 2001 From: Alex <36385732+alex-miao@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:13:27 -0800 Subject: [PATCH 48/49] feat: add base sepolia and opt sepolia (#249) --- packages/accounts/src/light-account/utils.ts | 4 ++++ packages/alchemy/src/chains.ts | 6 +++++- packages/core/src/utils/defaults.ts | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/accounts/src/light-account/utils.ts b/packages/accounts/src/light-account/utils.ts index 6814c13f8b..804b26ac3b 100644 --- a/packages/accounts/src/light-account/utils.ts +++ b/packages/accounts/src/light-account/utils.ts @@ -5,10 +5,12 @@ import { arbitrumSepolia, base, baseGoerli, + baseSepolia, goerli, mainnet, optimism, optimismGoerli, + optimismSepolia, polygon, polygonMumbai, sepolia, @@ -30,11 +32,13 @@ export const getDefaultLightAccountFactoryAddress = (chain: Chain): Address => { case polygonMumbai.id: case optimism.id: case optimismGoerli.id: + case optimismSepolia.id: case arbitrum.id: case arbitrumGoerli.id: case arbitrumSepolia.id: case base.id: case baseGoerli.id: + case baseSepolia.id: return "0x00000055C0b4fA41dde26A74435ff03692292FBD"; } throw new Error( diff --git a/packages/alchemy/src/chains.ts b/packages/alchemy/src/chains.ts index 3da115c560..a88dd6c736 100644 --- a/packages/alchemy/src/chains.ts +++ b/packages/alchemy/src/chains.ts @@ -2,16 +2,18 @@ import type { Chain } from "viem"; import { arbitrum, arbitrumGoerli, + arbitrumSepolia, goerli, mainnet, optimism, optimismGoerli, + optimismSepolia, polygon, polygonMumbai, sepolia, base, baseGoerli, - arbitrumSepolia, + baseSepolia, } from "viem/chains"; export const SupportedChains = new Map([ @@ -25,6 +27,8 @@ export const SupportedChains = new Map([ [arbitrum.id, arbitrum], [optimism.id, optimism], [optimismGoerli.id, optimismGoerli], + [optimismSepolia.id, optimismSepolia], [base.id, base], [baseGoerli.id, baseGoerli], + [baseSepolia.id, baseSepolia], ]); diff --git a/packages/core/src/utils/defaults.ts b/packages/core/src/utils/defaults.ts index 2fbcc6ebac..8b490f0e2e 100644 --- a/packages/core/src/utils/defaults.ts +++ b/packages/core/src/utils/defaults.ts @@ -5,10 +5,12 @@ import { arbitrumSepolia, base, baseGoerli, + baseSepolia, goerli, mainnet, optimism, optimismGoerli, + optimismSepolia, polygon, polygonMumbai, sepolia, @@ -30,11 +32,13 @@ export const getDefaultEntryPointAddress = (chain: Chain): Address => { case polygonMumbai.id: case optimism.id: case optimismGoerli.id: + case optimismSepolia.id: case arbitrum.id: case arbitrumGoerli.id: case arbitrumSepolia.id: case base.id: case baseGoerli.id: + case baseSepolia.id: return "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"; } throw new Error( @@ -56,9 +60,11 @@ export const getDefaultSimpleAccountFactoryAddress = ( case mainnet.id: case polygon.id: case optimism.id: + case optimismSepolia.id: case arbitrum.id: case base.id: case baseGoerli.id: + case baseSepolia.id: case arbitrumSepolia.id: return "0x15Ba39375ee2Ab563E8873C8390be6f2E2F50232"; case sepolia.id: From 188ccd1fac1937fabe6e776da1e6c7da43e7da5e Mon Sep 17 00:00:00 2001 From: avasisht23 Date: Tue, 14 Nov 2023 16:10:05 -0500 Subject: [PATCH 49/49] chore: rebase --- yarn.lock | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index c765ba9f96..2bb3cc7dce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11870,11 +11870,6 @@ simple-get@^2.7.0: once "^1.3.1" simple-concat "^1.0.0" -sitka@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/sitka/-/sitka-1.1.1.tgz#3f93ccc84160e9c7a233d7afb3ec00630f92423c" - integrity sha512-GjvAdRLNH1eJZoTGtB2dHg1CGqZ3qoeBNbF5oWZL7tlWxMZ1WGnsPpJDmrcc302NA46qRUQZMXk0hiXW6HV+qA== - slash@3.0.0, slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -12676,13 +12671,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript-template@*: - version "1.0.7" - resolved "https://registry.yarnpkg.com/typescript-template/-/typescript-template-1.0.7.tgz#04d68ca33483bcbd89d5ed7ea2a3e3e1d2f6fb6c" - integrity sha512-h/RPRYJdzXoAKo6YDvh6v9Vr3JVcOb+DoXI4owCQttcHKEqevz67mWyIn2zXe7uDlo8VJEtzuk/QfRGB+Q6b8A== - dependencies: - sitka "^1.1.1" - "typescript@^3 || ^4": version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"