see https export type ChannelMode = 'Open' | 'Challenge' | 'Finalized' ; see https param finalizesAt param now export function getChannelMode ( finalizesAt , now ) { if ( finalizesAt == 0 ) { return 'Open' ; } else if ( finalizesAt <= now ) { return 'Finalized' ; } else { return 'Challenge' ; } }