Repository navigation
Conversation
This branch has not been deployed
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.
Boltz-free claim/refund constructors
Expose public constructors that build a claim or refund transaction from a caller-provided lockup UTXO, with no
BoltzApiClientV2in scope — a compile-time guarantee that the unilateral (script-path) spend path can run without any Boltz API call.Why
new_claim/new_refundfetch the lockup UTXO viafetch_swap_utxo, which is Electrum-first but falls back to the Boltz API when Electrum can't return the UTXO:bitcoin.rs: falls back on Electrum error.liquid.rs: falls back on Electrum error or an empty (Ok(None)) result — i.e. even when Electrum works but the UTXO isn't found.For a unilateral rescue of a stuck swap (lockup present, no cooperative claim/refund) we need a path that is provably Boltz-free, using params already on the user's device.
What
BtcSwapTx::new_claim_with_utxo— madepub(waspub(crate)).BtcSwapTx::new_refund_with_utxo— newpub(takesVec<(OutPoint, TxOut)>, mirroringnew_refund's multi-UTXO sweep).LBtcSwapTx::new_claim_with_utxo— madepub(waspub(crate)).LBtcSwapTx::new_refund_with_utxo— newpub.The Electrum-only fetch primitives already exist publicly (
BtcSwapScript::fetch_utxos,LBtcSwapScript::fetch_utxo), so callers obtain the UTXO with those and construct via the new entries. None of the new/changed functions take aBoltzApiClientV2.Chain swaps reuse
BtcSwapTx/LBtcSwapTx, so all three swap types are covered.Signing stays unchanged:
sign_claim/sign_refundwithCooperative: Nonealready performs the script-path spend with no Boltz access.Validation
cargo check --features lnurl,electrum— clean.cargo clippy --features lnurl,electrum— no warnings.cargo test --features lnurl,electrum --no-run— compiles.