Skip to content

Conversation

@fazzatti
Copy link
Contributor

@fazzatti fazzatti commented Nov 13, 2025

…e retrieval

  • Introduced a new method getBalancesFetcher in the PrivacyChannel class.
  • This method returns a function that fetches balances for given UTXO public keys.
  • Updated imports to include UTXOPublicKey and Buffer for handling UTXO data.
  • Enhanced readability by updating comments in the code.

This pull request introduces several enhancements and refactorings to the privacy channel and UTXO-based account modules, focusing on extensibility and improved integration between components. The main changes include new helper methods in the PrivacyChannel class, type refactoring for better type safety and clarity, and improved constructor patterns for UTXO-based accounts.

Privacy Channel Enhancements:

  • Added getBalancesFetcher, getTransactionBuilder, and getUTXOAccountHandler helper methods to the PrivacyChannel class, making it easier to fetch balances, create transaction builders, and instantiate UTXO-based account handlers pre-configured for the channel.

Type and Constructor Refactoring:

  • Introduced the UTXOBasedAccountContructorArgs type for a more structured and type-safe way to construct UTXO-based accounts, and updated the UtxoBasedAccount constructor and related usages to use this new type. [1] [2]
  • Defined the GetUTXOAccountHandlerArgs type to cleanly pass arguments (including options) when creating a UTXO account handler, omitting the fetchBalances property to ensure it is injected by the privacy channel.

Dependency and Version Updates:

  • Bumped the SDK version from 0.4.0 to 0.5.0 in deno.json to reflect these breaking and additive changes.

Imports and Internal Consistency:

  • Updated imports in affected files to ensure all new types and classes are correctly referenced, maintaining consistency across the codebase. [1] [2] [3] [4]

These changes collectively improve the modularity, type safety, and developer ergonomics of the privacy channel and UTXO-based account components.

…e retrieval

- Introduced a new method `getBalancesFetcher` in the `PrivacyChannel` class.
- This method returns a function that fetches balances for given UTXO public keys.
- Updated imports to include `UTXOPublicKey` and `Buffer` for handling UTXO data.
- Enhanced readability by updating comments in the code.
…ount management

- Implemented getUTXOAccountHandler in PrivacyChannel to create and return a UtxoBasedStellarAccount handler pre-configured for the privacy channel.
- Added GetUTXOAccountHandlerArgs type to define the arguments required for the new method.
- Updated types.ts to include Ed25519SecretKey in imports and defined the new GetUTXOAccountHandlerArgs type.
- Modified index.ts in utxo-based-account to adjust the constructor to accept UTXOBasedAccountContructorArgs.
…r, and getUTXOAccountHandler methods in PrivacyChannel; change import to type for UTXOBasedAccountContructorArgs
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 12.19512% with 36 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/privacy-channel/index.ts 10.00% 36 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the PrivacyChannel class with convenience methods for working with UTXO-based accounts, refactors constructor arguments into a reusable type, and bumps the package version to 0.5.0.

Key Changes:

  • Added three new public methods to PrivacyChannel: getBalancesFetcher(), getTransactionBuilder(), and getUTXOAccountHandler() to simplify UTXO account management
  • Extracted UTXO-based account constructor arguments into a reusable UTXOBasedAccountContructorArgs type
  • Updated package version from 0.4.0 to 0.5.0

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/utxo-based-account/types.ts Defines the new UTXOBasedAccountContructorArgs type to encapsulate constructor parameters
src/utxo-based-account/index.ts Refactors constructor to use the new type definition
src/privacy-channel/types.ts Adds GetUTXOAccountHandlerArgs type for the new UTXO account handler method
src/privacy-channel/index.ts Implements three new convenience methods for balance fetching, transaction building, and UTXO account handling
deno.json Bumps package version to 0.5.0

Copy link
Contributor

@toruguera toruguera left a comment

Choose a reason for hiding this comment

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

Good structure improvement! 🚀

@fazzatti fazzatti merged commit 0f36842 into dev Nov 13, 2025
1 check passed
@fazzatti fazzatti deleted the feat/add-client-helping-functions-to-channel-client branch November 13, 2025 12:22
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.

3 participants