@@ -252,26 +252,26 @@ export class LaneDataService {
252252 filters : LaneFilterType
253253 ) : boolean {
254254 // Check source chain filters
255- if ( filters . sourceChainId && ! this . matchesChainFilter ( sourceChain , filters . sourceChainId , "chainId " ) ) {
255+ if ( filters . sourceChainId && ! this . matchesChainFilter ( sourceChain , filters . sourceChainId , "chain_id " ) ) {
256256 return false
257257 }
258258 if ( filters . sourceSelector && ! this . matchesChainFilter ( sourceChain , filters . sourceSelector , "selector" ) ) {
259259 return false
260260 }
261- if ( filters . sourceInternalId && ! this . matchesChainFilter ( sourceChain , filters . sourceInternalId , "internalId " ) ) {
261+ if ( filters . sourceInternalId && ! this . matchesChainFilter ( sourceChain , filters . sourceInternalId , "internal_id " ) ) {
262262 return false
263263 }
264264
265265 // Check destination chain filters
266- if ( filters . destinationChainId && ! this . matchesChainFilter ( destChain , filters . destinationChainId , "chainId " ) ) {
266+ if ( filters . destinationChainId && ! this . matchesChainFilter ( destChain , filters . destinationChainId , "chain_id " ) ) {
267267 return false
268268 }
269269 if ( filters . destinationSelector && ! this . matchesChainFilter ( destChain , filters . destinationSelector , "selector" ) ) {
270270 return false
271271 }
272272 if (
273273 filters . destinationInternalId &&
274- ! this . matchesChainFilter ( destChain , filters . destinationInternalId , "internalId " )
274+ ! this . matchesChainFilter ( destChain , filters . destinationInternalId , "internal_id " )
275275 ) {
276276 return false
277277 }
@@ -285,14 +285,21 @@ export class LaneDataService {
285285 private matchesChainFilter (
286286 chain : ChainInfoInternal ,
287287 filterValue : string ,
288- filterType : "chainId " | "selector" | "internalId "
288+ filterType : "chain_id " | "selector" | "internal_id "
289289 ) : boolean {
290290 const filterValues = filterValue . split ( "," ) . map ( ( v ) => v . trim ( ) )
291- const chainValue = chain [ filterType ] . toString ( )
291+ // Map snake_case filter types to camelCase property names
292+ const propertyMap : Record < string , keyof ChainInfoInternal > = {
293+ chain_id : "chainId" ,
294+ selector : "selector" ,
295+ internal_id : "internalId" ,
296+ }
297+ const propertyName = propertyMap [ filterType ]
298+ const chainValue = chain [ propertyName ] . toString ( )
292299
293- // For chainId , also check generated chain key format
294- if ( filterType === "chainId " ) {
295- const generatedKey = generateChainKey ( chain . chainId , chain . chainType , "chainId " )
300+ // For chain_id , also check generated chain key format
301+ if ( filterType === "chain_id " ) {
302+ const generatedKey = generateChainKey ( chain . chainId , chain . chainType , "chain_id " )
296303 return filterValues . includes ( chainValue ) || filterValues . includes ( generatedKey )
297304 }
298305
@@ -307,15 +314,23 @@ export class LaneDataService {
307314 destChain : ChainInfoInternal ,
308315 outputKey : OutputKeyType
309316 ) : string {
317+ // Map snake_case output keys to camelCase property names
318+ const propertyMap : Record < string , keyof ChainInfoInternal > = {
319+ chain_id : "chainId" ,
320+ selector : "selector" ,
321+ internal_id : "internalId" ,
322+ }
323+ const propertyName = propertyMap [ outputKey ]
324+
310325 const sourceKey =
311- outputKey === "chainId "
326+ outputKey === "chain_id "
312327 ? generateChainKey ( sourceChain . chainId , sourceChain . chainType , outputKey )
313- : sourceChain [ outputKey ] . toString ( )
328+ : sourceChain [ propertyName ] . toString ( )
314329
315330 const destKey =
316- outputKey === "chainId "
331+ outputKey === "chain_id "
317332 ? generateChainKey ( destChain . chainId , destChain . chainType , outputKey )
318- : destChain [ outputKey ] . toString ( )
333+ : destChain [ propertyName ] . toString ( )
319334
320335 return `${ sourceKey } _to_${ destKey } `
321336 }
@@ -515,14 +530,14 @@ export class LaneDataService {
515530 inputKeyType : LaneInputKeyType ,
516531 chainsReferenceData : Record < string , ChainConfig >
517532 ) : string | null {
518- // If already an internalId , return it directly
519- if ( inputKeyType === "internalId " ) {
533+ // If already an internal_id , return it directly
534+ if ( inputKeyType === "internal_id " ) {
520535 return chainsReferenceData [ identifier ] ? identifier : null
521536 }
522537
523- // Search through chains to find matching chainId or selector
538+ // Search through chains to find matching chain_id or selector
524539 for ( const [ internalId , chainConfig ] of Object . entries ( chainsReferenceData ) ) {
525- if ( inputKeyType === "chainId " ) {
540+ if ( inputKeyType === "chain_id " ) {
526541 // Try to match by numeric chain ID
527542 try {
528543 const supportedChain = directoryToSupportedChain ( internalId )
0 commit comments