@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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBobGatewayTradeQuote = void 0;
|
|
4
|
+
const chain_adapters_1 = require("@shapeshiftoss/chain-adapters");
|
|
5
|
+
const monads_1 = require("@sniptt/monads");
|
|
6
|
+
const uuid_1 = require("uuid");
|
|
7
|
+
const types_1 = require("../../../types");
|
|
8
|
+
const utils_1 = require("../../../utils");
|
|
9
|
+
const helpers_1 = require("../utils/helpers");
|
|
10
|
+
const getBobGatewayTradeQuote = async (input, deps) => {
|
|
11
|
+
const { sellAsset, buyAsset, sellAmountIncludingProtocolFeesCryptoBaseUnit, sendAddress, receiveAddress, accountNumber, affiliateBps, slippageTolerancePercentageDecimal, } = input;
|
|
12
|
+
const { config } = deps;
|
|
13
|
+
if (!sendAddress) {
|
|
14
|
+
return (0, monads_1.Err)((0, utils_1.makeSwapErrorRight)({
|
|
15
|
+
message: '[BobGateway] sendAddress is required for quote',
|
|
16
|
+
code: types_1.TradeQuoteError.UnknownError,
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
if (!receiveAddress) {
|
|
20
|
+
return (0, monads_1.Err)((0, utils_1.makeSwapErrorRight)({
|
|
21
|
+
message: '[BobGateway] receiveAddress is required for quote',
|
|
22
|
+
code: types_1.TradeQuoteError.UnknownError,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
const assertion = (0, helpers_1.assertValidTrade)({ sellAsset, buyAsset });
|
|
26
|
+
if (assertion.isErr())
|
|
27
|
+
return (0, monads_1.Err)(assertion.unwrapErr());
|
|
28
|
+
const { sellChainName, buyChainName } = assertion.unwrap();
|
|
29
|
+
// omit the sender for utxo sells so order creation does not enforce a per-address confirmed
|
|
30
|
+
// funds check (deposits are matched via op_return, not the sending address)
|
|
31
|
+
const sender = (0, chain_adapters_1.isEvmChainId)(sellAsset.chainId) ? sendAddress : undefined;
|
|
32
|
+
const maybeQuote = await (0, helpers_1.getBobGatewayQuote)({
|
|
33
|
+
config,
|
|
34
|
+
sellAsset,
|
|
35
|
+
buyAsset,
|
|
36
|
+
sellChainName,
|
|
37
|
+
buyChainName,
|
|
38
|
+
sender,
|
|
39
|
+
recipient: receiveAddress,
|
|
40
|
+
amount: sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
41
|
+
affiliateBps,
|
|
42
|
+
slippageTolerancePercentageDecimal,
|
|
43
|
+
});
|
|
44
|
+
if (maybeQuote.isErr())
|
|
45
|
+
return (0, monads_1.Err)(maybeQuote.unwrapErr());
|
|
46
|
+
const quote = maybeQuote.unwrap();
|
|
47
|
+
const maybeOrderMetadata = await (0, helpers_1.createBobGatewayOrderMetadata)(config, quote);
|
|
48
|
+
if (maybeOrderMetadata.isErr())
|
|
49
|
+
return (0, monads_1.Err)(maybeOrderMetadata.unwrapErr());
|
|
50
|
+
const orderMetadata = maybeOrderMetadata.unwrap();
|
|
51
|
+
const maybeFeeData = await (0, helpers_1.getBobGatewayQuoteFeeData)(input, deps, orderMetadata);
|
|
52
|
+
if (maybeFeeData.isErr())
|
|
53
|
+
return (0, monads_1.Err)(maybeFeeData.unwrapErr());
|
|
54
|
+
const feeData = maybeFeeData.unwrap();
|
|
55
|
+
const { buyAmountBeforeFeesCryptoBaseUnit, buyAmountAfterFeesCryptoBaseUnit, protocolFees, estimatedExecutionTimeMs, } = (0, helpers_1.parseBobGatewayQuote)(quote, buyAsset, deps.assetsById);
|
|
56
|
+
const rate = (0, utils_1.getInputOutputRate)({
|
|
57
|
+
sellAmountCryptoBaseUnit: sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
58
|
+
buyAmountCryptoBaseUnit: buyAmountAfterFeesCryptoBaseUnit,
|
|
59
|
+
sellAsset,
|
|
60
|
+
buyAsset,
|
|
61
|
+
});
|
|
62
|
+
const allowanceContract = (0, helpers_1.getBobGatewayAllowanceContract)(quote, sellAsset);
|
|
63
|
+
const tradeQuote = {
|
|
64
|
+
id: (0, uuid_1.v4)(),
|
|
65
|
+
quoteOrRate: 'quote',
|
|
66
|
+
rate,
|
|
67
|
+
receiveAddress,
|
|
68
|
+
affiliateBps,
|
|
69
|
+
slippageTolerancePercentageDecimal,
|
|
70
|
+
swapperName: types_1.SwapperName.BobGateway,
|
|
71
|
+
steps: [
|
|
72
|
+
{
|
|
73
|
+
buyAmountBeforeFeesCryptoBaseUnit,
|
|
74
|
+
buyAmountAfterFeesCryptoBaseUnit,
|
|
75
|
+
sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
76
|
+
feeData: { ...feeData, protocolFees },
|
|
77
|
+
rate,
|
|
78
|
+
source: types_1.SwapperName.BobGateway,
|
|
79
|
+
buyAsset,
|
|
80
|
+
sellAsset,
|
|
81
|
+
accountNumber,
|
|
82
|
+
allowanceContract,
|
|
83
|
+
estimatedExecutionTimeMs,
|
|
84
|
+
bobSpecific: orderMetadata,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
return (0, monads_1.Ok)(tradeQuote);
|
|
89
|
+
};
|
|
90
|
+
exports.getBobGatewayTradeQuote = getBobGatewayTradeQuote;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Result } from '@sniptt/monads';
|
|
2
|
+
import type { GetTradeRateInput, SwapErrorRight, SwapperDeps, TradeRate } from '../../../types';
|
|
3
|
+
export declare const getBobGatewayTradeRate: (input: GetTradeRateInput, deps: SwapperDeps) => Promise<Result<TradeRate, SwapErrorRight>>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBobGatewayTradeRate = void 0;
|
|
4
|
+
const caip_1 = require("@shapeshiftoss/caip");
|
|
5
|
+
const monads_1 = require("@sniptt/monads");
|
|
6
|
+
const uuid_1 = require("uuid");
|
|
7
|
+
const types_1 = require("../../../types");
|
|
8
|
+
const utils_1 = require("../../../utils");
|
|
9
|
+
const constants_1 = require("../utils/constants");
|
|
10
|
+
const helpers_1 = require("../utils/helpers");
|
|
11
|
+
const getBobGatewayTradeRate = async (input, deps) => {
|
|
12
|
+
const { sellAsset, buyAsset, sellAmountIncludingProtocolFeesCryptoBaseUnit, receiveAddress, accountNumber, affiliateBps, slippageTolerancePercentageDecimal, } = input;
|
|
13
|
+
const { config } = deps;
|
|
14
|
+
const assertion = (0, helpers_1.assertValidTrade)({ sellAsset, buyAsset });
|
|
15
|
+
if (assertion.isErr())
|
|
16
|
+
return (0, monads_1.Err)(assertion.unwrapErr());
|
|
17
|
+
const { sellChainName, buyChainName } = assertion.unwrap();
|
|
18
|
+
const recipient = receiveAddress ?? (buyAsset.chainId === caip_1.btcChainId ? constants_1.DUMMY_BTC_ADDRESS : constants_1.DUMMY_EVM_ADDRESS);
|
|
19
|
+
const sender = sellAsset.chainId === caip_1.btcChainId ? undefined : constants_1.DUMMY_EVM_ADDRESS;
|
|
20
|
+
const maybeQuote = await (0, helpers_1.getBobGatewayQuote)({
|
|
21
|
+
config,
|
|
22
|
+
sellAsset,
|
|
23
|
+
buyAsset,
|
|
24
|
+
sellChainName,
|
|
25
|
+
buyChainName,
|
|
26
|
+
sender,
|
|
27
|
+
recipient,
|
|
28
|
+
amount: sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
29
|
+
affiliateBps,
|
|
30
|
+
slippageTolerancePercentageDecimal,
|
|
31
|
+
});
|
|
32
|
+
if (maybeQuote.isErr())
|
|
33
|
+
return (0, monads_1.Err)(maybeQuote.unwrapErr());
|
|
34
|
+
const quote = maybeQuote.unwrap();
|
|
35
|
+
const { buyAmountBeforeFeesCryptoBaseUnit, buyAmountAfterFeesCryptoBaseUnit, protocolFees, estimatedExecutionTimeMs, } = (0, helpers_1.parseBobGatewayQuote)(quote, buyAsset, deps.assetsById);
|
|
36
|
+
const rate = (0, utils_1.getInputOutputRate)({
|
|
37
|
+
sellAmountCryptoBaseUnit: sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
38
|
+
buyAmountCryptoBaseUnit: buyAmountAfterFeesCryptoBaseUnit,
|
|
39
|
+
sellAsset,
|
|
40
|
+
buyAsset,
|
|
41
|
+
});
|
|
42
|
+
const allowanceContract = (0, helpers_1.getBobGatewayAllowanceContract)(quote, sellAsset);
|
|
43
|
+
const networkFeeCryptoBaseUnit = await (0, helpers_1.getBobGatewayRateNetworkFeeCryptoBaseUnit)(quote, sellAsset, deps);
|
|
44
|
+
const tradeRate = {
|
|
45
|
+
id: (0, uuid_1.v4)(),
|
|
46
|
+
quoteOrRate: 'rate',
|
|
47
|
+
rate,
|
|
48
|
+
receiveAddress,
|
|
49
|
+
affiliateBps,
|
|
50
|
+
slippageTolerancePercentageDecimal,
|
|
51
|
+
swapperName: types_1.SwapperName.BobGateway,
|
|
52
|
+
steps: [
|
|
53
|
+
{
|
|
54
|
+
buyAmountBeforeFeesCryptoBaseUnit,
|
|
55
|
+
buyAmountAfterFeesCryptoBaseUnit,
|
|
56
|
+
sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
57
|
+
feeData: {
|
|
58
|
+
networkFeeCryptoBaseUnit,
|
|
59
|
+
protocolFees,
|
|
60
|
+
},
|
|
61
|
+
rate,
|
|
62
|
+
source: types_1.SwapperName.BobGateway,
|
|
63
|
+
buyAsset,
|
|
64
|
+
sellAsset,
|
|
65
|
+
accountNumber,
|
|
66
|
+
allowanceContract,
|
|
67
|
+
estimatedExecutionTimeMs,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
return (0, monads_1.Ok)(tradeRate);
|
|
72
|
+
};
|
|
73
|
+
exports.getBobGatewayTradeRate = getBobGatewayTradeRate;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type BobGatewayEvmTxMetadata = {
|
|
2
|
+
to: string;
|
|
3
|
+
data: string;
|
|
4
|
+
value: string;
|
|
5
|
+
chain: string;
|
|
6
|
+
};
|
|
7
|
+
type BobGatewayUtxoTxMetadata = {
|
|
8
|
+
depositAddress: string;
|
|
9
|
+
opReturnData?: string;
|
|
10
|
+
};
|
|
11
|
+
export type BobGatewayMetadata = {
|
|
12
|
+
orderId: string;
|
|
13
|
+
} & ({
|
|
14
|
+
evmTx: BobGatewayEvmTxMetadata;
|
|
15
|
+
utxoTx?: never;
|
|
16
|
+
} | {
|
|
17
|
+
utxoTx: BobGatewayUtxoTxMetadata;
|
|
18
|
+
evmTx?: never;
|
|
19
|
+
});
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChainId } from '@shapeshiftoss/caip';
|
|
2
|
+
export declare const BOB_GATEWAY_BASE_URL = "https://gateway-api-mainnet.gobob.xyz";
|
|
3
|
+
export declare const chainIdToBobGatewayChainName: {
|
|
4
|
+
readonly [x: string]: "arbitrum" | "avalanche" | "base" | "bera" | "bitcoin" | "bob" | "bsc" | "ethereum" | "sei" | "sonic" | "unichain";
|
|
5
|
+
};
|
|
6
|
+
export declare const bobGatewayChainNameToChainId: Record<BobGatewayChainName, ChainId>;
|
|
7
|
+
export type BobGatewayChainName = (typeof chainIdToBobGatewayChainName)[keyof typeof chainIdToBobGatewayChainName];
|
|
8
|
+
export declare const DUMMY_EVM_ADDRESS: `0x${string}`;
|
|
9
|
+
export declare const DUMMY_BTC_ADDRESS = "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq";
|
|
10
|
+
export declare const BOB_GATEWAY_TOKENSWAP_DEFAULT_GAS_LIMIT = "350000";
|
|
11
|
+
export declare const BOB_GATEWAY_OFFRAMP_DEFAULT_GAS_LIMIT = "550000";
|
|
12
|
+
export declare const BOB_GATEWAY_ONRAMP_DEFAULT_TX_VSIZE = "200";
|
|
13
|
+
export declare const decimalSlippageToBobBps: (slippageDecimal: string) => string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decimalSlippageToBobBps = exports.BOB_GATEWAY_ONRAMP_DEFAULT_TX_VSIZE = exports.BOB_GATEWAY_OFFRAMP_DEFAULT_GAS_LIMIT = exports.BOB_GATEWAY_TOKENSWAP_DEFAULT_GAS_LIMIT = exports.DUMMY_BTC_ADDRESS = exports.DUMMY_EVM_ADDRESS = exports.bobGatewayChainNameToChainId = exports.chainIdToBobGatewayChainName = exports.BOB_GATEWAY_BASE_URL = void 0;
|
|
4
|
+
const caip_1 = require("@shapeshiftoss/caip");
|
|
5
|
+
exports.BOB_GATEWAY_BASE_URL = 'https://gateway-api-mainnet.gobob.xyz';
|
|
6
|
+
// Chain name strings expected by the BOB Gateway API
|
|
7
|
+
// https://gateway-api-mainnet.gobob.xyz/v2/get-routes
|
|
8
|
+
exports.chainIdToBobGatewayChainName = {
|
|
9
|
+
[caip_1.arbitrumChainId]: 'arbitrum',
|
|
10
|
+
[caip_1.avalancheChainId]: 'avalanche',
|
|
11
|
+
[caip_1.baseChainId]: 'base',
|
|
12
|
+
[caip_1.berachainChainId]: 'bera',
|
|
13
|
+
[caip_1.btcChainId]: 'bitcoin',
|
|
14
|
+
[caip_1.bobChainId]: 'bob',
|
|
15
|
+
[caip_1.bscChainId]: 'bsc',
|
|
16
|
+
[caip_1.ethChainId]: 'ethereum',
|
|
17
|
+
[caip_1.seiChainId]: 'sei',
|
|
18
|
+
[caip_1.sonicChainId]: 'sonic',
|
|
19
|
+
[caip_1.unichainChainId]: 'unichain',
|
|
20
|
+
};
|
|
21
|
+
exports.bobGatewayChainNameToChainId = Object.fromEntries(Object.entries(exports.chainIdToBobGatewayChainName).map(([chainId, chainName]) => [chainName, chainId]));
|
|
22
|
+
exports.DUMMY_EVM_ADDRESS = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045';
|
|
23
|
+
exports.DUMMY_BTC_ADDRESS = 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq';
|
|
24
|
+
exports.BOB_GATEWAY_TOKENSWAP_DEFAULT_GAS_LIMIT = '350000'; // EVM→EVM
|
|
25
|
+
exports.BOB_GATEWAY_OFFRAMP_DEFAULT_GAS_LIMIT = '550000'; // EVM→BTC
|
|
26
|
+
exports.BOB_GATEWAY_ONRAMP_DEFAULT_TX_VSIZE = '200'; // BTC→EVM
|
|
27
|
+
// https://docs.gobob.xyz/api-reference/v2/get-a-gateway-quote#parameter-slippage
|
|
28
|
+
const decimalSlippageToBobBps = (slippageDecimal) => {
|
|
29
|
+
return String(Math.round(parseFloat(slippageDecimal) * 10_000));
|
|
30
|
+
};
|
|
31
|
+
exports.decimalSlippageToBobBps = decimalSlippageToBobBps;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { GatewayOrderStatusV2, GatewayQuoteV2, GetQuoteParams } from '@gobob/bob-sdk';
|
|
2
|
+
import { GatewaySDK } from '@gobob/bob-sdk';
|
|
3
|
+
import type { AssetId } from '@shapeshiftoss/caip';
|
|
4
|
+
import type { Asset, AssetsByIdPartial } from '@shapeshiftoss/types';
|
|
5
|
+
import { TxStatus } from '@shapeshiftoss/unchained-client';
|
|
6
|
+
import type { Result } from '@sniptt/monads';
|
|
7
|
+
import type { GetTradeQuoteInput, QuoteFeeData, SwapErrorRight, SwapperConfig, SwapperDeps } from '../../../types';
|
|
8
|
+
import type { BobGatewayMetadata } from '../types';
|
|
9
|
+
import type { BobGatewayChainName } from './constants';
|
|
10
|
+
export declare const getBobGatewayClient: (config: SwapperConfig) => GatewaySDK;
|
|
11
|
+
export declare const assetIdToBobGatewayToken: (assetId: string) => string;
|
|
12
|
+
export declare const getBobGatewayAffiliates: (affiliateBps: string) => GetQuoteParams['affiliates'];
|
|
13
|
+
export declare const getBobGatewayQuote: ({ config, sellAsset, buyAsset, sellChainName, buyChainName, sender, recipient, amount, affiliateBps, slippageTolerancePercentageDecimal, }: {
|
|
14
|
+
config: SwapperConfig;
|
|
15
|
+
sellAsset: Asset;
|
|
16
|
+
buyAsset: Asset;
|
|
17
|
+
sellChainName: BobGatewayChainName;
|
|
18
|
+
buyChainName: BobGatewayChainName;
|
|
19
|
+
sender: string | undefined;
|
|
20
|
+
recipient: string;
|
|
21
|
+
amount: string;
|
|
22
|
+
affiliateBps: string;
|
|
23
|
+
slippageTolerancePercentageDecimal: string | undefined;
|
|
24
|
+
}) => Promise<Result<GatewayQuoteV2, SwapErrorRight>>;
|
|
25
|
+
export declare const createBobGatewayOrderMetadata: (config: SwapperConfig, gatewayQuote: GatewayQuoteV2) => Promise<Result<BobGatewayMetadata, SwapErrorRight>>;
|
|
26
|
+
export declare const registerBobGatewayTx: ({ config, orderId, txHash, sellAsset, buyAsset, }: {
|
|
27
|
+
config: SwapperConfig;
|
|
28
|
+
orderId: string;
|
|
29
|
+
txHash: string;
|
|
30
|
+
sellAsset: Asset;
|
|
31
|
+
buyAsset: Asset;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
export declare const getBobGatewayQuoteFeeData: (input: GetTradeQuoteInput, { assertGetUtxoChainAdapter, assertGetEvmChainAdapter }: SwapperDeps, orderMetadata: BobGatewayMetadata) => Promise<Result<Omit<QuoteFeeData, 'protocolFees'>, SwapErrorRight>>;
|
|
34
|
+
export declare const getBobGatewayRateNetworkFeeCryptoBaseUnit: (quote: GatewayQuoteV2, sellAsset: Asset, { assertGetEvmChainAdapter, assertGetUtxoChainAdapter }: SwapperDeps) => Promise<string | undefined>;
|
|
35
|
+
export declare const mapBobGatewayOrderStatusToTxStatus: (status: GatewayOrderStatusV2) => TxStatus;
|
|
36
|
+
export declare const parseBobGatewayQuote: (quote: GatewayQuoteV2, buyAsset: Asset, assetsById: AssetsByIdPartial) => {
|
|
37
|
+
buyAmountBeforeFeesCryptoBaseUnit: string;
|
|
38
|
+
buyAmountAfterFeesCryptoBaseUnit: string;
|
|
39
|
+
protocolFees: Partial<Record<AssetId, import("../../../types").ProtocolFee>>;
|
|
40
|
+
estimatedExecutionTimeMs: number | undefined;
|
|
41
|
+
};
|
|
42
|
+
export declare const getBobGatewayAllowanceContract: (quote: GatewayQuoteV2, sellAsset: Asset) => string;
|
|
43
|
+
export declare const assertValidTrade: ({ sellAsset, buyAsset, }: {
|
|
44
|
+
sellAsset: Asset;
|
|
45
|
+
buyAsset: Asset;
|
|
46
|
+
}) => Result<{
|
|
47
|
+
sellChainName: BobGatewayChainName;
|
|
48
|
+
buyChainName: BobGatewayChainName;
|
|
49
|
+
}, SwapErrorRight>;
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertValidTrade = exports.getBobGatewayAllowanceContract = exports.parseBobGatewayQuote = exports.mapBobGatewayOrderStatusToTxStatus = exports.getBobGatewayRateNetworkFeeCryptoBaseUnit = exports.getBobGatewayQuoteFeeData = exports.registerBobGatewayTx = exports.createBobGatewayOrderMetadata = exports.getBobGatewayQuote = exports.getBobGatewayAffiliates = exports.assetIdToBobGatewayToken = exports.getBobGatewayClient = void 0;
|
|
4
|
+
const bob_sdk_1 = require("@gobob/bob-sdk");
|
|
5
|
+
const caip_1 = require("@shapeshiftoss/caip");
|
|
6
|
+
const chain_adapters_1 = require("@shapeshiftoss/chain-adapters");
|
|
7
|
+
const unchained_client_1 = require("@shapeshiftoss/unchained-client");
|
|
8
|
+
const utils_1 = require("@shapeshiftoss/utils");
|
|
9
|
+
const monads_1 = require("@sniptt/monads");
|
|
10
|
+
const viem_1 = require("viem");
|
|
11
|
+
const constants_1 = require("../../../constants");
|
|
12
|
+
const types_1 = require("../../../types");
|
|
13
|
+
const utils_2 = require("../../../utils");
|
|
14
|
+
const helpers_1 = require("../../utils/helpers/helpers");
|
|
15
|
+
const constants_2 = require("./constants");
|
|
16
|
+
const getBobGatewayClient = (config) => {
|
|
17
|
+
return new bob_sdk_1.GatewaySDK({ basePath: constants_2.BOB_GATEWAY_BASE_URL, apiKey: config.VITE_BOB_GATEWAY_API_KEY });
|
|
18
|
+
};
|
|
19
|
+
exports.getBobGatewayClient = getBobGatewayClient;
|
|
20
|
+
const assetIdToBobGatewayToken = (assetId) => {
|
|
21
|
+
// BOB Gateway uses the zero address as the token address for native assets
|
|
22
|
+
if (!(0, utils_1.isToken)(assetId))
|
|
23
|
+
return viem_1.zeroAddress;
|
|
24
|
+
return (0, caip_1.fromAssetId)(assetId).assetReference;
|
|
25
|
+
};
|
|
26
|
+
exports.assetIdToBobGatewayToken = assetIdToBobGatewayToken;
|
|
27
|
+
const getBobGatewayAffiliates = (affiliateBps) => {
|
|
28
|
+
const bps = (0, utils_1.bnOrZero)(affiliateBps);
|
|
29
|
+
if (!bps.isFinite() || bps.lte(0))
|
|
30
|
+
return undefined;
|
|
31
|
+
const affiliateAddress = (0, helpers_1.getTreasuryAddressFromChainId)(caip_1.ethChainId);
|
|
32
|
+
return [{ address: (0, viem_1.getAddress)(affiliateAddress), bps: bps.toNumber() }];
|
|
33
|
+
};
|
|
34
|
+
exports.getBobGatewayAffiliates = getBobGatewayAffiliates;
|
|
35
|
+
const getBobGatewayQuote = async ({ config, sellAsset, buyAsset, sellChainName, buyChainName, sender, recipient, amount, affiliateBps, slippageTolerancePercentageDecimal, }) => {
|
|
36
|
+
const slippage = (0, constants_2.decimalSlippageToBobBps)(slippageTolerancePercentageDecimal ??
|
|
37
|
+
(0, constants_1.getDefaultSlippageDecimalPercentageForSwapper)(types_1.SwapperName.BobGateway));
|
|
38
|
+
try {
|
|
39
|
+
const quote = await (0, exports.getBobGatewayClient)(config).getQuote({
|
|
40
|
+
fromChain: sellChainName,
|
|
41
|
+
toChain: buyChainName,
|
|
42
|
+
fromToken: (0, exports.assetIdToBobGatewayToken)(sellAsset.assetId),
|
|
43
|
+
toToken: (0, exports.assetIdToBobGatewayToken)(buyAsset.assetId),
|
|
44
|
+
fromUserAddress: sender,
|
|
45
|
+
toUserAddress: recipient,
|
|
46
|
+
amount,
|
|
47
|
+
maxSlippage: Number(slippage),
|
|
48
|
+
affiliates: (0, exports.getBobGatewayAffiliates)(affiliateBps),
|
|
49
|
+
});
|
|
50
|
+
return (0, monads_1.Ok)(quote);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
if ((0, bob_sdk_1.isGatewayError)(err)) {
|
|
54
|
+
switch (err.code) {
|
|
55
|
+
case bob_sdk_1.GatewayErrorCode.QuoteAmountTooLow:
|
|
56
|
+
return (0, monads_1.Err)((0, utils_2.createTradeAmountTooSmallErr)({
|
|
57
|
+
minAmountCryptoBaseUnit: err.details.minimum,
|
|
58
|
+
assetId: sellAsset.assetId,
|
|
59
|
+
}));
|
|
60
|
+
case bob_sdk_1.GatewayErrorCode.UnableToCoverFees:
|
|
61
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
62
|
+
message: '[BobGateway] sell amount does not cover fees',
|
|
63
|
+
code: types_1.TradeQuoteError.SellAmountBelowTradeFee,
|
|
64
|
+
cause: err,
|
|
65
|
+
}));
|
|
66
|
+
case bob_sdk_1.GatewayErrorCode.NoRoute:
|
|
67
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
68
|
+
message: '[BobGateway] no route found for trade pair',
|
|
69
|
+
code: types_1.TradeQuoteError.NoRouteFound,
|
|
70
|
+
cause: err,
|
|
71
|
+
}));
|
|
72
|
+
case bob_sdk_1.GatewayErrorCode.DisabledChain:
|
|
73
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
74
|
+
message: '[BobGateway] trading is temporarily halted for this chain',
|
|
75
|
+
code: types_1.TradeQuoteError.TradingHalted,
|
|
76
|
+
cause: err,
|
|
77
|
+
}));
|
|
78
|
+
default:
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
83
|
+
message: '[BobGateway] failed to fetch quote',
|
|
84
|
+
code: types_1.TradeQuoteError.QueryFailed,
|
|
85
|
+
cause: err,
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.getBobGatewayQuote = getBobGatewayQuote;
|
|
90
|
+
const createBobGatewayOrderMetadata = async (config, gatewayQuote) => {
|
|
91
|
+
try {
|
|
92
|
+
const orderResponse = await (0, exports.getBobGatewayClient)(config).api.createOrderV2({
|
|
93
|
+
gatewayQuoteV2: gatewayQuote,
|
|
94
|
+
});
|
|
95
|
+
// onramp (BTC→EVM)
|
|
96
|
+
if ('onramp' in orderResponse) {
|
|
97
|
+
return (0, monads_1.Ok)({
|
|
98
|
+
orderId: orderResponse.onramp.orderId,
|
|
99
|
+
utxoTx: {
|
|
100
|
+
depositAddress: orderResponse.onramp.address,
|
|
101
|
+
opReturnData: orderResponse.onramp.opReturnData ?? undefined,
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// offramp (EVM→BTC) and tokenSwap (EVM→EVM) orders share the same tx shape
|
|
106
|
+
const order = 'offramp' in orderResponse ? orderResponse.offramp : orderResponse.tokenSwap;
|
|
107
|
+
return (0, monads_1.Ok)({
|
|
108
|
+
orderId: order.orderId,
|
|
109
|
+
evmTx: {
|
|
110
|
+
to: order.tx.to,
|
|
111
|
+
data: order.tx.data,
|
|
112
|
+
value: order.tx.value,
|
|
113
|
+
chain: order.tx.chain,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
if ((0, bob_sdk_1.isGatewayError)(err) && err.code === bob_sdk_1.GatewayErrorCode.InsufficientConfirmedFunds) {
|
|
119
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
120
|
+
message: '[BobGateway] insufficient confirmed balance',
|
|
121
|
+
code: types_1.TradeQuoteError.InsufficientFundsUnconfirmed,
|
|
122
|
+
cause: err,
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
126
|
+
message: '[BobGateway] failed to create order',
|
|
127
|
+
code: types_1.TradeQuoteError.QueryFailed,
|
|
128
|
+
cause: err,
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
exports.createBobGatewayOrderMetadata = createBobGatewayOrderMetadata;
|
|
133
|
+
const registerBobGatewayTx = async ({ config, orderId, txHash, sellAsset, buyAsset, }) => {
|
|
134
|
+
const registerTxV2 = (() => {
|
|
135
|
+
// BTC→EVM
|
|
136
|
+
if (constants_2.chainIdToBobGatewayChainName[sellAsset.chainId] === 'bitcoin') {
|
|
137
|
+
return { onramp: { orderId, bitcoinTxid: txHash } };
|
|
138
|
+
}
|
|
139
|
+
// EVM→BTC
|
|
140
|
+
if (constants_2.chainIdToBobGatewayChainName[buyAsset.chainId] === 'bitcoin') {
|
|
141
|
+
return { offramp: { orderId, evmTxhash: txHash } };
|
|
142
|
+
}
|
|
143
|
+
// EVM→EVM
|
|
144
|
+
return { tokenSwap: { orderId, evmTxhash: txHash } };
|
|
145
|
+
})();
|
|
146
|
+
await (0, exports.getBobGatewayClient)(config).api.registerTxV2({ registerTxV2 });
|
|
147
|
+
};
|
|
148
|
+
exports.registerBobGatewayTx = registerBobGatewayTx;
|
|
149
|
+
const getBobGatewayQuoteFeeData = async (input, { assertGetUtxoChainAdapter, assertGetEvmChainAdapter }, orderMetadata) => {
|
|
150
|
+
const { sellAsset, sellAmountIncludingProtocolFeesCryptoBaseUnit } = input;
|
|
151
|
+
try {
|
|
152
|
+
if (orderMetadata.utxoTx && 'xpub' in input) {
|
|
153
|
+
const { depositAddress, opReturnData } = orderMetadata.utxoTx;
|
|
154
|
+
const { fast } = await assertGetUtxoChainAdapter(sellAsset.chainId).getFeeData({
|
|
155
|
+
to: depositAddress,
|
|
156
|
+
value: sellAmountIncludingProtocolFeesCryptoBaseUnit,
|
|
157
|
+
chainSpecific: { pubkey: input.xpub, opReturnData },
|
|
158
|
+
sendMax: false,
|
|
159
|
+
});
|
|
160
|
+
return (0, monads_1.Ok)({
|
|
161
|
+
networkFeeCryptoBaseUnit: fast.txFee,
|
|
162
|
+
chainSpecific: { satsPerByte: fast.chainSpecific.satoshiPerByte },
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
if (orderMetadata.evmTx && input.sendAddress && 'supportsEIP1559' in input) {
|
|
166
|
+
const { to, data, value } = orderMetadata.evmTx;
|
|
167
|
+
const { networkFeeCryptoBaseUnit } = await chain_adapters_1.evm.getFees({
|
|
168
|
+
adapter: assertGetEvmChainAdapter(sellAsset.chainId),
|
|
169
|
+
to,
|
|
170
|
+
data,
|
|
171
|
+
value,
|
|
172
|
+
from: input.sendAddress,
|
|
173
|
+
supportsEIP1559: input.supportsEIP1559,
|
|
174
|
+
});
|
|
175
|
+
return (0, monads_1.Ok)({ networkFeeCryptoBaseUnit });
|
|
176
|
+
}
|
|
177
|
+
throw new Error('[BobGateway] invalid quote');
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
181
|
+
message: '[BobGateway] failed to estimate network fee',
|
|
182
|
+
code: types_1.TradeQuoteError.NetworkFeeEstimationFailed,
|
|
183
|
+
cause: err,
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
exports.getBobGatewayQuoteFeeData = getBobGatewayQuoteFeeData;
|
|
188
|
+
const getBobGatewayRateNetworkFeeCryptoBaseUnit = async (quote, sellAsset, { assertGetEvmChainAdapter, assertGetUtxoChainAdapter }) => {
|
|
189
|
+
try {
|
|
190
|
+
if ('onramp' in quote) {
|
|
191
|
+
const adapter = assertGetUtxoChainAdapter(sellAsset.chainId);
|
|
192
|
+
const { fast } = await adapter.httpProvider.getNetworkFees();
|
|
193
|
+
if (!fast?.satsPerKiloByte)
|
|
194
|
+
return undefined;
|
|
195
|
+
const satsPerByte = Math.max(1, Math.ceil(fast.satsPerKiloByte / 1000));
|
|
196
|
+
return (0, utils_1.bnOrZero)(satsPerByte).times(constants_2.BOB_GATEWAY_ONRAMP_DEFAULT_TX_VSIZE).toFixed(0);
|
|
197
|
+
}
|
|
198
|
+
const defaultGasLimit = 'offramp' in quote
|
|
199
|
+
? constants_2.BOB_GATEWAY_OFFRAMP_DEFAULT_GAS_LIMIT
|
|
200
|
+
: constants_2.BOB_GATEWAY_TOKENSWAP_DEFAULT_GAS_LIMIT;
|
|
201
|
+
const { average } = await assertGetEvmChainAdapter(sellAsset.chainId).getGasFeeData();
|
|
202
|
+
const feePerGas = (0, utils_1.bnOrZero)(average.maxFeePerGas).gt(0) ? average.maxFeePerGas : average.gasPrice;
|
|
203
|
+
return (0, utils_1.bnOrZero)(defaultGasLimit).times((0, utils_1.bnOrZero)(feePerGas)).toFixed(0);
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
exports.getBobGatewayRateNetworkFeeCryptoBaseUnit = getBobGatewayRateNetworkFeeCryptoBaseUnit;
|
|
210
|
+
const mapBobGatewayOrderStatusToTxStatus = (status) => {
|
|
211
|
+
if ('inProgress' in status)
|
|
212
|
+
return unchained_client_1.TxStatus.Pending;
|
|
213
|
+
if ('success' in status)
|
|
214
|
+
return unchained_client_1.TxStatus.Confirmed;
|
|
215
|
+
if ('failed' in status)
|
|
216
|
+
return unchained_client_1.TxStatus.Failed;
|
|
217
|
+
if ('refunded' in status)
|
|
218
|
+
return unchained_client_1.TxStatus.Failed;
|
|
219
|
+
return unchained_client_1.TxStatus.Unknown;
|
|
220
|
+
};
|
|
221
|
+
exports.mapBobGatewayOrderStatusToTxStatus = mapBobGatewayOrderStatusToTxStatus;
|
|
222
|
+
const bobGatewayFeeToAssetId = (fee) => {
|
|
223
|
+
const chainId = constants_2.bobGatewayChainNameToChainId[fee.chain];
|
|
224
|
+
if (!chainId)
|
|
225
|
+
return;
|
|
226
|
+
if (fee.address.toLowerCase() === viem_1.zeroAddress)
|
|
227
|
+
return (0, utils_1.chainIdToFeeAssetId)(chainId);
|
|
228
|
+
return (0, caip_1.toAssetId)({
|
|
229
|
+
chainId,
|
|
230
|
+
assetNamespace: caip_1.ASSET_NAMESPACE.erc20,
|
|
231
|
+
assetReference: fee.address,
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
const parseBobGatewayQuote = (quote, buyAsset, assetsById) => {
|
|
235
|
+
const { outputAmount, estimatedTimeInSecs, fees } = (() => {
|
|
236
|
+
if ('onramp' in quote) {
|
|
237
|
+
const { outputAmount, estimatedTimeInSecs, fees } = quote.onramp;
|
|
238
|
+
return { outputAmount, estimatedTimeInSecs, fees: [fees] };
|
|
239
|
+
}
|
|
240
|
+
if ('offramp' in quote) {
|
|
241
|
+
const { outputAmount, estimatedTimeInSecs, feeBreakdown } = quote.offramp;
|
|
242
|
+
const { affiliateFee, inclusionFee, protocolFee, solverFee } = feeBreakdown;
|
|
243
|
+
return {
|
|
244
|
+
outputAmount,
|
|
245
|
+
estimatedTimeInSecs,
|
|
246
|
+
fees: [affiliateFee, inclusionFee, protocolFee, solverFee],
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
const { outputAmount, estimatedTimeInSecs, fees } = quote.tokenSwap;
|
|
250
|
+
return { outputAmount, estimatedTimeInSecs, fees: [fees] };
|
|
251
|
+
})();
|
|
252
|
+
const protocolFees = fees.reduce((acc, fee) => {
|
|
253
|
+
const amountCryptoBaseUnit = (0, utils_1.bnOrZero)(fee.amount);
|
|
254
|
+
if (amountCryptoBaseUnit.lte(0))
|
|
255
|
+
return acc;
|
|
256
|
+
const assetId = bobGatewayFeeToAssetId(fee);
|
|
257
|
+
if (!assetId)
|
|
258
|
+
return acc;
|
|
259
|
+
const asset = assetId === buyAsset.assetId ? buyAsset : assetsById[assetId];
|
|
260
|
+
if (!asset)
|
|
261
|
+
return acc;
|
|
262
|
+
acc[assetId] = {
|
|
263
|
+
amountCryptoBaseUnit: (0, utils_1.bnOrZero)(acc[assetId]?.amountCryptoBaseUnit)
|
|
264
|
+
.plus(amountCryptoBaseUnit)
|
|
265
|
+
.toFixed(),
|
|
266
|
+
asset,
|
|
267
|
+
requiresBalance: false,
|
|
268
|
+
};
|
|
269
|
+
return acc;
|
|
270
|
+
}, {});
|
|
271
|
+
// buyAmountBeforeFees is denominated in the buy asset, so only add back buy-asset-denominated fees
|
|
272
|
+
const buyAssetFeeCryptoBaseUnit = (0, utils_1.bnOrZero)(protocolFees[buyAsset.assetId]?.amountCryptoBaseUnit);
|
|
273
|
+
return {
|
|
274
|
+
buyAmountBeforeFeesCryptoBaseUnit: buyAssetFeeCryptoBaseUnit
|
|
275
|
+
.plus((0, utils_1.bnOrZero)(outputAmount.amount))
|
|
276
|
+
.toFixed(),
|
|
277
|
+
buyAmountAfterFeesCryptoBaseUnit: outputAmount.amount,
|
|
278
|
+
protocolFees,
|
|
279
|
+
estimatedExecutionTimeMs: typeof estimatedTimeInSecs === 'number' ? estimatedTimeInSecs * 1000 : undefined,
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
exports.parseBobGatewayQuote = parseBobGatewayQuote;
|
|
283
|
+
const getBobGatewayAllowanceContract = (quote, sellAsset) => {
|
|
284
|
+
if (!(0, chain_adapters_1.isEvmChainId)(sellAsset.chainId))
|
|
285
|
+
return '';
|
|
286
|
+
if (!(0, utils_1.contractAddressOrUndefined)(sellAsset.assetId))
|
|
287
|
+
return '';
|
|
288
|
+
if ('offramp' in quote)
|
|
289
|
+
return quote.offramp.txTo;
|
|
290
|
+
if ('tokenSwap' in quote)
|
|
291
|
+
return quote.tokenSwap.txTo;
|
|
292
|
+
return '';
|
|
293
|
+
};
|
|
294
|
+
exports.getBobGatewayAllowanceContract = getBobGatewayAllowanceContract;
|
|
295
|
+
const assertValidTrade = ({ sellAsset, buyAsset, }) => {
|
|
296
|
+
const sellChainName = constants_2.chainIdToBobGatewayChainName[sellAsset.chainId];
|
|
297
|
+
const buyChainName = constants_2.chainIdToBobGatewayChainName[buyAsset.chainId];
|
|
298
|
+
if (!sellChainName) {
|
|
299
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
300
|
+
message: `[BobGateway] unsupported sell chain: ${sellAsset.chainId}`,
|
|
301
|
+
code: types_1.TradeQuoteError.UnsupportedChain,
|
|
302
|
+
details: { chainId: sellAsset.chainId },
|
|
303
|
+
}));
|
|
304
|
+
}
|
|
305
|
+
if (!buyChainName) {
|
|
306
|
+
return (0, monads_1.Err)((0, utils_2.makeSwapErrorRight)({
|
|
307
|
+
message: `[BobGateway] unsupported buy chain: ${buyAsset.chainId}`,
|
|
308
|
+
code: types_1.TradeQuoteError.UnsupportedChain,
|
|
309
|
+
details: { chainId: buyAsset.chainId },
|
|
310
|
+
}));
|
|
311
|
+
}
|
|
312
|
+
return (0, monads_1.Ok)({ sellChainName, buyChainName });
|
|
313
|
+
};
|
|
314
|
+
exports.assertValidTrade = assertValidTrade;
|
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
26
|
const caip_1 = require("@shapeshiftoss/caip");
|
|
37
27
|
const unchained_client_1 = require("@shapeshiftoss/unchained-client");
|
|
@@ -155,7 +145,7 @@ vitest_1.vi.mock('../xhr', () => ({
|
|
|
155
145
|
(0, vitest_1.it)('should proceed to bridge polling for cross-chain swaps', async () => {
|
|
156
146
|
const mockBridgeInfo = {
|
|
157
147
|
id: 12345,
|
|
158
|
-
state: 1,
|
|
148
|
+
state: 1,
|
|
159
149
|
toHash: 'dest-tx',
|
|
160
150
|
relayerHash: 'relayer-tx',
|
|
161
151
|
relayerChain: { scanUrl: 'https://scan.url' },
|
|
@@ -199,7 +189,7 @@ vitest_1.vi.mock('../xhr', () => ({
|
|
|
199
189
|
txHash: mockTxHash,
|
|
200
190
|
chainId: mockEvmChainId,
|
|
201
191
|
address: mockAddress,
|
|
202
|
-
swap: undefined,
|
|
192
|
+
swap: undefined,
|
|
203
193
|
assertGetEvmChainAdapter: mockAssertGetEvmChainAdapter,
|
|
204
194
|
assertGetSolanaChainAdapter: mockAssertGetSolanaChainAdapter,
|
|
205
195
|
fetchIsSmartContractAddressQuery: mockFetchIsSmartContractAddressQuery,
|
|
@@ -74,7 +74,7 @@ const getTradeQuote = async (input, _deps) => {
|
|
|
74
74
|
const buildTxResult = await (0, xhr_1.fetchTxData)({
|
|
75
75
|
hash: route.hash,
|
|
76
76
|
slippage,
|
|
77
|
-
from: sendAddress,
|
|
77
|
+
from: sendAddress,
|
|
78
78
|
receiver: receiveAddress, // receiver (destination chain address)
|
|
79
79
|
});
|
|
80
80
|
if (buildTxResult.isErr())
|