From 9caf47ecc7b9a58b8462c404710286f03c797b91 Mon Sep 17 00:00:00 2001 From: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:52:10 -0500 Subject: [PATCH] feat: support enhanced apis in alchemy provider (#221) --- .../__snapshots__/provider.test.ts.snap | 160 ++++++++++++++++++ .../alchemy/src/__tests__/provider.test.ts | 2 +- 2 files changed, 161 insertions(+), 1 deletion(-) diff --git a/packages/alchemy/src/__tests__/__snapshots__/provider.test.ts.snap b/packages/alchemy/src/__tests__/__snapshots__/provider.test.ts.snap index df915faca7..f57387a9b2 100644 --- a/packages/alchemy/src/__tests__/__snapshots__/provider.test.ts.snap +++ b/packages/alchemy/src/__tests__/__snapshots__/provider.test.ts.snap @@ -174,3 +174,163 @@ Alchemy { }, } `; + +exports[`Alchemy Provider Tests > should have called propety 1`] = ` +Alchemy { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + "core": CoreNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "debug": DebugNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "nft": NftNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "notify": NotifyNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "transact": TransactNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "ws": WebSocketNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, +} +`; + +exports[`Alchemy Provider Tests > should have enhanced api properties extended from the Alchemy SDK 1`] = ` +Alchemy { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + "core": CoreNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "debug": DebugNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "nft": NftNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "notify": NotifyNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "transact": TransactNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, + "ws": WebSocketNamespace { + "config": AlchemyConfig { + "apiKey": "test", + "authToken": undefined, + "batchRequests": false, + "maxRetries": 5, + "network": "eth-sepolia", + "requestTimeout": 0, + "url": undefined, + }, + }, +} +`; diff --git a/packages/alchemy/src/__tests__/provider.test.ts b/packages/alchemy/src/__tests__/provider.test.ts index f37e1a79fe..b2e9eb1169 100644 --- a/packages/alchemy/src/__tests__/provider.test.ts +++ b/packages/alchemy/src/__tests__/provider.test.ts @@ -8,7 +8,7 @@ import { import { Alchemy, Network } from "alchemy-sdk"; import { toHex, type Address, type Chain, type HDAccount } from "viem"; import { mnemonicToAccount } from "viem/accounts"; -import { polygonMumbai } from "viem/chains"; +import { polygonMumbai, sepolia } from "viem/chains"; import { AlchemyProvider } from "../provider.js"; describe("Alchemy Provider Tests", () => {