rubic-sdk
Version:
Simplify dApp creation
66 lines (65 loc) • 3.01 kB
TypeScript
import BigNumber from 'bignumber.js';
import { BytesLike } from 'ethers';
import { PriceTokenAmount } from "../../../../../common/tokens";
import { EvmBlockchainName } from "../../../../../core/blockchain/models/blockchain-name";
import { EvmEncodeConfig } from "../../../../../core/blockchain/web3-pure/typed-web3-pure/evm-web3-pure/models/evm-encode-config";
import { ContractParams } from "../../../../common/models/contract-params";
import { XyBuildTxRequest } from "../../../../common/providers/xy/models/xy-build-tx-request";
import { EvmCrossChainTrade } from "../common/evm-cross-chain-trade/evm-cross-chain-trade";
import { GasData } from "../common/evm-cross-chain-trade/models/gas-data";
import { BridgeType } from "../common/models/bridge-type";
import { FeeInfo } from "../common/models/fee-info";
import { GetContractParamsOptions } from "../common/models/get-contract-params-options";
import { RubicStep } from "../common/models/rubicStep";
import { TradeInfo } from "../common/models/trade-info";
import { EvmOnChainTrade } from "../../../../on-chain/calculation-manager/providers/common/on-chain-trade/evm-on-chain-trade/evm-on-chain-trade";
/**
* Calculated XY cross-chain trade.
*/
export declare class XyCrossChainTrade extends EvmCrossChainTrade {
readonly type: "xy";
readonly isAggregator = false;
readonly onChainSubtype: {
from: undefined;
to: undefined;
};
readonly bridgeType: BridgeType;
readonly from: PriceTokenAmount<EvmBlockchainName>;
readonly to: PriceTokenAmount<EvmBlockchainName>;
readonly toTokenAmountMin: BigNumber;
readonly priceImpact: number | null;
readonly gasData: GasData | null;
private readonly transactionRequest;
private get fromBlockchain();
protected get fromContractAddress(): string;
/**
* Gets gas fee in source blockchain.
*/
get estimatedGas(): BigNumber | null;
readonly feeInfo: FeeInfo;
private readonly slippage;
protected get methodName(): string;
private readonly onChainTrade;
private readonly xyEstimatedGas;
constructor(crossChainTrade: {
from: PriceTokenAmount<EvmBlockchainName>;
to: PriceTokenAmount<EvmBlockchainName>;
transactionRequest: XyBuildTxRequest;
gasData: GasData | null;
priceImpact: number | null;
slippage: number;
feeInfo: FeeInfo;
onChainTrade: EvmOnChainTrade | null;
bridgeType: BridgeType;
xyEstimatedGas: BigNumber;
}, providerAddress: string, routePath: RubicStep[], useProxy: boolean);
getContractParams(options: GetContractParamsOptions): Promise<ContractParams>;
getTradeAmountRatio(fromUsd: BigNumber): BigNumber;
protected getTransactionConfigAndAmount(receiverAddress?: string): Promise<{
config: EvmEncodeConfig;
amount: string;
}>;
private getResponseFromApiToTransactionRequest;
getTradeInfo(): TradeInfo;
protected getProviderData(_sourceData: BytesLike): unknown[];
}