rubic-sdk-next
Version:
Simplify dApp creation
32 lines • 1.46 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TonApiCrossChainTrade = void 0;
const core_1 = require("@cryptorubic/core");
const ton_cross_chain_trade_1 = require("../../../cross-chain/calculation-manager/providers/common/ton-cross-chain-trade/ton-cross-chain-trade");
class TonApiCrossChainTrade extends ton_cross_chain_trade_1.TonCrossChainTrade {
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;
}
getTradeInfo() {
return {
estimatedGas: null,
feeInfo: this.feeInfo,
priceImpact: this.priceImpact,
slippage: this.slippage * 100,
routePath: this.routePath
};
}
}
exports.TonApiCrossChainTrade = TonApiCrossChainTrade;
//# sourceMappingURL=ton-api-cross-chain-trade.js.map