UNPKG

@cowprotocol/cow-sdk

Version:

<p align="center"> <img width="400" src="https://github.com/cowprotocol/cow-sdk/raw/main/docs/images/CoW.png" /> </p>

24 lines (23 loc) 1.24 kB
import { LimitTradeParametersFromQuote, PrivateKey, TradeParameters } from './types'; import { OrderQuoteResponse, QuoteAmountsAndCosts } from '../order-book'; import { Signer } from 'ethers'; import { type ExternalProvider } from '@ethersproject/providers'; export declare function swapParamsToLimitOrderParams(params: TradeParameters, quoteResponse: OrderQuoteResponse): LimitTradeParametersFromQuote; export declare function getIsEthFlowOrder(params: { sellToken: string; }): boolean; export declare function getSigner(signer: Signer | ExternalProvider | PrivateKey): Signer; /** * Returns the gas value plus a margin for unexpected or variable gas costs (20%) * @param value the gas value to pad */ export declare function calculateGasMargin(value: bigint): bigint; export declare function mapQuoteAmountsAndCosts<T, R>(value: QuoteAmountsAndCosts<T>, mapper: (value: T) => R): QuoteAmountsAndCosts<R>; /** * Set sell token to the initial one * Because for ETH-flow orders we do quote requests with wrapped token */ export declare function getTradeParametersAfterQuote({ quoteParameters, orderParameters, }: { quoteParameters: TradeParameters; orderParameters: TradeParameters; }): TradeParameters;