import type * as Chain from './Chain.js' import type * as Token from './Token.js' /** A supported funding path between two chain-scoped tokens. */ export type Route = { /** Token received on Tempo. */ destination: Token.Resolved /** Token supplied by the caller. */ source: Token.Resolved } /** Creates funding routes from destination and source chain-token selections. */ export function from(options: from.Options): Route[] { return options.sources.flatMap((source) => source.tokens.flatMap((token) => options.destination.tokens.map((destination) => ({ destination, source: token })), ), ) } export declare namespace from { /** Funding route definition. */ type Options = { /** Chain and tokens received on Tempo. */ destination: Chain.Selection /** Chains and tokens accepted as funding inputs. */ sources: readonly Chain.Selection[] } }