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 }