UNPKG

soulswap-rubik-sdk

Version:
43 lines (42 loc) 1.92 kB
import { InstantTrade } from '@features/instant-trades/instant-trade'; import { TradeType } from 'src/features/instant-trades/models/trade-type'; import { TransactionReceipt } from 'web3-eth'; import { SwapTransactionOptions } from '@features/instant-trades/models/swap-transaction-options'; import { PriceTokenAmount } from '@core/blockchain/tokens/price-token-amount'; import { GasFeeInfo } from '@features/instant-trades/models/gas-fee-info'; import { Token } from '@core/blockchain/tokens/token'; import { TransactionConfig } from 'web3-core'; import { EncodeFromAddressTransactionOptions } from '@features/instant-trades/models/encode-transaction-options'; declare type OneinchTradeStruct = { contractAddress: string; from: PriceTokenAmount; to: PriceTokenAmount; slippageTolerance: number; disableMultihops: boolean; path: ReadonlyArray<Token>; gasFeeInfo?: GasFeeInfo | null; }; export declare class OneinchTrade extends InstantTrade { private static readonly oneInchTradeTypes; static checkIfNeedApproveAndThrowError(from: PriceTokenAmount): Promise<void | never>; private readonly httpClient; protected readonly contractAddress: string; readonly from: PriceTokenAmount; readonly to: PriceTokenAmount; private readonly nativeSupportedFrom; readonly nativeSupportedTo: PriceTokenAmount; gasFeeInfo: GasFeeInfo | null; slippageTolerance: number; private readonly disableMultihops; readonly path: ReadonlyArray<Token>; get type(): TradeType; private get apiBaseUrl(); constructor(oneinchTradeStruct: OneinchTradeStruct); needApprove(): Promise<boolean>; swap(options?: SwapTransactionOptions): Promise<TransactionReceipt>; encode(options: EncodeFromAddressTransactionOptions): Promise<TransactionConfig>; private getTradeData; private getGasParamsFromApiTradeData; private specifyError; } export {};