Skip to content

Commit c46cda7

Browse files
authored
Merge branch 'alchemyplatform:master' into master
2 parents e15b77c + ebb99c7 commit c46cda7

18 files changed

Lines changed: 500 additions & 44 deletions

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ jobs:
99
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
1010
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
1111
docker:
12-
- image: cimg/node:16.13.2
12+
- image: cimg/node:lts
1313
# Add steps to the job
1414
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
1515
steps:
1616
- checkout
1717
- restore_cache:
1818
name: Restore Yarn package cache
1919
keys:
20-
- yarn-packages-{{ checksum "yarn.lock" }}
20+
- yarn-packages-{{ checksum "yarn.lock" }}
2121
- run:
2222
name: Install dependencies
23-
command: "yarn --frozen-lockfile"
23+
command: 'yarn --frozen-lockfile'
2424
- save_cache:
2525
name: Save Yarn package cache
2626
key: yarn-packages-{{ checksum "yarn.lock" }}
2727
paths:
28-
- ~/.cache/yarn
28+
- ~/.cache/yarn
2929
- run:
3030
name: Run tests
31-
command: "yarn test"
31+
command: 'yarn test'
3232

3333
# Invoke jobs via workflows
3434
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@
66

77
### Minor Changes
88

9+
## 3.5.9
10+
11+
### Minor Changes
12+
13+
- Added Anime Mainnet and Sepolia, Story Mainnet and Aeneid, Megaeth Testnet
14+
15+
## 3.5.8
16+
17+
### Minor Changes
18+
19+
- Added Berachain Bepolia, Celo Baklava, Ethereum Hoodi, Gensyn Testnet,
20+
Lens Mainnet, Settlus Mainnet, Superseed Mainnet and Sepolia, Tea Sepolia
21+
- Deprecated Berachain Bartio
22+
- Replace `optimism` with `opt-mainnet`
23+
24+
## 3.5.7
25+
26+
### Minor Changes
27+
28+
- Added Solana address activity webhook
29+
- Added animation to NFT type
30+
- Added name to create-webhook
31+
932
## 3.5.6
1033

1134
### Minor Changes

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The SDK leverages Alchemy's hardened node infrastructure, guaranteeing best-in-c
1212
1313
The SDK currently supports the following chains (chains with '(d)' after are deprecated):
1414

15-
- **Ethereum**: Mainnet, Goerli (d), Sepolia, Holesky
15+
- **Ethereum**: Mainnet, Goerli (d), Sepolia, Holesky, Hoodi
1616
- **Polygon**: Mainnet, Mumbai (d), Amoy
1717
- **Optimism**: Mainnet, Goerli (d), Sepolia
1818
- **Arbitrum**: Mainnet, Goerli (d), Sepolia
@@ -31,10 +31,10 @@ The SDK currently supports the following chains (chains with '(d)' after are dep
3131
- **Gnosis**: Mainnet, Chiado
3232
- **BNB**: Mainnet, Testnet
3333
- **Avalanche**: Mainnet, Fuji
34-
- **Celo**: Mainnet, Alfajores
34+
- **Celo**: Mainnet, Alfajores, Baklava
3535
- **Metis**: Mainnet
3636
- **OpBNB**: Mainnet, Testnet
37-
- **Berachain**: Mainnet, Bartio
37+
- **Berachain**: Mainnet, Bartio, Bepolia
3838
- **Soneium**: Mainnet, Minato
3939
- **Worldchain**: Mainnet, Sepolia
4040
- **Rootstock**: Mainnet, Testnet
@@ -44,7 +44,7 @@ The SDK currently supports the following chains (chains with '(d)' after are dep
4444
- **Polynomial**: Mainnet, Sepolia
4545
- **Crossfi**: Mainnet, Testnet
4646
- **Apechain**: Mainnet, Curtis
47-
- **Lens**: Sepolia
47+
- **Lens**: Mainnet, Sepolia
4848
- **Geist**: Mainnet, Polter
4949
- **Lumia**: Prism, Testnet
5050
- **Unichain**: Mainnet, Sepolia
@@ -56,8 +56,13 @@ The SDK currently supports the following chains (chains with '(d)' after are dep
5656
- **Sei**: Mainnet, Testnet
5757
- **Ronin**: Mainnet, Saigon
5858
- **Monad**: Testnet
59-
- **Settlus**: Testnet (Sepolia)
60-
59+
- **Settlus**: Mainnet, Testnet (Sepolia)
60+
- **Gensyn**: Testnet
61+
- **Superseed**: Mainnet, Sepolia
62+
- **Tea**: Sepolia
63+
- **Anime**: Mainnet, Sepolia
64+
- **Story**: Mainnet, Aeneid
65+
- **Megaeth**: Testnet
6166

6267
You can find per-method documentation of the Alchemy SDK endpoints at the [Alchemy Docs linked in the sidebar](https://docs.alchemy.com/reference/alchemy-sdk-quickstart).
6368

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "alchemy-sdk",
3-
"version": "3.5.6",
3+
"version": "3.5.9",
44
"description": "Extended Ethers.js SDK for Alchemy APIs",
55
"author": "Alchemy",
66
"license": "MIT",
@@ -67,6 +67,7 @@
6767
"@ethersproject/units": "^5.7.0",
6868
"@ethersproject/wallet": "^5.7.0",
6969
"@ethersproject/web": "^5.7.0",
70+
"@solana/web3.js": "^1.87.6",
7071
"axios": "^1.7.4",
7172
"sturdy-websocket": "^0.2.1",
7273
"websocket": "^1.0.34"

src/api/alchemy-provider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ export class AlchemyProvider
8181
// ethers. This allows the parent super constructor in JsonRpcProvider to
8282
// correctly set the network.
8383
const ethersNetwork = EthersNetwork[alchemyNetwork];
84+
if (!ethersNetwork) {
85+
throw new Error(`Unsupported network: ${alchemyNetwork}`);
86+
}
8487
super(connection, ethersNetwork);
8588

8689
this.apiKey = config.apiKey;

src/api/alchemy-websocket-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class AlchemyWebSocketProvider
123123
// ethers. This allows the parent super constructor in JsonRpcProvider to
124124
// correctly set the network.
125125
const ethersNetwork = EthersNetwork[alchemyNetwork];
126-
super(ws as any, ethersNetwork);
126+
super(ws as any, ethersNetwork ?? undefined);
127127
this.apiKey = apiKey;
128128

129129
// Start heartbeat and backfiller for the websocket connection.

src/api/notify-namespace.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ export class NotifyNamespace {
498498
network = params.network
499499
? NETWORK_TO_WEBHOOK_NETWORK.get(params.network)
500500
: network;
501+
501502
addresses = await this.resolveAddresses(params.addresses);
502503
} else if (type == WebhookType.GRAPHQL) {
503504
if (
@@ -519,6 +520,7 @@ export class NotifyNamespace {
519520
webhook_type: type,
520521
webhook_url: url,
521522
...(appId && { app_id: appId }),
523+
...(params.name && { name: params.name }),
522524

523525
// Only include the filters/addresses in the final response if they're defined
524526
...nftFilterObj,
@@ -667,7 +669,9 @@ function parseRawWebhook(rawWebhook: RawWebhook): Webhook {
667669
signingKey: rawWebhook.signing_key,
668670
version: rawWebhook.version as WebhookVersion,
669671
// Only include the appId in the final response if it's defined
670-
...(rawWebhook.app_id !== undefined && { appId: rawWebhook.app_id })
672+
...(rawWebhook.app_id !== undefined && { appId: rawWebhook.app_id }),
673+
// Only include the name in the final response if it's defined
674+
...(rawWebhook.name !== undefined && { name: rawWebhook.name })
671675
};
672676
}
673677

src/internal/prices-api.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import { AlchemyApiType } from '../util/const';
1313
import { nullsToUndefined } from '../util/util';
1414
import { requestHttpWithBackoff } from './dispatch';
1515

16-
const PRICES_BASE_URL = 'https://api.g.alchemy.com/prices/v1/alch-demo';
17-
1816
export async function getTokenPriceByAddress(
1917
config: AlchemyConfig,
2018
addresses: TokenAddressRequest[],
@@ -31,8 +29,7 @@ export async function getTokenPriceByAddress(
3129
{},
3230
{
3331
method: 'POST',
34-
data: { addresses },
35-
baseURL: PRICES_BASE_URL
32+
data: { addresses }
3633
}
3734
);
3835
return nullsToUndefined<GetTokenPriceByAddressResponse>(response);
@@ -97,8 +94,7 @@ export async function getHistoricalPriceBySymbol(
9794
startTime,
9895
endTime,
9996
interval
100-
},
101-
baseURL: PRICES_BASE_URL
97+
}
10298
}
10399
);
104100
return nullsToUndefined<HistoricalPriceBySymbolResponse>(response);
@@ -130,8 +126,7 @@ export async function getHistoricalPriceByAddress(
130126
startTime,
131127
endTime,
132128
interval
133-
},
134-
baseURL: PRICES_BASE_URL
129+
}
135130
}
136131
);
137132
return nullsToUndefined<HistoricalPriceByAddressResponse>(response);

src/internal/raw-interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export interface RawWebhook {
255255
signing_key: string;
256256
version: string;
257257
app_id?: string;
258+
name?: string;
258259
}
259260

260261
export interface RawWebhookPagination {

src/types/nft-types.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export interface NftMetadata extends Record<string, any> {
3131

3232
/** URL to the NFT asset image. */
3333
image?: string;
34-
3534
/**
3635
* The image URL that appears along the top of the NFT asset page. This tends
3736
* to be the highest resolution image.
@@ -1264,6 +1263,17 @@ export interface Nft {
12641263
description?: string;
12651264
/** Media URLs and information for the NFT */
12661265
image: NftImage;
1266+
/** Animation information for the NFT. */
1267+
animation?: {
1268+
/** URL of the animation stored in Alchemy's cache. */
1269+
cachedUrl?: string;
1270+
/** The original URL of the animation as stored on the contract. */
1271+
originalUrl?: string;
1272+
/** The type of the animation media. */
1273+
contentType?: string;
1274+
/** The size of the animation in bytes. */
1275+
size?: number;
1276+
};
12671277
/** The raw metadata for the NFT based on the metadata URI on the NFT contract. */
12681278
raw: NftRawMetadata;
12691279
/** URIs for accessing the NFT's metadata blob. */

0 commit comments

Comments
 (0)