-
Notifications
You must be signed in to change notification settings - Fork 575
Open
Labels
T-feature-requestType: Adding a brand new feature (not to be confused with improving an existing feature).Type: Adding a brand new feature (not to be confused with improving an existing feature).from-communityThis originated from the community :)This originated from the community :)
Description
Problem Statement
Add default definitions of aztec vm chains to aztec.js. Similar to viem/chains. This will keep the ecosystem aligned on the chains info and make upgrades smoother(no need to update RPC urls etc)
Proposed Solution
export interface AvmChain {
id: number;
name: string;
rpcUrls: {
default: AvmChainRpcUrls;
[key: string]: AvmChainRpcUrls;
};
}
export interface AvmChainRpcUrls {
http: readonly [string, ...string[]];
}
export const avmChains = {
devnet20251212: {
id: 829903097, // bytes4(keccak256('aztec-devnet20251212'))
name: "Aztec Devnet 20251212",
rpcUrls: {
default: {
http: ["https://next.devnet.aztec-labs.com"],
},
},
},
sandbox: {
id: 147120760, // bytes4(keccak256('aztec-sandbox'))
name: "Aztec Sandbox",
rpcUrls: {
default: {
http: ["http://localhost:8080"],
},
},
},
} as const satisfies Record<string, AvmChain>;Example Use Case
import { avmChains } from '@aztec/aztec.js/chains';
// automatically pulls `.rpcUrls.default[0]`
const node = createAztecNode(avmChains.devnet20251212);
console.log(node.chain.id) // 829903097Alternative Solutions
No response
Additional Context
No response
Metadata
Metadata
Assignees
Labels
T-feature-requestType: Adding a brand new feature (not to be confused with improving an existing feature).Type: Adding a brand new feature (not to be confused with improving an existing feature).from-communityThis originated from the community :)This originated from the community :)