Conversation
…Moonlight transaction builder
…function for type safety
…up 🧹 - Deleted `index.ts` from `src/pool/` as it was exporting an unused module. - Removed `index.ts`, `types.ts`, and `index.unit.test.ts` from `src/pool/pool-engine/` to eliminate unnecessary code and improve maintainability.
…ts and types - Added constants for AuthReadMethods and AuthInvokeMethods in `src/channel-auth/constants.ts`. - Introduced `PrivacyChannel` class in `src/privacy-channel/index.ts` to manage channel interactions. - Created types for channel operations in `src/privacy-channel/types.ts`, including read and invoke methods. - Established contract specifications using `Spec` for both authentication and channel operations.
- Added JSDoc comments to the `require`, `getclient`, `getAuthId`, `getNetworkConfig`, `getDerivator`, and `getChannelId` methods. - Improved documentation clarity by specifying return types and potential errors for better developer understanding and usage.
…s instead of direct invocation
… in PrivacyChannel class 🛠️
…references in PrivacyChannel class
…larity in channel authentication context
…uth class for accessibility
…hannel class for improved accessibility
… clarity in channel authentication context 🔧
…rity in channel context 🔧
…ve project maintainability
…ency versions for improved compatibility
… client initialization, contract interaction, and provider management
…tation - Updated import statement in src/operation/index.ts to reference the correct deposit-auth-entry.ts file. - Deleted obsolete src/utils/auth/deposit-auth-entry copy.ts file. - Renamed function in src/utils/auth/deposit-auth-entry.ts from generateDepositAuthEntry to buildDepositAuthEntry for consistency.
…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
…XOAccountHandler method in PrivacyChannel
…g-functions-to-channel-client
…accurate reporting
- Removed unused properties and methods from PrivacyChannel, including _derivator and related methods. - Simplified getDerivator method to create a new StellarDerivator instance directly. - Added static methods in UtxoBasedStellarAccount and MoonlightTransactionBuilder to create instances from PrivacyChannel, enhancing integration. - Updated integration tests to utilize new static methods for creating transaction builders and UTXO account handlers, improving test clarity and maintainability.
…romPrivacyChannel method
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces Operations Bundle encoding/decoding support to the MLXDR module, enabling serialization of multiple operations as a bundle for atomic batch processing. It also adds convenient factory methods for creating MoonlightTransactionBuilder and UtxoBasedStellarAccount from PrivacyChannel instances, along with refactoring the PrivacyChannel to use lazy derivator instantiation.
- Operations Bundle MLXDR encoding/decoding with comprehensive tests
- Factory methods (
fromPrivacyChannel) for improved developer ergonomics - Lazy derivator instantiation in PrivacyChannel for cleaner state management
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/custom-xdr/types.ts | Added OperationsBundle type byte (0x08) and shifted TransactionBundle to 0x09 |
| src/custom-xdr/index.ts | Implemented fromOperationsBundle/toOperationsBundle encoding/decoding functions |
| src/custom-xdr/index.unit.test.ts | Added comprehensive tests for operations bundle serialization with single, multiple, and signed operations |
| src/transaction-builder/index.ts | Added fromPrivacyChannel static factory method for simplified instantiation |
| src/transaction-builder/signing.unit.test.ts | Added test verifying signature consistency between individual and bundled operations |
| src/privacy-channel/index.ts | Refactored to lazy derivator instantiation and added getBalancesFetcher helper method |
| src/utxo-based-account/utxo-based-stellar-account/index.ts | Added fromPrivacyChannel static factory method |
| src/utxo-based-account/types.ts | Extracted UTXOBasedAccountConstructorArgs type for better type reuse |
| src/utxo-based-account/index.ts | Updated constructor to use new UTXOBasedAccountConstructorArgs type |
| src/operation/index.unit.test.ts | Fixed circular import and corrected describe block name from "Condition" to "Operation" |
| test/integration/utxo-based-account.integration.test.ts | Refactored to use new fromPrivacyChannel and getBalancesFetcher helpers |
| test/integration/privacy-channel.integration.test.ts | Updated to use fromPrivacyChannel factory method and adjusted import structure |
| deno.json | Bumped version from 0.4.0 to 0.6.0 |
| codecov.yml | Configured patch coverage as informational and set 70% project coverage target |
toruguera
approved these changes
Nov 14, 2025
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.
This pull request introduces support for "Operations Bundle" encoding and decoding in the MLXDR (Moonlight XDR) module, along with related tests and some utility improvements. The main focus is on enabling serialization and deserialization of multiple operations as a single bundle, which is important for batch processing and atomicity in smart contract interactions. There are also minor updates to configuration files and some codebase cleanups.
The most important changes are:
MLXDR Operations Bundle Support
fromOperationsBundle) and decoding (toOperationsBundle) functions for "Operations Bundle" to theMLXDRmodule, allowing multiple operations to be serialized/deserialized together. This includes new type bytes, helpers, and error handling for empty bundles. (src/custom-xdr/index.ts,src/custom-xdr/types.ts) [1] [2] [3] [4] [5]src/custom-xdr/index.unit.test.ts)Transaction Builder and Privacy Channel Utilities
fromPrivacyChannelmethod toMoonlightTransactionBuilderto easily instantiate a builder from aPrivacyChannelinstance. (src/transaction-builder/index.ts) [1] [2]getBalancesFetchermethod toPrivacyChannelfor retrieving balances of UTXO public keys. (src/privacy-channel/index.ts)PrivacyChannelto lazily instantiate itsStellarDerivatorinstead of storing it, simplifying property management. (src/privacy-channel/index.ts) [1] [2] [3] [4]Testing Enhancements
src/transaction-builder/signing.unit.test.ts)Configuration and Versioning
0.4.0to0.6.0indeno.json.codecov.ymlto mark patch coverage as informational and set a 70% target for project coverage.These changes collectively improve the SDK's ability to handle complex multi-operation workflows and enhance developer ergonomics for privacy-focused Stellar Soroban contracts.