PoolGraph: {
    getPath: ((startMint, endMint, options?) => Path[]);
    getAllPaths(options?): PathSearchEntries;
    getPathsForPairs(searchTokenPairs, options?): PathSearchEntries;
}

A type representing an undirected graph of pools that can be used to find paths between two tokens. In this graph, nodes are token mints, and edges are pools

Type declaration

  • getPath: ((startMint, endMint, options?) => Path[])

    Get a list of paths between two tokens for this pool graph.

    Notes:

    • Only support paths with up to 2 edges
    • Paths searching between two identical token mints are not supported.

    Param: startMint

    The token the path starts from

    Param: endMint

    The token the path ends in

    Param: options

    Options for finding a path

    Returns

    A list of path between the two tokens. If no path are found, it will be an empty array.

      • (startMint, endMint, options?): Path[]
      • Get a list of paths between two tokens for this pool graph.

        Notes:

        • Only support paths with up to 2 edges
        • Paths searching between two identical token mints are not supported.

        Parameters

        • startMint: Address

          The token the path starts from

        • endMint: Address

          The token the path ends in

        • Optional options: PathSearchOptions

          Options for finding a path

        Returns Path[]

        A list of path between the two tokens. If no path are found, it will be an empty array.

  • getAllPaths:function
  • getPathsForPairs:function
    • Get a map of paths from a list of token pairs for this pool graph.

      Notes:

      • Only support paths with up to 2 edges
      • Paths searching between two identical token mints are not supported.

      Parameters

      • searchTokenPairs: [Address, Address][]

        A list of token pairs to find paths for. The first token in the pair is the start token, and the second token is the end token.

      • Optional options: PathSearchOptions

        Options for finding a path

      Returns PathSearchEntries

      An array of search result entires in the same order as the searchTokenPairs.

Generated using TypeDoc