-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add getBalancesFetcher method to PrivacyChannel for UTXO balanc… #18
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: add getBalancesFetcher method to PrivacyChannel for UTXO balanc… #18
Conversation
…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.
… pre-configured transaction builders
…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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this 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(), andgetUTXOAccountHandler()to simplify UTXO account management - Extracted UTXO-based account constructor arguments into a reusable
UTXOBasedAccountContructorArgstype - 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 |
toruguera
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good structure improvement! 🚀
…XOAccountHandler method in PrivacyChannel
…e retrieval
getBalancesFetcherin thePrivacyChannelclass.UTXOPublicKeyandBufferfor handling UTXO data.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
PrivacyChannelclass, type refactoring for better type safety and clarity, and improved constructor patterns for UTXO-based accounts.Privacy Channel Enhancements:
getBalancesFetcher,getTransactionBuilder, andgetUTXOAccountHandlerhelper methods to thePrivacyChannelclass, making it easier to fetch balances, create transaction builders, and instantiate UTXO-based account handlers pre-configured for the channel.Type and Constructor Refactoring:
UTXOBasedAccountContructorArgstype for a more structured and type-safe way to construct UTXO-based accounts, and updated theUtxoBasedAccountconstructor and related usages to use this new type. [1] [2]GetUTXOAccountHandlerArgstype to cleanly pass arguments (including options) when creating a UTXO account handler, omitting thefetchBalancesproperty to ensure it is injected by the privacy channel.Dependency and Version Updates:
0.4.0to0.5.0indeno.jsonto reflect these breaking and additive changes.Imports and Internal Consistency:
These changes collectively improve the modularity, type safety, and developer ergonomics of the privacy channel and UTXO-based account components.