Skip to content

Commit

Permalink
feat: make alchemy-sdk an optional dependency on aa-alchemy (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
avasisht23 authored and moldy530 committed Nov 17, 2023
1 parent 1c27b6b commit a0088b3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 29 deletions.
4 changes: 2 additions & 2 deletions packages/alchemy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
"gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d",
"peerDependencies": {
"alchemy-sdk": "^2.10.1"
"optionalDependencies": {
"alchemy-sdk": "^3.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/alchemy/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class AlchemyProvider extends SmartAccountProvider<HttpTransport> {
}

/**
* This methods adds Alchemy Enhanced APIs to the provider, via a peer dependency on `alchemy-sdk`.
* This methods adds Alchemy Enhanced APIs to the provider, via an optional dependency on `alchemy-sdk`.
* @see: https://github.com/alchemyplatform/alchemy-sdk-js
*
* The Alchemy SDK client must be configured with the same API key and network as the AlchemyProvider.
Expand Down
2 changes: 1 addition & 1 deletion packages/ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"test:run-e2e": "vitest run --config vitest.config.e2e.ts"
},
"devDependencies": {
"alchemy-sdk": "^2.8.3",
"alchemy-sdk": "^3.0.0",
"dotenv": "^16.0.3",
"typescript": "^5.0.4",
"typescript-template": "*",
Expand Down
22 changes: 2 additions & 20 deletions site/overview/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In your project directory, you'll need to run the following to install the requi
::: code-group

```bash [npm]
npm init -y
npm init es6 -y
npm install -save-dev typescript
npm install @alchemy/aa-alchemy @alchemy/aa-accounts @alchemy/aa-core viem
```
Expand All @@ -46,9 +46,7 @@ We're installing [viem](https://viem.sh/) as well. Viem contains helpful abstrac

:::

Make sure your new `package.json` file and `tsconfig.json` files look like the following. Note that we added `"type": module` in `package.json` for this example:

::: code-group
Make sure your new `package.json` file looks something like the following. Note that we have `"type": module` in `package.json` for this example:

```json [package.json]
{
Expand All @@ -70,22 +68,6 @@ Make sure your new `package.json` file and `tsconfig.json` files look like the f
}
```

```json [tsconfig.json]
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
```

:::

You'll also want to make sure your `Node` version is _18.10.0_ using your version manager:

::: code-group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ head:
`withAlchemyEnhancedApis` is a method on `AlchemyProvider` that you can optionally call to create a new provider instance with added methods that access the Alchemy [Enhanced APIs](https://www.alchemy.com/enhanced-apis) via the [Alchemy SDK](https://github.com/alchemyplatform/alchemy-sdk-js).

:::tip Note
This method requires a peer dependency on the [`alchemy-sdk`](https://github.com/alchemyplatform/alchemy-sdk-js) package, as the input to this method is an Alchemy SDK client.
This method requires an optional dependency on the [`alchemy-sdk`](https://github.com/alchemyplatform/alchemy-sdk-js) package, as the input to this method is an Alchemy SDK client.

The Alchemy SDK client must be configured with the same API key and network as the AlchemyProvider. This method validates such at runtime.

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5185,10 +5185,10 @@ ajv@^8.11.0:
require-from-string "^2.0.2"
uri-js "^4.2.2"

alchemy-sdk@^2.8.3:
version "2.10.1"
resolved "https://registry.yarnpkg.com/alchemy-sdk/-/alchemy-sdk-2.10.1.tgz#806bd7a1dca34d0af58ed7d7da03e6d533ad1334"
integrity sha512-zV6rBS2K0H3ickE28N7YiPvKPP9EQV+ZAiv9Zi3+aSzhcm0D1bkK+OS/+Tc7mU6EflSpZcDNC1fsLWlRqJOX4Q==
alchemy-sdk@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/alchemy-sdk/-/alchemy-sdk-3.0.0.tgz#20ecb1dce4a8881d126e7062b96109c26e4ab186"
integrity sha512-mTvL9+ly55dz2h+/qElLNy2KM6yJY15bAHr7HCCaYquIYpdBHd1kKSosFBUKRGpWECngFoq+ZF+78hmEPMrZkw==
dependencies:
"@ethersproject/abi" "^5.7.0"
"@ethersproject/abstract-provider" "^5.7.0"
Expand Down

0 comments on commit a0088b3

Please sign in to comment.