Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(provider): add alchemy 'sepolia' testnet provider #3863

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src.ts/providers/provider-alchemy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import type { Networkish } from "./network.js";
const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"

function getHost(name: string): string {
switch(name) {
switch (name) {
case "mainnet":
return "eth-mainnet.alchemyapi.io";
case "goerli":
return "eth-goerli.g.alchemy.com";

case "sepolia":
return "eth-sepolia.g.alchemy.com";
case "arbitrum":
return "arb-mainnet.g.alchemy.com";
case "arbitrum-goerli":
Expand Down Expand Up @@ -80,7 +81,7 @@ export class AlchemyProvider extends JsonRpcProvider implements CommunityResourc
// https://docs.alchemy.com/reference/trace-transaction
if (req.method === "getTransactionResult") {
const { trace, tx } = await resolveProperties({
trace: this.send("trace_transaction", [ req.hash ]),
trace: this.send("trace_transaction", [req.hash]),
tx: this.getTransaction(req.hash)
});
if (trace == null || tx == null) { return null; }
Expand Down Expand Up @@ -117,7 +118,7 @@ export class AlchemyProvider extends JsonRpcProvider implements CommunityResourc
static getRequest(network: Network, apiKey?: string): FetchRequest {
if (apiKey == null) { apiKey = defaultApiKey; }

const request = new FetchRequest(`https:/\/${ getHost(network.name) }/v2/${ apiKey }`);
const request = new FetchRequest(`https:/\/${getHost(network.name)}/v2/${apiKey}`);
request.allowGzip = true;

if (apiKey === defaultApiKey) {
Expand Down