-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adds MAv2 client #1212
base: howy/add-get-nonce
Are you sure you want to change the base?
feat: adds MAv2 client #1212
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd the label graphite-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
"transport" | "account" | "chain" | ||
>; | ||
|
||
export function createSMAV2SignerAccountClient< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: don't think we need "Signer" in the param/function name
a013c85
to
94ebe8d
Compare
53bfaa2
to
4883301
Compare
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label graphite-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
const instance = local070InstanceOptSep; | ||
const client = instance.getClient().extend(publicActions); | ||
custom, | ||
keccak256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'keccak256' is defined but never used.
keccak256, | ||
parseEther, | ||
publicActions, | ||
toHex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'toHex' is defined but never used.
parseEther, | ||
publicActions, | ||
toHex, | ||
type Address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Address' is defined but never used.
toHex, | ||
type Address, | ||
} from "viem"; | ||
import { privateKeyToAccount } from "viem/accounts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'privateKeyToAccount' is defined but never used.
|
||
const target = "0x000000000000000000000000000000000000dEaD"; | ||
|
||
const startBalance = await client.getBalance({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'startBalance' is assigned a value but never used.
address: target, | ||
}); | ||
|
||
const result2 = provider.sendUserOperation({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'result2' is assigned a value but never used.
94ebe8d
to
ea409dd
Compare
d826e90
to
d9aa83d
Compare
ea409dd
to
59baaa4
Compare
59baaa4
to
c6709ec
Compare
d9aa83d
to
101c00d
Compare
c6709ec
to
6e56cc3
Compare
6e56cc3
to
1109e77
Compare
1109e77
to
3e9e0e7
Compare
# Pull Request Checklist - [x] Did you add new tests and confirm existing tests pass? (`yarn test`) - [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)) - [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples)? (e.g. `feat!: breaking change`) - [ ] Did you run lint (`yarn lint:check`) and fix any issues? (`yarn lint:write`) - [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)? <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on renaming and restructuring several ABI files and exports in the smart contracts directory, enhancing clarity and consistency in the codebase. ### Detailed summary - Renamed `MAV2FactoryAbi` to `accountFactoryAbi` in `accountFactoryAbi.ts`. - Renamed `smaV2Abi` to `semiModularAccountBytecodeAbi` in `semiModularAccountBytecodeAbi.ts`. - Renamed `singleSignerValidationAbi` to `singleSignerValidationModuleAbi` in `singleSignerValidationModule.ts`. - Updated import statements to reflect the new names. - Added a new `addresses` export containing various module addresses in `utils.ts`. - Introduced new ABI definitions for `paymasterGuardModule`, `timeRangeModule`, `webauthnValidationModule`, `nativeTokenLimitModule`, and `allowlistModule`. - Added ABI definitions for events and error types in the newly created ABI files. > The following files were skipped due to too many changes: `account-kit/smart-contracts/src/ma-v2/abis/semiModularAccountStorageAbi.ts` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
uses a placeholder signer for now <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a new smart contract account type called `SMAV2Account`, along with its creation function `createSMAV2Account`. It includes types, parameters, and logic for initializing accounts using a bundler client, handling initial owners, and generating account addresses. ### Detailed summary - Added type `SMAV2Account` for smart contract accounts. - Introduced type `CreateSMAV2AccountParams` for account creation parameters. - Implemented `createSMAV2Account` function to create a new account. - Added logic to handle account initialization and owner address retrieval. - Utilized `createBundlerClient` for client creation. - Integrated `standardExecutor` and `multiOwnerMessageSigner` for account functionality. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- [ ] Did you add new tests and confirm existing tests pass? (`yarn test`) - [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)) - [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples)? (e.g. `feat!: breaking change`) - [ ] Did you run lint (`yarn lint:check`) and fix any issues? (`yarn lint:write`) - [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)? <!-- start pr-codex --> --- This PR introduces a new module for single signer validation in the `account-kit` smart contracts. It adds functionality for packing signatures and validating user operations, along with defining the ABI for the single signer validation module and related contracts. - Added `PackSignatureParams` type and `packSignature` utility in `utils.ts`. - Created `SingleSignerValidationModule` with metadata and encoding functions in `single-signer-validation/module.ts`. - Implemented `singleSignerMessageSigner` function in `single-signer-validation/signer.ts` for signing operations. - Defined the ABI for `singleSignerValidation` in `abis/singleSignerValidation.ts`. - Added ABI for `MAV2Factory` and `smaV2` in their respective files. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- [x] Did you add new tests and confirm existing tests pass? (`yarn test`) - [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)) - [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples)? (e.g. `feat!: breaking change`) - [ ] Did you run lint (`yarn lint:check`) and fix any issues? (`yarn lint:write`) - [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)? <!-- start pr-codex --> --- This PR focuses on renaming and restructuring various ABI exports and imports in the `account-kit/smart-contracts` project, enhancing clarity and organization in the codebase. - Renamed `MAV2FactoryAbi` to `accountFactoryAbi` in `accountFactoryAbi.ts`. - Renamed `smaV2Abi` to `semiModularAccountBytecodeAbi` in `semiModularAccountBytecodeAbi.ts`. - Renamed `singleSignerValidationAbi` to `singleSignerValidationModuleAbi` in `singleSignerValidationModule.ts`. - Updated import statement in `module.ts` for `singleSignerValidationModuleAbi`. - Added new `addresses` export with various module addresses in `utils.ts`. - Introduced `paymasterGuardModuleAbi` in `paymasterGuardModule.ts`. - Added `timeRangeModuleAbi` in `timeRangeModule.ts`. - Added `webauthnValidationModuleAbi` in `webauthnValidation.ts`. - Added `nativeTokenLimitModuleAbi` in `nativeTokenLimitModule.ts`. - Added `allowlistModuleAbi` in `allowlistModule.ts`. - Introduced `modularAccountAbi` in `modularAccountAbi.ts`. - Introduced `semiModularAccountStorageAbi` in `semiModularAccountStorageAbi.ts`. > The following files were skipped due to too many changes: `account-kit/smart-contracts/src/ma-v2/abis/semiModularAccountStorageAbi.ts` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
# Pull Request Checklist - [x] Did you add new tests and confirm existing tests pass? (`yarn test`) - [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)) - [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples)? (e.g. `feat!: breaking change`) - [ ] Did you run lint (`yarn lint:check`) and fix any issues? (`yarn lint:write`) - [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)? <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces several new smart contract ABIs and address constants for a modular account system, enhancing functionality for various modules, including validation and execution. ### Detailed summary - Added `addresses` constant with various module addresses in `addresses.ts`. - Introduced ABIs for `paymasterGuardModule`, `timeRangeModule`, `webauthnValidation`, `nativeTokenLimitModule`, `allowlistModule`, and `maV2`. - Each ABI includes functions, events, and errors relevant to their respective modules. > The following files were skipped due to too many changes: `account-kit/smart-contracts/src/ma-v2/abis/smaStorage.ts` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
3e9e0e7
to
840636a
Compare
101c00d
to
5b3c0b0
Compare
d7346a7
to
72a46ce
Compare
Pull Request Checklist
yarn test
)site
folder, and guidelines for updating/adding docs can be found in the contribution guide)feat!: breaking change
)yarn lint:check
) and fix any issues? (yarn lint:write
)PR-Codex overview
This PR introduces the
createSMAV2AccountClient
function, enhancing the smart account client functionality by allowing the creation of a MAv2 account client with specified configuration parameters. It also updates the related test file to reflect these changes.Detailed summary
createSMAV2AccountClient
function to create a MAv2 account client.CreateSMAV2AccountClientParams
type for client configuration.createSMAV2AccountClient
and improve the test structure.