rubic-sdk
Version:
Simplify dApp creation
57 lines (56 loc) • 3.13 kB
TypeScript
import BigNumber from 'bignumber.js';
import { PriceTokenAmount } from "../../../../../common/tokens";
import { BlockchainName, EvmBlockchainName } from "../../../../../core/blockchain/models/blockchain-name";
import { EvmWeb3Private } from "../../../../../core/blockchain/web3-private-service/web3-private/evm-web3-private/evm-web3-private";
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 { SwapTransactionOptions } from "../../../../common/models/swap-transaction-options";
import { EvmCrossChainTrade } from '../common/evm-cross-chain-trade/evm-cross-chain-trade';
import { GasData } from '../common/evm-cross-chain-trade/models/gas-data';
import { FeeInfo } from '../common/models/fee-info';
import { GetContractParamsOptions } from '../common/models/get-contract-params-options';
import { OnChainSubtype } from '../common/models/on-chain-subtype';
import { RubicStep } from '../common/models/rubicStep';
import { TradeInfo } from '../common/models/trade-info';
import { StargateV2SupportedBlockchains } from './constants/stargate-v2-cross-chain-supported-blockchains';
import { StargateV2MessagingFee, StargateV2QuoteParamsStruct } from './modal/stargate-v2-quote-params-struct';
export declare class StargateV2CrossChainTrade extends EvmCrossChainTrade {
protected get methodName(): string;
protected get web3Private(): EvmWeb3Private;
readonly from: PriceTokenAmount<EvmBlockchainName>;
readonly to: PriceTokenAmount<BlockchainName>;
readonly feeInfo: FeeInfo;
readonly type: "stargate_v2";
readonly gasData: GasData;
readonly toTokenAmountMin: BigNumber;
readonly isAggregator = false;
readonly slippageTolerance: number;
readonly priceImpact: number | null;
readonly onChainSubtype: OnChainSubtype;
readonly bridgeType: "stargate_v2";
readonly messagingFee: StargateV2MessagingFee;
private readonly fromTokenAddress;
private readonly fromWithoutFee;
get fromBlockchain(): StargateV2SupportedBlockchains;
protected get fromContractAddress(): string;
private readonly stargateV2SendParams;
constructor(crossChainTrade: {
from: PriceTokenAmount<EvmBlockchainName>;
to: PriceTokenAmount<EvmBlockchainName>;
slippageTolerance: number;
gasData: GasData | null;
feeInfo: FeeInfo;
sendParams: StargateV2QuoteParamsStruct;
messagingFee: StargateV2MessagingFee;
priceImpact: number | null;
toTokenAmountMin: BigNumber;
}, providerAddress: string, routePath: RubicStep[], useProxy: boolean);
protected getContractParams(options: GetContractParamsOptions): Promise<ContractParams>;
protected getTransactionConfigAndAmount(_receiverAddress?: string | undefined): Promise<{
config: EvmEncodeConfig;
amount: string;
}>;
protected swapDirect(options?: SwapTransactionOptions): Promise<string>;
getTradeAmountRatio(fromUsd: BigNumber): BigNumber;
getTradeInfo(): TradeInfo;
}