@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
package/dist/esm/constants.js
CHANGED
|
@@ -7,6 +7,8 @@ import { avnuSwapper } from './swappers/AvnuSwapper/AvnuSwapper.js';
|
|
|
7
7
|
import { avnuApi } from './swappers/AvnuSwapper/endpoints.js';
|
|
8
8
|
import { bebopSwapper } from './swappers/BebopSwapper/BebopSwapper.js';
|
|
9
9
|
import { bebopApi } from './swappers/BebopSwapper/endpoints.js';
|
|
10
|
+
import { bobGatewaySwapper } from './swappers/BobGatewaySwapper/BobGatewaySwapper.js';
|
|
11
|
+
import { bobGatewayApi } from './swappers/BobGatewaySwapper/endpoints.js';
|
|
10
12
|
import { butterSwap } from './swappers/ButterSwap/ButterSwap.js';
|
|
11
13
|
import { butterSwapApi } from './swappers/ButterSwap/endpoints.js';
|
|
12
14
|
import { cetusSwapper } from './swappers/CetusSwapper/CetusSwapper.js';
|
|
@@ -111,6 +113,10 @@ export const swappers = {
|
|
|
111
113
|
...debridgeSwapper,
|
|
112
114
|
...debridgeApi,
|
|
113
115
|
},
|
|
116
|
+
[SwapperName.BobGateway]: {
|
|
117
|
+
...bobGatewaySwapper,
|
|
118
|
+
...bobGatewayApi,
|
|
119
|
+
},
|
|
114
120
|
[SwapperName.Test]: undefined,
|
|
115
121
|
};
|
|
116
122
|
const DEFAULT_SLIPPAGE_DECIMAL_PERCENTAGE = '0.002';
|
|
@@ -129,6 +135,7 @@ const DEFAULT_AVNU_SLIPPAGE_DECIMAL_PERCENTAGE = '0.02';
|
|
|
129
135
|
const DEFAULT_STONFI_SLIPPAGE_DECIMAL_PERCENTAGE = '0.01';
|
|
130
136
|
// deBridge API off-chain simulation overestimates output on some chains (e.g. SEI ~2.4%), so auto slippage (1%) is insufficient
|
|
131
137
|
const DEFAULT_DEBRIDGE_SLIPPAGE_DECIMAL_PERCENTAGE = '0.03';
|
|
138
|
+
const DEFAULT_BOB_GATEWAY_SLIPPAGE_DECIMAL_PERCENTAGE = '0.03';
|
|
132
139
|
export const getDefaultSlippageDecimalPercentageForSwapper = (swapperName) => {
|
|
133
140
|
if (swapperName === undefined)
|
|
134
141
|
return DEFAULT_SLIPPAGE_DECIMAL_PERCENTAGE;
|
|
@@ -167,6 +174,8 @@ export const getDefaultSlippageDecimalPercentageForSwapper = (swapperName) => {
|
|
|
167
174
|
return DEFAULT_AVNU_SLIPPAGE_DECIMAL_PERCENTAGE;
|
|
168
175
|
case SwapperName.Stonfi:
|
|
169
176
|
return DEFAULT_STONFI_SLIPPAGE_DECIMAL_PERCENTAGE;
|
|
177
|
+
case SwapperName.BobGateway:
|
|
178
|
+
return DEFAULT_BOB_GATEWAY_SLIPPAGE_DECIMAL_PERCENTAGE;
|
|
170
179
|
default:
|
|
171
180
|
return assertUnreachable(swapperName);
|
|
172
181
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './cowswap-utils/index.js';
|
|
|
3
3
|
export * from './safe-utils/index.js';
|
|
4
4
|
export * from './swapper.js';
|
|
5
5
|
export * from './swappers/ArbitrumBridgeSwapper/index.js';
|
|
6
|
+
export * from './swappers/BobGatewaySwapper/index.js';
|
|
6
7
|
export * from './swappers/AvnuSwapper/index.js';
|
|
7
8
|
export * from './swappers/BebopSwapper/index.js';
|
|
8
9
|
export * from './swappers/CetusSwapper/index.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './cowswap-utils/index.js';
|
|
|
3
3
|
export * from './safe-utils/index.js';
|
|
4
4
|
export * from './swapper.js';
|
|
5
5
|
export * from './swappers/ArbitrumBridgeSwapper/index.js';
|
|
6
|
+
export * from './swappers/BobGatewaySwapper/index.js';
|
|
6
7
|
export * from './swappers/AvnuSwapper/index.js';
|
|
7
8
|
export * from './swappers/BebopSwapper/index.js';
|
|
8
9
|
export * from './swappers/CetusSwapper/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const acrossService: {
|
|
2
|
-
get: <T = any>(url: string, config?: import("axios").AxiosRequestConfig<any>) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T>, import("../../../index.js").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("../../../index.js").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("../../../index.js").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("../../../index.js").SwapErrorRight>>;
|
|
5
5
|
};
|
|
@@ -5,9 +5,9 @@ export declare const getParentToChildMessageDataFromParentTxHash: ({ depositTxId
|
|
|
5
5
|
depositTxId: string;
|
|
6
6
|
parentProvider: ethersv5.providers.JsonRpcProvider;
|
|
7
7
|
childProvider: ethersv5.providers.JsonRpcProvider;
|
|
8
|
-
isClassic?: boolean;
|
|
8
|
+
isClassic?: boolean | undefined;
|
|
9
9
|
}) => Promise<{
|
|
10
|
-
isClassic?: boolean;
|
|
11
|
-
parentToChildMsg?: ParentToChildMessageReaderClassic | ParentToChildMessageReader;
|
|
10
|
+
isClassic?: boolean | undefined;
|
|
11
|
+
parentToChildMsg?: ParentToChildMessageReaderClassic | ParentToChildMessageReader | undefined;
|
|
12
12
|
} | undefined>;
|
|
13
13
|
export declare const arbitrumBridgeApi: SwapperApi;
|
|
@@ -51,7 +51,9 @@ describe('getTradeQuote', () => {
|
|
|
51
51
|
},
|
|
52
52
|
}),
|
|
53
53
|
};
|
|
54
|
-
vi.mocked(EthBridger).
|
|
54
|
+
vi.mocked(EthBridger).mockImplementation(function () {
|
|
55
|
+
return ethBridgerMock;
|
|
56
|
+
});
|
|
55
57
|
const maybeQuote = await getTradeQuote(commonInput, {
|
|
56
58
|
assertGetEvmChainAdapter,
|
|
57
59
|
getEthersV5Provider: vi.fn(),
|
|
@@ -74,7 +76,9 @@ describe('getTradeQuote', () => {
|
|
|
74
76
|
},
|
|
75
77
|
}),
|
|
76
78
|
};
|
|
77
|
-
vi.mocked(EthBridger).
|
|
79
|
+
vi.mocked(EthBridger).mockImplementation(function () {
|
|
80
|
+
return ethBridgerMock;
|
|
81
|
+
});
|
|
78
82
|
const withdrawInput = {
|
|
79
83
|
...commonInput,
|
|
80
84
|
sellAsset: ETH_ARBITRUM,
|
|
@@ -109,7 +113,9 @@ describe('getTradeQuote', () => {
|
|
|
109
113
|
.fn()
|
|
110
114
|
.mockResolvedValue('0x0c66f315542fdec1d312c415b14eef614b0910ef'),
|
|
111
115
|
};
|
|
112
|
-
vi.mocked(Erc20Bridger).
|
|
116
|
+
vi.mocked(Erc20Bridger).mockImplementation(function () {
|
|
117
|
+
return Erc20BridgerMock;
|
|
118
|
+
});
|
|
113
119
|
const erc20DepositInput = {
|
|
114
120
|
...commonInput,
|
|
115
121
|
sellAsset: FOX_MAINNET,
|
|
@@ -144,7 +150,9 @@ describe('getTradeQuote', () => {
|
|
|
144
150
|
.fn()
|
|
145
151
|
.mockResolvedValue('0x0c66f315542fdec1d312c415b14eef614b0910ef'),
|
|
146
152
|
};
|
|
147
|
-
vi.mocked(Erc20Bridger).
|
|
153
|
+
vi.mocked(Erc20Bridger).mockImplementation(function () {
|
|
154
|
+
return Erc20BridgerMock;
|
|
155
|
+
});
|
|
148
156
|
const erc20WithdrawInput = {
|
|
149
157
|
...commonInput,
|
|
150
158
|
sellAsset: FOX_ARBITRUM,
|
|
@@ -23,12 +23,12 @@ export type FetchArbitrumBridgeQuoteInput = {
|
|
|
23
23
|
assertGetEvmChainAdapter: (chainId: ChainId) => EvmChainAdapter;
|
|
24
24
|
};
|
|
25
25
|
export declare const fetchArbitrumBridgePrice: (args: FetchArbitrumBridgePriceInput) => Promise<{
|
|
26
|
-
request: Omit<ParentToChildTransactionRequest | ChildToParentTransactionRequest,
|
|
26
|
+
request: Omit<ParentToChildTransactionRequest | ChildToParentTransactionRequest, 'retryableData'> | undefined;
|
|
27
27
|
allowanceContract: string;
|
|
28
28
|
networkFeeCryptoBaseUnit: string;
|
|
29
29
|
}>;
|
|
30
30
|
export declare const fetchArbitrumBridgeQuote: (args: FetchArbitrumBridgeQuoteInput) => Promise<{
|
|
31
|
-
request: Omit<ParentToChildTransactionRequest | ChildToParentTransactionRequest,
|
|
31
|
+
request: Omit<ParentToChildTransactionRequest | ChildToParentTransactionRequest, 'retryableData'> | undefined;
|
|
32
32
|
allowanceContract: string;
|
|
33
33
|
networkFeeCryptoBaseUnit: string;
|
|
34
34
|
}>;
|
|
@@ -145,8 +145,8 @@ export const avnuApi = {
|
|
|
145
145
|
compiledCalldata: formattedCalldata,
|
|
146
146
|
chainId: chainIdHex,
|
|
147
147
|
nonce,
|
|
148
|
-
nonceDataAvailabilityMode: 0,
|
|
149
|
-
feeDataAvailabilityMode: 0,
|
|
148
|
+
nonceDataAvailabilityMode: 0,
|
|
149
|
+
feeDataAvailabilityMode: 0,
|
|
150
150
|
resourceBounds: {
|
|
151
151
|
l1_gas: {
|
|
152
152
|
max_amount: resourceBounds.l1_gas.max_amount,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChainId } from '@shapeshiftoss/caip';
|
|
2
2
|
export declare const AVNU_SUPPORTED_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 DEFAULT_SLIPPAGE_PERCENTAGE = "0.005";
|
|
5
5
|
export declare const AVNU_API_BASE_URL = "https://starknet.api.avnu.fi";
|
|
@@ -3,7 +3,8 @@ import { v4 as uuid } from 'uuid';
|
|
|
3
3
|
import { getDefaultSlippageDecimalPercentageForSwapper } from '../../../constants.js';
|
|
4
4
|
import { SwapperName, TradeQuoteError } from '../../../types.js';
|
|
5
5
|
import { makeSwapErrorRight } from '../../../utils.js';
|
|
6
|
-
import {
|
|
6
|
+
import { BEBOP_SOLANA_DUMMY_ADDRESS } from '../types.js';
|
|
7
|
+
import { fetchBebopSolanaQuote } from '../utils/fetchFromBebop.js';
|
|
7
8
|
import { assertValidTrade, calculateRate, isBebopSolanaTxSafe } from '../utils/helpers/helpers.js';
|
|
8
9
|
export async function getBebopSolanaTradeRate(input, _assetsById, apiKey) {
|
|
9
10
|
const { sellAsset, buyAsset, accountNumber, receiveAddress, affiliateBps, sellAmountIncludingProtocolFeesCryptoBaseUnit, } = input;
|
|
@@ -12,17 +13,20 @@ export async function getBebopSolanaTradeRate(input, _assetsById, apiKey) {
|
|
|
12
13
|
return Err(assertion.unwrapErr());
|
|
13
14
|
const slippageTolerancePercentageDecimal = input.slippageTolerancePercentageDecimal ??
|
|
14
15
|
getDefaultSlippageDecimalPercentageForSwapper(SwapperName.Bebop);
|
|
15
|
-
const
|
|
16
|
+
const address = receiveAddress ?? BEBOP_SOLANA_DUMMY_ADDRESS;
|
|
17
|
+
const maybeBebopQuoteResponse = await fetchBebopSolanaQuote({
|
|
16
18
|
buyAsset,
|
|
17
19
|
sellAsset,
|
|
18
20
|
sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
19
|
-
|
|
21
|
+
takerAddress: address,
|
|
22
|
+
receiverAddress: address,
|
|
23
|
+
slippageTolerancePercentageDecimal,
|
|
20
24
|
affiliateBps,
|
|
21
25
|
apiKey,
|
|
22
26
|
});
|
|
23
|
-
if (
|
|
24
|
-
return Err(
|
|
25
|
-
const bebopPriceResponse =
|
|
27
|
+
if (maybeBebopQuoteResponse.isErr())
|
|
28
|
+
return Err(maybeBebopQuoteResponse.unwrapErr());
|
|
29
|
+
const bebopPriceResponse = maybeBebopQuoteResponse.unwrap();
|
|
26
30
|
const sellTokenAddress = Object.keys(bebopPriceResponse.sellTokens)[0];
|
|
27
31
|
const buyTokenAddress = Object.keys(bebopPriceResponse.buyTokens)[0];
|
|
28
32
|
if (!sellTokenAddress || !buyTokenAddress) {
|
|
@@ -37,15 +37,7 @@ export async function getBebopTradeQuote(input, assertGetEvmChainAdapter, _asset
|
|
|
37
37
|
});
|
|
38
38
|
if (maybeBebopQuoteResponse.isErr())
|
|
39
39
|
return Err(maybeBebopQuoteResponse.unwrapErr());
|
|
40
|
-
const
|
|
41
|
-
const bestRoute = bebopQuoteResponse.routes.find(r => r.type === bebopQuoteResponse.bestPrice);
|
|
42
|
-
if (!bestRoute || !bestRoute.quote) {
|
|
43
|
-
return Err(makeSwapErrorRight({
|
|
44
|
-
message: 'No best route found',
|
|
45
|
-
code: TradeQuoteError.NoRouteFound,
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
const quote = bestRoute.quote;
|
|
40
|
+
const quote = maybeBebopQuoteResponse.unwrap();
|
|
49
41
|
const sellTokenAddress = Object.keys(quote.sellTokens)[0];
|
|
50
42
|
const buyTokenAddress = Object.keys(quote.buyTokens)[0];
|
|
51
43
|
if (!isAddress(sellTokenAddress) || !isAddress(buyTokenAddress)) {
|
|
@@ -92,7 +84,7 @@ export async function getBebopTradeQuote(input, assertGetEvmChainAdapter, _asset
|
|
|
92
84
|
accountNumber,
|
|
93
85
|
rate,
|
|
94
86
|
feeData: {
|
|
95
|
-
protocolFees: {},
|
|
87
|
+
protocolFees: {},
|
|
96
88
|
networkFeeCryptoBaseUnit,
|
|
97
89
|
},
|
|
98
90
|
buyAmountBeforeFeesCryptoBaseUnit,
|
|
@@ -8,7 +8,8 @@ import { SwapperName, TradeQuoteError } from '../../../types.js';
|
|
|
8
8
|
import { makeSwapErrorRight } from '../../../utils.js';
|
|
9
9
|
import { buildAffiliateFee } from '../../utils/affiliateFee.js';
|
|
10
10
|
import { isNativeEvmAsset } from '../../utils/helpers/helpers.js';
|
|
11
|
-
import {
|
|
11
|
+
import { BEBOP_DUMMY_ADDRESS } from '../types.js';
|
|
12
|
+
import { fetchBebopQuote } from '../utils/fetchFromBebop.js';
|
|
12
13
|
import { assertValidTrade, calculateRate } from '../utils/helpers/helpers.js';
|
|
13
14
|
export async function getBebopTradeRate(input, assertGetEvmChainAdapter, _assetsById, apiKey) {
|
|
14
15
|
const { sellAsset, buyAsset, accountNumber, receiveAddress, affiliateBps, sellAmountIncludingProtocolFeesCryptoBaseUnit, } = input;
|
|
@@ -17,25 +18,20 @@ export async function getBebopTradeRate(input, assertGetEvmChainAdapter, _assets
|
|
|
17
18
|
return Err(assertion.unwrapErr());
|
|
18
19
|
const slippageTolerancePercentageDecimal = input.slippageTolerancePercentageDecimal ??
|
|
19
20
|
getDefaultSlippageDecimalPercentageForSwapper(SwapperName.Bebop);
|
|
20
|
-
const
|
|
21
|
+
const address = receiveAddress ?? BEBOP_DUMMY_ADDRESS;
|
|
22
|
+
const maybeBebopQuoteResponse = await fetchBebopQuote({
|
|
21
23
|
buyAsset,
|
|
22
24
|
sellAsset,
|
|
23
25
|
sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
24
|
-
|
|
26
|
+
takerAddress: address,
|
|
27
|
+
receiverAddress: address,
|
|
28
|
+
slippageTolerancePercentageDecimal,
|
|
25
29
|
affiliateBps,
|
|
26
30
|
apiKey,
|
|
27
31
|
});
|
|
28
|
-
if (
|
|
29
|
-
return Err(
|
|
30
|
-
const
|
|
31
|
-
const bestRoute = bebopPriceResponse.routes.find(r => r.type === bebopPriceResponse.bestPrice);
|
|
32
|
-
if (!bestRoute || !bestRoute.quote) {
|
|
33
|
-
return Err(makeSwapErrorRight({
|
|
34
|
-
message: 'No best route found',
|
|
35
|
-
code: TradeQuoteError.NoRouteFound,
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
const quote = bestRoute.quote;
|
|
32
|
+
if (maybeBebopQuoteResponse.isErr())
|
|
33
|
+
return Err(maybeBebopQuoteResponse.unwrapErr());
|
|
34
|
+
const quote = maybeBebopQuoteResponse.unwrap();
|
|
39
35
|
const sellTokenAddress = Object.keys(quote.sellTokens)[0];
|
|
40
36
|
const buyTokenAddress = Object.keys(quote.buyTokens)[0];
|
|
41
37
|
if (!isAddress(sellTokenAddress) || !isAddress(buyTokenAddress)) {
|
|
@@ -76,7 +72,7 @@ export async function getBebopTradeRate(input, assertGetEvmChainAdapter, _assets
|
|
|
76
72
|
accountNumber,
|
|
77
73
|
rate,
|
|
78
74
|
feeData: {
|
|
79
|
-
protocolFees: {},
|
|
75
|
+
protocolFees: {},
|
|
80
76
|
networkFeeCryptoBaseUnit,
|
|
81
77
|
},
|
|
82
78
|
buyAmountBeforeFeesCryptoBaseUnit,
|
|
@@ -3,91 +3,77 @@ import type { Address, Hex } from 'viem';
|
|
|
3
3
|
export declare const bebopSupportedEvmChainIds: readonly [KnownChainIds.EthereumMainnet, KnownChainIds.PolygonMainnet, KnownChainIds.ArbitrumMainnet, KnownChainIds.BaseMainnet, KnownChainIds.AvalancheMainnet, KnownChainIds.OptimismMainnet, KnownChainIds.BnbSmartChainMainnet];
|
|
4
4
|
export declare const bebopSupportedChainIds: readonly [KnownChainIds.EthereumMainnet, KnownChainIds.PolygonMainnet, KnownChainIds.ArbitrumMainnet, KnownChainIds.BaseMainnet, KnownChainIds.AvalancheMainnet, KnownChainIds.OptimismMainnet, KnownChainIds.BnbSmartChainMainnet, KnownChainIds.SolanaMainnet];
|
|
5
5
|
export type BebopSupportedChainId = (typeof bebopSupportedChainIds)[number];
|
|
6
|
-
export type
|
|
6
|
+
export type BebopQuoteResponse = {
|
|
7
|
+
requestId: string;
|
|
7
8
|
type: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
status: string;
|
|
10
|
+
quoteId: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
approvalType: 'Standard' | 'Permit' | 'Permit2';
|
|
13
|
+
nativeToken: string;
|
|
14
|
+
taker: Address;
|
|
15
|
+
receiver: Address;
|
|
16
|
+
expiry: number;
|
|
17
|
+
slippage: number;
|
|
18
|
+
gasFee: {
|
|
19
|
+
native: string;
|
|
20
|
+
usd: number;
|
|
21
|
+
};
|
|
22
|
+
buyTokens: Record<Address, {
|
|
23
|
+
amount: string;
|
|
24
|
+
decimals: number;
|
|
25
|
+
priceUsd: number;
|
|
26
|
+
symbol: string;
|
|
27
|
+
minimumAmount: string;
|
|
28
|
+
price: number;
|
|
29
|
+
priceBeforeFee: number;
|
|
30
|
+
amountBeforeFee: string;
|
|
31
|
+
deltaFromExpected: number;
|
|
32
|
+
}>;
|
|
33
|
+
sellTokens: Record<Address, {
|
|
34
|
+
amount: string;
|
|
35
|
+
decimals: number;
|
|
36
|
+
priceUsd: number;
|
|
37
|
+
symbol: string;
|
|
38
|
+
price: number;
|
|
39
|
+
priceBeforeFee: number;
|
|
40
|
+
}>;
|
|
41
|
+
settlementAddress: Address;
|
|
42
|
+
approvalTarget: Address;
|
|
43
|
+
requiredSignatures: string[];
|
|
44
|
+
priceImpact: number;
|
|
45
|
+
warnings: string[];
|
|
46
|
+
toSign: {
|
|
47
|
+
partner_id: number;
|
|
18
48
|
expiry: number;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
symbol: string;
|
|
29
|
-
minimumAmount: string;
|
|
30
|
-
price: number;
|
|
31
|
-
priceBeforeFee: number;
|
|
32
|
-
amountBeforeFee: string;
|
|
33
|
-
deltaFromExpected: number;
|
|
34
|
-
}>;
|
|
35
|
-
sellTokens: Record<Address, {
|
|
36
|
-
amount: string;
|
|
37
|
-
decimals: number;
|
|
38
|
-
priceUsd: number;
|
|
39
|
-
symbol: string;
|
|
40
|
-
price: number;
|
|
41
|
-
priceBeforeFee: number;
|
|
42
|
-
}>;
|
|
43
|
-
settlementAddress: Address;
|
|
44
|
-
approvalTarget: Address;
|
|
45
|
-
requiredSignatures: string[];
|
|
46
|
-
priceImpact: number;
|
|
47
|
-
warnings: string[];
|
|
48
|
-
toSign: {
|
|
49
|
-
partner_id: number;
|
|
50
|
-
expiry: number;
|
|
51
|
-
taker_address: Address;
|
|
52
|
-
maker_address: Address;
|
|
53
|
-
maker_nonce: string;
|
|
54
|
-
taker_token: Address;
|
|
55
|
-
maker_token: Address;
|
|
56
|
-
taker_amount: string;
|
|
57
|
-
maker_amount: string;
|
|
58
|
-
receiver: Address;
|
|
59
|
-
packed_commands: string;
|
|
60
|
-
};
|
|
61
|
-
onchainOrderType?: string;
|
|
62
|
-
solver?: string;
|
|
63
|
-
makers?: string[];
|
|
64
|
-
partialFillOffset?: number;
|
|
65
|
-
tx: {
|
|
66
|
-
to: Address;
|
|
67
|
-
from: Address;
|
|
68
|
-
data: Hex;
|
|
69
|
-
value: Hex;
|
|
70
|
-
gas?: number;
|
|
71
|
-
gasPrice?: number;
|
|
72
|
-
};
|
|
73
|
-
partnerFee?: Record<Address, string>;
|
|
74
|
-
protocolFee?: Record<Address, string>;
|
|
49
|
+
taker_address: Address;
|
|
50
|
+
maker_address: Address;
|
|
51
|
+
maker_nonce: string;
|
|
52
|
+
taker_token: Address;
|
|
53
|
+
maker_token: Address;
|
|
54
|
+
taker_amount: string;
|
|
55
|
+
maker_amount: string;
|
|
56
|
+
receiver: Address;
|
|
57
|
+
packed_commands: string;
|
|
75
58
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
59
|
+
onchainOrderType?: string;
|
|
60
|
+
solver?: string;
|
|
61
|
+
makers?: string[];
|
|
62
|
+
partialFillOffset?: number;
|
|
63
|
+
tx: {
|
|
64
|
+
to: Address;
|
|
65
|
+
from: Address;
|
|
66
|
+
data: Hex;
|
|
67
|
+
value: Hex;
|
|
68
|
+
gas?: number;
|
|
69
|
+
gasPrice?: number;
|
|
70
|
+
};
|
|
71
|
+
partnerFee?: Record<Address, string>;
|
|
72
|
+
protocolFee?: Record<Address, string>;
|
|
87
73
|
};
|
|
88
74
|
export declare const chainIdToBebopChain: Record<BebopSupportedChainId, string>;
|
|
89
75
|
export declare const BEBOP_NATIVE_MARKER = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
90
|
-
export declare const BEBOP_DUMMY_ADDRESS:
|
|
76
|
+
export declare const BEBOP_DUMMY_ADDRESS: `0x${string}`;
|
|
91
77
|
export declare const BEBOP_SOLANA_DUMMY_ADDRESS = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
92
78
|
export type BebopSolanaQuoteResponse = {
|
|
93
79
|
requestId: string;
|
|
@@ -4,6 +4,6 @@ import type { MonadicSwapperAxiosService } from '../../../types.js';
|
|
|
4
4
|
type AxiosInstanceHoF = (instance: AxiosInstance, options?: Omit<RetryConfig, 'instance'>) => AxiosInstance;
|
|
5
5
|
export declare const bebopServiceFactory: ({ apiKey, wrapper, }: {
|
|
6
6
|
apiKey: string;
|
|
7
|
-
wrapper?: AxiosInstanceHoF;
|
|
7
|
+
wrapper?: AxiosInstanceHoF | undefined;
|
|
8
8
|
}) => MonadicSwapperAxiosService;
|
|
9
9
|
export {};
|
|
@@ -10,15 +10,7 @@ export declare const fetchBebopQuote: ({ buyAsset, sellAsset, sellAmountIncludin
|
|
|
10
10
|
takerAddress: Address;
|
|
11
11
|
receiverAddress: Address;
|
|
12
12
|
slippageTolerancePercentageDecimal: string;
|
|
13
|
-
affiliateBps?: string;
|
|
14
|
-
apiKey: string;
|
|
15
|
-
}) => Promise<Result<BebopQuoteResponse, SwapErrorRight>>;
|
|
16
|
-
export declare const fetchBebopPrice: ({ buyAsset, sellAsset, sellAmountIncludingProtocolFeesCryptoBaseUnit, receiveAddress, affiliateBps, apiKey, }: {
|
|
17
|
-
buyAsset: Asset;
|
|
18
|
-
sellAsset: Asset;
|
|
19
|
-
sellAmountIncludingProtocolFeesCryptoBaseUnit: string;
|
|
20
|
-
receiveAddress: string | undefined;
|
|
21
|
-
affiliateBps?: string;
|
|
13
|
+
affiliateBps?: string | undefined;
|
|
22
14
|
apiKey: string;
|
|
23
15
|
}) => Promise<Result<BebopQuoteResponse, SwapErrorRight>>;
|
|
24
16
|
export declare const fetchBebopSolanaQuote: ({ buyAsset, sellAsset, sellAmountIncludingProtocolFeesCryptoBaseUnit, takerAddress, receiverAddress, slippageTolerancePercentageDecimal, affiliateBps, apiKey, }: {
|
|
@@ -28,14 +20,6 @@ export declare const fetchBebopSolanaQuote: ({ buyAsset, sellAsset, sellAmountIn
|
|
|
28
20
|
takerAddress: string;
|
|
29
21
|
receiverAddress: string;
|
|
30
22
|
slippageTolerancePercentageDecimal: string;
|
|
31
|
-
affiliateBps?: string;
|
|
32
|
-
apiKey: string;
|
|
33
|
-
}) => Promise<Result<BebopSolanaQuoteResponse, SwapErrorRight>>;
|
|
34
|
-
export declare const fetchBebopSolanaPrice: ({ buyAsset, sellAsset, sellAmountIncludingProtocolFeesCryptoBaseUnit, receiveAddress, affiliateBps, apiKey, }: {
|
|
35
|
-
buyAsset: Asset;
|
|
36
|
-
sellAsset: Asset;
|
|
37
|
-
sellAmountIncludingProtocolFeesCryptoBaseUnit: string;
|
|
38
|
-
receiveAddress: string | undefined;
|
|
39
|
-
affiliateBps?: string;
|
|
23
|
+
affiliateBps?: string | undefined;
|
|
40
24
|
apiKey: string;
|
|
41
25
|
}) => Promise<Result<BebopSolanaQuoteResponse, SwapErrorRight>>;
|