Skip to content

feat: Add getTransaction method to BlockchainClient#134

Merged
bucko13 merged 40 commits intocaravan-bitcoin:mainfrom
Legend101Zz:client-methods
Mar 5, 2025
Merged

feat: Add getTransaction method to BlockchainClient#134
bucko13 merged 40 commits intocaravan-bitcoin:mainfrom
Legend101Zz:client-methods

Conversation

@Legend101Zz
Copy link
Contributor

@Legend101Zz Legend101Zz commented Sep 12, 2024

This commit adds a getTransaction method to the BlockchainClient class, which provides a consistent structure for fetching transaction details across different data providers (Bitcoin Core, Blockstream, Mempool).

Changes:

  • Add TransactionDetails interface for unified transaction data
  • Implement getTransaction method
  • Add normalizeTransactionData to standardize response

@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2024

🦋 Changeset detected

Latest commit: a91bb7c

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

This PR includes changesets to release 1 package
Name Type
@caravan/clients Minor

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

@vercel
Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
caravan-coordinator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 5:17pm

@Legend101Zz
Copy link
Contributor Author

#116 This method was added to help add fee-bumping methods RBF/CPFP to caravan-coordinator

Copy link
Contributor Author

@Legend101Zz Legend101Zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this fn looks good to you ?
Because I noticed that getTransactionHex does not have typed return type

Copy link
Contributor

@bucko13 bucko13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple requests. Overall looks good though. Thanks and sorry for the delay in review!

Copy link
Contributor

@bucko13 bucko13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of relatively small changes otherwise looking good!

This commit adds a getTransaction method to the BlockchainClient class,
which provides a consistent structure for fetching transaction details across different data providers (Bitcoin Core, Blockstream, Mempool).

Changes:
 - Add `TransactionDetails` interface for unified transaction data
 - Implement `getTransaction` method
 - Add `normalizeTransactionData` to standardize response
Copy link
Contributor

@bucko13 bucko13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tx data processing from private client is not working for me. Left some comments that will hopefully help fix.

txid,
true,
]);
return response.result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i run this with the #168 PR I'm getting an error because callBitcoind doesn't return a result prop. if you change this, the error doesn't happen anymore.

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2025

📝 Walkthrough

Walkthrough

This pull request introduces new methods, functions, and type definitions aimed at enhancing blockchain interactions within the @caravan/clients package. The BlockchainClient class now features a getTransaction method that retrieves and normalizes transaction data using a new normalization function. A dedicated module for Bitcoin node interactions (bitcoind.ts) has been added, providing functions for JSON-RPC calls, error handling, and utility operations. Similarly, a new module for block explorer interactions (block_explorer.ts) includes functions to fetch UTXOs, assess address status, estimate fees, and broadcast transactions. Additional type definitions for raw transaction data, inputs, outputs, and RPC structures have been incorporated, alongside minor modifications in test files to cover the new functionalities. A new file (blockchain.ts) further integrates Bitcoin network operations, ensuring correct client type validations and error handling throughout the various blockchain operations.

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/caravan-clients/src/bitcoind.ts

Oops! Something went wrong! :(

ESLint: 7.32.0

ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".

(The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "/packages/caravan-clients".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install @typescript-eslint/eslint-plugin@latest --save-dev

The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in "packages/caravan-clients/.eslintrc.js » @caravan/eslint-config/library.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/caravan-clients/src/block_explorer.ts

Oops! Something went wrong! :(

ESLint: 7.32.0

ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".

(The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "/packages/caravan-clients".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install @typescript-eslint/eslint-plugin@latest --save-dev

The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in "packages/caravan-clients/.eslintrc.js » @caravan/eslint-config/library.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/caravan-clients/src/blockchain.ts

Oops! Something went wrong! :(

ESLint: 7.32.0

ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".

(The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "/packages/caravan-clients".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install @typescript-eslint/eslint-plugin@latest --save-dev

The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in "packages/caravan-clients/.eslintrc.js » @caravan/eslint-config/library.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (6)
packages/caravan-clients/src/blockchain.ts (6)

4-7: Minor spelling concern for function name.
The function blockExplorerGetAddresesUTXOs contains a small typo ("Addreses" instead of "Addresses"). Although this is a minor issue, correcting it would improve the code’s readability and consistency.


64-64: Fix JSDoc typo.
There's an extra brace in the JSDoc comment for the client parameter:

@param {ClientConfig}} client

Removing the extra brace will keep the documentation clean and consistent.

- * @param {ClientConfig}} client
+ * @param {ClientConfig} client

82-83: Consider unifying the shape of updates.
When a wallet address is not found, the returned object includes an addressKnown property which is missing from the initial default UTXOUpdates interface in lines 75-80. Ensure consistent shape and property sets to avoid type or runtime issues.

 let updates: UTXOUpdates = {
   utxos: [],
   balanceSats: BigNumber(0),
   fetchedUTXOs: false,
   fetchUTXOsError: "",
+  addressKnown: true, // or another sensible default if needed
 };

Also applies to: 85-91


100-101: Mark fetchedUTXOs as true for empty arrays.
If unsortedUTXOs is falsy, returning early keeps fetchedUTXOs as false, which can create confusion. Consider explicitly marking them as fetched, even if empty, to accurately represent the fetch status.

 if (!unsortedUTXOs) {
   return {
     ...updates,
+    fetchedUTXOs: true,
   };
 }

26-29: Validate non-empty credentials.
Though you check for string types, empty or undefined credentials might still slip through. Consider validating that strings are non-empty to ensure a robust configuration.

 return (
   client.type === BITCOIND &&
-  typeof client.url === "string" &&
-  typeof client.username === "string" &&
-  typeof client.password === "string"
+  (typeof client.url === "string" && client.url.length > 0) &&
+  (typeof client.username === "string" && client.username.length > 0) &&
+  (typeof client.password === "string" && client.password.length > 0)
 );

178-179: Improve credential security.
The code currently passes credentials (password, username) directly into functions, which might indicate plain-text usage. Consider referencing environment variables or a secure vault integration to handle sensitive information. This is a general best practice to protect credentials.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1de4b1c and d792e32.

📒 Files selected for processing (1)
  • packages/caravan-clients/src/blockchain.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ci (20.x)
🔇 Additional comments (1)
packages/caravan-clients/src/blockchain.ts (1)

84-84: Potential mismatch of client type.
This code checks client.type === "private", but throughout the file, the constants BLOCK_EXPLORER and BITCOIND are typically used. If this is intentional, please confirm. Otherwise, it may be an oversight that prevents correct error handling for bitcoind clients.

Copy link
Contributor

@bucko13 bucko13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! just a couple of minor comments and cleanup (some optional)

url: string,
auth: AxiosBasicCredentials,
method: string,
params: unknown[] = [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is always a list of strings right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or number I guess.

Copy link
Contributor Author

@Legend101Zz Legend101Zz Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh ... good call! params actually accepts more than just strings or numbers.

For example:

  • In bitcoindImportMulti, it's an array with complex objects like [imports, { rescan }].
  • In wallet.ts, bitcoindListUnspent passes an object: { minconf: 0, maxconf: 9999999, addresses: addressParam }.

Since Bitcoin RPC methods have pretty varied parameter structures, sticking with unknown[] makes sense.

But to be even more precise, we could use:

params: unknown[] | Record<string, unknown> = []

Also this is something related to the //@ts-expect-error Will Fix this in wallet.ts which you also asked about

what's the story with these?

Actually, we already had BitcoindWalletParams already defined and I did not want to change it ( as limiting the scope of the PR ) ... now in the BitcoindWalletParamswe have params defined as any[] | Record<string, any> so that's what the first @ts-expect-error is for in the callBitcoindWallet ...

The other @ts-expect-error in bitcoindListUnspent is due to the no proper generic typing in callBitcoindWallet as it always returns RPCResponse<unknown> so if the resp in

    const resp: {
      result: ListUnspentResponse[];
    } = await callBitcoindWallet({
      baseUrl: url,
      auth,
      walletName,
      method: "listunspent",
      params: { minconf: 0, maxconf: 9999999, addresses: addressParam },
    });
is `ListUnspentResponse[]` is not guaranteed and ts throws error ...

These can be fixed with minor tweaks in the `BitcoindWalletParams` interface and making `callBitcoindWallet` return a generic response based on type of call like `callBitcoind`

should I proceed with it ??

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (6)
packages/caravan-clients/src/blockchain.ts (2)

1-4: Consider removing or resolving the “no-explicit-any” disabling rule.

While it’s sometimes necessary to silence type errors temporarily, resolving them ensures better type safety and early detection of potential bugs.


36-61: Define a more specific return type instead of Promise<any[]>.

Returning Promise<any[]> obscures the shape of the data, hindering effective type-checking downstream. Use a dedicated interface or type.

packages/caravan-clients/src/block_explorer.ts (2)

45-65: Optimize repeated transaction fetching and “delay hack.”

Repeatedly fetching each transaction (with an artificial delay) may cause performance bottlenecks. Consider these improvements:

  1. Use batch requests, if supported by the block explorer’s API.
  2. Implement a more systematic rate-limiting strategy (e.g., exponential backoff or token bucket).

68-68: Use optional chaining for clearer error handling.

Instead of (e.response && e.response.data) || e;, prefer optional chaining for maintainability and readability:

- throw (e.response && e.response.data) || e;
+ throw e.response?.data ?? e;

Also applies to: 98-98, 120-120, 141-141

🧰 Tools
🪛 Biome (1.9.4)

[error] 68-68: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/caravan-clients/src/bitcoind.ts (2)

74-79: Use optional chaining in isWalletAddressNotFoundError.

Simplify nested checks using optional chaining:

-return (
-  e.response &&
-  e.response.data &&
-  e.response.data.error &&
-  e.response.data.error.code === -4
-);
+return e.response?.data?.error?.code === -4;
🧰 Tools
🪛 Biome (1.9.4)

[error] 75-77: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


255-258: Prefer optional chaining in error throw statements.

This maintains consistency with the rest of the codebase and ensures more explicit null/undefined guarding:

-throw (e.response && e.response.data.error.message) || e;
+throw e.response?.data?.error?.message ?? e;
🧰 Tools
🪛 Biome (1.9.4)

[error] 257-257: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d792e32 and c90dfbf.

📒 Files selected for processing (3)
  • packages/caravan-clients/src/bitcoind.ts (1 hunks)
  • packages/caravan-clients/src/block_explorer.ts (1 hunks)
  • packages/caravan-clients/src/blockchain.ts (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/caravan-clients/src/block_explorer.ts

[error] 68-68: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 98-98: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 120-120: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 141-141: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/caravan-clients/src/bitcoind.ts

[error] 75-77: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 257-257: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ci (20.x)
🔇 Additional comments (4)
packages/caravan-clients/src/blockchain.ts (3)

127-151: Logic and structure approved.

This function properly delegates to explorer or bitcoind for address status.


177-201: Broadcast function appears well-structured.

The approach for selecting bitcoind or explorer client follows the established pattern.


88-88:

Details

✅ Verification successful

Verify usage of client.type === "private".

The code checks against "private", while your ClientConfig constants are BLOCK_EXPLORER and BITCOIND. If this is intentional, ensure that "private" is a valid client type; otherwise, revise the condition.


🏁 Script executed:

#!/bin/bash
# Find all references to 'client.type' across the codebase to verify there's a 'private' usage or definition
rg "client\.type"

Length of output: 3616


Verified: Valid usage of client.type === "private" is intentional.
After searching the codebase, it's clear that the literal "private" is used consistently in various parts of the application (for example, in both apps/coordinator and packages/caravan-clients) alongside other client types such as BLOCK_EXPLORER and BITCOIND. This confirms that the check at line 88 is correct and intentional. No changes are needed.

packages/caravan-clients/src/bitcoind.ts (1)

193-201: Duplicate comment: unify error handling vs. returning raw errors.

… `BaseBitcoindArgs`, updating function signatures
@bucko13
Copy link
Contributor

bucko13 commented Mar 5, 2025

Great stuff! Thanks a ton for the typescript conversion as well. Huge win for what started out as a small feature improvement.

@bucko13 bucko13 merged commit c220696 into caravan-bitcoin:main Mar 5, 2025
4 checks passed
@github-actions github-actions bot mentioned this pull request Mar 5, 2025
bucko13 added a commit that referenced this pull request Mar 11, 2025
* fix: multisig support for indirect keystore interactions (#120)

* Version Packages (#121)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Caravan Health Package (beta) (#112)

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
Co-authored-by: buck <buck@unchained.com>

* Version Packages (#123)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Tweaks to SegWit PSBT Inputs/Outputs (#124)

* fix: supply witness script when generating multisig

* fix: include non witness utxo in segwit inputs

* fix: add unsignedPSBT to state on finalizeOutputs

* fix: variable names and pass psbt to direct sig importer

* update fixture shape and psbts to include non witness utxos

* tweak fixture shape and add non witness utxos to psbts

* hackish injection of non witness utxos for tests

* include nonwitness utxo for segwit in caravan bitcoin; update base64 encoded psbts in fixtures for less testing hackery

* include multisig obj in caravan bitcoin fixtures

---------

Co-authored-by: buck <buck@unchained.com>

* Feat: bip32 package with blinded xpub support (#126)

* cleanup and fix generator templates

* init bip32 package with paths utils

* fix: eslint and add import ordering

* split up key and path modules and add tests

* custom util for getting random ints in node or browser

* use custom random int for blinded paths

* util for getting blinded xpub from source

* feat: blind xpub support for text input

* make new bip32 package publishable

* feat: reused functionality extracted to a utility for getting relative child sequence

* Fix hermit selection (#127)

* convert HermitReader and SignatureImporter to typescript

* adding height on hermit reader

* convert HermitReader to functional and use new QrReader api

* fix falsey bug

* styling cleanup

---------

Co-authored-by: Justin Moore <11jmoore@pm.me>

* caravan/bip32 publish access public (#129)

* tweak to package.json (#130)

* Version Packages (#128)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* unsignedPsbt in redux store should include global xpubs (#132)

* bump for coordinator (#138)

* Version Packages (#139)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fee bumping Package (#114)

* feat: Initialize @caravan/feebumping package

Create a new package for fee bumping functionality in Caravan. This package
provides modular and reusable utilities for implementing RBF (Replace-By-Fee)
and CPFP (Child-Pays-For-Parent) fee bumping strategies.

Key additions:
- Basic package structure and configuration files
- Core modules for RBF and CPFP implementations
- Fee estimation utilities
- Type definitions for fee bumping operations
- Constants and utility functions

This package aims to enhance Caravan's transaction management capabilities
by providing a flexible and extensible fee bumping solution that can be
easily integrated into the Caravan coordinator wallet and other Bitcoin
projects.

* update package-lock (#143)

* Version Packages (#144)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* add support for the BitBox02 hardware wallet (#117)

* add support for the BitBox02 hardware wallet

Using the `bitbox-api` NPM package, which loads a WASM module.

Note about CJS:
Currently the `bitbox-api` package is an ESM package with a `module:
...` entrypoint, so it is not compatible with the `cjs` target of
caravan-wallets. The only workaround that I could find where
compilation succeeds and the package works in the browser is to mark
bitbox-api as external in tsup.config.ts.

Note about signing tests:

- The BitBox02 requires the previous transaction of each input to be
present in the PSBT (`PSBT_IN_NON_WITNESS_UTXO`), so it can verify the
input amount and avoid fee attacks. The signing test fixtures are
missing these, so they fail.

- The BitBox02 uses the anti-klepto (anti-exfil) protocol to mitigate
covert nonce exfil attacks. This results in random signatures. The
unit test fixtures hardcode the expected signatures, assuming they are
always the same. As a result, also here the tests fail. To fix this,
the tests should rather verify the ECDSA signatures against the
transaction sighash for each input.

* hide BitBox02 menu item for P2SH

BitBox02 does not support legacy P2SH.

* bitbox: display pairing code

The BitBox, if not paired yet, will show a pairing code for
confirmation. This can happen in any BitBox interaction.

This commit adds a `showPairingCode` param to all BitBox
interactions. If not provided, a default implementation is used which
shows the pairing code in a browser popup.

The current `messages()` system is not a good fit, as the client does
not know when to call `messagesFor()` to display it. Having a separate
UI button to pair the BitBox is not good UX (why should the user be
bothered to click a "pair" button first? What if the user doesn't) and
also fragile (a re-pairing could be needed at any time).

* add regtest support for BitBox02

---------

Co-authored-by: buck <buck@unchained.com>

* Version Packages (#145)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: fees package private (#146)

* Translate segwit psbt (#147)

* chore: fix turbo.json for test runner

* update deps

* feat: dds support for translatePSBT for segwit PSBTs

* pass key details to sig interaction just in case

* Version Packages (#148)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: move bitbox to normal dependency (#149)

* Version Packages (#150)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(wallets): bundle internal dependencies with production bundle (#151)

* Version Packages (#152)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: @caravan/bitcoin shouldn't be noExternal (#153)

* Version Packages (#154)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: unknown network error for regtest (#156)

* support regtest network in coldcard and custom interactions

* add changeset

* Version Packages (#157)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* include addressType for valid PSBT translation in SignMultisigTransaction (#159)

* Version Packages (#160)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(deps-dev): bump gh-pages from 3.2.3 to 5.0.0

Bumps [gh-pages](https://github.com/tschaub/gh-pages) from 3.2.3 to 5.0.0.
- [Release notes](https://github.com/tschaub/gh-pages/releases)
- [Changelog](https://github.com/tschaub/gh-pages/blob/main/changelog.md)
- [Commits](tschaub/gh-pages@v3.2.3...v5.0.0)

---
updated-dependencies:
- dependency-name: gh-pages
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: turbo dev depends on build w/ esbuild noExternal (#164)

* Add sparrow to allowed method of importing pubkeys (#166)

Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>

* bump @trezor/connect-web from 9.1.12 to 9.4.7 (#163)

Co-authored-by: dylan-thompson <141655089+dylan-thompson@users.noreply.github.com>

* Version Packages (#169)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(deps): bump axios from 1.6.7 to 1.7.4 in /packages/caravan-wallets

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* PsbtV2.toV0(): Convert a PsbtV2 class to its serialized PSBTv0 counterpart (#158)

* feat: PsbtV2.toV0()

* chore: changeset

* fix: remove log

* test: add more tests for PsbtV2.toV0

* chore: update package-lock to match package.json (#171)

* Version Packages (#173)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: replace npm install with npm ci in CI workflows (#175)

* fix(psbt): lock dependency of caravan-bitcoin (#174)

* Version Packages

* chore(deps): bump axios from 1.6.7 to 1.7.4

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps-dev): bump vite from 4.5.5 to 4.5.6

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.5 to 4.5.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(turbo): add build as lint task dependency (#178)

* chore(wallets): bump trezor connect dependency (#183)

* Version Packages (#184)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix/docker updates (#185)

* fix(docker): add multi-platform support for coordinator Dockerfile

* chore(changeset): changeset for multi-platform Dockerfile change

* docs(dockerfile): clarify platform-agnostic comment for coordinator app

* feat: Add getTransaction method to BlockchainClient (#134)

* feat: Add getTransaction method to BlockchainClient

This commit adds a getTransaction method to the BlockchainClient class,
which provides a consistent structure for fetching transaction details across different data providers (Bitcoin Core, Blockstream, Mempool).

Changes:
 - Add `TransactionDetails` interface for unified transaction data
 - Implement `getTransaction` method
 - Add `normalizeTransactionData` to standardize response

* REVIEW-CHANGES : changes in bitcoind.js and tests

* refactor: move transaction normalization to standalone utility

* refactor: update TransactionDetails to use camelCase naming

* refactor(bitcoind): convert bitcoind.js to TypeScript

* feat(bitcoind): update ListTransactionsItem interface to match RPC spec

* fix(client): handle different transaction response formats properly for the getTransaction method

* fix: update test mocks to match RPC response types

* changes to fix broken tests

* refactor(block-explorer): Convert to TypeScript with improved type safety

* refactor(blockchain): Migrate to TypeScript and enhance error handling

* revert: revert: undo recent changes to bitcoind.ts

* fixes: Type fixes in bitcoind

* fix: remove async promise executor in callBitcoind

* doc-strings: added doc strings to callBitcoind method

* refactor: add TypeScript type annotations to bitcoindParams function

* Added detailed docstrings to the `bitcoindListUnspent` method

* Added detailed docstrings to the `bitcoindGetAddressStatus` method

* Added detailed docstrings to the `bitcoindEstimateSmartFee` method

* refactor: improve typing and error handling in bitcoindSendRawTransaction

* refactor: improve typing and added doc-strings in bitcoindRawTxData

* revert: undo recent changes to block_explorer.ts

* fixes-types: Partial type fixes in block_explorer.ts to pass type errors

* fixes-type-block_explorer: Fixed blockExplorerGetAddresesUTXOs function

* fixes-type-block_explorer: Fixed blockExplorerGetAddressStatus function

* fixes-type-block_explorer: Fixed blockExplorerGetFeeEstimate function

* fixes-type-block_explorer: Fixed blockExplorerBroadcastTransaction function

* revert: undo recent changes to blockchain.ts

* fixes-types: Partial type fixes in blockchain.ts to pass type errors

* fixes-type-blockchain: Fixed fetchAddressUTXOsUnsorted function

* fixes-type-blockchain: Fixed fetchAddressUTXOs function

* fixes-type-blockchain: Fixed getAddressStatus function

* fixes-type-blockchain: Fixed fetchFeeEstimate function

* fixes-type-blockchain: Fixed broadcastTransaction function

* TO-DO: any error eslint disable to-do

* chore(changeset): Update changeset to include TypeScript migration

* refactor(bitcoind): standardize Bitcoin RPC parameters by introducing `BaseBitcoindArgs`, updating function signatures

* refactor(bitcoind): `bitcoindRawTxData` to use standardize Bitcoin RPC function parameters

* chore: rename block_explorer.ts to blockExplorer.ts for consistency

---------

Co-authored-by: buck <buck@unchained.com>

* Version Packages (#186)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Allow a PsbtV2 to be constructed with a psbtv2 which has been forceably set to have PSBT_GLOBAL_TX_VERSION === 1 (#188)

* feat: allowTxnVersion1 on instantiation

* chore: changeset

* Version Packages (#189)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: workflow failure

* removing unused dependencies from caravan-bitcoin package

---------

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
Co-authored-by: chadchapnick <143517546+chadchapnick@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Harshil Jani <harshiljani2002@gmail.com>
Co-authored-by: buck <buck@unchained.com>
Co-authored-by: Justin Moore <11jmoore@pm.me>
Co-authored-by: Mrigesh Thakur <96632943+Legend101Zz@users.noreply.github.com>
Co-authored-by: benma <m@mben.ch>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Shuford <75178461+robertshuford@users.noreply.github.com>
Co-authored-by: kimlwh <kimlwh@proton.me>
Co-authored-by: dylan-thompson <141655089+dylan-thompson@users.noreply.github.com>
Co-authored-by: Jack D <shadouts@hotmail.com>
bucko13 added a commit that referenced this pull request Mar 26, 2025
* fix: multisig support for indirect keystore interactions (#120)

* Version Packages (#121)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Caravan Health Package (beta) (#112)

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
Co-authored-by: buck <buck@unchained.com>

* Version Packages (#123)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Tweaks to SegWit PSBT Inputs/Outputs (#124)

* fix: supply witness script when generating multisig

* fix: include non witness utxo in segwit inputs

* fix: add unsignedPSBT to state on finalizeOutputs

* fix: variable names and pass psbt to direct sig importer

* update fixture shape and psbts to include non witness utxos

* tweak fixture shape and add non witness utxos to psbts

* hackish injection of non witness utxos for tests

* include nonwitness utxo for segwit in caravan bitcoin; update base64 encoded psbts in fixtures for less testing hackery

* include multisig obj in caravan bitcoin fixtures

---------

Co-authored-by: buck <buck@unchained.com>

* Feat: bip32 package with blinded xpub support (#126)

* cleanup and fix generator templates

* init bip32 package with paths utils

* fix: eslint and add import ordering

* split up key and path modules and add tests

* custom util for getting random ints in node or browser

* use custom random int for blinded paths

* util for getting blinded xpub from source

* feat: blind xpub support for text input

* make new bip32 package publishable

* feat: reused functionality extracted to a utility for getting relative child sequence

* Fix hermit selection (#127)

* convert HermitReader and SignatureImporter to typescript

* adding height on hermit reader

* convert HermitReader to functional and use new QrReader api

* fix falsey bug

* styling cleanup

---------

Co-authored-by: Justin Moore <11jmoore@pm.me>

* caravan/bip32 publish access public (#129)

* tweak to package.json (#130)

* Version Packages (#128)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* unsignedPsbt in redux store should include global xpubs (#132)

* bump for coordinator (#138)

* Version Packages (#139)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fee bumping Package (#114)

* feat: Initialize @caravan/feebumping package

Create a new package for fee bumping functionality in Caravan. This package
provides modular and reusable utilities for implementing RBF (Replace-By-Fee)
and CPFP (Child-Pays-For-Parent) fee bumping strategies.

Key additions:
- Basic package structure and configuration files
- Core modules for RBF and CPFP implementations
- Fee estimation utilities
- Type definitions for fee bumping operations
- Constants and utility functions

This package aims to enhance Caravan's transaction management capabilities
by providing a flexible and extensible fee bumping solution that can be
easily integrated into the Caravan coordinator wallet and other Bitcoin
projects.

* update package-lock (#143)

* Version Packages (#144)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* add support for the BitBox02 hardware wallet (#117)

* add support for the BitBox02 hardware wallet

Using the `bitbox-api` NPM package, which loads a WASM module.

Note about CJS:
Currently the `bitbox-api` package is an ESM package with a `module:
...` entrypoint, so it is not compatible with the `cjs` target of
caravan-wallets. The only workaround that I could find where
compilation succeeds and the package works in the browser is to mark
bitbox-api as external in tsup.config.ts.

Note about signing tests:

- The BitBox02 requires the previous transaction of each input to be
present in the PSBT (`PSBT_IN_NON_WITNESS_UTXO`), so it can verify the
input amount and avoid fee attacks. The signing test fixtures are
missing these, so they fail.

- The BitBox02 uses the anti-klepto (anti-exfil) protocol to mitigate
covert nonce exfil attacks. This results in random signatures. The
unit test fixtures hardcode the expected signatures, assuming they are
always the same. As a result, also here the tests fail. To fix this,
the tests should rather verify the ECDSA signatures against the
transaction sighash for each input.

* hide BitBox02 menu item for P2SH

BitBox02 does not support legacy P2SH.

* bitbox: display pairing code

The BitBox, if not paired yet, will show a pairing code for
confirmation. This can happen in any BitBox interaction.

This commit adds a `showPairingCode` param to all BitBox
interactions. If not provided, a default implementation is used which
shows the pairing code in a browser popup.

The current `messages()` system is not a good fit, as the client does
not know when to call `messagesFor()` to display it. Having a separate
UI button to pair the BitBox is not good UX (why should the user be
bothered to click a "pair" button first? What if the user doesn't) and
also fragile (a re-pairing could be needed at any time).

* add regtest support for BitBox02

---------

Co-authored-by: buck <buck@unchained.com>

* Version Packages (#145)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: fees package private (#146)

* Translate segwit psbt (#147)

* chore: fix turbo.json for test runner

* update deps

* feat: dds support for translatePSBT for segwit PSBTs

* pass key details to sig interaction just in case

* Version Packages (#148)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: move bitbox to normal dependency (#149)

* Version Packages (#150)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(wallets): bundle internal dependencies with production bundle (#151)

* Version Packages (#152)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: @caravan/bitcoin shouldn't be noExternal (#153)

* Version Packages (#154)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: unknown network error for regtest (#156)

* support regtest network in coldcard and custom interactions

* add changeset

* Version Packages (#157)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* include addressType for valid PSBT translation in SignMultisigTransaction (#159)

* Version Packages (#160)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(deps-dev): bump gh-pages from 3.2.3 to 5.0.0

Bumps [gh-pages](https://github.com/tschaub/gh-pages) from 3.2.3 to 5.0.0.
- [Release notes](https://github.com/tschaub/gh-pages/releases)
- [Changelog](https://github.com/tschaub/gh-pages/blob/main/changelog.md)
- [Commits](tschaub/gh-pages@v3.2.3...v5.0.0)

---
updated-dependencies:
- dependency-name: gh-pages
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: turbo dev depends on build w/ esbuild noExternal (#164)

* Add sparrow to allowed method of importing pubkeys (#166)

Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>

* bump @trezor/connect-web from 9.1.12 to 9.4.7 (#163)

Co-authored-by: dylan-thompson <141655089+dylan-thompson@users.noreply.github.com>

* Version Packages (#169)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(deps): bump axios from 1.6.7 to 1.7.4 in /packages/caravan-wallets

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* PsbtV2.toV0(): Convert a PsbtV2 class to its serialized PSBTv0 counterpart (#158)

* feat: PsbtV2.toV0()

* chore: changeset

* fix: remove log

* test: add more tests for PsbtV2.toV0

* chore: update package-lock to match package.json (#171)

* Version Packages (#173)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: replace npm install with npm ci in CI workflows (#175)

* fix(psbt): lock dependency of caravan-bitcoin (#174)

* Version Packages

* chore(deps): bump axios from 1.6.7 to 1.7.4

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps-dev): bump vite from 4.5.5 to 4.5.6

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.5 to 4.5.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(turbo): add build as lint task dependency (#178)

* chore(wallets): bump trezor connect dependency (#183)

* Version Packages (#184)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix/docker updates (#185)

* fix(docker): add multi-platform support for coordinator Dockerfile

* chore(changeset): changeset for multi-platform Dockerfile change

* docs(dockerfile): clarify platform-agnostic comment for coordinator app

* feat: Add getTransaction method to BlockchainClient (#134)

* feat: Add getTransaction method to BlockchainClient

This commit adds a getTransaction method to the BlockchainClient class,
which provides a consistent structure for fetching transaction details across different data providers (Bitcoin Core, Blockstream, Mempool).

Changes:
 - Add `TransactionDetails` interface for unified transaction data
 - Implement `getTransaction` method
 - Add `normalizeTransactionData` to standardize response

* REVIEW-CHANGES : changes in bitcoind.js and tests

* refactor: move transaction normalization to standalone utility

* refactor: update TransactionDetails to use camelCase naming

* refactor(bitcoind): convert bitcoind.js to TypeScript

* feat(bitcoind): update ListTransactionsItem interface to match RPC spec

* fix(client): handle different transaction response formats properly for the getTransaction method

* fix: update test mocks to match RPC response types

* changes to fix broken tests

* refactor(block-explorer): Convert to TypeScript with improved type safety

* refactor(blockchain): Migrate to TypeScript and enhance error handling

* revert: revert: undo recent changes to bitcoind.ts

* fixes: Type fixes in bitcoind

* fix: remove async promise executor in callBitcoind

* doc-strings: added doc strings to callBitcoind method

* refactor: add TypeScript type annotations to bitcoindParams function

* Added detailed docstrings to the `bitcoindListUnspent` method

* Added detailed docstrings to the `bitcoindGetAddressStatus` method

* Added detailed docstrings to the `bitcoindEstimateSmartFee` method

* refactor: improve typing and error handling in bitcoindSendRawTransaction

* refactor: improve typing and added doc-strings in bitcoindRawTxData

* revert: undo recent changes to block_explorer.ts

* fixes-types: Partial type fixes in block_explorer.ts to pass type errors

* fixes-type-block_explorer: Fixed blockExplorerGetAddresesUTXOs function

* fixes-type-block_explorer: Fixed blockExplorerGetAddressStatus function

* fixes-type-block_explorer: Fixed blockExplorerGetFeeEstimate function

* fixes-type-block_explorer: Fixed blockExplorerBroadcastTransaction function

* revert: undo recent changes to blockchain.ts

* fixes-types: Partial type fixes in blockchain.ts to pass type errors

* fixes-type-blockchain: Fixed fetchAddressUTXOsUnsorted function

* fixes-type-blockchain: Fixed fetchAddressUTXOs function

* fixes-type-blockchain: Fixed getAddressStatus function

* fixes-type-blockchain: Fixed fetchFeeEstimate function

* fixes-type-blockchain: Fixed broadcastTransaction function

* TO-DO: any error eslint disable to-do

* chore(changeset): Update changeset to include TypeScript migration

* refactor(bitcoind): standardize Bitcoin RPC parameters by introducing `BaseBitcoindArgs`, updating function signatures

* refactor(bitcoind): `bitcoindRawTxData` to use standardize Bitcoin RPC function parameters

* chore: rename block_explorer.ts to blockExplorer.ts for consistency

---------

Co-authored-by: buck <buck@unchained.com>

* Version Packages (#186)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Allow a PsbtV2 to be constructed with a psbtv2 which has been forceably set to have PSBT_GLOBAL_TX_VERSION === 1 (#188)

* feat: allowTxnVersion1 on instantiation

* chore: changeset

* Version Packages (#189)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: fixed the private node rpc calls bug in clients `getTransaction` method (#196)

* Version Packages (#197)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(wallet): Add pending transaction tab  (#168)

* fix: workflow failure fixes

* fix: tests failures fixed

---------

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
Co-authored-by: chadchapnick <143517546+chadchapnick@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Harshil Jani <harshiljani2002@gmail.com>
Co-authored-by: buck <buck@unchained.com>
Co-authored-by: Justin Moore <11jmoore@pm.me>
Co-authored-by: Mrigesh Thakur <96632943+Legend101Zz@users.noreply.github.com>
Co-authored-by: benma <m@mben.ch>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Shuford <75178461+robertshuford@users.noreply.github.com>
Co-authored-by: kimlwh <kimlwh@proton.me>
Co-authored-by: dylan-thompson <141655089+dylan-thompson@users.noreply.github.com>
Co-authored-by: Jack D <shadouts@hotmail.com>
bucko13 added a commit that referenced this pull request Apr 2, 2025
* fix: multisig support for indirect keystore interactions (#120)

* Version Packages (#121)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Caravan Health Package (beta) (#112)

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
Co-authored-by: buck <buck@unchained.com>

* Version Packages (#123)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Tweaks to SegWit PSBT Inputs/Outputs (#124)

* fix: supply witness script when generating multisig

* fix: include non witness utxo in segwit inputs

* fix: add unsignedPSBT to state on finalizeOutputs

* fix: variable names and pass psbt to direct sig importer

* update fixture shape and psbts to include non witness utxos

* tweak fixture shape and add non witness utxos to psbts

* hackish injection of non witness utxos for tests

* include nonwitness utxo for segwit in caravan bitcoin; update base64 encoded psbts in fixtures for less testing hackery

* include multisig obj in caravan bitcoin fixtures

---------

Co-authored-by: buck <buck@unchained.com>

* Feat: bip32 package with blinded xpub support (#126)

* cleanup and fix generator templates

* init bip32 package with paths utils

* fix: eslint and add import ordering

* split up key and path modules and add tests

* custom util for getting random ints in node or browser

* use custom random int for blinded paths

* util for getting blinded xpub from source

* feat: blind xpub support for text input

* make new bip32 package publishable

* feat: reused functionality extracted to a utility for getting relative child sequence

* Fix hermit selection (#127)

* convert HermitReader and SignatureImporter to typescript

* adding height on hermit reader

* convert HermitReader to functional and use new QrReader api

* fix falsey bug

* styling cleanup

---------

Co-authored-by: Justin Moore <11jmoore@pm.me>

* caravan/bip32 publish access public (#129)

* tweak to package.json (#130)

* Version Packages (#128)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* unsignedPsbt in redux store should include global xpubs (#132)

* bump for coordinator (#138)

* Version Packages (#139)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fee bumping Package (#114)

* feat: Initialize @caravan/feebumping package

Create a new package for fee bumping functionality in Caravan. This package
provides modular and reusable utilities for implementing RBF (Replace-By-Fee)
and CPFP (Child-Pays-For-Parent) fee bumping strategies.

Key additions:
- Basic package structure and configuration files
- Core modules for RBF and CPFP implementations
- Fee estimation utilities
- Type definitions for fee bumping operations
- Constants and utility functions

This package aims to enhance Caravan's transaction management capabilities
by providing a flexible and extensible fee bumping solution that can be
easily integrated into the Caravan coordinator wallet and other Bitcoin
projects.

* update package-lock (#143)

* Version Packages (#144)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* add support for the BitBox02 hardware wallet (#117)

* add support for the BitBox02 hardware wallet

Using the `bitbox-api` NPM package, which loads a WASM module.

Note about CJS:
Currently the `bitbox-api` package is an ESM package with a `module:
...` entrypoint, so it is not compatible with the `cjs` target of
caravan-wallets. The only workaround that I could find where
compilation succeeds and the package works in the browser is to mark
bitbox-api as external in tsup.config.ts.

Note about signing tests:

- The BitBox02 requires the previous transaction of each input to be
present in the PSBT (`PSBT_IN_NON_WITNESS_UTXO`), so it can verify the
input amount and avoid fee attacks. The signing test fixtures are
missing these, so they fail.

- The BitBox02 uses the anti-klepto (anti-exfil) protocol to mitigate
covert nonce exfil attacks. This results in random signatures. The
unit test fixtures hardcode the expected signatures, assuming they are
always the same. As a result, also here the tests fail. To fix this,
the tests should rather verify the ECDSA signatures against the
transaction sighash for each input.

* hide BitBox02 menu item for P2SH

BitBox02 does not support legacy P2SH.

* bitbox: display pairing code

The BitBox, if not paired yet, will show a pairing code for
confirmation. This can happen in any BitBox interaction.

This commit adds a `showPairingCode` param to all BitBox
interactions. If not provided, a default implementation is used which
shows the pairing code in a browser popup.

The current `messages()` system is not a good fit, as the client does
not know when to call `messagesFor()` to display it. Having a separate
UI button to pair the BitBox is not good UX (why should the user be
bothered to click a "pair" button first? What if the user doesn't) and
also fragile (a re-pairing could be needed at any time).

* add regtest support for BitBox02

---------

Co-authored-by: buck <buck@unchained.com>

* Version Packages (#145)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: fees package private (#146)

* Translate segwit psbt (#147)

* chore: fix turbo.json for test runner

* update deps

* feat: dds support for translatePSBT for segwit PSBTs

* pass key details to sig interaction just in case

* Version Packages (#148)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: move bitbox to normal dependency (#149)

* Version Packages (#150)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(wallets): bundle internal dependencies with production bundle (#151)

* Version Packages (#152)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: @caravan/bitcoin shouldn't be noExternal (#153)

* Version Packages (#154)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: unknown network error for regtest (#156)

* support regtest network in coldcard and custom interactions

* add changeset

* Version Packages (#157)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* include addressType for valid PSBT translation in SignMultisigTransaction (#159)

* Version Packages (#160)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(deps-dev): bump gh-pages from 3.2.3 to 5.0.0

Bumps [gh-pages](https://github.com/tschaub/gh-pages) from 3.2.3 to 5.0.0.
- [Release notes](https://github.com/tschaub/gh-pages/releases)
- [Changelog](https://github.com/tschaub/gh-pages/blob/main/changelog.md)
- [Commits](tschaub/gh-pages@v3.2.3...v5.0.0)

---
updated-dependencies:
- dependency-name: gh-pages
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: turbo dev depends on build w/ esbuild noExternal (#164)

* Add sparrow to allowed method of importing pubkeys (#166)

Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>

* bump @trezor/connect-web from 9.1.12 to 9.4.7 (#163)

Co-authored-by: dylan-thompson <141655089+dylan-thompson@users.noreply.github.com>

* Version Packages (#169)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(deps): bump axios from 1.6.7 to 1.7.4 in /packages/caravan-wallets

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* PsbtV2.toV0(): Convert a PsbtV2 class to its serialized PSBTv0 counterpart (#158)

* feat: PsbtV2.toV0()

* chore: changeset

* fix: remove log

* test: add more tests for PsbtV2.toV0

* chore: update package-lock to match package.json (#171)

* Version Packages (#173)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: replace npm install with npm ci in CI workflows (#175)

* fix(psbt): lock dependency of caravan-bitcoin (#174)

* Version Packages

* chore(deps): bump axios from 1.6.7 to 1.7.4

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps-dev): bump vite from 4.5.5 to 4.5.6

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.5 to 4.5.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(turbo): add build as lint task dependency (#178)

* chore(wallets): bump trezor connect dependency (#183)

* Version Packages (#184)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix/docker updates (#185)

* fix(docker): add multi-platform support for coordinator Dockerfile

* chore(changeset): changeset for multi-platform Dockerfile change

* docs(dockerfile): clarify platform-agnostic comment for coordinator app

* feat: Add getTransaction method to BlockchainClient (#134)

* feat: Add getTransaction method to BlockchainClient

This commit adds a getTransaction method to the BlockchainClient class,
which provides a consistent structure for fetching transaction details across different data providers (Bitcoin Core, Blockstream, Mempool).

Changes:
 - Add `TransactionDetails` interface for unified transaction data
 - Implement `getTransaction` method
 - Add `normalizeTransactionData` to standardize response

* REVIEW-CHANGES : changes in bitcoind.js and tests

* refactor: move transaction normalization to standalone utility

* refactor: update TransactionDetails to use camelCase naming

* refactor(bitcoind): convert bitcoind.js to TypeScript

* feat(bitcoind): update ListTransactionsItem interface to match RPC spec

* fix(client): handle different transaction response formats properly for the getTransaction method

* fix: update test mocks to match RPC response types

* changes to fix broken tests

* refactor(block-explorer): Convert to TypeScript with improved type safety

* refactor(blockchain): Migrate to TypeScript and enhance error handling

* revert: revert: undo recent changes to bitcoind.ts

* fixes: Type fixes in bitcoind

* fix: remove async promise executor in callBitcoind

* doc-strings: added doc strings to callBitcoind method

* refactor: add TypeScript type annotations to bitcoindParams function

* Added detailed docstrings to the `bitcoindListUnspent` method

* Added detailed docstrings to the `bitcoindGetAddressStatus` method

* Added detailed docstrings to the `bitcoindEstimateSmartFee` method

* refactor: improve typing and error handling in bitcoindSendRawTransaction

* refactor: improve typing and added doc-strings in bitcoindRawTxData

* revert: undo recent changes to block_explorer.ts

* fixes-types: Partial type fixes in block_explorer.ts to pass type errors

* fixes-type-block_explorer: Fixed blockExplorerGetAddresesUTXOs function

* fixes-type-block_explorer: Fixed blockExplorerGetAddressStatus function

* fixes-type-block_explorer: Fixed blockExplorerGetFeeEstimate function

* fixes-type-block_explorer: Fixed blockExplorerBroadcastTransaction function

* revert: undo recent changes to blockchain.ts

* fixes-types: Partial type fixes in blockchain.ts to pass type errors

* fixes-type-blockchain: Fixed fetchAddressUTXOsUnsorted function

* fixes-type-blockchain: Fixed fetchAddressUTXOs function

* fixes-type-blockchain: Fixed getAddressStatus function

* fixes-type-blockchain: Fixed fetchFeeEstimate function

* fixes-type-blockchain: Fixed broadcastTransaction function

* TO-DO: any error eslint disable to-do

* chore(changeset): Update changeset to include TypeScript migration

* refactor(bitcoind): standardize Bitcoin RPC parameters by introducing `BaseBitcoindArgs`, updating function signatures

* refactor(bitcoind): `bitcoindRawTxData` to use standardize Bitcoin RPC function parameters

* chore: rename block_explorer.ts to blockExplorer.ts for consistency

---------

Co-authored-by: buck <buck@unchained.com>

* Version Packages (#186)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Allow a PsbtV2 to be constructed with a psbtv2 which has been forceably set to have PSBT_GLOBAL_TX_VERSION === 1 (#188)

* feat: allowTxnVersion1 on instantiation

* chore: changeset

* Version Packages (#189)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: fixed the private node rpc calls bug in clients `getTransaction` method (#196)

* Version Packages (#197)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(wallet): Add pending transaction tab  (#168)

* UI cleanup: Remove redundant header and focus on pending transactions (#205)

* UI cleanup: Remove redundant header and focus on pending transactions

* added changeset

* fix: rm req of PSBT_GLOBAL_FALLBACK_LOCKTIME on isReadyForConstructor (#199)

Co-authored-by: buck <buck@unchained.com>

* Version Packages (#203)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Feat/add get wallet transaction (#206)

* Add-RPC-Call:Added `bitcoindGetWalletTransaction` function for direct RPC access

* add-type: WalletTransactionResponse

* fix: WalletTransactionResponse as per docs

* add-utility-fn: transformWalletTransactionToRawTransactionData added

* add-method: Added `getWalletTransaction` method to the BlockchainClient class

* tests: added bitcoindGetWalletTransaction tests

* tests: added transformWalletTransactionToRawTransactionData tests

* test: added getWalletTransaction tests

* added changeset

* refactor :  update getTransaction method

* UI(Transaction-Tab): added back the fee-display component

* fixes: to handle category(send/receive) of tx

* fix:error checking for category details of tx

* fix:error checking for category details of tx-2

* test-fix: fixes to handle the new added category type

* Version Packages (#217)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: updated readme (#218)

* fix for code scanning

---------

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
Co-authored-by: chadchapnick <143517546+chadchapnick@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Harshil Jani <harshiljani2002@gmail.com>
Co-authored-by: buck <buck@unchained.com>
Co-authored-by: Justin Moore <11jmoore@pm.me>
Co-authored-by: Mrigesh Thakur <96632943+Legend101Zz@users.noreply.github.com>
Co-authored-by: benma <m@mben.ch>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Shuford <75178461+robertshuford@users.noreply.github.com>
Co-authored-by: kimlwh <kimlwh@proton.me>
Co-authored-by: dylan-thompson <141655089+dylan-thompson@users.noreply.github.com>
Co-authored-by: Jack D <shadouts@hotmail.com>
Co-authored-by: Jack D <jack@unchained.com>
Co-authored-by: Narasimha <129654598+narasimha-1511@users.noreply.github.com>
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