Skip to content

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

Fixes misleading default value in createSwapPaymentInfo service method.

Problem

The service has includeTx = true as default:

async createSwapPaymentInfo(userId: number, dto: GetSwapPaymentInfoDto, includeTx = true)

But the controller always passes an explicit boolean:

this.swapService.createSwapPaymentInfo(jwt.user, dto, includeTx === 'true');

When no ?includeTx query parameter is provided:

  • includeTx in controller = undefined
  • undefined === 'true' = false

So the service default is never used, and the actual behavior is false.

Fix

Change default from true to false to accurately reflect actual behavior.

This is purely a code clarity fix - no functional change.

Test Plan

  • No functional change - behavior stays the same
  • CI passes

The controller always passes an explicit boolean via `includeTx === 'true'`,
so the service default was never used. Change from `true` to `false` to
accurately reflect the actual behavior (depositTx is only included when
explicitly requested via ?includeTx=true).
Make custody order swap calls explicit about not including depositTx,
matching the pattern used for sell orders. This ensures the default
value change in swap.service.ts has no functional impact.

Affected calls:
- CustodyOrderType.SWAP
- CustodyOrderType.SEND
- CustodyOrderType.RECEIVE
@TaprootFreak TaprootFreak merged commit 0966205 into develop Jan 2, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the fix/swap-includeTx-default branch January 2, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants