File tree Expand file tree Collapse file tree 5 files changed +37
-3
lines changed
Expand file tree Collapse file tree 5 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 1+ import { defineChain } from "viem" ;
2+
3+ export const avalancheLocal = /*#__PURE__*/ defineChain ( {
4+ id : 43_112 ,
5+ name : "Avalanche Local" ,
6+ nativeCurrency : {
7+ decimals : 18 ,
8+ name : "Avalanche" ,
9+ symbol : "AVAX" ,
10+ } ,
11+ rpcUrls : {
12+ default : { http : [ "http://127.0.0.1:9650/ext/bc/C/rpc" ] } ,
13+ } ,
14+ testnet : true ,
15+ } ) ;
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ export type {
174174} from "viem/chains" ;
175175export { avalanche } from "./avalanche.js" ;
176176export { avalancheFuji } from "./avalancheFuji.js" ;
177+ export { avalancheLocal } from "./avalancheLocal.js" ;
177178/** @deprecated Use `sonicTestnet` instead. */
178179export {
179180 fantomSonicTestnet ,
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ export function createAvalancheClient<
120120 } ) ;
121121 const extendedClient = client . extend ( avalanchePublicActions ) as any ;
122122
123- if ( chainConfig ?. id !== 43_113 && chainConfig ?. id !== 43_114 ) {
123+ if ( chainConfig ?. id !== 43_112 && chainConfig ?. id !== 43_113 && chainConfig ?. id !== 43_114 ) {
124124 return {
125125 ...extendedClient ,
126126 } ;
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ function getClientURL(
9494 clientType : ClientType = "public" ,
9595 transportType : "http" | "webSocket" = "http"
9696) : string | undefined {
97- if ( chain ?. id !== 43_113 && chain ?. id !== 43_114 ) {
97+ if ( chain ?. id !== 43_112 && chain ?. id !== 43_113 && chain ?. id !== 43_114 ) {
9898 return url ?? chain ?. rpcUrls . default [ transportType ] ?. [ 0 ] ;
9999 }
100100
Original file line number Diff line number Diff line change 1+ // Chain IDs for easy reference
2+ export const AVALANCHE_CHAIN_IDS = {
3+ MAINNET : 43114 ,
4+ FUJI : 43113 ,
5+ LOCAL : 43112 ,
6+ } as const ;
7+
8+ // Network IDs (different from chain IDs)
9+ export const AVALANCHE_NETWORK_IDS = {
10+ MAINNET : 1 ,
11+ FUJI : 5 ,
12+ LOCAL : 1337 ,
13+ } as const ;
14+
115export const P_CHAIN_MAINNET_ID = '11111111111111111111111111111111LpoYY' ;
216export const P_CHAIN_FUJI_ID = '11111111111111111111111111111111LpoYY' ;
17+ export const P_CHAIN_LOCAL_ID = '11111111111111111111111111111111LpoYY' ;
318export const P_CHAIN_ALIAS = 'P' ;
419
520export const X_CHAIN_MAINNET_ID = '2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM' ;
621export const X_CHAIN_FUJI_ID = '2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm' ;
22+ export const X_CHAIN_LOCAL_ID = '2eNy1mUFdmaxXNj1eQHUe7Np4gju9sJsEtWQ4MX3ToiNKuADed' ;
723export const X_CHAIN_ALIAS = 'X' ;
824
925export const C_CHAIN_MAINNET_ID = '2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5' ;
1026export const C_CHAIN_FUJI_ID = 'yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp' ;
27+ export const C_CHAIN_LOCAL_ID = '2CA6j5zYzasynPsFeNoqWkmTCt3VScMvXUZHbfDJ8k3oGzAPtU' ;
1128export const C_CHAIN_ALIAS = 'C' ;
1229
1330export const MAINNET_NETWORK_ID = 1 ;
14- export const TESTNET_NETWORK_ID = 5 ;
31+ export const TESTNET_NETWORK_ID = 5 ;
32+ export const LOCAL_NETWORK_ID = 1337 ;
You can’t perform that action at this time.
0 commit comments