From 1fc449529d76e8fba604d9029aa2266814b70755 Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Fri, 1 Dec 2023 12:17:36 -0800 Subject: [PATCH] docs: sign user op hash doc and fix navigation links in docs --- site/.vitepress/config.ts | 6 ++- site/packages/aa-accounts/contributing.md | 2 +- .../middleware/withAlchemyGasManager.md | 2 - .../provider/withAlchemyEnhancedApis.md | 2 + .../provider/withAlchemyGasManager.md | 2 - .../provider/withAlchemyUserOpSimulation.md | 2 - .../optional/signTypedDataWith6492.md | 2 - .../optional/signUserOperationHash.md | 49 +++++++++++++++++++ site/packages/aa-core/provider/extend.md | 3 +- .../provider/types/userOperationOverrides.md | 2 + .../convertEthersSignerToAccountSigner.md | 2 + .../aa-signers/magic/getAuthDetails.md | 2 + .../aa-signers/web3auth/introduction.md | 2 +- 13 files changed, 65 insertions(+), 13 deletions(-) create mode 100644 site/packages/aa-core/accounts/optional/signUserOperationHash.md diff --git a/site/.vitepress/config.ts b/site/.vitepress/config.ts index a263a3dfee..4b09ae637c 100644 --- a/site/.vitepress/config.ts +++ b/site/.vitepress/config.ts @@ -357,6 +357,10 @@ export default defineConfig({ text: "signTypedDataWith6492", link: "/signTypedDataWith6492", }, + { + text: "signUserOperationHash", + link: "/signUserOperationHash", + }, ], }, { @@ -681,7 +685,7 @@ export default defineConfig({ { text: "getAddress", link: "/getAddress" }, { text: "signMessage", link: "/signMessage" }, { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getDgetAuthDetailsetails" }, + { text: "getAuthDetails", link: "/getAuthDetails" }, ], }, { text: "Contributing", link: "/contributing" }, diff --git a/site/packages/aa-accounts/contributing.md b/site/packages/aa-accounts/contributing.md index eb7ce8f87c..368bb2c17d 100644 --- a/site/packages/aa-accounts/contributing.md +++ b/site/packages/aa-accounts/contributing.md @@ -11,7 +11,7 @@ head: - property: og:description content: How to add your own Account Implementation to aa-accounts next: - text: aa-ethers + text: aa-signers --- # Contributing to `aa-accounts` diff --git a/site/packages/aa-alchemy/middleware/withAlchemyGasManager.md b/site/packages/aa-alchemy/middleware/withAlchemyGasManager.md index 8b0cf6a6bf..c1cd3a5d59 100644 --- a/site/packages/aa-alchemy/middleware/withAlchemyGasManager.md +++ b/site/packages/aa-alchemy/middleware/withAlchemyGasManager.md @@ -10,8 +10,6 @@ head: - - meta - property: og:description content: Overview of the withAlchemyGasManager method in aa-alchemy -next: - text: Utils --- # withAlchemyGasManager diff --git a/site/packages/aa-alchemy/provider/withAlchemyEnhancedApis.md b/site/packages/aa-alchemy/provider/withAlchemyEnhancedApis.md index de86966034..de412a00ed 100644 --- a/site/packages/aa-alchemy/provider/withAlchemyEnhancedApis.md +++ b/site/packages/aa-alchemy/provider/withAlchemyEnhancedApis.md @@ -10,6 +10,8 @@ head: - - meta - property: og:description content: Overview of the withAlchemyEnhancedApis method on Alchemy Provider in aa-alchemy +next: + text: Middleware --- # withAlchemyEnhancedApis diff --git a/site/packages/aa-alchemy/provider/withAlchemyGasManager.md b/site/packages/aa-alchemy/provider/withAlchemyGasManager.md index 8ec6215e8d..c4790115d9 100644 --- a/site/packages/aa-alchemy/provider/withAlchemyGasManager.md +++ b/site/packages/aa-alchemy/provider/withAlchemyGasManager.md @@ -10,8 +10,6 @@ head: - - meta - property: og:description content: Overview of the withAlchemyGasManager method on Alchemy Provider in aa-alchemy -next: - text: Middleware --- # withAlchemyGasManager diff --git a/site/packages/aa-alchemy/provider/withAlchemyUserOpSimulation.md b/site/packages/aa-alchemy/provider/withAlchemyUserOpSimulation.md index 792e11a57f..a6d929213a 100644 --- a/site/packages/aa-alchemy/provider/withAlchemyUserOpSimulation.md +++ b/site/packages/aa-alchemy/provider/withAlchemyUserOpSimulation.md @@ -10,8 +10,6 @@ head: - - meta - property: og:description content: Overview of the withAlchemyUserOpSimulation method on Alchemy Provider in aa-alchemy -next: - text: Middleware --- # withAlchemyUserOpSimulation diff --git a/site/packages/aa-core/accounts/optional/signTypedDataWith6492.md b/site/packages/aa-core/accounts/optional/signTypedDataWith6492.md index 0291877b24..42125d344a 100644 --- a/site/packages/aa-core/accounts/optional/signTypedDataWith6492.md +++ b/site/packages/aa-core/accounts/optional/signTypedDataWith6492.md @@ -10,8 +10,6 @@ head: - - meta - property: og:description content: Overview of the signTypedDataWith6492 method on BaseSmartContractAccount -next: - text: Other Methods --- # signTypedDataWith6492 diff --git a/site/packages/aa-core/accounts/optional/signUserOperationHash.md b/site/packages/aa-core/accounts/optional/signUserOperationHash.md new file mode 100644 index 0000000000..e3898cf228 --- /dev/null +++ b/site/packages/aa-core/accounts/optional/signUserOperationHash.md @@ -0,0 +1,49 @@ +--- +outline: deep +head: + - - meta + - property: og:title + content: signUserOperationHash + - - meta + - name: description + content: Overview of the signUserOperationHash method on BaseSmartContractAccount + - - meta + - property: og:description + content: Overview of the signUserOperationHash method on BaseSmartContractAccount +next: + text: Other Methods +--- + +# signUserOperationHash + +If your account handles [ERC-1271 signatures](https://eips.ethereum.org/EIPS/eip-1271) of `personal_sign` differently than it does user operations, you can implement your additional way to sign the user operation. + +**Note**: This method is already implemented on `BaseSmartContractAccount` defaulting to using the [`signMessage`](/packages/aa-core/accounts/required/signMessage.md) method. So any class that extends and implements `BaseSmartContractAccount` may call this method. + +## Usage + +::: code-group + +```ts [example.ts] +import { provider } from "./provider"; +// [!code focus:99] +const signature = await provider.account.signUserOperationHash( + `` +); +``` + +<<< @/snippets/provider.ts + +::: + +## Returns + +### `Promise` + +The signature of the UserOperation + +## Parameters + +### `uoHash: Hash` + +The hash of the UserOperation to sign diff --git a/site/packages/aa-core/provider/extend.md b/site/packages/aa-core/provider/extend.md index cf29203eac..494f097a3a 100644 --- a/site/packages/aa-core/provider/extend.md +++ b/site/packages/aa-core/provider/extend.md @@ -10,8 +10,7 @@ head: - - meta - property: og:description content: Overview of the extend method on ISmartAccountProvider -next: - text: SmartContractAccount +next: Types --- # extend diff --git a/site/packages/aa-core/provider/types/userOperationOverrides.md b/site/packages/aa-core/provider/types/userOperationOverrides.md index 6a479f481d..8eeeeca23a 100644 --- a/site/packages/aa-core/provider/types/userOperationOverrides.md +++ b/site/packages/aa-core/provider/types/userOperationOverrides.md @@ -10,6 +10,8 @@ head: - - meta - property: og:description content: Overview of the UserOperationOverrides type in aa-core types +next: + text: SmartContractAccount --- # UserOperationOverrides diff --git a/site/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md b/site/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md index 63eb60ef9f..e30280ee01 100644 --- a/site/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md +++ b/site/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md @@ -10,6 +10,8 @@ head: - - meta - property: og:description content: Overview of the convertEthersSignerToAccountSigner method in aa-ethers +next: + text: Glossary --- # Utils diff --git a/site/packages/aa-signers/magic/getAuthDetails.md b/site/packages/aa-signers/magic/getAuthDetails.md index 80e49b12c8..ccdeac94f3 100644 --- a/site/packages/aa-signers/magic/getAuthDetails.md +++ b/site/packages/aa-signers/magic/getAuthDetails.md @@ -10,6 +10,8 @@ head: - - meta - property: og:description content: Overview of the getAuthDetails method on MagicSigner +next: + text: Web3auth --- # getAuthDetails diff --git a/site/packages/aa-signers/web3auth/introduction.md b/site/packages/aa-signers/web3auth/introduction.md index 9f3ce70a16..cea4fe406f 100644 --- a/site/packages/aa-signers/web3auth/introduction.md +++ b/site/packages/aa-signers/web3auth/introduction.md @@ -12,7 +12,7 @@ head: content: Overview of the Web3AuthSigner class in aa-signers --- -# web3auth Signer +# Web3auth Signer `Web3AuthSigner` is a signer implementation which extends `SmartAccountAuthenticator` to leverage the [web3auth web modal SDK](https://web3auth.io/docs/sdk/pnp/web/modal). It supports features such as authentication, message and typed data signing, and authentication details retrieval.