From 948249648d580fb6212a338e88489c55b1de812a Mon Sep 17 00:00:00 2001 From: xgram Date: Mon, 8 Jun 2026 09:33:50 +0000 Subject: [PATCH] fixed amount from/to bug --- src/swap/central/xgram.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/swap/central/xgram.ts b/src/swap/central/xgram.ts index 56331e29..7f52f691 100644 --- a/src/swap/central/xgram.ts +++ b/src/swap/central/xgram.ts @@ -214,11 +214,14 @@ export function makeXgramPlugin(opts: EdgeCorePluginOptions): EdgeSwapPlugin { return { id: quoteReply.id, validUntil: quoteReply.expiresAt, - fromAmount: quoteReply.ccyAmountFrom, - toAmount: - quoteReply.ccyAmountToExpected != null + fromAmount: isSelling + ? quoteReply.ccyAmountFrom + : quoteReply.ccyAmountToExpected ?? largeDenomAmount, + toAmount: isSelling + ? quoteReply.ccyAmountToExpected != null ? quoteReply.ccyAmountToExpected.toString() - : largeDenomAmount, + : largeDenomAmount + : quoteReply.ccyAmountFrom, payinAddress: quoteReply.depositAddress, payinExtraId: quoteReply.depositTag }