Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RubicCrossChainTrade

Calculated Rubic cross chain trade.

Hierarchy

Index

Constructors

  • new RubicCrossChainTrade(crossChainTrade: { cryptoFeeToken: PriceTokenAmount; feeInPercents: number; feeInfo: FeeInfo; fromTrade: CrossChainContractTrade; gasData: GasData; toTrade: CrossChainContractTrade; transitFeeToken: PriceTokenAmount }, providerAddress: string): RubicCrossChainTrade

Properties

cryptoFeeToken: PriceTokenAmount

Native token in source blockchain, taken as fee.

feeInPercents: number
feeInfo: FeeInfo

Swap fee information.

Token to sell with input amount.

fromTrade: CrossChainContractTrade

Wrapped instant trade in source blockchain.

gasData: GasData

Gas fee info in source blockchain.

itType: { from: undefined | "ACRYPTOS" | "ALDRIN_EXCHANGE" | "ALGEBRA" | "ANNEX" | "APE_SWAP" | "ARTH_SWAP" | "BABY_SWAP" | "BALANCER" | "BEAM_SWAP" | "BI_SWAP" | "CREMA_FINANCE" | "CRONA_SWAP" | "CROPPER_FINANCE" | "CROW_FI" | "CRO_DEX" | "CURVE" | "DEFI_PLAZA" | "DEFI_SWAP" | "DFYN" | "DODO" | "DYSTOPIA" | "HONEY_SWAP" | "JET_SWAP" | "JOE" | "J_SWAP" | "KYBER_SWAP" | "LUA_SWAP" | "MAVERICK" | "MDEX" | "MESH_SWAP" | "MM_FINANCE" | "MOJITO_SWAP" | "ONE_INCH" | "ONE_MOON" | "ONE_SOL" | "OOLONG_SWAP" | "OPEN_OCEAN" | "ORCA_SWAP" | "OSMOSIS_SWAP" | "PANCAKE_SWAP" | "PANGOLIN" | "PARA_SWAP" | "POLYDEX" | "QUICK_SWAP" | "RAYDIUM" | "REF_FINANCE" | "SABER_STABLE_SWAP" | "SAROS_SWAP" | "SERUM" | "SHIBA_SWAP" | "SMOOTHY" | "SOLAR_BEAM" | "SPIRIT_SWAP" | "SPL_TOKEN_SWAP" | "SPOOKY_SWAP" | "STELLA_SWAP" | "SUSHI_SWAP" | "TRISOLARIS" | "UBE_SWAP" | "UNISWAP_V2" | "UNI_SWAP_V3" | "VIPER_SWAP" | "VOLTAGE_SWAP" | "VVS_FINANCE" | "WANNA_SWAP" | "WAULT_SWAP" | "WOO_FI" | "WRAPPED" | "ZAPPY" | "ZIP_SWAP" | "ZRX" | "AURORA_SWAP" | "JUPITER" | "REN_BTC"; to: undefined | "ACRYPTOS" | "ALDRIN_EXCHANGE" | "ALGEBRA" | "ANNEX" | "APE_SWAP" | "ARTH_SWAP" | "BABY_SWAP" | "BALANCER" | "BEAM_SWAP" | "BI_SWAP" | "CREMA_FINANCE" | "CRONA_SWAP" | "CROPPER_FINANCE" | "CROW_FI" | "CRO_DEX" | "CURVE" | "DEFI_PLAZA" | "DEFI_SWAP" | "DFYN" | "DODO" | "DYSTOPIA" | "HONEY_SWAP" | "JET_SWAP" | "JOE" | "J_SWAP" | "KYBER_SWAP" | "LUA_SWAP" | "MAVERICK" | "MDEX" | "MESH_SWAP" | "MM_FINANCE" | "MOJITO_SWAP" | "ONE_INCH" | "ONE_MOON" | "ONE_SOL" | "OOLONG_SWAP" | "OPEN_OCEAN" | "ORCA_SWAP" | "OSMOSIS_SWAP" | "PANCAKE_SWAP" | "PANGOLIN" | "PARA_SWAP" | "POLYDEX" | "QUICK_SWAP" | "RAYDIUM" | "REF_FINANCE" | "SABER_STABLE_SWAP" | "SAROS_SWAP" | "SERUM" | "SHIBA_SWAP" | "SMOOTHY" | "SOLAR_BEAM" | "SPIRIT_SWAP" | "SPL_TOKEN_SWAP" | "SPOOKY_SWAP" | "STELLA_SWAP" | "SUSHI_SWAP" | "TRISOLARIS" | "UBE_SWAP" | "UNISWAP_V2" | "UNI_SWAP_V3" | "VIPER_SWAP" | "VOLTAGE_SWAP" | "VVS_FINANCE" | "WANNA_SWAP" | "WAULT_SWAP" | "WOO_FI" | "WRAPPED" | "ZAPPY" | "ZIP_SWAP" | "ZRX" | "AURORA_SWAP" | "JUPITER" | "REN_BTC" }

Type declaration

  • from: undefined | "ACRYPTOS" | "ALDRIN_EXCHANGE" | "ALGEBRA" | "ANNEX" | "APE_SWAP" | "ARTH_SWAP" | "BABY_SWAP" | "BALANCER" | "BEAM_SWAP" | "BI_SWAP" | "CREMA_FINANCE" | "CRONA_SWAP" | "CROPPER_FINANCE" | "CROW_FI" | "CRO_DEX" | "CURVE" | "DEFI_PLAZA" | "DEFI_SWAP" | "DFYN" | "DODO" | "DYSTOPIA" | "HONEY_SWAP" | "JET_SWAP" | "JOE" | "J_SWAP" | "KYBER_SWAP" | "LUA_SWAP" | "MAVERICK" | "MDEX" | "MESH_SWAP" | "MM_FINANCE" | "MOJITO_SWAP" | "ONE_INCH" | "ONE_MOON" | "ONE_SOL" | "OOLONG_SWAP" | "OPEN_OCEAN" | "ORCA_SWAP" | "OSMOSIS_SWAP" | "PANCAKE_SWAP" | "PANGOLIN" | "PARA_SWAP" | "POLYDEX" | "QUICK_SWAP" | "RAYDIUM" | "REF_FINANCE" | "SABER_STABLE_SWAP" | "SAROS_SWAP" | "SERUM" | "SHIBA_SWAP" | "SMOOTHY" | "SOLAR_BEAM" | "SPIRIT_SWAP" | "SPL_TOKEN_SWAP" | "SPOOKY_SWAP" | "STELLA_SWAP" | "SUSHI_SWAP" | "TRISOLARIS" | "UBE_SWAP" | "UNISWAP_V2" | "UNI_SWAP_V3" | "VIPER_SWAP" | "VOLTAGE_SWAP" | "VVS_FINANCE" | "WANNA_SWAP" | "WAULT_SWAP" | "WOO_FI" | "WRAPPED" | "ZAPPY" | "ZIP_SWAP" | "ZRX" | "AURORA_SWAP" | "JUPITER" | "REN_BTC"
  • to: undefined | "ACRYPTOS" | "ALDRIN_EXCHANGE" | "ALGEBRA" | "ANNEX" | "APE_SWAP" | "ARTH_SWAP" | "BABY_SWAP" | "BALANCER" | "BEAM_SWAP" | "BI_SWAP" | "CREMA_FINANCE" | "CRONA_SWAP" | "CROPPER_FINANCE" | "CROW_FI" | "CRO_DEX" | "CURVE" | "DEFI_PLAZA" | "DEFI_SWAP" | "DFYN" | "DODO" | "DYSTOPIA" | "HONEY_SWAP" | "JET_SWAP" | "JOE" | "J_SWAP" | "KYBER_SWAP" | "LUA_SWAP" | "MAVERICK" | "MDEX" | "MESH_SWAP" | "MM_FINANCE" | "MOJITO_SWAP" | "ONE_INCH" | "ONE_MOON" | "ONE_SOL" | "OOLONG_SWAP" | "OPEN_OCEAN" | "ORCA_SWAP" | "OSMOSIS_SWAP" | "PANCAKE_SWAP" | "PANGOLIN" | "PARA_SWAP" | "POLYDEX" | "QUICK_SWAP" | "RAYDIUM" | "REF_FINANCE" | "SABER_STABLE_SWAP" | "SAROS_SWAP" | "SERUM" | "SHIBA_SWAP" | "SMOOTHY" | "SOLAR_BEAM" | "SPIRIT_SWAP" | "SPL_TOKEN_SWAP" | "SPOOKY_SWAP" | "STELLA_SWAP" | "SUSHI_SWAP" | "TRISOLARIS" | "UBE_SWAP" | "UNISWAP_V2" | "UNI_SWAP_V3" | "VIPER_SWAP" | "VOLTAGE_SWAP" | "VVS_FINANCE" | "WANNA_SWAP" | "WAULT_SWAP" | "WOO_FI" | "WRAPPED" | "ZAPPY" | "ZIP_SWAP" | "ZRX" | "AURORA_SWAP" | "JUPITER" | "REN_BTC"

Token to get with output amount.

toTokenAmountMin: BigNumber

Minimum amount of output token user will get.

toTrade: CrossChainContractTrade

Wrapped instant trade in target blockchain.

transitFeeToken: PriceTokenAmount

Transit token in source blockchain, taken as fee.

type: "RUBIC" = CROSS_CHAIN_TRADE_TYPE.RUBIC

Type of calculated cross chain trade.

Accessors

  • get estimatedGas(): null | BigNumber
  • get priceImpactData(): { priceImpactFrom: null | number; priceImpactTo: null | number }

Methods

  • encodeApprove(tokenAddress: string, spenderAddress: string, value: BigNumber | "infinity", options?: TransactionOptions): Promise<TransactionConfig>
  • getContractParams(options?: { fromAddress?: string; receiverAddress?: string; swapTokenWithFee?: boolean }): Promise<ContractParams>
  • getTradeAmountRatio(fromUsd: BigNumber): BigNumber
  • needApprove(): Promise<boolean>
  • checkReceiverAddress(receiverAddress: undefined | string, toBlockchain?: BlockchainName): void

Generated using TypeDoc