@shapeshiftoss/swapper 17.7.2 → 17.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/constants.js +35 -26
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +8 -17
- package/dist/cjs/swappers/AcrossSwapper/utils/acrossService.d.ts +3 -3
- package/dist/cjs/swappers/AcrossSwapper/utils/getTrade.js +2 -1
- package/dist/cjs/swappers/ArbitrumBridgeSwapper/endpoints.d.ts +3 -3
- package/dist/cjs/swappers/ArbitrumBridgeSwapper/getTradeQuote/getTradeQuote.js +2 -2
- package/dist/cjs/swappers/ArbitrumBridgeSwapper/getTradeQuote/getTradeQuote.test.js +12 -4
- package/dist/cjs/swappers/ArbitrumBridgeSwapper/getTradeRate/getTradeRate.js +2 -1
- package/dist/cjs/swappers/ArbitrumBridgeSwapper/utils/fetchArbitrumBridgeSwap.d.ts +2 -2
- package/dist/cjs/swappers/AvnuSwapper/endpoints.js +2 -2
- package/dist/cjs/swappers/AvnuSwapper/utils/constants.d.ts +1 -1
- package/dist/cjs/swappers/BebopSwapper/getBebopSolanaTradeQuote/getBebopSolanaTradeQuote.js +2 -1
- package/dist/cjs/swappers/BebopSwapper/getBebopSolanaTradeRate/getBebopSolanaTradeRate.js +11 -6
- package/dist/cjs/swappers/BebopSwapper/getBebopTradeQuote/getBebopTradeQuote.js +4 -11
- package/dist/cjs/swappers/BebopSwapper/getBebopTradeRate/getBebopTradeRate.js +12 -15
- package/dist/cjs/swappers/BebopSwapper/types.d.ts +65 -79
- package/dist/cjs/swappers/BebopSwapper/utils/bebopService.d.ts +1 -1
- package/dist/cjs/swappers/BebopSwapper/utils/fetchFromBebop.d.ts +2 -18
- package/dist/cjs/swappers/BebopSwapper/utils/fetchFromBebop.js +49 -82
- package/dist/cjs/swappers/BebopSwapper/utils/helpers/helpers.d.ts +1 -2
- package/dist/cjs/swappers/BobGatewaySwapper/BobGatewaySwapper.d.ts +2 -0
- package/dist/cjs/swappers/BobGatewaySwapper/BobGatewaySwapper.js +8 -0
- package/dist/cjs/swappers/BobGatewaySwapper/endpoints.d.ts +2 -0
- package/dist/cjs/swappers/BobGatewaySwapper/endpoints.js +143 -0
- package/dist/cjs/swappers/BobGatewaySwapper/index.d.ts +3 -0
- package/dist/cjs/swappers/BobGatewaySwapper/index.js +22 -0
- package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.d.ts +3 -0
- package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.js +90 -0
- package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeRate.d.ts +3 -0
- package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeRate.js +73 -0
- package/dist/cjs/swappers/BobGatewaySwapper/types.d.ts +20 -0
- package/dist/cjs/swappers/BobGatewaySwapper/types.js +2 -0
- package/dist/cjs/swappers/BobGatewaySwapper/utils/constants.d.ts +13 -0
- package/dist/cjs/swappers/BobGatewaySwapper/utils/constants.js +31 -0
- package/dist/cjs/swappers/BobGatewaySwapper/utils/helpers.d.ts +49 -0
- package/dist/cjs/swappers/BobGatewaySwapper/utils/helpers.js +314 -0
- package/dist/cjs/swappers/ButterSwap/swapperApi/checkTradeStatus.test.js +9 -19
- package/dist/cjs/swappers/ButterSwap/swapperApi/getTradeQuote.js +1 -1
- package/dist/cjs/swappers/ButterSwap/test-data/routeQuote.js +4 -4
- package/dist/cjs/swappers/ButterSwap/utils/butterSwapHistoryService.d.ts +3 -3
- package/dist/cjs/swappers/ButterSwap/utils/butterSwapService.d.ts +3 -3
- package/dist/cjs/swappers/ButterSwap/xhr.js +4 -4
- package/dist/cjs/swappers/CetusSwapper/utils/constants.d.ts +1 -1
- package/dist/cjs/swappers/ChainflipSwapper/ChainflipSwapper.js +1 -0
- package/dist/cjs/swappers/ChainflipSwapper/constants.d.ts +1 -1
- package/dist/cjs/swappers/ChainflipSwapper/constants.js +3 -0
- package/dist/cjs/swappers/ChainflipSwapper/endpoints.js +20 -0
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteBoostQuote.js +5 -4
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteEstimatedDurationsSeconds.js +5 -4
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteQuote.js +5 -5
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteQuoteFee.js +5 -5
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasStatusChunkInfo.js +5 -4
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasStatusDca.js +5 -4
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasStatusEgress.js +5 -4
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasStatusSwap.js +5 -4
- package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasSwapDepositAddress.js +5 -4
- package/dist/cjs/swappers/ChainflipSwapper/types.d.ts +2 -1
- package/dist/cjs/swappers/ChainflipSwapper/types.js +1 -0
- package/dist/cjs/swappers/ChainflipSwapper/utils/chainflipService.d.ts +3 -3
- package/dist/cjs/swappers/ChainflipSwapper/utils/getQuoteOrRate.js +25 -5
- package/dist/cjs/swappers/ChainflipSwapper/utils/getUtxoTxFees.d.ts +1 -1
- package/dist/cjs/swappers/ChainflipSwapper/utils/helpers.d.ts +2 -3
- package/dist/cjs/swappers/ChainflipSwapper/utils/helpers.js +2 -1
- package/dist/cjs/swappers/CowSwapper/getCowSwapTradeQuote/getCowSwapTradeQuote.js +3 -2
- package/dist/cjs/swappers/CowSwapper/getCowSwapTradeQuote/getCowSwapTradeQuote.test.js +8 -8
- package/dist/cjs/swappers/CowSwapper/getCowSwapTradeRate/getCowSwapTradeRate.js +3 -2
- package/dist/cjs/swappers/CowSwapper/utils/cowService.d.ts +3 -3
- package/dist/cjs/swappers/CowSwapper/utils/helpers/helpers.test.js +3 -3
- package/dist/cjs/swappers/DebridgeSwapper/utils/debridgeService.d.ts +3 -3
- package/dist/cjs/swappers/DebridgeSwapper/utils/getTrade.js +2 -1
- package/dist/cjs/swappers/NearIntentsSwapper/constants.d.ts +1 -0
- package/dist/cjs/swappers/NearIntentsSwapper/constants.js +2 -1
- package/dist/cjs/swappers/NearIntentsSwapper/swapperApi/getTradeQuote.js +5 -2
- package/dist/cjs/swappers/NearIntentsSwapper/utils/helpers/helpers.d.ts +2 -2
- package/dist/cjs/swappers/NearIntentsSwapper/utils/helpers/helpers.js +5 -1
- package/dist/cjs/swappers/PortalsSwapper/getPortalsTradeQuote/getPortalsTradeQuote.js +2 -1
- package/dist/cjs/swappers/PortalsSwapper/getPortalsTradeRate/getPortalsTradeRate.js +4 -3
- package/dist/cjs/swappers/PortalsSwapper/utils/helpers.d.ts +1 -1
- package/dist/cjs/swappers/RelaySwapper/constant.d.ts +1 -39
- package/dist/cjs/swappers/RelaySwapper/constant.js +1 -1
- package/dist/cjs/swappers/RelaySwapper/utils/fetchRelayTrade.d.ts +1 -1
- package/dist/cjs/swappers/RelaySwapper/utils/getRelayPsbtRelayer.js +7 -17
- package/dist/cjs/swappers/RelaySwapper/utils/getTrade.js +2 -1
- package/dist/cjs/swappers/RelaySwapper/utils/relayService.d.ts +3 -3
- package/dist/cjs/swappers/SunioSwapper/endpoints.js +19 -36
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapContractCall.d.ts +6 -0
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapContractCall.js +33 -0
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapRouteParameters.js +6 -6
- package/dist/cjs/swappers/SunioSwapper/utils/constants.d.ts +2 -0
- package/dist/cjs/swappers/SunioSwapper/utils/constants.js +7 -1
- package/dist/cjs/swappers/SunioSwapper/utils/estimateSunioNetworkFee.d.ts +12 -0
- package/dist/cjs/swappers/SunioSwapper/utils/estimateSunioNetworkFee.js +78 -0
- package/dist/cjs/swappers/SunioSwapper/utils/getQuoteOrRate.js +18 -75
- package/dist/cjs/swappers/SunioSwapper/utils/getSunioTransactionFees.d.ts +2 -0
- package/dist/cjs/swappers/SunioSwapper/utils/getSunioTransactionFees.js +36 -0
- package/dist/cjs/swappers/SunioSwapper/utils/helpers/helpers.d.ts +1 -2
- package/dist/cjs/swappers/SunioSwapper/utils/sunioService.d.ts +3 -3
- package/dist/cjs/swappers/ThorchainSwapper/getTradeQuote/getTradeQuote.test.js +10 -0
- package/dist/cjs/swappers/ThorchainSwapper/utils/getL1ToLongtailQuote.js +8 -18
- package/dist/cjs/swappers/ThorchainSwapper/utils/getL1ToLongtailRate.js +8 -18
- package/dist/cjs/swappers/ThorchainSwapper/utils/getLongtailQuote.js +1 -1
- package/dist/cjs/swappers/ThorchainSwapper/utils/getLongtailRate.js +1 -1
- package/dist/cjs/swappers/ThorchainSwapper/utils/longTailHelpers.js +2 -2
- package/dist/cjs/swappers/ZrxSwapper/getZrxTradeQuote/getZrxTradeQuote.js +2 -1
- package/dist/cjs/swappers/ZrxSwapper/getZrxTradeQuote/getZrxTradeQuote.test.js +7 -17
- package/dist/cjs/swappers/ZrxSwapper/getZrxTradeRate/getZrxTradeRate.js +2 -1
- package/dist/cjs/swappers/ZrxSwapper/utils/fetchFromZrx.js +2 -2
- package/dist/cjs/swappers/ZrxSwapper/utils/helpers/helpers.d.ts +3 -2
- package/dist/cjs/swappers/ZrxSwapper/utils/zrxService.d.ts +1 -1
- package/dist/cjs/swappers/utils/helpers/helpers.js +1 -0
- package/dist/cjs/swappers/utils/test-data/cryptoMarketDataById.d.ts +1 -35
- package/dist/cjs/thorchain-utils/checkTradeStatus.js +8 -1
- package/dist/cjs/thorchain-utils/cosmossdk/getThorTxData.d.ts +12 -0
- package/dist/cjs/thorchain-utils/cosmossdk/getThorTxData.js +19 -0
- package/dist/cjs/thorchain-utils/cosmossdk/index.d.ts +1 -0
- package/dist/cjs/thorchain-utils/cosmossdk/index.js +1 -0
- package/dist/cjs/thorchain-utils/getCallDataFromQuote.d.ts +1 -1
- package/dist/cjs/thorchain-utils/getL1RateOrQuote.js +51 -33
- package/dist/cjs/thorchain-utils/getQuote.js +27 -29
- package/dist/cjs/thorchain-utils/index.d.ts +1 -0
- package/dist/cjs/thorchain-utils/index.js +19 -18
- package/dist/cjs/thorchain-utils/parseBuyTxHash.d.ts +1 -1
- package/dist/cjs/thorchain-utils/service.d.ts +3 -3
- package/dist/cjs/thorchain-utils/tron/getTronTransactionFees.js +8 -5
- package/dist/cjs/thorchain-utils/types.d.ts +1 -1
- package/dist/cjs/tron-utils/getTronTransactionFees.d.ts +1 -1
- package/dist/cjs/types.d.ts +16 -3
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/utils/tenderly/storageSlots.js +20 -20
- package/dist/cjs/utils.d.ts +4 -4
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/constants.js +9 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/swappers/AcrossSwapper/utils/acrossService.d.ts +3 -3
- package/dist/esm/swappers/ArbitrumBridgeSwapper/endpoints.d.ts +3 -3
- package/dist/esm/swappers/ArbitrumBridgeSwapper/getTradeQuote/getTradeQuote.test.js +12 -4
- package/dist/esm/swappers/ArbitrumBridgeSwapper/utils/fetchArbitrumBridgeSwap.d.ts +2 -2
- package/dist/esm/swappers/AvnuSwapper/endpoints.js +2 -2
- package/dist/esm/swappers/AvnuSwapper/utils/constants.d.ts +1 -1
- package/dist/esm/swappers/BebopSwapper/getBebopSolanaTradeRate/getBebopSolanaTradeRate.js +10 -6
- package/dist/esm/swappers/BebopSwapper/getBebopTradeQuote/getBebopTradeQuote.js +2 -10
- package/dist/esm/swappers/BebopSwapper/getBebopTradeRate/getBebopTradeRate.js +11 -15
- package/dist/esm/swappers/BebopSwapper/types.d.ts +65 -79
- package/dist/esm/swappers/BebopSwapper/utils/bebopService.d.ts +1 -1
- package/dist/esm/swappers/BebopSwapper/utils/fetchFromBebop.d.ts +2 -18
- package/dist/esm/swappers/BebopSwapper/utils/fetchFromBebop.js +45 -76
- package/dist/esm/swappers/BebopSwapper/utils/helpers/helpers.d.ts +1 -2
- package/dist/esm/swappers/BobGatewaySwapper/BobGatewaySwapper.d.ts +2 -0
- package/dist/esm/swappers/BobGatewaySwapper/BobGatewaySwapper.js +5 -0
- package/dist/esm/swappers/BobGatewaySwapper/endpoints.d.ts +2 -0
- package/dist/esm/swappers/BobGatewaySwapper/endpoints.js +140 -0
- package/dist/esm/swappers/BobGatewaySwapper/index.d.ts +3 -0
- package/dist/esm/swappers/BobGatewaySwapper/index.js +3 -0
- package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.d.ts +3 -0
- package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.js +86 -0
- package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeRate.d.ts +3 -0
- package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeRate.js +69 -0
- package/dist/esm/swappers/BobGatewaySwapper/types.d.ts +20 -0
- package/dist/esm/swappers/BobGatewaySwapper/utils/constants.d.ts +13 -0
- package/dist/esm/swappers/BobGatewaySwapper/utils/constants.js +27 -0
- package/dist/esm/swappers/BobGatewaySwapper/utils/helpers.d.ts +49 -0
- package/dist/esm/swappers/BobGatewaySwapper/utils/helpers.js +299 -0
- package/dist/esm/swappers/ButterSwap/swapperApi/checkTradeStatus.test.js +2 -2
- package/dist/esm/swappers/ButterSwap/swapperApi/getTradeQuote.js +1 -1
- package/dist/esm/swappers/ButterSwap/test-data/routeQuote.js +4 -4
- package/dist/esm/swappers/ButterSwap/utils/butterSwapHistoryService.d.ts +3 -3
- package/dist/esm/swappers/ButterSwap/utils/butterSwapService.d.ts +3 -3
- package/dist/esm/swappers/CetusSwapper/utils/constants.d.ts +1 -1
- package/dist/esm/swappers/ChainflipSwapper/ChainflipSwapper.js +2 -1
- package/dist/esm/swappers/ChainflipSwapper/constants.d.ts +1 -1
- package/dist/esm/swappers/ChainflipSwapper/constants.js +4 -1
- package/dist/esm/swappers/ChainflipSwapper/endpoints.js +20 -0
- package/dist/esm/swappers/ChainflipSwapper/types.d.ts +2 -1
- package/dist/esm/swappers/ChainflipSwapper/types.js +1 -0
- package/dist/esm/swappers/ChainflipSwapper/utils/chainflipService.d.ts +3 -3
- package/dist/esm/swappers/ChainflipSwapper/utils/getQuoteOrRate.js +26 -6
- package/dist/esm/swappers/ChainflipSwapper/utils/getUtxoTxFees.d.ts +1 -1
- package/dist/esm/swappers/ChainflipSwapper/utils/helpers.d.ts +2 -3
- package/dist/esm/swappers/ChainflipSwapper/utils/helpers.js +2 -1
- package/dist/esm/swappers/CowSwapper/getCowSwapTradeQuote/getCowSwapTradeQuote.js +1 -1
- package/dist/esm/swappers/CowSwapper/getCowSwapTradeQuote/getCowSwapTradeQuote.test.js +8 -8
- package/dist/esm/swappers/CowSwapper/getCowSwapTradeRate/getCowSwapTradeRate.js +1 -1
- package/dist/esm/swappers/CowSwapper/utils/cowService.d.ts +3 -3
- package/dist/esm/swappers/CowSwapper/utils/helpers/helpers.test.js +3 -3
- package/dist/esm/swappers/DebridgeSwapper/utils/debridgeService.d.ts +3 -3
- package/dist/esm/swappers/NearIntentsSwapper/constants.d.ts +1 -0
- package/dist/esm/swappers/NearIntentsSwapper/constants.js +1 -0
- package/dist/esm/swappers/NearIntentsSwapper/swapperApi/getTradeQuote.js +7 -4
- package/dist/esm/swappers/NearIntentsSwapper/utils/helpers/helpers.d.ts +2 -2
- package/dist/esm/swappers/NearIntentsSwapper/utils/helpers/helpers.js +5 -1
- package/dist/esm/swappers/PortalsSwapper/getPortalsTradeRate/getPortalsTradeRate.js +2 -2
- package/dist/esm/swappers/PortalsSwapper/utils/helpers.d.ts +1 -1
- package/dist/esm/swappers/RelaySwapper/constant.d.ts +1 -39
- package/dist/esm/swappers/RelaySwapper/constant.js +1 -1
- package/dist/esm/swappers/RelaySwapper/utils/fetchRelayTrade.d.ts +1 -1
- package/dist/esm/swappers/RelaySwapper/utils/relayService.d.ts +3 -3
- package/dist/esm/swappers/SunioSwapper/endpoints.js +19 -36
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapContractCall.d.ts +6 -0
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapContractCall.js +29 -0
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapRouteParameters.js +6 -6
- package/dist/esm/swappers/SunioSwapper/utils/constants.d.ts +2 -0
- package/dist/esm/swappers/SunioSwapper/utils/constants.js +6 -0
- package/dist/esm/swappers/SunioSwapper/utils/estimateSunioNetworkFee.d.ts +12 -0
- package/dist/esm/swappers/SunioSwapper/utils/estimateSunioNetworkFee.js +74 -0
- package/dist/esm/swappers/SunioSwapper/utils/getQuoteOrRate.js +16 -74
- package/dist/esm/swappers/SunioSwapper/utils/getSunioTransactionFees.d.ts +2 -0
- package/dist/esm/swappers/SunioSwapper/utils/getSunioTransactionFees.js +32 -0
- package/dist/esm/swappers/SunioSwapper/utils/helpers/helpers.d.ts +1 -2
- package/dist/esm/swappers/SunioSwapper/utils/sunioService.d.ts +3 -3
- package/dist/esm/swappers/ThorchainSwapper/getTradeQuote/getTradeQuote.test.js +10 -0
- package/dist/esm/swappers/ThorchainSwapper/utils/getL1ToLongtailQuote.js +1 -1
- package/dist/esm/swappers/ThorchainSwapper/utils/getL1ToLongtailRate.js +1 -1
- package/dist/esm/swappers/ThorchainSwapper/utils/getLongtailQuote.js +1 -1
- package/dist/esm/swappers/ThorchainSwapper/utils/getLongtailRate.js +1 -1
- package/dist/esm/swappers/ZrxSwapper/utils/fetchFromZrx.js +2 -2
- package/dist/esm/swappers/ZrxSwapper/utils/helpers/helpers.d.ts +3 -2
- package/dist/esm/swappers/ZrxSwapper/utils/zrxService.d.ts +1 -1
- package/dist/esm/swappers/utils/helpers/helpers.js +2 -1
- package/dist/esm/swappers/utils/test-data/cryptoMarketDataById.d.ts +1 -35
- package/dist/esm/thorchain-utils/checkTradeStatus.js +8 -1
- package/dist/esm/thorchain-utils/cosmossdk/getThorTxData.d.ts +12 -0
- package/dist/esm/thorchain-utils/cosmossdk/getThorTxData.js +15 -0
- package/dist/esm/thorchain-utils/cosmossdk/index.d.ts +1 -0
- package/dist/esm/thorchain-utils/cosmossdk/index.js +1 -0
- package/dist/esm/thorchain-utils/getCallDataFromQuote.d.ts +1 -1
- package/dist/esm/thorchain-utils/getL1RateOrQuote.js +44 -16
- package/dist/esm/thorchain-utils/getQuote.js +27 -29
- package/dist/esm/thorchain-utils/index.d.ts +1 -0
- package/dist/esm/thorchain-utils/index.js +11 -1
- package/dist/esm/thorchain-utils/parseBuyTxHash.d.ts +1 -1
- package/dist/esm/thorchain-utils/service.d.ts +3 -3
- package/dist/esm/thorchain-utils/tron/getTronTransactionFees.js +8 -5
- package/dist/esm/thorchain-utils/types.d.ts +1 -1
- package/dist/esm/tron-utils/getTronTransactionFees.d.ts +1 -1
- package/dist/esm/types.d.ts +16 -3
- package/dist/esm/types.js +5 -0
- package/dist/esm/utils/tenderly/storageSlots.js +20 -20
- package/dist/esm/utils.d.ts +4 -4
- package/package.json +8 -7
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapTransaction.d.ts +0 -11
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapTransaction.js +0 -57
- package/dist/cjs/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.d.ts +0 -11
- package/dist/cjs/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.js +0 -40
- package/dist/cjs/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.test.js +0 -94
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapTransaction.d.ts +0 -11
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapTransaction.js +0 -53
- package/dist/esm/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.d.ts +0 -11
- package/dist/esm/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.js +0 -34
- package/dist/esm/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.test.d.ts +0 -1
- package/dist/esm/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.test.js +0 -92
- /package/dist/{cjs/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.test.d.ts → esm/swappers/BobGatewaySwapper/types.js} +0 -0
|
@@ -17,12 +17,12 @@ exports.ROUTE_QUOTE = {
|
|
|
17
17
|
},
|
|
18
18
|
tradeType: 0,
|
|
19
19
|
gasFee: {
|
|
20
|
-
amount: '0.001333043669759539',
|
|
20
|
+
amount: '0.001333043669759539',
|
|
21
21
|
symbol: 'ETH',
|
|
22
22
|
inUSD: '3.0629382849310107',
|
|
23
23
|
},
|
|
24
24
|
swapFee: {
|
|
25
|
-
nativeFee: '0.0',
|
|
25
|
+
nativeFee: '0.0',
|
|
26
26
|
tokenFee: '0.001', // human units
|
|
27
27
|
},
|
|
28
28
|
feeConfig: {
|
|
@@ -53,8 +53,8 @@ exports.ROUTE_QUOTE = {
|
|
|
53
53
|
symbol: 'USDC',
|
|
54
54
|
icon: 'https://s3.amazonaws.com/map-static-file/mapSwap/ethereum/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/logo.png',
|
|
55
55
|
},
|
|
56
|
-
totalAmountIn: '0.999',
|
|
57
|
-
totalAmountOut: '2296.409699',
|
|
56
|
+
totalAmountIn: '0.999',
|
|
57
|
+
totalAmountOut: '2296.409699',
|
|
58
58
|
route: [
|
|
59
59
|
{
|
|
60
60
|
amountIn: '0.999',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AxiosRequestConfig } from 'axios';
|
|
2
2
|
export declare const butterHistoryService: {
|
|
3
|
-
get: <T = any>(url: string, config?: AxiosRequestConfig<any>) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T>, import("../../..").SwapErrorRight>>;
|
|
4
|
-
post: <
|
|
5
|
-
delete: <
|
|
3
|
+
get: <T = any>(url: string, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T, any, {}>, import("../../..").SwapErrorRight>>;
|
|
4
|
+
post: <T_1 = any>(url: string, data: any, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T_1, any, {}>, import("../../..").SwapErrorRight>>;
|
|
5
|
+
delete: <T_2 = any>(url: string, data: any, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T_2, any, {}>, import("../../..").SwapErrorRight>>;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AxiosRequestConfig } from 'axios';
|
|
2
2
|
export declare const butterService: {
|
|
3
|
-
get: <T = any>(url: string, config?: AxiosRequestConfig<any>) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T>, import("../../..").SwapErrorRight>>;
|
|
4
|
-
post: <
|
|
5
|
-
delete: <
|
|
3
|
+
get: <T = any>(url: string, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T, any, {}>, import("../../..").SwapErrorRight>>;
|
|
4
|
+
post: <T_1 = any>(url: string, data: any, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T_1, any, {}>, import("../../..").SwapErrorRight>>;
|
|
5
|
+
delete: <T_2 = any>(url: string, data: any, config?: AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T_2, any, {}>, import("../../..").SwapErrorRight>>;
|
|
6
6
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBridgeInfoBySourceHash = exports.fetchTxData = exports.getButterRoute = exports.ButterSwapErrorCode = void 0;
|
|
4
|
-
exports.isRouteSuccess = isRouteSuccess;
|
|
5
|
-
exports.isBuildTxSuccess = isBuildTxSuccess;
|
|
6
|
-
exports.butterSwapErrorToTradeQuoteError = butterSwapErrorToTradeQuoteError;
|
|
3
|
+
exports.butterSwapErrorToTradeQuoteError = exports.getBridgeInfoBySourceHash = exports.isBuildTxSuccess = exports.isRouteSuccess = exports.fetchTxData = exports.getButterRoute = exports.ButterSwapErrorCode = void 0;
|
|
7
4
|
const caip_1 = require("@shapeshiftoss/caip");
|
|
8
5
|
const utils_1 = require("@shapeshiftoss/utils");
|
|
9
6
|
const monads_1 = require("@sniptt/monads");
|
|
@@ -93,9 +90,11 @@ exports.fetchTxData = fetchTxData;
|
|
|
93
90
|
function isRouteSuccess(response) {
|
|
94
91
|
return response.errno === 0;
|
|
95
92
|
}
|
|
93
|
+
exports.isRouteSuccess = isRouteSuccess;
|
|
96
94
|
function isBuildTxSuccess(response) {
|
|
97
95
|
return response.errno === 0;
|
|
98
96
|
}
|
|
97
|
+
exports.isBuildTxSuccess = isBuildTxSuccess;
|
|
99
98
|
/**
|
|
100
99
|
* @see https://docs.butternetwork.io/butter-swap-integration/butter-api-for-swap-data/get-swap-history-by-source-hash
|
|
101
100
|
*/
|
|
@@ -144,3 +143,4 @@ function butterSwapErrorToTradeQuoteError(errno) {
|
|
|
144
143
|
return types_1.TradeQuoteError.QueryFailed;
|
|
145
144
|
}
|
|
146
145
|
}
|
|
146
|
+
exports.butterSwapErrorToTradeQuoteError = butterSwapErrorToTradeQuoteError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ChainId } from '@shapeshiftoss/caip';
|
|
2
2
|
export declare const SUPPORTED_CETUS_CHAIN_IDS: readonly ChainId[];
|
|
3
|
-
export declare const isSupportedChainId: (chainId: ChainId) => chainId is
|
|
3
|
+
export declare const isSupportedChainId: (chainId: ChainId) => chainId is ChainId;
|
|
4
4
|
export declare const PYTH_DEPENDENT_PROVIDERS: string[];
|
|
@@ -5,6 +5,7 @@ const utils_1 = require("../../utils");
|
|
|
5
5
|
exports.chainflipSwapper = {
|
|
6
6
|
executeEvmTransaction: utils_1.executeEvmTransaction,
|
|
7
7
|
executeSolanaTransaction: utils_1.executeSolanaTransaction,
|
|
8
|
+
executeTronTransaction: utils_1.executeTronTransaction,
|
|
8
9
|
executeUtxoTransaction: (txToSign, { signAndBroadcastTransaction }) => {
|
|
9
10
|
return signAndBroadcastTransaction(txToSign);
|
|
10
11
|
},
|
|
@@ -5,7 +5,7 @@ import type { SwapSource } from '../../types';
|
|
|
5
5
|
import { ChainflipNetwork } from './types';
|
|
6
6
|
export declare const CHAINFLIP_REGULAR_QUOTE: "regular";
|
|
7
7
|
export declare const CHAINFLIP_DCA_QUOTE: "dca";
|
|
8
|
-
export declare const ChainflipSupportedChainIds: readonly [KnownChainIds.EthereumMainnet, KnownChainIds.ArbitrumMainnet, KnownChainIds.BitcoinMainnet, KnownChainIds.SolanaMainnet];
|
|
8
|
+
export declare const ChainflipSupportedChainIds: readonly [KnownChainIds.EthereumMainnet, KnownChainIds.ArbitrumMainnet, KnownChainIds.BitcoinMainnet, KnownChainIds.SolanaMainnet, KnownChainIds.TronMainnet];
|
|
9
9
|
export type ChainflipSupportedChainId = (typeof ChainflipSupportedChainIds)[number];
|
|
10
10
|
export declare const ChainflipSupportedAssetIdsByChainId: Partial<Record<KnownChainIds, AssetId[]>>;
|
|
11
11
|
export declare const chainIdToChainflipNetwork: Partial<Record<ChainId, ChainflipNetwork>>;
|
|
@@ -12,6 +12,7 @@ exports.ChainflipSupportedChainIds = [
|
|
|
12
12
|
types_1.KnownChainIds.ArbitrumMainnet,
|
|
13
13
|
types_1.KnownChainIds.BitcoinMainnet,
|
|
14
14
|
types_1.KnownChainIds.SolanaMainnet,
|
|
15
|
+
types_1.KnownChainIds.TronMainnet,
|
|
15
16
|
];
|
|
16
17
|
exports.ChainflipSupportedAssetIdsByChainId = {
|
|
17
18
|
[types_1.KnownChainIds.EthereumMainnet]: [caip_1.ethAssetId, caip_1.flipAssetId, caip_1.usdcAssetId, caip_1.usdtAssetId, caip_1.wbtcAssetId],
|
|
@@ -22,12 +23,14 @@ exports.ChainflipSupportedAssetIdsByChainId = {
|
|
|
22
23
|
],
|
|
23
24
|
[types_1.KnownChainIds.BitcoinMainnet]: [caip_1.btcAssetId],
|
|
24
25
|
[types_1.KnownChainIds.SolanaMainnet]: [caip_1.solAssetId, caip_1.usdcOnSolanaAssetId, caip_1.usdtOnSolanaAssetId],
|
|
26
|
+
[types_1.KnownChainIds.TronMainnet]: [caip_1.tronAssetId, caip_1.usdtOnTronAssetId],
|
|
25
27
|
};
|
|
26
28
|
exports.chainIdToChainflipNetwork = {
|
|
27
29
|
[types_1.KnownChainIds.EthereumMainnet]: types_3.ChainflipNetwork.Ethereum,
|
|
28
30
|
[types_1.KnownChainIds.ArbitrumMainnet]: types_3.ChainflipNetwork.Arbitrum,
|
|
29
31
|
[types_1.KnownChainIds.BitcoinMainnet]: types_3.ChainflipNetwork.Bitcoin,
|
|
30
32
|
[types_1.KnownChainIds.SolanaMainnet]: types_3.ChainflipNetwork.Solana,
|
|
33
|
+
[types_1.KnownChainIds.TronMainnet]: types_3.ChainflipNetwork.Tron,
|
|
31
34
|
};
|
|
32
35
|
exports.CHAINFLIP_SWAP_SOURCE = types_2.SwapperName.Chainflip;
|
|
33
36
|
exports.CHAINFLIP_BOOST_SWAP_SOURCE = `${types_2.SwapperName.Chainflip} • Boost`;
|
|
@@ -4,6 +4,7 @@ exports.chainflipApi = void 0;
|
|
|
4
4
|
const chain_adapters_1 = require("@shapeshiftoss/chain-adapters");
|
|
5
5
|
const unchained_client_1 = require("@shapeshiftoss/unchained-client");
|
|
6
6
|
const utils_1 = require("@shapeshiftoss/utils");
|
|
7
|
+
const getTronTransactionFees_1 = require("../../tron-utils/getTronTransactionFees");
|
|
7
8
|
const utils_2 = require("../../utils");
|
|
8
9
|
const helpers_1 = require("../utils/helpers/helpers");
|
|
9
10
|
const constants_1 = require("./constants");
|
|
@@ -166,6 +167,25 @@ exports.chainflipApi = {
|
|
|
166
167
|
const ratio = simulatedUnits > 0 ? boostedUnits / simulatedUnits : 1;
|
|
167
168
|
return String(Math.ceil(Number(fast.txFee) * ratio));
|
|
168
169
|
},
|
|
170
|
+
getUnsignedTronTransaction: ({ stepIndex, tradeQuote, from, assertGetTronChainAdapter }) => {
|
|
171
|
+
if (!(0, utils_2.isExecutableTradeQuote)(tradeQuote))
|
|
172
|
+
throw new Error('Unable to execute a trade rate quote');
|
|
173
|
+
const step = (0, utils_2.getExecutableTradeStep)(tradeQuote, stepIndex);
|
|
174
|
+
const { accountNumber, chainflipSpecific, sellAsset } = step;
|
|
175
|
+
if (!chainflipSpecific?.chainflipDepositAddress)
|
|
176
|
+
throw Error('Missing deposit address');
|
|
177
|
+
if (!chainflipSpecific?.chainflipSwapId)
|
|
178
|
+
throw Error('Missing swap id');
|
|
179
|
+
const adapter = assertGetTronChainAdapter(sellAsset.chainId);
|
|
180
|
+
return adapter.buildSendApiTransaction({
|
|
181
|
+
to: chainflipSpecific.chainflipDepositAddress,
|
|
182
|
+
from,
|
|
183
|
+
value: step.sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
184
|
+
accountNumber,
|
|
185
|
+
chainSpecific: { contractAddress: (0, utils_1.contractAddressOrUndefined)(sellAsset.assetId) },
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
getTronTransactionFees: getTronTransactionFees_1.getTronTransactionFees,
|
|
169
189
|
checkTradeStatus: async ({ config, swap }) => {
|
|
170
190
|
const chainflipSwapId = swap?.metadata.chainflipSwapId;
|
|
171
191
|
if (chainflipSwapId == null)
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.instanceOfChainflipBaasQuoteBoostQuote =
|
|
18
|
-
exports.ChainflipBaasQuoteBoostQuoteFromJSON = ChainflipBaasQuoteBoostQuoteFromJSON;
|
|
19
|
-
exports.ChainflipBaasQuoteBoostQuoteFromJSONTyped = ChainflipBaasQuoteBoostQuoteFromJSONTyped;
|
|
20
|
-
exports.ChainflipBaasQuoteBoostQuoteToJSON = ChainflipBaasQuoteBoostQuoteToJSON;
|
|
17
|
+
exports.ChainflipBaasQuoteBoostQuoteToJSON = exports.ChainflipBaasQuoteBoostQuoteFromJSONTyped = exports.ChainflipBaasQuoteBoostQuoteFromJSON = exports.instanceOfChainflipBaasQuoteBoostQuote = void 0;
|
|
21
18
|
const runtime_1 = require("../runtime");
|
|
22
19
|
const ChainflipBaasQuoteEstimatedDurationsSeconds_1 = require("./ChainflipBaasQuoteEstimatedDurationsSeconds");
|
|
23
20
|
const ChainflipBaasQuotePoolInfo_1 = require("./ChainflipBaasQuotePoolInfo");
|
|
@@ -29,9 +26,11 @@ function instanceOfChainflipBaasQuoteBoostQuote(value) {
|
|
|
29
26
|
let isInstance = true;
|
|
30
27
|
return isInstance;
|
|
31
28
|
}
|
|
29
|
+
exports.instanceOfChainflipBaasQuoteBoostQuote = instanceOfChainflipBaasQuoteBoostQuote;
|
|
32
30
|
function ChainflipBaasQuoteBoostQuoteFromJSON(json) {
|
|
33
31
|
return ChainflipBaasQuoteBoostQuoteFromJSONTyped(json, false);
|
|
34
32
|
}
|
|
33
|
+
exports.ChainflipBaasQuoteBoostQuoteFromJSON = ChainflipBaasQuoteBoostQuoteFromJSON;
|
|
35
34
|
function ChainflipBaasQuoteBoostQuoteFromJSONTyped(json, ignoreDiscriminator) {
|
|
36
35
|
if ((json === undefined) || (json === null)) {
|
|
37
36
|
return json;
|
|
@@ -56,6 +55,7 @@ function ChainflipBaasQuoteBoostQuoteFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
56
55
|
'numberOfChunks': !(0, runtime_1.exists)(json, 'numberOfChunks') ? undefined : json['numberOfChunks'],
|
|
57
56
|
};
|
|
58
57
|
}
|
|
58
|
+
exports.ChainflipBaasQuoteBoostQuoteFromJSONTyped = ChainflipBaasQuoteBoostQuoteFromJSONTyped;
|
|
59
59
|
function ChainflipBaasQuoteBoostQuoteToJSON(value) {
|
|
60
60
|
if (value === undefined) {
|
|
61
61
|
return undefined;
|
|
@@ -71,3 +71,4 @@ function ChainflipBaasQuoteBoostQuoteToJSON(value) {
|
|
|
71
71
|
'estimatedDurationsSeconds': (0, ChainflipBaasQuoteEstimatedDurationsSeconds_1.ChainflipBaasQuoteEstimatedDurationsSecondsToJSON)(value.estimatedDurationsSeconds),
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
+
exports.ChainflipBaasQuoteBoostQuoteToJSON = ChainflipBaasQuoteBoostQuoteToJSON;
|
package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteEstimatedDurationsSeconds.js
CHANGED
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.instanceOfChainflipBaasQuoteEstimatedDurationsSeconds =
|
|
18
|
-
exports.ChainflipBaasQuoteEstimatedDurationsSecondsFromJSON = ChainflipBaasQuoteEstimatedDurationsSecondsFromJSON;
|
|
19
|
-
exports.ChainflipBaasQuoteEstimatedDurationsSecondsFromJSONTyped = ChainflipBaasQuoteEstimatedDurationsSecondsFromJSONTyped;
|
|
20
|
-
exports.ChainflipBaasQuoteEstimatedDurationsSecondsToJSON = ChainflipBaasQuoteEstimatedDurationsSecondsToJSON;
|
|
17
|
+
exports.ChainflipBaasQuoteEstimatedDurationsSecondsToJSON = exports.ChainflipBaasQuoteEstimatedDurationsSecondsFromJSONTyped = exports.ChainflipBaasQuoteEstimatedDurationsSecondsFromJSON = exports.instanceOfChainflipBaasQuoteEstimatedDurationsSeconds = void 0;
|
|
21
18
|
const runtime_1 = require("../runtime");
|
|
22
19
|
/**
|
|
23
20
|
* Check if a given object implements the ChainflipBaasQuoteEstimatedDurationsSeconds interface.
|
|
@@ -26,9 +23,11 @@ function instanceOfChainflipBaasQuoteEstimatedDurationsSeconds(value) {
|
|
|
26
23
|
let isInstance = true;
|
|
27
24
|
return isInstance;
|
|
28
25
|
}
|
|
26
|
+
exports.instanceOfChainflipBaasQuoteEstimatedDurationsSeconds = instanceOfChainflipBaasQuoteEstimatedDurationsSeconds;
|
|
29
27
|
function ChainflipBaasQuoteEstimatedDurationsSecondsFromJSON(json) {
|
|
30
28
|
return ChainflipBaasQuoteEstimatedDurationsSecondsFromJSONTyped(json, false);
|
|
31
29
|
}
|
|
30
|
+
exports.ChainflipBaasQuoteEstimatedDurationsSecondsFromJSON = ChainflipBaasQuoteEstimatedDurationsSecondsFromJSON;
|
|
32
31
|
function ChainflipBaasQuoteEstimatedDurationsSecondsFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
32
|
if ((json === undefined) || (json === null)) {
|
|
34
33
|
return json;
|
|
@@ -39,6 +38,7 @@ function ChainflipBaasQuoteEstimatedDurationsSecondsFromJSONTyped(json, ignoreDi
|
|
|
39
38
|
'egress': !(0, runtime_1.exists)(json, 'egress') ? undefined : json['egress'],
|
|
40
39
|
};
|
|
41
40
|
}
|
|
41
|
+
exports.ChainflipBaasQuoteEstimatedDurationsSecondsFromJSONTyped = ChainflipBaasQuoteEstimatedDurationsSecondsFromJSONTyped;
|
|
42
42
|
function ChainflipBaasQuoteEstimatedDurationsSecondsToJSON(value) {
|
|
43
43
|
if (value === undefined) {
|
|
44
44
|
return undefined;
|
|
@@ -48,3 +48,4 @@ function ChainflipBaasQuoteEstimatedDurationsSecondsToJSON(value) {
|
|
|
48
48
|
}
|
|
49
49
|
return {};
|
|
50
50
|
}
|
|
51
|
+
exports.ChainflipBaasQuoteEstimatedDurationsSecondsToJSON = ChainflipBaasQuoteEstimatedDurationsSecondsToJSON;
|
|
@@ -14,11 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ChainflipBaasQuoteQuoteTypeEnum = void 0;
|
|
18
|
-
exports.instanceOfChainflipBaasQuoteQuote = instanceOfChainflipBaasQuoteQuote;
|
|
19
|
-
exports.ChainflipBaasQuoteQuoteFromJSON = ChainflipBaasQuoteQuoteFromJSON;
|
|
20
|
-
exports.ChainflipBaasQuoteQuoteFromJSONTyped = ChainflipBaasQuoteQuoteFromJSONTyped;
|
|
21
|
-
exports.ChainflipBaasQuoteQuoteToJSON = ChainflipBaasQuoteQuoteToJSON;
|
|
17
|
+
exports.ChainflipBaasQuoteQuoteToJSON = exports.ChainflipBaasQuoteQuoteFromJSONTyped = exports.ChainflipBaasQuoteQuoteFromJSON = exports.instanceOfChainflipBaasQuoteQuote = exports.ChainflipBaasQuoteQuoteTypeEnum = void 0;
|
|
22
18
|
const runtime_1 = require("../runtime");
|
|
23
19
|
const ChainflipBaasQuoteBoostQuote_1 = require("./ChainflipBaasQuoteBoostQuote");
|
|
24
20
|
const ChainflipBaasQuoteEstimatedDurationsSeconds_1 = require("./ChainflipBaasQuoteEstimatedDurationsSeconds");
|
|
@@ -38,9 +34,11 @@ function instanceOfChainflipBaasQuoteQuote(value) {
|
|
|
38
34
|
let isInstance = true;
|
|
39
35
|
return isInstance;
|
|
40
36
|
}
|
|
37
|
+
exports.instanceOfChainflipBaasQuoteQuote = instanceOfChainflipBaasQuoteQuote;
|
|
41
38
|
function ChainflipBaasQuoteQuoteFromJSON(json) {
|
|
42
39
|
return ChainflipBaasQuoteQuoteFromJSONTyped(json, false);
|
|
43
40
|
}
|
|
41
|
+
exports.ChainflipBaasQuoteQuoteFromJSON = ChainflipBaasQuoteQuoteFromJSON;
|
|
44
42
|
function ChainflipBaasQuoteQuoteFromJSONTyped(json, ignoreDiscriminator) {
|
|
45
43
|
if ((json === undefined) || (json === null)) {
|
|
46
44
|
return json;
|
|
@@ -68,6 +66,7 @@ function ChainflipBaasQuoteQuoteFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
68
66
|
'boostQuote': !(0, runtime_1.exists)(json, 'boostQuote') ? undefined : (0, ChainflipBaasQuoteBoostQuote_1.ChainflipBaasQuoteBoostQuoteFromJSON)(json['boostQuote']),
|
|
69
67
|
};
|
|
70
68
|
}
|
|
69
|
+
exports.ChainflipBaasQuoteQuoteFromJSONTyped = ChainflipBaasQuoteQuoteFromJSONTyped;
|
|
71
70
|
function ChainflipBaasQuoteQuoteToJSON(value) {
|
|
72
71
|
if (value === undefined) {
|
|
73
72
|
return undefined;
|
|
@@ -84,3 +83,4 @@ function ChainflipBaasQuoteQuoteToJSON(value) {
|
|
|
84
83
|
'boostQuote': (0, ChainflipBaasQuoteBoostQuote_1.ChainflipBaasQuoteBoostQuoteToJSON)(value.boostQuote),
|
|
85
84
|
};
|
|
86
85
|
}
|
|
86
|
+
exports.ChainflipBaasQuoteQuoteToJSON = ChainflipBaasQuoteQuoteToJSON;
|
|
@@ -14,11 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ChainflipBaasQuoteQuoteFeeTypeEnum = void 0;
|
|
18
|
-
exports.instanceOfChainflipBaasQuoteQuoteFee = instanceOfChainflipBaasQuoteQuoteFee;
|
|
19
|
-
exports.ChainflipBaasQuoteQuoteFeeFromJSON = ChainflipBaasQuoteQuoteFeeFromJSON;
|
|
20
|
-
exports.ChainflipBaasQuoteQuoteFeeFromJSONTyped = ChainflipBaasQuoteQuoteFeeFromJSONTyped;
|
|
21
|
-
exports.ChainflipBaasQuoteQuoteFeeToJSON = ChainflipBaasQuoteQuoteFeeToJSON;
|
|
17
|
+
exports.ChainflipBaasQuoteQuoteFeeToJSON = exports.ChainflipBaasQuoteQuoteFeeFromJSONTyped = exports.ChainflipBaasQuoteQuoteFeeFromJSON = exports.instanceOfChainflipBaasQuoteQuoteFee = exports.ChainflipBaasQuoteQuoteFeeTypeEnum = void 0;
|
|
22
18
|
const runtime_1 = require("../runtime");
|
|
23
19
|
/**
|
|
24
20
|
* @export
|
|
@@ -38,9 +34,11 @@ function instanceOfChainflipBaasQuoteQuoteFee(value) {
|
|
|
38
34
|
let isInstance = true;
|
|
39
35
|
return isInstance;
|
|
40
36
|
}
|
|
37
|
+
exports.instanceOfChainflipBaasQuoteQuoteFee = instanceOfChainflipBaasQuoteQuoteFee;
|
|
41
38
|
function ChainflipBaasQuoteQuoteFeeFromJSON(json) {
|
|
42
39
|
return ChainflipBaasQuoteQuoteFeeFromJSONTyped(json, false);
|
|
43
40
|
}
|
|
41
|
+
exports.ChainflipBaasQuoteQuoteFeeFromJSON = ChainflipBaasQuoteQuoteFeeFromJSON;
|
|
44
42
|
function ChainflipBaasQuoteQuoteFeeFromJSONTyped(json, ignoreDiscriminator) {
|
|
45
43
|
if ((json === undefined) || (json === null)) {
|
|
46
44
|
return json;
|
|
@@ -52,6 +50,7 @@ function ChainflipBaasQuoteQuoteFeeFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
52
50
|
'amountNative': !(0, runtime_1.exists)(json, 'amountNative') ? undefined : json['amountNative'],
|
|
53
51
|
};
|
|
54
52
|
}
|
|
53
|
+
exports.ChainflipBaasQuoteQuoteFeeFromJSONTyped = ChainflipBaasQuoteQuoteFeeFromJSONTyped;
|
|
55
54
|
function ChainflipBaasQuoteQuoteFeeToJSON(value) {
|
|
56
55
|
if (value === undefined) {
|
|
57
56
|
return undefined;
|
|
@@ -61,3 +60,4 @@ function ChainflipBaasQuoteQuoteFeeToJSON(value) {
|
|
|
61
60
|
}
|
|
62
61
|
return {};
|
|
63
62
|
}
|
|
63
|
+
exports.ChainflipBaasQuoteQuoteFeeToJSON = ChainflipBaasQuoteQuoteFeeToJSON;
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.instanceOfChainflipBaasStatusChunkInfo =
|
|
18
|
-
exports.ChainflipBaasStatusChunkInfoFromJSON = ChainflipBaasStatusChunkInfoFromJSON;
|
|
19
|
-
exports.ChainflipBaasStatusChunkInfoFromJSONTyped = ChainflipBaasStatusChunkInfoFromJSONTyped;
|
|
20
|
-
exports.ChainflipBaasStatusChunkInfoToJSON = ChainflipBaasStatusChunkInfoToJSON;
|
|
17
|
+
exports.ChainflipBaasStatusChunkInfoToJSON = exports.ChainflipBaasStatusChunkInfoFromJSONTyped = exports.ChainflipBaasStatusChunkInfoFromJSON = exports.instanceOfChainflipBaasStatusChunkInfo = void 0;
|
|
21
18
|
const runtime_1 = require("../runtime");
|
|
22
19
|
/**
|
|
23
20
|
* Check if a given object implements the ChainflipBaasStatusChunkInfo interface.
|
|
@@ -26,9 +23,11 @@ function instanceOfChainflipBaasStatusChunkInfo(value) {
|
|
|
26
23
|
let isInstance = true;
|
|
27
24
|
return isInstance;
|
|
28
25
|
}
|
|
26
|
+
exports.instanceOfChainflipBaasStatusChunkInfo = instanceOfChainflipBaasStatusChunkInfo;
|
|
29
27
|
function ChainflipBaasStatusChunkInfoFromJSON(json) {
|
|
30
28
|
return ChainflipBaasStatusChunkInfoFromJSONTyped(json, false);
|
|
31
29
|
}
|
|
30
|
+
exports.ChainflipBaasStatusChunkInfoFromJSON = ChainflipBaasStatusChunkInfoFromJSON;
|
|
32
31
|
function ChainflipBaasStatusChunkInfoFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
32
|
if ((json === undefined) || (json === null)) {
|
|
34
33
|
return json;
|
|
@@ -49,6 +48,7 @@ function ChainflipBaasStatusChunkInfoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
49
48
|
'retryCount': !(0, runtime_1.exists)(json, 'retryCount') ? undefined : json['retryCount'],
|
|
50
49
|
};
|
|
51
50
|
}
|
|
51
|
+
exports.ChainflipBaasStatusChunkInfoFromJSONTyped = ChainflipBaasStatusChunkInfoFromJSONTyped;
|
|
52
52
|
function ChainflipBaasStatusChunkInfoToJSON(value) {
|
|
53
53
|
if (value === undefined) {
|
|
54
54
|
return undefined;
|
|
@@ -58,3 +58,4 @@ function ChainflipBaasStatusChunkInfoToJSON(value) {
|
|
|
58
58
|
}
|
|
59
59
|
return {};
|
|
60
60
|
}
|
|
61
|
+
exports.ChainflipBaasStatusChunkInfoToJSON = ChainflipBaasStatusChunkInfoToJSON;
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.instanceOfChainflipBaasStatusDca =
|
|
18
|
-
exports.ChainflipBaasStatusDcaFromJSON = ChainflipBaasStatusDcaFromJSON;
|
|
19
|
-
exports.ChainflipBaasStatusDcaFromJSONTyped = ChainflipBaasStatusDcaFromJSONTyped;
|
|
20
|
-
exports.ChainflipBaasStatusDcaToJSON = ChainflipBaasStatusDcaToJSON;
|
|
17
|
+
exports.ChainflipBaasStatusDcaToJSON = exports.ChainflipBaasStatusDcaFromJSONTyped = exports.ChainflipBaasStatusDcaFromJSON = exports.instanceOfChainflipBaasStatusDca = void 0;
|
|
21
18
|
const runtime_1 = require("../runtime");
|
|
22
19
|
const ChainflipBaasStatusChunkInfo_1 = require("./ChainflipBaasStatusChunkInfo");
|
|
23
20
|
/**
|
|
@@ -27,9 +24,11 @@ function instanceOfChainflipBaasStatusDca(value) {
|
|
|
27
24
|
let isInstance = true;
|
|
28
25
|
return isInstance;
|
|
29
26
|
}
|
|
27
|
+
exports.instanceOfChainflipBaasStatusDca = instanceOfChainflipBaasStatusDca;
|
|
30
28
|
function ChainflipBaasStatusDcaFromJSON(json) {
|
|
31
29
|
return ChainflipBaasStatusDcaFromJSONTyped(json, false);
|
|
32
30
|
}
|
|
31
|
+
exports.ChainflipBaasStatusDcaFromJSON = ChainflipBaasStatusDcaFromJSON;
|
|
33
32
|
function ChainflipBaasStatusDcaFromJSONTyped(json, ignoreDiscriminator) {
|
|
34
33
|
if ((json === undefined) || (json === null)) {
|
|
35
34
|
return json;
|
|
@@ -41,6 +40,7 @@ function ChainflipBaasStatusDcaFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
41
40
|
'remainingChunks': !(0, runtime_1.exists)(json, 'remainingChunks') ? undefined : json['remainingChunks'],
|
|
42
41
|
};
|
|
43
42
|
}
|
|
43
|
+
exports.ChainflipBaasStatusDcaFromJSONTyped = ChainflipBaasStatusDcaFromJSONTyped;
|
|
44
44
|
function ChainflipBaasStatusDcaToJSON(value) {
|
|
45
45
|
if (value === undefined) {
|
|
46
46
|
return undefined;
|
|
@@ -53,3 +53,4 @@ function ChainflipBaasStatusDcaToJSON(value) {
|
|
|
53
53
|
'currentChunk': (0, ChainflipBaasStatusChunkInfo_1.ChainflipBaasStatusChunkInfoToJSON)(value.currentChunk),
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
+
exports.ChainflipBaasStatusDcaToJSON = ChainflipBaasStatusDcaToJSON;
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.instanceOfChainflipBaasStatusEgress =
|
|
18
|
-
exports.ChainflipBaasStatusEgressFromJSON = ChainflipBaasStatusEgressFromJSON;
|
|
19
|
-
exports.ChainflipBaasStatusEgressFromJSONTyped = ChainflipBaasStatusEgressFromJSONTyped;
|
|
20
|
-
exports.ChainflipBaasStatusEgressToJSON = ChainflipBaasStatusEgressToJSON;
|
|
17
|
+
exports.ChainflipBaasStatusEgressToJSON = exports.ChainflipBaasStatusEgressFromJSONTyped = exports.ChainflipBaasStatusEgressFromJSON = exports.instanceOfChainflipBaasStatusEgress = void 0;
|
|
21
18
|
const runtime_1 = require("../runtime");
|
|
22
19
|
const ChainflipBaasStatusFailure_1 = require("./ChainflipBaasStatusFailure");
|
|
23
20
|
/**
|
|
@@ -27,9 +24,11 @@ function instanceOfChainflipBaasStatusEgress(value) {
|
|
|
27
24
|
let isInstance = true;
|
|
28
25
|
return isInstance;
|
|
29
26
|
}
|
|
27
|
+
exports.instanceOfChainflipBaasStatusEgress = instanceOfChainflipBaasStatusEgress;
|
|
30
28
|
function ChainflipBaasStatusEgressFromJSON(json) {
|
|
31
29
|
return ChainflipBaasStatusEgressFromJSONTyped(json, false);
|
|
32
30
|
}
|
|
31
|
+
exports.ChainflipBaasStatusEgressFromJSON = ChainflipBaasStatusEgressFromJSON;
|
|
33
32
|
function ChainflipBaasStatusEgressFromJSONTyped(json, ignoreDiscriminator) {
|
|
34
33
|
if ((json === undefined) || (json === null)) {
|
|
35
34
|
return json;
|
|
@@ -49,6 +48,7 @@ function ChainflipBaasStatusEgressFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
49
48
|
'failedBlockIndex': !(0, runtime_1.exists)(json, 'failedBlockIndex') ? undefined : json['failedBlockIndex'],
|
|
50
49
|
};
|
|
51
50
|
}
|
|
51
|
+
exports.ChainflipBaasStatusEgressFromJSONTyped = ChainflipBaasStatusEgressFromJSONTyped;
|
|
52
52
|
function ChainflipBaasStatusEgressToJSON(value) {
|
|
53
53
|
if (value === undefined) {
|
|
54
54
|
return undefined;
|
|
@@ -60,3 +60,4 @@ function ChainflipBaasStatusEgressToJSON(value) {
|
|
|
60
60
|
'failure': (0, ChainflipBaasStatusFailure_1.ChainflipBaasStatusFailureToJSON)(value.failure),
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
+
exports.ChainflipBaasStatusEgressToJSON = ChainflipBaasStatusEgressToJSON;
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.instanceOfChainflipBaasStatusSwap =
|
|
18
|
-
exports.ChainflipBaasStatusSwapFromJSON = ChainflipBaasStatusSwapFromJSON;
|
|
19
|
-
exports.ChainflipBaasStatusSwapFromJSONTyped = ChainflipBaasStatusSwapFromJSONTyped;
|
|
20
|
-
exports.ChainflipBaasStatusSwapToJSON = ChainflipBaasStatusSwapToJSON;
|
|
17
|
+
exports.ChainflipBaasStatusSwapToJSON = exports.ChainflipBaasStatusSwapFromJSONTyped = exports.ChainflipBaasStatusSwapFromJSON = exports.instanceOfChainflipBaasStatusSwap = void 0;
|
|
21
18
|
const runtime_1 = require("../runtime");
|
|
22
19
|
const ChainflipBaasStatusChunkInfo_1 = require("./ChainflipBaasStatusChunkInfo");
|
|
23
20
|
const ChainflipBaasStatusDca_1 = require("./ChainflipBaasStatusDca");
|
|
@@ -28,9 +25,11 @@ function instanceOfChainflipBaasStatusSwap(value) {
|
|
|
28
25
|
let isInstance = true;
|
|
29
26
|
return isInstance;
|
|
30
27
|
}
|
|
28
|
+
exports.instanceOfChainflipBaasStatusSwap = instanceOfChainflipBaasStatusSwap;
|
|
31
29
|
function ChainflipBaasStatusSwapFromJSON(json) {
|
|
32
30
|
return ChainflipBaasStatusSwapFromJSONTyped(json, false);
|
|
33
31
|
}
|
|
32
|
+
exports.ChainflipBaasStatusSwapFromJSON = ChainflipBaasStatusSwapFromJSON;
|
|
34
33
|
function ChainflipBaasStatusSwapFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
34
|
if ((json === undefined) || (json === null)) {
|
|
36
35
|
return json;
|
|
@@ -50,6 +49,7 @@ function ChainflipBaasStatusSwapFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
50
49
|
'dca': !(0, runtime_1.exists)(json, 'dca') ? undefined : (0, ChainflipBaasStatusDca_1.ChainflipBaasStatusDcaFromJSON)(json['dca']),
|
|
51
50
|
};
|
|
52
51
|
}
|
|
52
|
+
exports.ChainflipBaasStatusSwapFromJSONTyped = ChainflipBaasStatusSwapFromJSONTyped;
|
|
53
53
|
function ChainflipBaasStatusSwapToJSON(value) {
|
|
54
54
|
if (value === undefined) {
|
|
55
55
|
return undefined;
|
|
@@ -72,3 +72,4 @@ function ChainflipBaasStatusSwapToJSON(value) {
|
|
|
72
72
|
'dca': (0, ChainflipBaasStatusDca_1.ChainflipBaasStatusDcaToJSON)(value.dca),
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
+
exports.ChainflipBaasStatusSwapToJSON = ChainflipBaasStatusSwapToJSON;
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* Do not edit the class manually.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.instanceOfChainflipBaasSwapDepositAddress =
|
|
18
|
-
exports.ChainflipBaasSwapDepositAddressFromJSON = ChainflipBaasSwapDepositAddressFromJSON;
|
|
19
|
-
exports.ChainflipBaasSwapDepositAddressFromJSONTyped = ChainflipBaasSwapDepositAddressFromJSONTyped;
|
|
20
|
-
exports.ChainflipBaasSwapDepositAddressToJSON = ChainflipBaasSwapDepositAddressToJSON;
|
|
17
|
+
exports.ChainflipBaasSwapDepositAddressToJSON = exports.ChainflipBaasSwapDepositAddressFromJSONTyped = exports.ChainflipBaasSwapDepositAddressFromJSON = exports.instanceOfChainflipBaasSwapDepositAddress = void 0;
|
|
21
18
|
const runtime_1 = require("../runtime");
|
|
22
19
|
/**
|
|
23
20
|
* Check if a given object implements the ChainflipBaasSwapDepositAddress interface.
|
|
@@ -26,9 +23,11 @@ function instanceOfChainflipBaasSwapDepositAddress(value) {
|
|
|
26
23
|
let isInstance = true;
|
|
27
24
|
return isInstance;
|
|
28
25
|
}
|
|
26
|
+
exports.instanceOfChainflipBaasSwapDepositAddress = instanceOfChainflipBaasSwapDepositAddress;
|
|
29
27
|
function ChainflipBaasSwapDepositAddressFromJSON(json) {
|
|
30
28
|
return ChainflipBaasSwapDepositAddressFromJSONTyped(json, false);
|
|
31
29
|
}
|
|
30
|
+
exports.ChainflipBaasSwapDepositAddressFromJSON = ChainflipBaasSwapDepositAddressFromJSON;
|
|
32
31
|
function ChainflipBaasSwapDepositAddressFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
32
|
if ((json === undefined) || (json === null)) {
|
|
34
33
|
return json;
|
|
@@ -45,6 +44,7 @@ function ChainflipBaasSwapDepositAddressFromJSONTyped(json, ignoreDiscriminator)
|
|
|
45
44
|
'channelOpeningFeeNative': !(0, runtime_1.exists)(json, 'channelOpeningFeeNative') ? undefined : json['channelOpeningFeeNative'],
|
|
46
45
|
};
|
|
47
46
|
}
|
|
47
|
+
exports.ChainflipBaasSwapDepositAddressFromJSONTyped = ChainflipBaasSwapDepositAddressFromJSONTyped;
|
|
48
48
|
function ChainflipBaasSwapDepositAddressToJSON(value) {
|
|
49
49
|
if (value === undefined) {
|
|
50
50
|
return undefined;
|
|
@@ -56,3 +56,4 @@ function ChainflipBaasSwapDepositAddressToJSON(value) {
|
|
|
56
56
|
'id': value.id,
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
+
exports.ChainflipBaasSwapDepositAddressToJSON = ChainflipBaasSwapDepositAddressToJSON;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const chainflipService: {
|
|
2
|
-
get: <T = any>(url: string, config?: import("axios").AxiosRequestConfig<any>) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T>, import("../../..").SwapErrorRight>>;
|
|
3
|
-
post: <
|
|
4
|
-
delete: <
|
|
2
|
+
get: <T = any>(url: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T, any, {}>, import("../../..").SwapErrorRight>>;
|
|
3
|
+
post: <T_1 = any>(url: string, data: any, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T_1, any, {}>, import("../../..").SwapErrorRight>>;
|
|
4
|
+
delete: <T_2 = any>(url: string, data: any, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T_2, any, {}>, import("../../..").SwapErrorRight>>;
|
|
5
5
|
};
|
|
@@ -70,11 +70,14 @@ const getQuoteOrRate = async (input, deps) => {
|
|
|
70
70
|
if (maybeQuoteResponse.isErr()) {
|
|
71
71
|
const error = maybeQuoteResponse.unwrapErr();
|
|
72
72
|
const cause = error.cause;
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
// Chainflip returns a 400 with `errors.minimalAmountNative` when the sell amount is below the
|
|
74
|
+
// route minimum. The `detail` wording varies ("Amount outside asset bounds", "Amount below
|
|
75
|
+
// minimum. Min: ..."), so key off the field rather than string-matching the message.
|
|
76
|
+
const minAmountCryptoBaseUnit = cause?.response?.data?.errors?.minimalAmountNative?.[0];
|
|
77
|
+
if (cause?.response?.status === 400 && minAmountCryptoBaseUnit !== undefined) {
|
|
75
78
|
return (0, monads_1.Err)((0, utils_2.createTradeAmountTooSmallErr)({
|
|
76
79
|
assetId: sellAsset.assetId,
|
|
77
|
-
minAmountCryptoBaseUnit
|
|
80
|
+
minAmountCryptoBaseUnit,
|
|
78
81
|
}));
|
|
79
82
|
}
|
|
80
83
|
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
@@ -122,6 +125,21 @@ const getQuoteOrRate = async (input, deps) => {
|
|
|
122
125
|
const { fast } = await sellAdapter.getFeeData(getFeeDataInput);
|
|
123
126
|
return { networkFeeCryptoBaseUnit: fast.txFee };
|
|
124
127
|
}
|
|
128
|
+
case caip_1.CHAIN_NAMESPACE.Tron: {
|
|
129
|
+
if (!input.sendAddress)
|
|
130
|
+
return { networkFeeCryptoBaseUnit: undefined };
|
|
131
|
+
const sellAdapter = deps.assertGetTronChainAdapter(sellAsset.chainId);
|
|
132
|
+
const { fast } = await sellAdapter.getFeeData({
|
|
133
|
+
// Simulates a self-send, since we don't know the 'to' just yet at this stage
|
|
134
|
+
to: input.sendAddress,
|
|
135
|
+
value: sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
136
|
+
chainSpecific: {
|
|
137
|
+
from: input.sendAddress,
|
|
138
|
+
contractAddress: (0, utils_1.contractAddressOrUndefined)(sellAsset.assetId),
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
return { networkFeeCryptoBaseUnit: fast.txFee };
|
|
142
|
+
}
|
|
125
143
|
default:
|
|
126
144
|
throw new Error('Unsupported chainNamespace');
|
|
127
145
|
}
|
|
@@ -185,6 +203,8 @@ const getQuoteOrRate = async (input, deps) => {
|
|
|
185
203
|
return 10;
|
|
186
204
|
case caip_1.CHAIN_NAMESPACE.Solana:
|
|
187
205
|
return 0;
|
|
206
|
+
case caip_1.CHAIN_NAMESPACE.Tron:
|
|
207
|
+
return 0;
|
|
188
208
|
default:
|
|
189
209
|
throw new Error('Unsupported chainNamespace');
|
|
190
210
|
}
|
|
@@ -231,7 +251,7 @@ const getQuoteOrRate = async (input, deps) => {
|
|
|
231
251
|
buyAsset,
|
|
232
252
|
sellAsset,
|
|
233
253
|
accountNumber,
|
|
234
|
-
allowanceContract: '0x0',
|
|
254
|
+
allowanceContract: '0x0',
|
|
235
255
|
estimatedExecutionTimeMs: (singleQuoteResponse.boostQuote.estimatedDurationsSeconds?.deposit ?? 0) +
|
|
236
256
|
(singleQuoteResponse.boostQuote.estimatedDurationsSeconds?.swap ?? 0) * 1000,
|
|
237
257
|
chainflipSpecific: {
|
|
@@ -289,7 +309,7 @@ const getQuoteOrRate = async (input, deps) => {
|
|
|
289
309
|
buyAsset,
|
|
290
310
|
sellAsset,
|
|
291
311
|
accountNumber,
|
|
292
|
-
allowanceContract: '0x0',
|
|
312
|
+
allowanceContract: '0x0',
|
|
293
313
|
estimatedExecutionTimeMs: ((singleQuoteResponse.estimatedDurationsSeconds?.deposit ?? 0) +
|
|
294
314
|
(singleQuoteResponse.estimatedDurationsSeconds?.swap ?? 0)) *
|
|
295
315
|
1000,
|
|
@@ -5,5 +5,5 @@ type GetUtxoTxFeesInput = {
|
|
|
5
5
|
sellAdapter: UtxoChainAdapter;
|
|
6
6
|
pubKey: string | undefined;
|
|
7
7
|
};
|
|
8
|
-
export declare const getUtxoTxFees: ({ sellAmountCryptoBaseUnit, sellAdapter, pubKey, }: GetUtxoTxFeesInput) => Promise<Omit<QuoteFeeData,
|
|
8
|
+
export declare const getUtxoTxFees: ({ sellAmountCryptoBaseUnit, sellAdapter, pubKey, }: GetUtxoTxFeesInput) => Promise<Omit<QuoteFeeData, 'protocolFees'>>;
|
|
9
9
|
export {};
|
|
@@ -3,7 +3,6 @@ import type { Asset } from '@shapeshiftoss/types';
|
|
|
3
3
|
import type { Result } from '@sniptt/monads';
|
|
4
4
|
import type { AxiosResponse } from 'axios';
|
|
5
5
|
import type { SwapErrorRight } from '../../../types';
|
|
6
|
-
import type { ChainflipSupportedChainId } from '../constants';
|
|
7
6
|
import type { ChainflipBaasSwapDepositAddress } from '../models';
|
|
8
7
|
type ChainFlipBrokerBaseArgs = {
|
|
9
8
|
brokerUrl: string;
|
|
@@ -21,8 +20,8 @@ type GetChainFlipSwapArgs = ChainFlipBrokerBaseArgs & {
|
|
|
21
20
|
numberOfChunks?: number;
|
|
22
21
|
chunkIntervalBlocks?: number;
|
|
23
22
|
};
|
|
24
|
-
export declare const isSupportedChainId: (chainId: ChainId) => chainId is
|
|
25
|
-
export declare const isSupportedAssetId: (chainId: ChainId, assetId: AssetId) => chainId is
|
|
23
|
+
export declare const isSupportedChainId: (chainId: ChainId) => chainId is import("@shapeshiftoss/types").KnownChainIds.EthereumMainnet | import("@shapeshiftoss/types").KnownChainIds.ArbitrumMainnet | import("@shapeshiftoss/types").KnownChainIds.BitcoinMainnet | import("@shapeshiftoss/types").KnownChainIds.SolanaMainnet | import("@shapeshiftoss/types").KnownChainIds.TronMainnet;
|
|
24
|
+
export declare const isSupportedAssetId: (chainId: ChainId, assetId: AssetId) => chainId is import("@shapeshiftoss/types").KnownChainIds.EthereumMainnet | import("@shapeshiftoss/types").KnownChainIds.ArbitrumMainnet | import("@shapeshiftoss/types").KnownChainIds.BitcoinMainnet | import("@shapeshiftoss/types").KnownChainIds.SolanaMainnet | import("@shapeshiftoss/types").KnownChainIds.TronMainnet;
|
|
26
25
|
export declare const calculateChainflipMinPrice: ({ sellAmountIncludingProtocolFeesCryptoBaseUnit, buyAmountAfterFeesCryptoBaseUnit, slippageTolerancePercentageDecimal, sellAsset, buyAsset, }: {
|
|
27
26
|
sellAmountIncludingProtocolFeesCryptoBaseUnit: string;
|
|
28
27
|
buyAmountAfterFeesCryptoBaseUnit: string;
|
|
@@ -51,7 +51,8 @@ const getChainFlipSwap = ({ brokerUrl, apiKey, sourceAsset, destinationAsset, de
|
|
|
51
51
|
swapUrl += `&numberOfChunks=${numberOfChunks}`;
|
|
52
52
|
swapUrl += `&chunkIntervalBlocks=${chunkIntervalBlocks}`;
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
// Opening a deposit channel can spike past the default 10s timeout (notably on Tron).
|
|
55
|
+
return chainflipService_1.chainflipService.get(swapUrl, { timeout: 30_000 });
|
|
55
56
|
};
|
|
56
57
|
exports.getChainFlipSwap = getChainFlipSwap;
|
|
57
58
|
const fetchChainFlipAssets = async ({ brokerUrl, }) => {
|