Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: get inputs for dual funding #149

Merged
merged 3 commits into from
Mar 14, 2024
Merged

Conversation

matthewjablack
Copy link
Contributor

What

Improve utxo selection process for DLC creation

Specifically add getInputsForDualFunding which accounts for DLC offer/accept fees using AtomicFinance/node-dlc#206 dualFundingCoinSelect which calculates DLC funding and execution fees an accounts for this in input selection.

Why

Since it's a dual funded transaction, each user pays for half of the base tx fees, and their share of the inputs they provide, which ends up being less than a typical transaction.

This fixes edge cases where there might not be enough inputs in a typical scenario for a single funded transaction, but there in fact is enough for a dual funded one.

Copy link

changeset-bot bot commented Mar 14, 2024

🦋 Changeset detected

Latest commit: 82ed846

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@atomicfinance/bitcoin-dlc-provider Patch
@atomicfinance/bitcoin-js-wallet-provider Patch
@atomicfinance/bitcoin-utils Patch
@atomicfinance/bitcoin-wallet-provider Patch
@atomicfinance/client Patch
@atomicfinance/types Patch
@atomicfinance/bitcoin-cfd-provider Patch
@atomicfinance/bitcoin-esplora-api-provider Patch
@atomicfinance/bitcoin-esplora-batch-api-provider Patch
@atomicfinance/bitcoin-node-wallet-provider Patch
@atomicfinance/bitcoin-rpc-provider Patch
@atomicfinance/crypto Patch
@atomicfinance/errors Patch
@atomicfinance/jsonrpc-provider Patch
@atomicfinance/node-provider Patch
@atomicfinance/provider Patch
@atomicfinance/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8286485376

Details

  • 54 of 70 (77.14%) changed or added relevant lines in 6 files are covered.
  • 14 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.4%) to 64.107%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/bitcoin-dlc-provider/lib/BitcoinDlcProvider.ts 4 5 80.0%
packages/bitcoin-js-wallet-provider/lib/BitcoinJsWalletProvider.ts 0 1 0.0%
packages/client/lib/Wallet.ts 1 3 33.33%
packages/bitcoin-wallet-provider/lib/BitcoinWalletProvider.ts 39 51 76.47%
Files with Coverage Reduction New Missed Lines %
packages/client/lib/Wallet.ts 1 40.0%
packages/bitcoin-js-wallet-provider/lib/BitcoinJsWalletProvider.ts 1 43.48%
packages/bitcoin-utils/lib/index.ts 4 51.09%
packages/bitcoin-wallet-provider/lib/BitcoinWalletProvider.ts 8 61.12%
Totals Coverage Status
Change from base Build 8103945159: -0.4%
Covered Lines: 1774
Relevant Lines: 2608

💛 - Coveralls

@matthewjablack matthewjablack merged commit 9781efe into master Mar 14, 2024
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.

2 participants