Skip to content

Commit

Permalink
docs: update the Accounts docs for aa-core (alchemyplatform#401)
Browse files Browse the repository at this point in the history
* docs: update the Accounts docs for aa-core

* docs: update the aa-alchemy package docs (alchemyplatform#402)

* docs: update the aa-alchemy package docs

* docs: update the docs for aa-ethers (alchemyplatform#403)

* docs: update the docs for aa-ethers

* docs: update aa-accounts docs (alchemyplatform#404)
  • Loading branch information
moldy530 authored Jan 31, 2024
1 parent 8817be1 commit be8c1ae
Show file tree
Hide file tree
Showing 87 changed files with 678 additions and 2,010 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export function createAlchemySmartAccountClientFromRpcClient({
gasManagerConfig,
feeEstimator,
gasEstimator,
paymasterAndData,
dummyPaymasterAndData,
customMiddleware,
client,
}: CreateAlchemySmartAccountClientFromRpcClient): AlchemySmartAccountClient {
Expand All @@ -63,8 +61,6 @@ export function createAlchemySmartAccountClientFromRpcClient({
userOperationSimulator: useSimulation
? alchemyUserOperationSimulator(client)
: undefined,
paymasterAndData,
dummyPaymasterAndData,
gasEstimator,
...(gasManagerConfig &&
alchemyGasManagerMiddleware(client, {
Expand Down
13 changes: 2 additions & 11 deletions packages/alchemy/src/client/smartAccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ export type AlchemySmartAccountClientConfig<
} & AlchemyProviderConfig &
Pick<
SmartAccountClientConfig<transport, chain, account>,
| "customMiddleware"
| "dummyPaymasterAndData"
| "paymasterAndData"
| "feeEstimator"
| "gasEstimator"
"customMiddleware" | "feeEstimator" | "gasEstimator"
>;

export type AlchemySmartAccountClient_Base<
Expand Down Expand Up @@ -74,11 +70,9 @@ export function createAlchemySmartAccountClient<
account,
gasManagerConfig,
useSimulation,
dummyPaymasterAndData,
feeEstimator,
customMiddleware,
gasEstimator,
paymasterAndData,
...config_
}: AlchemySmartAccountClientConfig<
TTransport,
Expand All @@ -90,11 +84,9 @@ export function createAlchemySmartAccountClient({
account,
gasManagerConfig,
useSimulation,
dummyPaymasterAndData,
feeEstimator,
customMiddleware,
gasEstimator,
paymasterAndData,
...config_
}: AlchemySmartAccountClientConfig): AlchemySmartAccountClient {
const config = AlchemyProviderConfigSchema.parse(config_);
Expand All @@ -115,10 +107,9 @@ export function createAlchemySmartAccountClient({
...opts,
feeOptions,
},
dummyPaymasterAndData,
feeEstimator,
customMiddleware,
gasEstimator,
paymasterAndData,
useSimulation,
});
}
15 changes: 6 additions & 9 deletions packages/alchemy/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
export type * from "./actions/simulateUserOperationChanges.js";
export { simulateUserOperationChanges } from "./actions/simulateUserOperationChanges.js";
export type * from "./actions/types.js";

export { defineAlchemyChain } from "./chains.js";
export type * from "./client/decorators/alchemyEnhancedApis.js";
export { alchemyEnhancedApiActions } from "./client/decorators/alchemyEnhancedApis.js";
export type * from "./client/decorators/smartAccount.js";
export { alchemyActions } from "./client/decorators/smartAccount.js";
export { isAlchemySmartAccountClient } from "./client/isAlchemySmartAccountClient.js";
export type * from "./client/lightAccountClient.js";
export { createLightAccountAlchemyClient } from "./client/lightAccountClient.js";
Expand All @@ -10,18 +14,11 @@ export { createAlchemyPublicRpcClient } from "./client/rpcClient.js";
export type * from "./client/smartAccountClient.js";
export { createAlchemySmartAccountClient } from "./client/smartAccountClient.js";
export type * from "./client/types.js";

export type * from "./client/decorators/alchemyEnhancedApis.js";
export { alchemyEnhancedApiActions } from "./client/decorators/alchemyEnhancedApis.js";
export type * from "./client/decorators/smartAccount.js";
export { alchemyActions } from "./client/decorators/smartAccount.js";

export { getDefaultUserOperationFeeOptions } from "./defaults.js";
export { alchemyFeeEstimator } from "./middleware/feeEstimator.js";
export type * from "./middleware/gasManager.js";
export { alchemyGasManagerMiddleware } from "./middleware/gasManager.js";
export { alchemyUserOperationSimulator } from "./middleware/userOperationSimulator.js";

export { getDefaultUserOperationFeeOptions } from "./defaults.js";
export type * from "./schema.js";
export { AlchemyProviderConfigSchema } from "./schema.js";
export type { AlchemyProviderConfig } from "./type.js";
8 changes: 6 additions & 2 deletions packages/core/src/account/smartContractAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export type ToSmartContractAccountParams<
getAccountInitCode: () => Promise<Hex>;
getDummySignature: () => Hex;
encodeExecute: (tx: Tx) => Promise<Hex>;
encodeBatchExecute: (txs: Tx[]) => Promise<Hex>;
encodeBatchExecute?: (txs: Tx[]) => Promise<Hex>;
// if not provided, will default to just using signMessage over the Hex
signUserOperationHash?: (uoHash: Hex) => Promise<Hex>;
encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise<Hex>;
Expand Down Expand Up @@ -308,7 +308,11 @@ export async function toSmartContractAccount<
// and allow for generating the UO hash based on the EP version
signUserOperationHash: signUserOperationHash_,
getFactoryAddress,
encodeBatchExecute,
encodeBatchExecute:
encodeBatchExecute ??
(() => {
throw new Error("Account does not support batch execution");
}),
encodeExecute,
getDummySignature,
getInitCode,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/client/smartAccountClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe("SmartAccountClient Tests", async () => {
return;
},
}),
chain,
account,
});

Expand Down
37 changes: 11 additions & 26 deletions site/.vitepress/sidebar/packages/aa-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,23 @@ export const aaAccountsSidebar: DefaultTheme.SidebarItem = {
},
{
text: "Light Account",
link: "/light-account/",
},
{
text: "Light Account Actions",
collapsed: true,
base: "/packages/aa-accounts/light-account",
base: "/packages/aa-accounts/light-account/actions",
items: [
{
text: "Introduction",
link: "/introduction",
},
{
text: "constructor",
link: "/constructor",
},
{
text: "provider",
link: "/provider",
},
{
text: "signMessageWith6492",
link: "/signMessageWith6492",
},
{ text: "signTypedData", link: "/signTypedData" },
{
text: "signTypedDataWith6492",
link: "/signTypedDataWith6492",
text: "transferOwnership",
link: "/transferOwnership",
},
{ text: "getOwnerAddress", link: "/getOwnerAddress" },
{
text: "encodeTransferOwnership",
link: "/encodeTransferOwnership",
},
{ text: "transferOwnership", link: "/transferOwnership" },
],
},
{
text: "Light Account Client",
link: "/light-account/client",
},
{
text: "Utils",
collapsed: true,
Expand Down
65 changes: 21 additions & 44 deletions site/.vitepress/sidebar/packages/aa-alchemy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,75 +10,52 @@ export const aaAlchemySidebar: DefaultTheme.SidebarItem = {
link: "/",
},
{
text: "Provider",
base: "/packages/aa-alchemy/provider",
text: "Smart Account Client",
link: "/smart-account-client/",
},
{
text: "Smart Account Actions",
base: "/packages/aa-alchemy/smart-account-client/actions",
collapsed: true,
items: [
{
text: "Introduction",
link: "/introduction",
},
{
text: "constructor",
link: "/constructor",
},
{
text: "factory",
link: "/light-account-factory",
},
{ text: "gasEstimator", link: "/gasEstimator" },
{
text: "simulateUserOperationAssetChanges",
link: "/simulateUserOperationAssetChanges",
},
{
text: "withAlchemyGasManager",
link: "/withAlchemyGasManager",
text: "simulateUserOperation",
link: "/simulateUserOperation",
},
{
text: "withAlchemyUserOpSimulation",
link: "/withAlchemyUserOpSimulation",
},
{
text: "withAlchemyEnhancedApis",
link: "/withAlchemyEnhancedApis",
text: "alchemyEnhancedApiActions",
link: "/alchemyEnhancedApiActions",
},
],
},
{
text: "Light Account Client",
link: "/light-account-client/",
},
{
text: "Middleware",
base: "/packages/aa-alchemy/middleware",
collapsed: true,
items: [
{
text: "Introduction",
link: "/introduction",
},
{
text: "withAlchemyGasFeeEstimator",
link: "/withAlchemyGasFeeEstimator",
text: "alchemyFeeEstimator",
link: "/alchemyFeeEstimator",
},
{
text: "withAlchemyGasManager",
link: "/withAlchemyGasManager",
text: "alchemyGasManagerMiddleware",
link: "/alchemyGasManagerMiddleware",
},
{
text: "withAlchemyUserOpSimulation",
link: "/withAlchemyUserOpSimulation",
text: "alchemyUserOperationSimulator",
link: "/alchemyUserOperationSimulator",
},
],
},
{
text: "Utils",
collapsed: true,
base: "/packages/aa-alchemy/utils",
items: [
{
text: "Introduction",
link: "/introduction",
},
{ text: "SupportedChains", link: "/supportedChains" },
],
items: [{ text: "Define Alchemy Chain", link: "/defineAlchemyChain" }],
},
],
};
101 changes: 3 additions & 98 deletions site/.vitepress/sidebar/packages/aa-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export const aaCoreSidebar: DefaultTheme.SidebarItem = {
},
{
text: "Bundler Client",
base: "/packages/aa-core/bundler-client/index",
link: "/index",
base: "/packages/aa-core/bundler-client",
link: "/",
},
{
text: "Bundler Actions",
Expand Down Expand Up @@ -143,102 +143,7 @@ export const aaCoreSidebar: DefaultTheme.SidebarItem = {
{
text: "Accounts",
base: "/packages/aa-core/accounts",
collapsed: true,
items: [
{
text: "Introduction",
link: "/introduction",
},
{
text: "constructor",
link: "/constructor",
},
{
text: "Required Methods",
collapsed: true,
base: "/packages/aa-core/accounts/required",
items: [
{
text: "getDummySignature",
link: "/getDummySignature",
},
{
text: "getAccountInitCode",
link: "/getAccountInitCode",
},
{
text: "signMessage",
link: "/signMessage",
},
{
text: "encodeExecute",
link: "/encodeExecute",
},
],
},
{
text: "Optional Methods",
collapsed: true,
base: "/packages/aa-core/accounts/optional",
items: [
{
text: "encodeBatchExecute",
link: "/encodeBatchExecute",
},
{
text: "signTypedData",
link: "/signTypedData",
},
{
text: "signMessageWith6492",
link: "/signMessageWith6492",
},
{
text: "signTypedDataWith6492",
link: "/signTypedDataWith6492",
},
{
text: "signUserOperationHash",
link: "/signUserOperationHash",
},
],
},
{
text: "Other Methods",
collapsed: true,
base: "/packages/aa-core/accounts/other",
items: [
{
text: "getAddress",
link: "/getAddress",
},
{
text: "getNonce",
link: "/getNonce",
},
{
text: "getOwner",
link: "/getOwner",
},
{
text: "getDeploymentState",
link: "/getDeploymentState",
},
{
text: "isAccountDeployed",
link: "/isAccountDeployed",
},
{
text: "getFactoryAddress",
link: "/getFactoryAddress",
},
{
text: "getEntryPointAddress",
link: "/getEntryPointAddress",
},
],
},
],
link: "/",
},
{
text: "Signers",
Expand Down
Loading

0 comments on commit be8c1ae

Please sign in to comment.