UNPKG

rubic-sdk-next

Version:
36 lines 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EvmApiCrossChainTrade = void 0; const core_1 = require("@cryptorubic/core"); const evm_cross_chain_trade_1 = require("../../../cross-chain/calculation-manager/providers/common/evm-cross-chain-trade/evm-cross-chain-trade"); class EvmApiCrossChainTrade extends evm_cross_chain_trade_1.EvmCrossChainTrade { get needAuthWallet() { return this.isWalletAuth; } constructor(params) { super(params.apiQuote.integratorAddress, params.routePath, params.apiQuote, params.apiResponse); this.onChainSubtype = { from: undefined, to: undefined }; this.isAggregator = false; this.type = params.apiResponse.providerType; this.bridgeType = this.type; this.toTokenAmountMin = core_1.Token.fromWei(params.apiResponse.estimate.destinationWeiMinAmount, params.to.decimals); this.priceImpact = params.apiResponse.estimate.priceImpact; this.slippage = params.apiResponse.estimate.slippage; this.to = params.to; this.feeInfo = params.feeInfo; this.from = params.from; this.gasData = null; this.isWalletAuth = Boolean(params.needAuthWallet); } getTradeInfo() { return { estimatedGas: null, feeInfo: this.feeInfo, priceImpact: this.priceImpact, slippage: this.slippage * 100, routePath: this.routePath }; } } exports.EvmApiCrossChainTrade = EvmApiCrossChainTrade; //# sourceMappingURL=evm-api-cross-chain-trade.js.map