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 13, 2024
2 parents 9172698 + 340c5c8 commit a271a50
Show file tree
Hide file tree
Showing 32 changed files with 755 additions and 20 deletions.
6 changes: 6 additions & 0 deletions 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.9](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-02-13)

### Features

- **amoy:** add amoy from viem update ([#448](https://github.com/alchemyplatform/aa-sdk/issues/448)) ([adae84a](https://github.com/alchemyplatform/aa-sdk/commit/adae84add30536676725dbc8805f3436c8ad395e))

# [3.0.0-alpha.8](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-02-11)

### Features
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.8",
"version": "3.0.0-alpha.9",
"npmClient": "yarn",
"conventionalCommits": true,
"conventionalPrerelease": true,
Expand Down
6 changes: 6 additions & 0 deletions packages/accounts/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.9](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-02-13)

### Features

- **amoy:** add amoy from viem update ([#448](https://github.com/alchemyplatform/aa-sdk/issues/448)) ([adae84a](https://github.com/alchemyplatform/aa-sdk/commit/adae84add30536676725dbc8805f3436c8ad395e))

# [3.0.0-alpha.7](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2024-02-10)

**Note:** Version bump only for package @alchemy/aa-accounts
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.7",
"version": "3.0.0-alpha.9",
"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.5",
"@alchemy/aa-core": "^3.0.0-alpha.9",
"viem": "^2.7.8"
}
}
6 changes: 6 additions & 0 deletions packages/alchemy/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.9](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-02-13)

### Features

- **amoy:** add amoy from viem update ([#448](https://github.com/alchemyplatform/aa-sdk/issues/448)) ([adae84a](https://github.com/alchemyplatform/aa-sdk/commit/adae84add30536676725dbc8805f3436c8ad395e))

# [3.0.0-alpha.8](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-02-11)

### Features
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.8",
"version": "3.0.0-alpha.9",
"description": "adapters for @alchemy/aa-core for interacting with alchemy services",
"author": "Alchemy",
"license": "MIT",
Expand Down Expand Up @@ -46,7 +46,7 @@
"vitest": "^0.31.0"
},
"dependencies": {
"@alchemy/aa-core": "^3.0.0-alpha.5",
"@alchemy/aa-core": "^3.0.0-alpha.9",
"@turnkey/http": "^2.6.2",
"@turnkey/iframe-stamper": "^1.0.0",
"@turnkey/viem": "^0.4.8",
Expand Down
2 changes: 0 additions & 2 deletions packages/alchemy/src/signer/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { IframeStamper } from "@turnkey/iframe-stamper";
import { WebauthnStamper } from "@turnkey/webauthn-stamper";
import { type Hex } from "viem";
import { z } from "zod";
import { SessionManagerParamsSchema } from "../session/manager.js";
import { base64UrlEncode } from "../utils/base64UrlEncode.js";
import { generateRandomBuffer } from "../utils/generateRandomBuffer.js";
import type {
Expand All @@ -26,7 +25,6 @@ export const AlchemySignerClientParamsSchema = z.object({
iframeElementId: z.string().default("turnkey-iframe"),
iframeContainerId: z.string(),
}),
sessionConfig: SessionManagerParamsSchema.optional(),
});

export type AlchemySignerClientParams = z.input<
Expand Down
2 changes: 1 addition & 1 deletion packages/alchemy/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.8";
export const VERSION = "3.0.0-alpha.9";
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.9](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-02-13)

### Features

- **amoy:** add amoy from viem update ([#448](https://github.com/alchemyplatform/aa-sdk/issues/448)) ([adae84a](https://github.com/alchemyplatform/aa-sdk/commit/adae84add30536676725dbc8805f3436c8ad395e))

# [3.0.0-alpha.5](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-02-07)

### 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.5",
"version": "3.0.0-alpha.9",
"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.5";
export const VERSION = "3.0.0-alpha.9";
6 changes: 6 additions & 0 deletions packages/ethers/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.9](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-02-13)

### Features

- **amoy:** add amoy from viem update ([#448](https://github.com/alchemyplatform/aa-sdk/issues/448)) ([adae84a](https://github.com/alchemyplatform/aa-sdk/commit/adae84add30536676725dbc8805f3436c8ad395e))

# [3.0.0-alpha.5](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-02-07)

**Note:** Version bump only for package @alchemy/aa-ethers
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.5",
"version": "3.0.0-alpha.9",
"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.5",
"@alchemy/aa-core": "^3.0.0-alpha.9",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/signers/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.9](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-02-13)

### Features

- **amoy:** add amoy from viem update ([#448](https://github.com/alchemyplatform/aa-sdk/issues/448)) ([adae84a](https://github.com/alchemyplatform/aa-sdk/commit/adae84add30536676725dbc8805f3436c8ad395e))

# [3.0.0-alpha.5](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-02-07)

**Note:** Version bump only for package @alchemy/aa-signers
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.5",
"version": "3.0.0-alpha.9",
"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.5",
"@alchemy/aa-core": "^3.0.0-alpha.9",
"viem": "^2.7.8"
},
"optionalDependencies": {
Expand Down
1 change: 1 addition & 0 deletions site/.vitepress/sidebar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const sidebar: DefaultTheme.Sidebar = [
base: "/signers",
items: [
{ text: "Introduction", link: "/choosing-a-signer" },
{ text: "Alchemy Signer", link: "/alchemy-signer" },
{
text: "Signer guides",
base: "/signers/guides",
Expand Down
48 changes: 48 additions & 0 deletions site/.vitepress/sidebar/packages/aa-alchemy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,54 @@ export const aaAlchemySidebar: DefaultTheme.SidebarItem = {
},
],
},
{
text: "Alchemy Signer",
base: "/packages/aa-alchemy/signer",
collapsed: true,
items: [
{
text: "Overview",
link: "/overview",
},
{
text: "authenticate",
link: "/authenticate",
},
{
text: "disconnect",
link: "/disconnect",
},
{
text: "getAuthDetails",
link: "/getAuthDetails",
},

{
text: "getAddress",
link: "/getAddress",
},
{
text: "signMessage",
link: "/signMessage",
},
{
text: "signTypedData",
link: "/signTypedData",
},
{
text: "getUser",
link: "/getUser",
},
{
text: "addPasskey",
link: "/addPasskey",
},
{
text: "exportWallet",
link: "/exportWallet",
},
],
},
{
text: "Utils",
collapsed: true,
Expand Down
49 changes: 49 additions & 0 deletions site/packages/aa-alchemy/signer/addPasskey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
outline: deep
head:
- - meta
- property: og:title
content: Alchemy Signer • addPasskey
- - meta
- name: description
content: Learn how to use the AlchemySigner.addPasskey method
- - meta
- property: og:description
content: Learn how to use the AlchemySigner.addPasskey method
- - meta
- name: twitter:title
content: Alchemy Signer • addPasskey
- - meta
- name: twitter:description
content: Learn how to use the AlchemySigner.addPasskey method
---

# addPasskey

The `addPasskey` method is used to add a passkey as an auth method to an already logged in user.

::: warning
This method throws if there is no authenticated user.
:::

## Usage

::: code-group

```ts
import { signer } from "./signer";

await signer.addPasskey();
```

<<< @/snippets/signers/alchemy/signer.ts

:::

## Returns

`Promise<string[]>` -- on success returns an array of credential ids

## Parameters

`params?: CredentialCreationOptions` -- overrides for the WebAuthn credential creation options. For more info on the `CredentialCreationOptions` interface, see [here](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.credentialcreationoptions.html).
71 changes: 71 additions & 0 deletions site/packages/aa-alchemy/signer/authenticate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
outline: deep
head:
- - meta
- property: og:title
content: Alchemy Signer • authenticate
- - meta
- name: description
content: Learn how to use the AlchemySigner.authenticate method
- - meta
- property: og:description
content: Learn how to use the AlchemySigner.authenticate method
- - meta
- name: twitter:title
content: Alchemy Signer • authenticate
- - meta
- name: twitter:description
content: Learn how to use the AlchemySigner.authenticate method
---

# authenticate

The `authenticate` method is used to authenticate a user with the Alchemy Signer.

## Usage

::: code-group

```ts
import { signer } from "./signer";

const bundlePromise = new Promise(async (resolve) => {
// up to you define how you collect the OTP from the user
const otpFromUser = await getOtpFromUser();
resolve(otpFromUser);
});

const user = await signer.authenticate({
type: "email",
email: "[email protected]",
// the bundle is the OTP that the user will input from their email
bundle: bundlePromise,
});
```

<<< @/snippets/signers/alchemy/signer.ts

:::

## Returns

`Promise<User>` -- on success returns a `User` object representing the authenticated user.

## Parameters

`AuthParams` -- an object that contains the following properties:

```ts
export type AuthParams =
| { type: "email"; email: string; bundle: Promise<string> }
| {
type: "passkey";
createNew: false;
}
| {
type: "passkey";
createNew: true;
username: string;
creationOpts?: CredentialCreationOptionOverrides;
};
```
Loading

0 comments on commit a271a50

Please sign in to comment.