UNPKG

rubic-sdk

Version:
21 lines 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDepositStatus = getDepositStatus; const errors_1 = require("../../../../../../../common/errors"); const cross_chain_trade_type_1 = require("../../../../models/cross-chain-trade-type"); const changelly_api_service_1 = require("../../../changelly-provider/services/changelly-api-service"); const changenow_cross_chain_api_service_1 = require("../../../changenow-provider/services/changenow-cross-chain-api-service"); const simple_swap_api_service_1 = require("../../../simple-swap-provider/services/simple-swap-api-service"); const getDepositStatusFnMap = { [cross_chain_trade_type_1.CROSS_CHAIN_TRADE_TYPE.CHANGENOW]: changenow_cross_chain_api_service_1.ChangeNowCrossChainApiService.getTxStatus, [cross_chain_trade_type_1.CROSS_CHAIN_TRADE_TYPE.SIMPLE_SWAP]: simple_swap_api_service_1.SimpleSwapApiService.getTxStatus, [cross_chain_trade_type_1.CROSS_CHAIN_TRADE_TYPE.CHANGELLY]: changelly_api_service_1.ChangellyApiService.getTxStatus }; function getDepositStatus(id, tradeType) { const getDepositStatusFn = getDepositStatusFnMap[tradeType]; if (!getDepositStatusFn) { throw new errors_1.RubicSdkError('Unsupported cross chain provider'); } return getDepositStatusFn(id); } //# sourceMappingURL=get-deposit-status.js.map