UNPKG

hermes-swap-router-sdk

Version:

An sdk for routing swaps using Uniswap v2, Uniswap v3 and Balancer Stable Pools.

25 lines (24 loc) 1.05 kB
import { Currency, NativeToken } from 'maia-core-sdk'; import { MixedRouteSDK, TPool } from '../entities/mixedRoute/route'; export declare enum EncodingType { V2 = "V2", V3 = "V3", BAL_STABLE = "BAL", VAULT = "ERC4626" } export declare const getTypeGroup: (pool: TPool) => EncodingType; /** * Utility function to return each consecutive section of various types of pools in a MixedRoute * @param route * @returns a nested array of various types of pools in the order of the route */ export declare const partitionMixedRouteByProtocol: (route: MixedRouteSDK<Currency, Currency>) => TPool[][]; export declare function partitionPoolsByProtocol(pools: TPool[]): TPool[][]; /** * Simple utility function to get the output of an array of Pools * @param pools * @param firstInputToken * @returns the output token of the last pool in the array */ export declare const getOutputOfPools: (pools: TPool[], firstInputToken: NativeToken) => NativeToken; export { UNIVERSAL_ROUTER_ADDRESS } from './constants';