Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 18 additions & 3 deletions packages/agent-sdk/src/evm/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,34 @@ const ALCHEMY_RPC_ENDPOINTS: Record<number, string> = {
1: "https://eth-mainnet.g.alchemy.com/v2",
10: "https://opt-mainnet.g.alchemy.com/v2",
56: "https://bsc-mainnet.g.alchemy.com/v2",
100: "https://gnosis-mainnet.g.alchemy.com/v2",
130: "https://unichain-mainnet.g.alchemy.com/v2",
137: "https://polygon-mainnet.g.alchemy.com/v2",
146: "https://sonic-mainnet.g.alchemy.com/v2",
232: "https://lens-mainnet.g.alchemy.com/v2",
250: "https://fantom-mainnet.g.alchemy.com/v2",
252: "https://frax-mainnet.g.alchemy.com/v2",
592: "https://astar-mainnet.g.alchemy.com/v2",
1868: "https://soneium-mainnet.g.alchemy.com/v2",
8453: "https://base-mainnet.g.alchemy.com/v2",
42161: "https://arb-mainnet.g.alchemy.com/v2",
42220: "https://celo-mainnet.g.alchemy.com/v2",
43114: "https://avax-mainnet.g.alchemy.com/v2",
59144: "https://linea-mainnet.g.alchemy.com/v2",
80094: "https://berachain-mainnet.g.alchemy.com/v2",
81457: "https://blast-mainnet.g.alchemy.com/v2",
7777777: "https://zora-mainnet.g.alchemy.com/v2",
// Testnets
10200: "https://gnosis-chiado.g.alchemy.com/v2/",
84532: "https://base-sepolia.g.alchemy.com/v2/",
11155111: "https://eth-sepolia.g.alchemy.com/v2/",
11155420: "https://opt-sepolia.g.alchemy.com/v2/",
};

export const getAlchemyClient = (
export function getAlchemyClient(
chainId: number,
alchemyKey: string,
): PublicClient | undefined => {
): PublicClient | undefined {
const alchemyRpcBase = ALCHEMY_RPC_ENDPOINTS[chainId];
if (alchemyRpcBase) {
return createPublicClient({
Expand All @@ -57,4 +72,4 @@ export const getAlchemyClient = (
});
}
console.warn("No Alchemy Base URL available");
};
}
1 change: 1 addition & 0 deletions packages/agent-sdk/src/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export * from "./weth";
export * from "./tokens";
export * from "./safe";
export * from "./chain";
export * from "./client";

export function hexifyValue(value: string): Hex {
if (isHex(value)) {
Expand Down