Skip to content

Commit

Permalink
Merge branch 'alchemyplatform:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
moldy530 authored Feb 1, 2024
2 parents f96d896 + a45c22a commit e2637b4
Show file tree
Hide file tree
Showing 169 changed files with 586 additions and 1,037 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.0.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-02-01)

### Bug Fixes

- session key permissions builder returning 0x ([7577d8c](https://github.com/alchemyplatform/aa-sdk/commit/7577d8ca570965a8857cc8d301c02f76660e453f))

# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31)

### Bug Fixes

- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa))

# [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.2",
"npmClient": "yarn",
"conventionalCommits": true,
"conventionalPrerelease": true,
Expand Down
12 changes: 12 additions & 0 deletions packages/accounts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.0.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-02-01)

### Bug Fixes

- session key permissions builder returning 0x ([7577d8c](https://github.com/alchemyplatform/aa-sdk/commit/7577d8ca570965a8857cc8d301c02f76660e453f))

# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31)

### Bug Fixes

- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa))

# [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/accounts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alchemy/aa-accounts",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.2",
"description": "A collection of ERC-4337 compliant smart contract account interfaces",
"author": "Alchemy",
"license": "MIT",
Expand Down Expand Up @@ -74,7 +74,7 @@
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
"gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d",
"dependencies": {
"@alchemy/aa-core": "^3.0.0-alpha.0",
"@alchemy/aa-core": "^3.0.0-alpha.1",
"viem": "^2.5.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class SessionKeyPermissionsBuilder {
}),
this._requiredPaymaster
),
].filter((x) => x === "0x");
].filter((x) => x !== "0x");
}

private encodeIfDefined<T>(encode: (param: T) => Hex, param?: T): Hex {
Expand Down
10 changes: 10 additions & 0 deletions packages/alchemy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.0.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-02-01)

**Note:** Version bump only for package @alchemy/aa-alchemy

# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31)

### Bug Fixes

- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa))

# [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/alchemy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alchemy/aa-alchemy",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.2",
"description": "adapters for @alchemy/aa-core for interacting with alchemy services",
"author": "Alchemy",
"license": "MIT",
Expand Down Expand Up @@ -57,7 +57,7 @@
"vitest": "^0.31.0"
},
"dependencies": {
"@alchemy/aa-core": "^3.0.0-alpha.0",
"@alchemy/aa-core": "^3.0.0-alpha.1",
"viem": "^2.5.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/alchemy/src/client/lightAccountClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("Light Account Client Tests", () => {
{
"fetchOptions": {
"headers": {
"Alchemy-AA-Sdk-Version": "3.0.0-alpha.0",
"Alchemy-AA-Sdk-Version": "3.0.0-alpha.1",
"Authorization": "Bearer test",
},
},
Expand Down
70 changes: 70 additions & 0 deletions packages/alchemy/src/client/modularAccountClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import {
accountLoupeActions,
createMultiOwnerModularAccount,
multiOwnerPluginActions,
pluginManagerActions,
type CreateMultiOwnerModularAccountParams,
type LightAccount,
type MultiOwnerModularAccount,
} from "@alchemy/aa-accounts";
import type { SmartAccountSigner } from "@alchemy/aa-core";
import {
custom,
type Chain,
type CustomTransport,
type HttpTransport,
type Transport,
} from "viem";
import { AlchemyProviderConfigSchema } from "../schema.js";
import { createAlchemySmartAccountClientFromRpcClient } from "./internal/smartAccountClientFromRpc.js";
import { createAlchemyPublicRpcClient } from "./rpcClient.js";
import type {
AlchemySmartAccountClient,
AlchemySmartAccountClientConfig,
} from "./smartAccountClient";

export type AlchemyModularAccountClientConfig<
TOwner extends SmartAccountSigner = SmartAccountSigner
> = Omit<
CreateMultiOwnerModularAccountParams<HttpTransport, TOwner>,
"transport" | "chain"
> &
Omit<
AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TOwner>>,
"account"
>;

export const createModularAccountAlchemyClient: <
TOwner extends SmartAccountSigner = SmartAccountSigner
>(
params: AlchemyModularAccountClientConfig<TOwner>
) => Promise<
AlchemySmartAccountClient<
CustomTransport,
Chain | undefined,
MultiOwnerModularAccount<TOwner>
>
> = async (config) => {
const { chain, opts, ...connectionConfig } =
AlchemyProviderConfigSchema.parse(config);

const client = createAlchemyPublicRpcClient({
chain,
connectionConfig,
});

const account = await createMultiOwnerModularAccount({
transport: custom(client),
...config,
});

return createAlchemySmartAccountClientFromRpcClient({
...config,
client,
account,
opts,
})
.extend(multiOwnerPluginActions)
.extend(pluginManagerActions)
.extend(accountLoupeActions);
};
4 changes: 3 additions & 1 deletion packages/alchemy/src/client/smartAccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getDefaultUserOperationFeeOptions } from "../defaults.js";
import { type AlchemyGasManagerConfig } from "../middleware/gasManager.js";
import { AlchemyProviderConfigSchema } from "../schema.js";
import type { AlchemyProviderConfig } from "../type.js";
import type { AlchemySmartAccountClientActions } from "./decorators/smartAccount.js";
import { createAlchemySmartAccountClientFromRpcClient } from "./internal/smartAccountClientFromRpc.js";
import { createAlchemyPublicRpcClient } from "./rpcClient.js";
import type { AlchemyRpcSchema } from "./types.js";
Expand Down Expand Up @@ -41,7 +42,8 @@ export type AlchemySmartAccountClient_Base<
actions extends SmartAccountClientActions<
chain,
account
> = SmartAccountClientActions<chain, account>
> = SmartAccountClientActions<chain, account> &
AlchemySmartAccountClientActions<account>
> = Prettify<
SmartAccountClient<
transport,
Expand Down
2 changes: 2 additions & 0 deletions packages/alchemy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ 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";
export type * from "./client/modularAccountClient.js";
export { createModularAccountAlchemyClient } from "./client/modularAccountClient.js";
export type * from "./client/rpcClient.js";
export { createAlchemyPublicRpcClient } from "./client/rpcClient.js";
export type * from "./client/smartAccountClient.js";
Expand Down
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31)

### Bug Fixes

- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa))

# [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@alchemy/aa-core",
"license": "MIT",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.1",
"description": "viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts",
"author": "Alchemy",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file is autogenerated by inject-version.ts. Any changes will be
// overwritten on commit!
export const VERSION = "3.0.0-alpha.0";
export const VERSION = "3.0.0-alpha.1";
4 changes: 4 additions & 0 deletions packages/ethers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31)

**Note:** Version bump only for package @alchemy/aa-ethers

# [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30)

### Code Refactoring
Expand Down
4 changes: 2 additions & 2 deletions packages/ethers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@alchemy/aa-ethers",
"license": "MIT",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.1",
"description": "Ethers.js wrapper for @alchemy/aa-core",
"author": "Alchemy",
"type": "module",
Expand Down Expand Up @@ -49,7 +49,7 @@
"vitest": "^0.31.0"
},
"dependencies": {
"@alchemy/aa-core": "^3.0.0-alpha.0",
"@alchemy/aa-core": "^3.0.0-alpha.1",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/signers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31)

**Note:** Version bump only for package @alchemy/aa-signers

# [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30)

- refactor(aa-accounts)!: migrate aa-accounts to viem approach ([37a5b48](https://github.com/alchemyplatform/aa-sdk/commit/37a5b489bdd2527dca311787d5585f1dc3a5f05b))
Expand Down
4 changes: 2 additions & 2 deletions packages/signers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alchemy/aa-signers",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.1",
"description": "A collection of signers used to create ERC-4337 smart accounts",
"author": "Alchemy",
"license": "MIT",
Expand Down Expand Up @@ -114,7 +114,7 @@
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
"gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d",
"dependencies": {
"@alchemy/aa-core": "^3.0.0-alpha.0",
"@alchemy/aa-core": "^3.0.0-alpha.1",
"viem": "^2.5.0"
},
"optionalDependencies": {
Expand Down
Loading

0 comments on commit e2637b4

Please sign in to comment.