Skip to content

release 0.6.0#22

Merged
fazzatti merged 106 commits intomainfrom
dev
Nov 14, 2025
Merged

release 0.6.0#22
fazzatti merged 106 commits intomainfrom
dev

Conversation

@fazzatti
Copy link
Contributor

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

  • Added encoding (fromOperationsBundle) and decoding (toOperationsBundle) functions for "Operations Bundle" to the MLXDR module, 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]
  • Comprehensive unit tests for the new Operations Bundle logic, covering single and multiple operations, mixed operation types, and signed operations. (src/custom-xdr/index.unit.test.ts)

Transaction Builder and Privacy Channel Utilities

  • Added a static fromPrivacyChannel method to MoonlightTransactionBuilder to easily instantiate a builder from a PrivacyChannel instance. (src/transaction-builder/index.ts) [1] [2]
  • Added a getBalancesFetcher method to PrivacyChannel for retrieving balances of UTXO public keys. (src/privacy-channel/index.ts)
  • Refactored PrivacyChannel to lazily instantiate its StellarDerivator instead of storing it, simplifying property management. (src/privacy-channel/index.ts) [1] [2] [3] [4]

Testing Enhancements

  • Added a test to ensure that signing operations individually and via a transaction bundle produces the same signature. (src/transaction-builder/signing.unit.test.ts)

Configuration and Versioning

  • Bumped SDK version from 0.4.0 to 0.6.0 in deno.json.
  • Updated codecov.yml to 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.

Victor Hugo and others added 30 commits October 13, 2025 18:22
…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.
… clarity in channel authentication context 🔧
… client initialization, contract interaction, and provider management
fazzatti and others added 20 commits November 11, 2025 18:00
…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.
…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
- 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.
@fazzatti fazzatti requested a review from toruguera November 14, 2025 18:09
@fazzatti fazzatti self-assigned this Nov 14, 2025
Copilot AI review requested due to automatic review settings November 14, 2025 18:09
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 76.00000% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/custom-xdr/index.ts 76.00% 12 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 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

@fazzatti fazzatti merged commit 4cbfbcd into main Nov 14, 2025
3 checks 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.

3 participants