hermes-v2-sdk
Version:
⚒️ An SDK for building applications on top of Hermes V2
46 lines (45 loc) • 2.78 kB
TypeScript
import { CurrencyAmount, NativeToken, Price } from 'maia-core-sdk';
import { ComposableStablePool as BalancerPool } from './balancerPools/composableStable';
import { PhantomStablePoolToken } from './balancerPools/phantomStablePool';
export declare class BalancerComposableStablePool extends BalancerPool {
constructor(id: string, address: string, amp: string, swapFee: string, totalShares: string, tokens: PhantomStablePoolToken[], tokensList: string[]);
involvesToken(token: NativeToken): boolean;
/**
* Return the price of the given token in terms of another token in the pool.
* @param inputToken token to return price of
* @param outputToken token to return price in terms of
* @returns price of the given token in terms of another token in the pool
* @throws if token is not in the pool
* @throws if otherToken is not in the pool
* @throws if token and otherToken are the same
*/
priceOf(inputToken: NativeToken, outputToken: NativeToken): Price<NativeToken, NativeToken>;
/**
* Returns the chain ID of the tokens in the pair.
*/
get chainId(): number;
/**
* Given an input amount of a token, return the computed output amount, and a pool with state updated after the trade
* @param inputAmount The input amount for which to quote the output amount
* @param outputToken The token to which the output amount should correspond (defaults to BPT if not specified)
* @returns The output amount and the pool with updated state
* @throws if token is not in the pool
* @throws if outputToken is not in the pool
* @throws if token and outputToken are the same
*/
getOutputAmount(inputAmount: CurrencyAmount<NativeToken>, outputToken?: NativeToken): Promise<[CurrencyAmount<NativeToken>, BalancerComposableStablePool]>;
/**
* Given an output amount of a token, return the computed input amount, and a pool with state updated after the trade
* @param outputAmount The output amount for which to quote the input amount
* @param inputToken The token from which the input amount should correspond (defaults to BPT if not specified)
* @returns The input amount and the pool with updated state
* @throws if token is not in the pool
* @throws if inputToken is not in the pool
* @throws if token and inputToken are the same
*/
getInputAmount(outputAmount: CurrencyAmount<NativeToken>, inputToken?: NativeToken): Promise<[CurrencyAmount<NativeToken>, BalancerComposableStablePool]>;
static clonePool(poolInstance: BalancerComposableStablePool): BalancerComposableStablePool;
clonePool(): BalancerComposableStablePool;
private _checkInput;
private updateNewPool;
}