@@ -60,7 +60,7 @@ export const abi = [
6060
6161
6262
63- let globalAddresses = { } ;
63+ let globalAddresses : Record < number , any > = { } ;
6464
6565for ( let chain of eulerChains ) {
6666 globalAddresses [ chain . chainId ] = {
@@ -84,13 +84,14 @@ export const eVaultFunctionNames = extractFunctionNames(abiEVault);
8484export const eulerRouterFunctionNames = extractFunctionNames ( abiEulerRouter ) ;
8585
8686
87- export let supportedChains = { } ;
88- export let supportedChainList = [ ] ;
87+ export let supportedChains : Record < number , any > = { } ;
88+ export let supportedChainList : any [ ] = [ ] ;
8989
9090for ( let config of eulerChains ) {
91- let chain = viemChains [ config . viemName || config . name ] ;
91+ let chain = Object . values ( viemChains ) . find ( chain => chain . id === config . chainId ) ;
92+
9293 if ( config . status === 'testing' ) continue ;
93- if ( ! chain ) throw Error ( `no viem entry found for chain ${ config . name } ` ) ;
94+ if ( ! chain ) throw Error ( `no viem entry found for chain ${ config . name } (chainId: ${ config . chainId } ) ` ) ;
9495
9596 let client = createPublicClient ( {
9697 chain,
@@ -99,7 +100,7 @@ for (let config of eulerChains) {
99100
100101 supportedChains [ config . chainId ] = {
101102 id : config . chainId ,
102- explorerUrl : chain . blockExplorers . default . url ,
103+ explorerUrl : chain . blockExplorers ? .default ? .url || '' ,
103104 client,
104105 config,
105106 } ;
@@ -111,7 +112,7 @@ for (let config of eulerChains) {
111112function loadDeploymentAddresses (
112113 chainId : number
113114) : AddressMetadataMap < AddressMetadata > {
114- let output = { } ;
115+ let output : Record < string , AddressMetadata > = { } ;
115116
116117 let chain = supportedChains [ chainId ] ;
117118 if ( ! chain ) throw Error ( `unable to load deployment addrs for chain ${ chainId } ` ) ;
0 commit comments