export class ChainIdHelper { static readonly VersionFormatRegExp = /(.+)-([\d]+)/ ; static parse ( chainId ) { const split = chainId . split ( ChainIdHelper . VersionFormatRegExp ) . filter ( Boolean ) ; if ( split . length !== 2 ) { return { identifier : chainId , version : 0 , } ; } else { return { identifier : split [ 0 ] , version : parseInt ( split [ 1 ] ) } ; } } static hasChainVersion ( chainId ) { const version = ChainIdHelper . parse ( chainId ) ; return version . identifier !== chainId ; } }