mirror of
https://github.com/Brotocol-xyz/bro-sdk.git
synced 2026-01-12 14:54:21 +08:00
fix: dex aggregator bridge info
This commit is contained in:
@@ -3,17 +3,16 @@ import {
|
||||
isSupportedBitcoinRoute,
|
||||
} from "../bitcoinUtils/peggingHelpers"
|
||||
import {
|
||||
evmTokenFromCorrespondingStacksToken,
|
||||
getEvm2StacksFeeInfo,
|
||||
getStacks2EvmFeeInfo,
|
||||
} from "../evmUtils/peggingHelpers"
|
||||
import { getStacks2MetaFeeInfo } from "../metaUtils/peggingHelpers"
|
||||
import { StacksContractName } from "../stacksUtils/stxContractAddresses"
|
||||
import {
|
||||
executeReadonlyCallBro,
|
||||
getStacksContractCallInfo,
|
||||
numberFromStacksContractNumber,
|
||||
} from "../stacksUtils/contractHelpers"
|
||||
import { StacksContractName } from "../stacksUtils/stxContractAddresses"
|
||||
import { BigNumber } from "../utils/BigNumber"
|
||||
import {
|
||||
getAndCheckTransitStacksTokens,
|
||||
@@ -577,31 +576,13 @@ export async function constructDexAggregatorIntermediaryInfo(
|
||||
lastStepFromStacksToken,
|
||||
} = info
|
||||
|
||||
const swapFromEVMTokenId = (
|
||||
await evmTokenFromCorrespondingStacksToken(
|
||||
ctx,
|
||||
swapRoute.evmChain,
|
||||
firstStepToStacksToken,
|
||||
)
|
||||
)[0]
|
||||
const swapToEVMTokenId = (
|
||||
await evmTokenFromCorrespondingStacksToken(
|
||||
ctx,
|
||||
swapRoute.evmChain,
|
||||
lastStepFromStacksToken,
|
||||
)
|
||||
)[0]
|
||||
if (swapFromEVMTokenId == null || swapToEVMTokenId == null) {
|
||||
return null
|
||||
}
|
||||
|
||||
const routes = [
|
||||
// evm peg out agg
|
||||
{
|
||||
fromChain: transitStacksChainId,
|
||||
fromToken: firstStepToStacksToken,
|
||||
toChain: swapRoute.evmChain,
|
||||
toToken: swapFromEVMTokenId,
|
||||
toToken: swapRoute.fromEVMToken,
|
||||
},
|
||||
//
|
||||
// swap
|
||||
@@ -609,7 +590,7 @@ export async function constructDexAggregatorIntermediaryInfo(
|
||||
// evm peg in
|
||||
{
|
||||
fromChain: swapRoute.evmChain,
|
||||
fromToken: swapToEVMTokenId,
|
||||
fromToken: swapRoute.toEVMToken,
|
||||
toChain: transitStacksChainId,
|
||||
toToken: lastStepFromStacksToken,
|
||||
},
|
||||
|
||||
@@ -347,7 +347,7 @@ export async function getSpecialFeeDetailsForSwapRoute(
|
||||
* 1. btc > stacks (initialRoute)
|
||||
* 2. stacks > runes
|
||||
* * BTC > Runes (`via: evmDexAggregator`):
|
||||
* 1. btc > stacks (initialRoute as well, but not what we want)
|
||||
* 1. btc > stacks (it's also an initialRoute, but not what we want)
|
||||
* 2. stacks > evm
|
||||
* 3. evm swap
|
||||
* 4. evm > stacks (initialRoute for this partition)
|
||||
|
||||
Reference in New Issue
Block a user