UNPKG

rubic-sdk-next

Version:
46 lines 2.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RangoBitcoinCrossChainTrade = void 0; const bitcoin_cross_chain_trade_1 = require("../../common/bitcoin-cross-chain-trade/bitcoin-cross-chain-trade"); const cross_chain_trade_type_1 = require("../../../models/cross-chain-trade-type"); const bridge_type_1 = require("../../common/models/bridge-type"); class RangoBitcoinCrossChainTrade extends bitcoin_cross_chain_trade_1.BitcoinCrossChainTrade { get fromBlockchain() { return this.from.blockchain; } get fromContractAddress() { throw new Error('Method not supported'); } get methodName() { throw new Error('Method not supported'); } constructor(params) { super(params.providerAddress, params.routePath, params.apiQuote, params.apiResponse); this.type = cross_chain_trade_type_1.CROSS_CHAIN_TRADE_TYPE.RANGO; this.isAggregator = true; this.onChainSubtype = { from: undefined, to: undefined }; this.bridgeType = bridge_type_1.BRIDGE_TYPE.RANGO; this.needProvidePubKey = false; this.to = params.crossChainTrade.to; this.from = params.crossChainTrade.from; this.toTokenAmountMin = params.crossChainTrade.toTokenAmountMin; this.feeInfo = params.crossChainTrade.feeInfo; this.gasData = params.crossChainTrade.gasData; this.priceImpact = params.crossChainTrade.priceImpact; this.slippage = params.crossChainTrade.slippage; this.swapQueryParams = params.crossChainTrade.swapQueryParams; this.bridgeType = params.crossChainTrade.bridgeSubtype || bridge_type_1.BRIDGE_TYPE.RANGO; this.memo = params.crossChainTrade.memo; } getTradeInfo() { return { estimatedGas: this.estimatedGas, feeInfo: this.feeInfo, priceImpact: this.priceImpact || null, slippage: this.slippage * 100, routePath: this.routePath }; } } exports.RangoBitcoinCrossChainTrade = RangoBitcoinCrossChainTrade; //# sourceMappingURL=rango-bitcoin-cross-chain-trade.js.map