@@ -16,6 +16,7 @@ import {
1616 VerifiersConfig ,
1717 Verifier ,
1818 VerifierType ,
19+ PoolType ,
1920} from "./types.ts"
2021import { determineTokenMechanism } from "./utils.ts"
2122import { ExplorerInfo , SupportedChain , ChainType } from "@config/types.ts"
@@ -318,8 +319,9 @@ export const getTokenMechanism = (params: {
318319 const tokenConfig = tokensReferenceData [ params . token ]
319320 const sourceChainPoolInfo = tokenConfig [ sourceChainRdd ]
320321 const destinationChainPoolInfo = tokenConfig [ destinationChainRdd ]
321- const sourceChainPoolType = sourceChainPoolInfo . pool . type
322- const destinationChainPoolType = destinationChainPoolInfo . pool . type
322+ const sourceChainPoolType = ( sourceChainPoolInfo . pool ?. type || sourceChainPoolInfo . poolType ) as PoolType
323+ const destinationChainPoolType = ( destinationChainPoolInfo . pool ?. type ||
324+ destinationChainPoolInfo . poolType ) as PoolType
323325 const tokenMechanism = determineTokenMechanism ( sourceChainPoolType , destinationChainPoolType )
324326 return tokenMechanism
325327}
@@ -594,7 +596,13 @@ export const getChainsOfToken = ({ token, filter }: { token: string; filter: Env
594596 } ) ( )
595597
596598 // Get all valid chains for the given token
597- return Object . entries ( tokensData [ token ] )
599+ const tokenData = tokensData [ token ]
600+ if ( ! tokenData ) {
601+ console . warn ( `No token data found for ${ token } in ${ filter } environment` )
602+ return [ ]
603+ }
604+
605+ return Object . entries ( tokenData )
598606 . filter ( ( [ , tokenData ] ) => tokenData . pool && tokenData . pool . type !== "feeTokenOnly" )
599607 . filter ( ( [ chain ] ) => {
600608 const lanes = getAllTokenLanes ( { token, environment : filter } )
@@ -619,6 +627,11 @@ export const getAllNetworkLanes = async ({
619627
620628 const allLanes = lanesReferenceData [ chain ]
621629
630+ // Handle chains with no outbound lanes (e.g., newly added chains)
631+ if ( ! allLanes ) {
632+ return [ ]
633+ }
634+
622635 const lanesData : {
623636 name : string
624637 logo : string
0 commit comments