hermes-v2-sdk
Version:
⚒️ An SDK for building applications on top of Hermes V2
44 lines (43 loc) • 2.2 kB
TypeScript
import { BigintIsh, CurrencyAmount, NativeToken, Price } from 'maia-core-sdk';
export declare const computePairAddress: ({ factoryAddress, tokenA, tokenB, }: {
factoryAddress: string;
tokenA: NativeToken;
tokenB: NativeToken;
}) => string;
export declare class Pair {
readonly liquidityToken: NativeToken;
private readonly tokenAmounts;
static getAddress(tokenA: NativeToken, tokenB: NativeToken): string;
constructor(currencyAmountA: CurrencyAmount<NativeToken>, tokenAmountB: CurrencyAmount<NativeToken>);
/**
* Returns true if the token is either token0 or token1
* @param token to check
*/
involvesToken(token: NativeToken): boolean;
/**
* Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0
*/
get token0Price(): Price<NativeToken, NativeToken>;
/**
* Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1
*/
get token1Price(): Price<NativeToken, NativeToken>;
/**
* Return the price of the given token in terms of the other token in the pair.
* @param token token to return price of
*/
priceOf(token: NativeToken): Price<NativeToken, NativeToken>;
/**
* Returns the chain ID of the tokens in the pair.
*/
get chainId(): number;
get token0(): NativeToken;
get token1(): NativeToken;
get reserve0(): CurrencyAmount<NativeToken>;
get reserve1(): CurrencyAmount<NativeToken>;
reserveOf(token: NativeToken): CurrencyAmount<NativeToken>;
getOutputAmount(inputAmount: CurrencyAmount<NativeToken>): [CurrencyAmount<NativeToken>, Pair];
getInputAmount(outputAmount: CurrencyAmount<NativeToken>): [CurrencyAmount<NativeToken>, Pair];
getLiquidityMinted(totalSupply: CurrencyAmount<NativeToken>, tokenAmountA: CurrencyAmount<NativeToken>, tokenAmountB: CurrencyAmount<NativeToken>): CurrencyAmount<NativeToken>;
getLiquidityValue(token: NativeToken, totalSupply: CurrencyAmount<NativeToken>, liquidity: CurrencyAmount<NativeToken>, feeOn?: boolean, kLast?: BigintIsh): CurrencyAmount<NativeToken>;
}