Skip to content

Commit

Permalink
v2.2.2 (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebrianchen authored Nov 17, 2022
1 parent db16e15 commit a44b080
Show file tree
Hide file tree
Showing 205 changed files with 1,151 additions and 961 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Added `TransactNamespace.sendGasOptimizedTransaction()`. Instead of sending a single transaction that might not get mined, this method allows you to send the same transaction multiple times, with different gas prices and gas limits. This should result in lower fees paid.

## 2.2.2

### Major Changes

### Minor Changes

- Added support for ENS resolution to the `NotifyNamespace` and `WebsocketNamespace` methods.
Expand Down
36 changes: 29 additions & 7 deletions docs-md/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ It supports the exact same syntax and functionality of the Ethers.js `AlchemyPro

The SDK leverages Alchemy's hardened node infrastructure, guaranteeing best-in-class node reliability, scalability, and data correctness, and is undergoing active development by Alchemy's engineers.

> 🙋‍♀️ **FEATURE REQUESTS:** We'd love your thoughts on what would improve your web3 dev process the most! If you have 5 minutes, tell us what you want on our [Feature Request feedback form](https://alchemyapi.typeform.com/sdk-feedback), and we'd love to build it for you:
> 🙋‍♀️ **FEATURE REQUESTS:**
>
> We'd love your thoughts on what would improve your web3 dev process the most! If you have 5 minutes, tell us what you want on our [Feature Request feedback form](https://alchemyapi.typeform.com/sdk-feedback), and we'd love to build it for you.
The SDK currently supports the following chains:

Expand Down Expand Up @@ -40,6 +42,10 @@ const settings = {
const alchemy = new Alchemy(settings);
```

> **ℹ️ Creating a unique Alchemy API Key**
>
> The public "demo" API key may be rate limited based on traffic. To create your own API key, **[sign up for an Alchemy account here](https://alchemy.com/?a=SDKquickstart)** and use the key created on your dashboard for the first app.
The `Alchemy` object returned by `new Alchemy()` provides access to the Alchemy API. An optional config object can be passed in when initializing to set your API key, change the network, or specify the max number of retries.

## Using the Alchemy SDK
Expand All @@ -54,6 +60,10 @@ The Alchemy SDK currently supports five different namespaces, including:

If you are already using Ethers.js, you should be simply able to replace the Ethers.js Provider object with `alchemy.core` and it should work properly.

> **ℹ️ ENS Name Resolution**
>
> The Alchemy SDK now supports ENS names (e.g. `vitalik.eth`) for every parameter where you can pass in a Externally Owned Address, or user address (e.g. `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`).
```ts
import { Alchemy, AlchemySubscription } from 'alchemy-sdk';

Expand All @@ -80,6 +90,13 @@ alchemy.ws.on(
);
```

The Alchemy SDK also supports a number of Ethers.js objects that streamline the development process:

- [`Utils`](https://docs.ethers.io/v5/api/utils/): Equivalent to `ethers.utils`, this provides a number of common Ethers.js utility methods for developers.
- [`Contract`](https://docs.ethers.io/v5/api/contract/contract/): An abstraction for smart contract code deployed to the blockchain.
- [`ContractFactory`](https://docs.ethers.io/v5/api/contract/contract-factory/): Allows developers to build a `Contract` object.
- [`Wallet`](https://docs.ethers.io/v5/api/signer/#Wallet): An implementation of `Signer` that can sign transactions and messages using a private key as a standard Externally Owned Account.

## Alchemy Core

The core namespace contains all commonly-used [Ethers.js Provider](https://docs.ethers.io/v5/api/providers/api-providers/#AlchemyProvider) methods. If you are already using Ethers.js, you should be simply able to replace the Ethers.js Provider object with `alchemy.core` when accessing provider methods and it should just work.
Expand Down Expand Up @@ -130,7 +147,7 @@ alchemy.ws.on('block', res => console.log(res));
alchemy.ws.once(
{
method: AlchemySubscription.PENDING_TRANSACTIONS,
toAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
toAddress: 'vitalik.eth'
},
res => console.log(res)
);
Expand Down Expand Up @@ -171,7 +188,8 @@ The `transact` namespace also aliases over several commonly used methods from th
The SDK currently supports the following [NFT API](https://docs.alchemy.com/alchemy/enhanced-apis/nft-api) endpoints
under the `alchemy.nft` namespace:

- `getNftMetadata()`: Get the NFT metadata for a contract address and tokenId.
- `getNftMetadata()`: Get the NFT metadata for an NFT contract address and tokenId.
- `getNftMetadataBatch()`: Get the NFT metadata for multiple NFT contract addresses/token id pairs.
- `getContractMetadata()`: Get the metadata associated with an NFT contract
- `getNftsForOwner()`: Get NFTs for an owner address.
- `getNftsForOwnerIterator()`: Get NFTs for an owner address as an async iterator (handles paging automatically).
Expand All @@ -187,7 +205,9 @@ under the `alchemy.nft` namespace:
- `refreshContract()`: Enqueues the specified contract address to have all token ids' metadata refreshed.
- `getFloorPrice()`: Return the floor prices of a NFT contract by marketplace.
- `computeRarity()`: Get the rarity of each attribute of an NFT.
- `getNftSales()`: Returns NFT sales that have happened through on-chain marketplaces.
- `summarizeNftAttributes()`: Get the summary of attribute prevalence for all NFTs in a contract.
- `searchContractMetadata()`: Search for a keyword across metadata of all ERC-721 and ERC-1155 smart contracts.

### Using `BaseNft` and `Nft`

Expand Down Expand Up @@ -264,7 +284,11 @@ or as a webpage by opening `docs/index.html` in your browser.

## Usage Examples

Below are a few usage examples. You can also find examples at the following page: [Examples Using the Alchemy SDK](https://docs.alchemy.com/reference/using-the-alchemy-sdk).
Below are a few usage examples.

> **ℹ️ More Examples **
>
> You can also go here: [Examples Using the Alchemy SDK](https://docs.alchemy.com/reference/using-the-alchemy-sdk).
### Getting the NFTs owned by an address

Expand Down Expand Up @@ -328,9 +352,7 @@ import { Alchemy } from 'alchemy-sdk';

const alchemy = new Alchemy();

alchemy.core
.getTokenBalances('0x994b342dd87fc825f66e51ffa3ef71ad818b6893')
.then(console.log);
alchemy.core.getTokenBalances('vitalik.eth').then(console.log);
```

## Questions and Feedback
Expand Down
14 changes: 7 additions & 7 deletions docs-md/classes/Alchemy.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ different network or API key, create a new instance of [Alchemy](Alchemy.md).

#### Defined in

[src/api/alchemy.ts:55](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy.ts#L55)
[src/api/alchemy.ts:55](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy.ts#L55)

## Properties

Expand All @@ -50,7 +50,7 @@ and allows access to the underlying providers.

#### Defined in

[src/api/alchemy.ts:41](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy.ts#L41)
[src/api/alchemy.ts:41](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy.ts#L41)

___

Expand All @@ -63,7 +63,7 @@ Enhanced APIs.

#### Defined in

[src/api/alchemy.ts:23](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy.ts#L23)
[src/api/alchemy.ts:23](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy.ts#L23)

___

Expand All @@ -75,7 +75,7 @@ The `nft` namespace contains methods for Alchemy's NFT API.

#### Defined in

[src/api/alchemy.ts:26](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy.ts#L26)
[src/api/alchemy.ts:26](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy.ts#L26)

___

Expand All @@ -88,7 +88,7 @@ as part of the Notify API.

#### Defined in

[src/api/alchemy.ts:47](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy.ts#L47)
[src/api/alchemy.ts:47](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy.ts#L47)

___

Expand All @@ -101,7 +101,7 @@ checking on the state of submitted transasctions.

#### Defined in

[src/api/alchemy.ts:35](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy.ts#L35)
[src/api/alchemy.ts:35](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy.ts#L35)

___

Expand All @@ -113,4 +113,4 @@ The `ws` namespace contains methods for using WebSockets and creating subscripti

#### Defined in

[src/api/alchemy.ts:29](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy.ts#L29)
[src/api/alchemy.ts:29](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy.ts#L29)
29 changes: 21 additions & 8 deletions docs-md/classes/AlchemyConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ exposes the underlying providers for more advanced use cases.

- [apiKey](AlchemyConfig.md#apikey)
- [authToken](AlchemyConfig.md#authtoken)
- [batchRequests](AlchemyConfig.md#batchrequests)
- [maxRetries](AlchemyConfig.md#maxretries)
- [network](AlchemyConfig.md#network)
- [url](AlchemyConfig.md#url)
Expand All @@ -38,7 +39,7 @@ exposes the underlying providers for more advanced use cases.

#### Defined in

[src/api/alchemy-config.ts:55](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-config.ts#L55)
[src/api/alchemy-config.ts:58](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L58)

## Properties

Expand All @@ -50,7 +51,7 @@ The Alchemy API key.

#### Defined in

[src/api/alchemy-config.ts:22](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-config.ts#L22)
[src/api/alchemy-config.ts:22](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L22)

___

Expand All @@ -62,7 +63,19 @@ The optional Alchemy auth token to use when sending requests with the Notify API

#### Defined in

[src/api/alchemy-config.ts:37](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-config.ts#L37)
[src/api/alchemy-config.ts:40](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L40)

___

### batchRequests

`Readonly` **batchRequests**: `boolean`

Setting to enable automatic batching on json-rpc requests. Defaults to false.

#### Defined in

[src/api/alchemy-config.ts:31](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L31)

___

Expand All @@ -74,7 +87,7 @@ The maximum number of retries to perform.

#### Defined in

[src/api/alchemy-config.ts:28](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-config.ts#L28)
[src/api/alchemy-config.ts:28](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L28)

___

Expand All @@ -86,7 +99,7 @@ The Network that this SDK is associated with.

#### Defined in

[src/api/alchemy-config.ts:25](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-config.ts#L25)
[src/api/alchemy-config.ts:25](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L25)

___

Expand All @@ -99,7 +112,7 @@ and apiKey.

#### Defined in

[src/api/alchemy-config.ts:34](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-config.ts#L34)
[src/api/alchemy-config.ts:37](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L37)

## Methods

Expand All @@ -123,7 +136,7 @@ other less-common methods.

#### Defined in

[src/api/alchemy-config.ts:96](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-config.ts#L96)
[src/api/alchemy-config.ts:100](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L100)

___

Expand All @@ -148,4 +161,4 @@ other less-common methods.

#### Defined in

[src/api/alchemy-config.ts:118](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-config.ts#L118)
[src/api/alchemy-config.ts:122](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-config.ts#L122)
23 changes: 17 additions & 6 deletions docs-md/classes/AlchemyProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Do not call this constructor directly. Instead, instantiate an instance of
- [\_pollingInterval](AlchemyProvider.md#_pollinginterval)
- [anyNetwork](AlchemyProvider.md#anynetwork)
- [apiKey](AlchemyProvider.md#apikey)
- [batchRequests](AlchemyProvider.md#batchrequests)
- [connection](AlchemyProvider.md#connection)
- [disableCcipRead](AlchemyProvider.md#disableccipread)
- [formatter](AlchemyProvider.md#formatter)
Expand Down Expand Up @@ -400,7 +401,17 @@ ___

#### Defined in

[src/api/alchemy-provider.ts:39](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-provider.ts#L39)
[src/api/alchemy-provider.ts:41](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-provider.ts#L41)

___

### batchRequests

`Readonly` **batchRequests**: `boolean`

#### Defined in

[src/api/alchemy-provider.ts:43](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-provider.ts#L43)

___

Expand Down Expand Up @@ -452,7 +463,7 @@ ___

#### Defined in

[src/api/alchemy-provider.ts:40](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-provider.ts#L40)
[src/api/alchemy-provider.ts:42](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-provider.ts#L42)

## Accessors

Expand Down Expand Up @@ -924,7 +935,7 @@ JsonRpcProvider.\_startPending

#### Defined in

[src/api/alchemy-provider.ts:184](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-provider.ts#L184)
[src/api/alchemy-provider.ts:204](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-provider.ts#L204)

___

Expand Down Expand Up @@ -1124,7 +1135,7 @@ JsonRpcProvider.detectNetwork

#### Defined in

[src/api/alchemy-provider.ts:172](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-provider.ts#L172)
[src/api/alchemy-provider.ts:192](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-provider.ts#L192)

___

Expand Down Expand Up @@ -1603,7 +1614,7 @@ CommunityResourcable.isCommunityResource

#### Defined in

[src/api/alchemy-provider.ts:194](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-provider.ts#L194)
[src/api/alchemy-provider.ts:214](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-provider.ts#L214)

___

Expand Down Expand Up @@ -1963,7 +1974,7 @@ JsonRpcProvider.send

#### Defined in

[src/api/alchemy-provider.ts:208](https://github.com/alchemyplatform/alchemy-sdk-js/blob/c3fdebb/src/api/alchemy-provider.ts#L208)
[src/api/alchemy-provider.ts:228](https://github.com/alchemyplatform/alchemy-sdk-js/blob/30d9ef5/src/api/alchemy-provider.ts#L228)

___

Expand Down
Loading

0 comments on commit a44b080

Please sign in to comment.