soulswap-rubik-sdk
Version:
Simplify dApp creation
34 lines (33 loc) • 1.49 kB
TypeScript
import { InstantTrade } from '@features/instant-trades/instant-trade';
import { SwapTransactionOptions } from '@features/instant-trades/models/swap-transaction-options';
import { TradeType } from 'src/features';
import { TransactionReceipt } from 'web3-eth';
import { ZrxQuoteResponse } from '@features/instant-trades/dexes/common/zrx-common/models/zrx-types';
import { PriceTokenAmount } from '@core/blockchain/tokens/price-token-amount';
import { GasFeeInfo } from '@features/instant-trades/models/gas-fee-info';
import { EncodeTransactionOptions } from '@features/instant-trades/models/encode-transaction-options';
import { TransactionConfig } from 'web3-core';
interface ZrxTradeStruct {
from: PriceTokenAmount;
to: PriceTokenAmount;
slippageTolerance: number;
apiTradeData: ZrxQuoteResponse;
gasFeeInfo?: GasFeeInfo;
}
export declare class ZrxTrade extends InstantTrade {
readonly from: PriceTokenAmount;
readonly to: PriceTokenAmount;
/**
* In Zrx you can't change slippage after calculation is done.
*/
readonly slippageTolerance: number;
gasFeeInfo: GasFeeInfo | null;
private readonly apiTradeData;
protected readonly contractAddress: string;
get type(): TradeType;
constructor(tradeStruct: ZrxTradeStruct);
swap(options?: SwapTransactionOptions): Promise<TransactionReceipt>;
encode(options?: EncodeTransactionOptions): Promise<TransactionConfig>;
private getGasParamsFromApiTradeData;
}
export {};