hector-rubic-sdk
Version:
Simplify dApp creation
46 lines (45 loc) • 1.95 kB
TypeScript
import { InstantTrade } from '../../../instant-trade';
import { TradeType } from '../../../models/trade-type';
import { TransactionReceipt } from 'web3-eth';
import { SwapTransactionOptions } from '../../../models/swap-transaction-options';
import { PriceTokenAmount } from '../../../../../core/blockchain/tokens/price-token-amount';
import { GasFeeInfo } from '../../../models/gas-fee-info';
import { Token } from '../../../../../core/blockchain/tokens/token';
import { TransactionConfig } from 'web3-core';
import { EncodeTransactionOptions } from '../../../models/encode-transaction-options';
declare type OneinchTradeStruct = {
contractAddress: string;
from: PriceTokenAmount;
to: PriceTokenAmount;
slippageTolerance: number;
disableMultihops: boolean;
path: ReadonlyArray<Token>;
gasFeeInfo?: GasFeeInfo | null;
data: string | null;
};
export declare class OneinchTrade extends InstantTrade {
private static readonly oneInchTradeTypes;
static checkIfNeedApproveAndThrowError(from: PriceTokenAmount): Promise<void | never>;
private readonly httpClient;
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>;
readonly wrappedPath: ReadonlyArray<Token>;
readonly transactionData: string | null;
get type(): TradeType;
private get apiBaseUrl();
constructor(oneinchTradeStruct: OneinchTradeStruct);
needApprove(): Promise<boolean>;
swap(options?: SwapTransactionOptions): Promise<TransactionReceipt>;
encode(options: EncodeTransactionOptions): Promise<TransactionConfig>;
private getTradeData;
private getGasParamsFromApiTradeData;
private specifyError;
}
export {};