Merged
Conversation
) * feat: add Boltz/Lightning.space adapter for Citrea cBTC liquidity Integrate Lightning.space (Boltz) as an additional liquidity source for Citrea/cBTC, enabling flexible BTC → cBTC reverse swaps for amounts smaller than the fixed 10 BTC Clementine Bridge. * fix: correct Boltz reverse swap status handling Use invoice.settled as success status for reverse swaps (not transaction.claimed which is for submarine swaps). Add complete SwapUpdateEvent enum matching boltz-backend. Simplify createReverseSwap params since EVM chains don't need preimageHash/claimPublicKey. * fix: use Chain Swap instead of Reverse Swap for BTC->cBTC BTC onchain -> cBTC onchain is a Chain Swap (not a Reverse Swap which is Lightning -> onchain). Switch to POST /v2/swap/chain with preimageHash, claimAddress, userLockAmount. Use correct final events: transaction.claimed for success. * fix: complete BTC→cBTC chain swap flow with BTC sending and claiming Previously the Boltz adapter created a chain swap but never sent BTC to the lockup address and never called helpMeClaim, leaving swaps stuck at swap.created. This implements the full flow: - Fix API URL (lightning.space/v1) and endpoint paths (/swap/v2/...) - Add getChainPairs() for pairHash and helpMeClaim() for server-side claiming - Send BTC to lockup address via BitcoinService after swap creation - Add state machine (btc_sent → claiming → done) in checkDepositCompletion - Store preimage/preimageHash in correlation data for claiming * fix: add 0x prefix to preimageHash in helpMeClaim, use lockup amount from response The helpMeClaim endpoint expects preimageHash with 0x prefix (verified against JuiceSwap frontend's prefix0x() call). Also use the actual lockup amount from the Boltz response instead of the requested amount for defensive correctness. * fix: use claimDetails.amount for outputAmount to account for Boltz fees The outputAmount was incorrectly set to userLockAmountSats (BTC sent) instead of claimAmountSats (cBTC received after Boltz fees). Now stores swap.claimDetails.amount in correlation data and uses it for the final outputAmount calculation. * fix: add missing await in try-catch to resolve ESLint warnings return-await is required inside try-catch blocks per @typescript-eslint/return-await rule. * feat: add migration to create Boltz action and activate cBTC rule Creates Boltz deposit action and wires it as onFail fallback for Clementine (Action 236). Activates Rule 320 (Citrea cBTC) with thresholds: minimal=0, optimal=0.1, maximal=0.5. Strategy: Clementine stays primary (fee-free, 10 BTC fixed). When it fails (e.g. balance < 10 BTC), Boltz handles flexible amounts as fallback. * feat: add refundPublicKey to chain swap for BTC refund on failure Generate secp256k1 key pair and send compressed public key as refundPublicKey in createChainSwap request. Store private key in correlation data for potential refund signing if swap fails. * style: fix Prettier formatting in Boltz adapter * fix: add transaction.lockupFailed to chain swap failure statuses Without this status, a failed lockup would leave the swap polling indefinitely. Verified against JuiceSwap bapp which includes lockupFailed in its swapStatusFailed list. * feat: validate swap amount against Boltz pair limits before creation Fetch dynamic min/max limits from Boltz chain pairs API and reject orders where the amount falls outside the allowed range. Prevents invalid swap creation and allows the order to retry later. * fix: store claimTxHash for idempotent claiming and include failureDetails in errors Persist claim transaction hash in correlation data so helpMeClaim is not called again on restart. Include both failureReason and failureDetails from Boltz status response in error messages. * chore: refactoring * fix: remove migration * feat: determine preimage + refund key deterministically * chore: renaming --------- Co-authored-by: David May <david.leo.may@gmail.com>
* feat: add Internet Computer (ICP) blockchain integration Add full ICP support including native ICP and ICRC-1 tokens (ckBTC, ckETH, ckUSDC, ckUSDT): - Principal-based wallet derivation (Ed25519, BIP32/BIP39) - Native ICP monitoring via query_blocks with internal AccountIdentifier matching - ICRC-1 token monitoring via get_transactions (ICRC-3) - Buy (EUR → ICP/ckUSDT), Sell (ICP/ckUSDT → EUR) pipelines - Payment Link (OCP) support with TxId and ICRC-2 Approve/TransferFrom flows - DEX strategies (check-liquidity, purchase, sell, supplementary) - PayIn strategies (register, send for coin and token) - Payout strategies (prepare, payout for coin and token) - Deposit address generation (one Principal per user for all ICP assets) - Signature verification for user authentication * fix: prettier formatting in config.ts after rebase * refactor: refactor minConfirmations to use map-based lookup Replace nested ternary with a record lookup for better readability and maintainability. * feat: CEX withdraw networks * fix: payment URI --------- Co-authored-by: David May <david.leo.may@gmail.com>
TaprootFreak
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatic Release PR
This PR was automatically created after changes were pushed to develop.
Commits: 1 new commit(s)
Checklist