Skip to content

Add all 4 transaction IDs for EVM Chain Swaps#122

Merged
TaprootFreak merged 4 commits intodevelopfrom
feat/all-4-tx-ids-for-chain-swaps
Feb 1, 2026
Merged

Add all 4 transaction IDs for EVM Chain Swaps#122
TaprootFreak merged 4 commits intodevelopfrom
feat/all-4-tx-ids-for-chain-swaps

Conversation

@TaprootFreak
Copy link
Contributor

Summary

  • Integrate Ponder-Claim database to fetch claim TX hashes for EVM Chain Swaps
  • Add ponder PostgreSQL connection pool configuration alongside existing Boltz DB
  • Extend SwapDto with cryptographic details (preimageHash, preimage, version)
  • Add chain ID fields for source/destination chains
  • Add sourceClaimTxId and destClaimTxId fields populated from Ponder-Claim DB
  • Create chain ID mapping utility (SYMBOL_TO_CHAIN_ID) for symbol resolution

Changes

  • .env.example: Add Ponder PostgreSQL configuration variables
  • src/config/config.ts: Add ponderPostgres configuration
  • src/subdomains/support/constants/chain-ids.ts: New chain ID mapping utility
  • src/subdomains/support/dto/swap-stats.dto.ts: Extended SwapDto with new fields
  • src/subdomains/support/services/support.service.ts:
    • Add ponder pool management
    • Add fetchClaimTxsWithChainFromPonder() method
    • Enrich chain swaps with claim TX data

How It Works

  1. Fetch chain swaps from Boltz DB (includes lockup TXs)
  2. Extract preimageHashes from all swaps
  3. Query Ponder-Claim DB's lockups table for matching claim TXs
  4. Match claim TXs to swaps using chainId (source vs destination)
  5. Return enriched swap data with all 4 TX IDs

Test plan

  • Verify Ponder DB connection works when configured
  • Test swap endpoint returns claim TXs when available
  • Verify graceful fallback when Ponder DB not configured
  • Check chain ID mapping for all supported symbols

Closes #121

Integrate Ponder-Claim database to fetch claim TX hashes:
- Add Ponder PostgreSQL connection pool and configuration
- Extend SwapDto with preimageHash, preimage, version, chain IDs
- Add sourceClaimTxId and destClaimTxId fields from Ponder-Claim DB
- Create chain ID mapping utility for symbol-to-chainId resolution
- Query lockups table by preimageHash to match claim TXs to swaps
Ponder generates PostgreSQL tables with snake_case column names:
- preimageHash → preimage_hash
- chainId → chain_id
- claimTxHash → claim_tx_hash

Also remove unused duplicate method and consolidate into single
fetchClaimTxsFromPonder() method.
Boltz stores preimageHash WITHOUT 0x prefix (64 hex chars)
Ponder stores preimageHash WITH 0x prefix (from Ethereum events)

Normalize all hashes to 0x prefix before querying Ponder and
when looking up in the claimTxMap.
@TaprootFreak TaprootFreak marked this pull request as ready for review February 1, 2026 22:10
@TaprootFreak TaprootFreak merged commit 72c8a82 into develop Feb 1, 2026
1 check passed
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.

feat: Return all 4 transaction IDs for EVM Chain Swaps

2 participants