@flaunch/sdk
Version:
Flaunch SDK to easily interact with the Flaunch protocol
76 lines • 4.12 kB
TypeScript
import { type ReadContract, type Address, type Drift, type HexString } from "@delvtech/drift";
import { QuoterAbi } from "../abi/Quoter";
import { PoolWithHookData } from "types";
export type QuoterABI = typeof QuoterAbi;
/**
* Client for interacting with the Quoter contract to get price quotes for swaps
* Provides methods to simulate trades and get expected output amounts
*/
export declare class ReadQuoter {
chainId: number;
readonly contract: ReadContract<QuoterABI>;
/**
* Creates a new ReadQuoter instance
* @param chainId - The chain ID where the Quoter contract is deployed
* @param address - The address of the Quoter contract
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
* @throws Error if address is not provided
*/
constructor(chainId: number, address: Address, drift?: Drift);
/**
* Gets a quote for selling an exact amount of tokens for ETH or outputToken
* @param coinAddress - The address of the token to sell
* @param amountIn - The exact amount of tokens to sell
* @param positionManagerAddress - The address of the position manager to use
* @param intermediatePoolKey - Optional intermediate pool key to use containing outputToken and ETH as currencies
* @returns Promise<bigint> - The expected amount of ETH to receive
*/
getSellQuoteExactInput({ coinAddress, amountIn, positionManagerAddress, intermediatePoolKey, }: {
coinAddress: Address;
amountIn: bigint;
positionManagerAddress: Address;
intermediatePoolKey?: PoolWithHookData;
}): Promise<bigint>;
/**
* Gets a quote for buying tokens with an exact amount of ETH or inputToken
* @param coinAddress - The address of the token to buy
* @param amountIn - The exact amount of ETH or inputToken to spend
* @param positionManagerAddress - The address of the position manager to use
* @param intermediatePoolKey - Optional intermediate pool key to use containing inputToken and ETH as currencies
* @param hookData - Optional hook data to use for the fleth <> coin swap. Only used when TrustedSigner is currently enabled
* @param userWallet - Optional user wallet to use for the swap. Only used when TrustedSigner is currently enabled
* @returns Promise<bigint> - The expected amount of coins to receive
*/
getBuyQuoteExactInput({ coinAddress, amountIn, positionManagerAddress, intermediatePoolKey, hookData, userWallet, }: {
coinAddress: Address;
amountIn: bigint;
positionManagerAddress: Address;
intermediatePoolKey?: PoolWithHookData;
hookData?: HexString;
userWallet?: Address;
}): Promise<bigint>;
/**
* Gets a quote for buying an exact amount of tokens with ETH or inputToken
* @param coinAddress - The address of the token to buy
* @param coinOut - The exact amount of tokens to receive
* @param positionManagerAddress - The address of the position manager to use
* @param intermediatePoolKey - Optional intermediate pool key to use containing inputToken and ETH as currencies
* @param hookData - Optional hook data to use for the fleth <> coin swap. Only used when TrustedSigner is currently enabled
* @param userWallet - Optional user wallet to use for the swap. Only used when TrustedSigner is currently enabled
* @returns Promise<bigint> - The required amount of ETH or inputToken to spend
*/
getBuyQuoteExactOutput({ coinAddress, coinOut, positionManagerAddress, intermediatePoolKey, hookData, userWallet, }: {
coinAddress: Address;
coinOut: bigint;
positionManagerAddress: Address;
intermediatePoolKey?: PoolWithHookData;
hookData?: HexString;
userWallet?: Address;
}): Promise<bigint>;
/**
* Gets the current ETH/USDC price from the pool
* @returns Promise<number> - The price of 1 ETH in USDC, formatted with 2 decimal places
*/
getETHUSDCPrice(): Promise<number>;
}
//# sourceMappingURL=QuoterClient.d.ts.map