Skip to content

Conversation

@TaprootFreak
Copy link
Collaborator

@TaprootFreak TaprootFreak commented Jan 1, 2026

Summary

Fix two bugs causing "Failed to create deposit transaction: invalid address or ENS name" error.

Root Cause

Bug 1: Missing user address in toPaymentInfoDto

In toPaymentInfoDto(), after calling transactionRequestService.create(), the returned transactionRequest only contains user: { id: userId } without the address field. When createDepositTx() tried to access request.user.address, it was undefined.

Fix: Add optional userAddress parameter to createDepositTx() and pass user.address from the already-loaded user object.

Bug 2: Missing deposit relation in controller

In the depositTx controller endpoint, getById() was called without loading the deposit relation. This caused route.deposit to be undefined, resulting in the same error when accessing route.deposit.address.

Fix: Add relations: { deposit: true } to the getById() call.

Changes

  • sell.service.ts: Add optional userAddress parameter, validation for missing addresses
  • sell.controller.ts: Load deposit relation in getById() call

Test plan

  • Sell page loads without "Failed to create deposit transaction" error
  • Deposit transaction data is correctly returned in API response
  • /paymentInfos/:id/tx endpoint works correctly

…lation

Two bugs were causing 'Failed to create deposit transaction: invalid address or ENS name':

1. In toPaymentInfoDto(): The transactionRequest only contained user: { id: userId }
   without the address field. Fixed by explicitly passing user.address.

2. In depositTx controller endpoint: getById() did not load the deposit relation,
   so route.deposit was undefined. Fixed by adding relations: { deposit: true }.

Also added validation to throw clear errors if address or deposit is missing.
@TaprootFreak TaprootFreak force-pushed the fix/sell-deposit-tx-user-address branch from c252d4a to 33e4049 Compare January 1, 2026 19:06
@TaprootFreak TaprootFreak merged commit 0bd51e6 into develop Jan 1, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the fix/sell-deposit-tx-user-address branch January 1, 2026 19:10
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