Skip to content

Conversation

@TaprootFreak
Copy link
Contributor

Summary

  • Add includeTx parameter to sell.hook.ts receiveFor (default: false)
  • Add includeTx parameter to swap.hook.ts receiveFor (default: false)
  • Only request depositTx when explicitly needed (e.g., when user clicks send button)

Problem

The API was attempting to create a deposit transaction even when the user is just viewing a price quote. This caused "insufficient funds for intrinsic transaction cost" errors when the wallet has insufficient gas for transaction estimation.

Solution

Make includeTx an optional parameter that defaults to false. Consumers should pass includeTx=true only when they actually need the prepared transaction (i.e., when the user is ready to send).

Usage

// Just getting a quote (no depositTx needed)
const quote = await receiveFor(paymentInfo);

// Ready to send transaction (need depositTx)
const sellWithTx = await receiveFor(paymentInfo, true);

Test plan

  • Verify sell quote works without errors
  • Verify swap quote works without errors
  • Verify includeTx=true still returns depositTx when needed

- Add includeTx parameter to sell.hook.ts receiveFor (default: false)
- Add includeTx parameter to swap.hook.ts receiveFor (default: false)
- Only request depositTx when explicitly needed (e.g., when user clicks send button)
- Prevents 'insufficient funds for intrinsic transaction cost' errors during quote requests

This fixes the issue where the API would attempt to create a deposit transaction
even when the user is just viewing a price quote, causing errors when the wallet
has insufficient gas for transaction estimation.
@TaprootFreak TaprootFreak merged commit 8ee90b0 into develop Jan 2, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the fix/include-tx-optional-parameter branch January 2, 2026 08:09
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