From 61e2865223b67d23fc65669065df60f9eb033b5e Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Thu, 3 Oct 2024 13:10:29 +0200 Subject: [PATCH 1/2] Tochain bug fix --- examples/do-swap/doStreamingSwap.ts | 3 ++- examples/do-swap/doSwap.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/do-swap/doStreamingSwap.ts b/examples/do-swap/doStreamingSwap.ts index 7011c418e..c102a9e0d 100644 --- a/examples/do-swap/doStreamingSwap.ts +++ b/examples/do-swap/doStreamingSwap.ts @@ -20,6 +20,7 @@ import { assetToString, delay, isSynthAsset, + isTradeAsset, register9Rheader, } from '@xchainjs/xchain-util' import { Wallet } from '@xchainjs/xchain-wallet' @@ -81,7 +82,7 @@ const doStreamingSwap = async (tcAmm: ThorchainAMM, wallet: Wallet) => { const streamingInterval = Number(process.argv[8]) const streamingQuantity = Number(process.argv[9]) - const toChain = isSynthAsset(toAsset) ? THORChain : toAsset.chain + const toChain = isSynthAsset(toAsset) || isTradeAsset(toAsset) ? THORChain : toAsset.chain const swapParams: QuoteSwapParams = { fromAddress: await wallet.getAddress(fromAsset.chain), diff --git a/examples/do-swap/doSwap.ts b/examples/do-swap/doSwap.ts index 6f4345e49..35bd9cead 100644 --- a/examples/do-swap/doSwap.ts +++ b/examples/do-swap/doSwap.ts @@ -20,6 +20,7 @@ import { assetToString, delay, isSynthAsset, + isTradeAsset, register9Rheader, } from '@xchainjs/xchain-util' import { Wallet } from '@xchainjs/xchain-wallet' @@ -82,7 +83,7 @@ const doSingleSwap = async (tcAmm: ThorchainAMM, wallet: Wallet) => { const fromAsset = assetFromString(`${process.argv[6]}`) const toAsset = assetFromString(`${process.argv[7]}`) - const toChain = isSynthAsset(toAsset) ? THORChain : toAsset.chain + const toChain = isSynthAsset(toAsset) || isTradeAsset(toAsset) ? THORChain : toAsset.chain const swapParams: QuoteSwapParams = { fromAsset, From b0932352a2cb4c007d82e23a49269b6c62c80a29 Mon Sep 17 00:00:00 2001 From: 0xp3gasus <0xp3gasus@proton.me> Date: Fri, 4 Oct 2024 01:30:27 +0200 Subject: [PATCH 2/2] Changeset version file --- .changeset/friendly-falcons-talk.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/friendly-falcons-talk.md diff --git a/.changeset/friendly-falcons-talk.md b/.changeset/friendly-falcons-talk.md new file mode 100644 index 000000000..6d459a6c2 --- /dev/null +++ b/.changeset/friendly-falcons-talk.md @@ -0,0 +1,5 @@ +--- +'xchainjs-do-swap': patch +--- + +Bug fix with toChain