feat: implement MLXDR operations bundle handling#21
Merged
Conversation
- Added support for operations bundles in MLXDR by introducing new methods: - `fromOperationsBundle`: Converts an array of Moonlight operations to an MLXDR operations bundle. - `toOperationsBundle`: Converts an MLXDR operations bundle back to an array of Moonlight operations. - Added validation for operations bundles in `isOperationsBundle`. - Updated `MLXDRTypeByte` enum to include `OperationsBundle` and adjusted `TransactionBundle` value. - Created unit tests for operations bundle functionality in `index.unit.test.ts` to ensure correct conversion and validation of operations bundles. - Refactored imports in `index.unit.test.ts` and `signing.unit.test.ts` for consistency and clarity.
- Updated imports in src/custom-xdr/index.unit.test.ts to use type imports for operation types. - Removed unused imports and variables in src/transaction-builder/signing.unit.test.ts to enhance code clarity and maintainability.
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 implements operations bundle handling in MLXDR (Moonlight XDR) format, allowing multiple Moonlight operations to be serialized and deserialized as a single bundle. The changes include new conversion methods, validation functions, comprehensive unit tests, and a breaking change to the MLXDRTypeByte enum to accommodate the new OperationsBundle type.
Key Changes:
- Added
fromOperationsBundleandtoOperationsBundlemethods to convert between operation arrays and MLXDR format - Introduced
OperationsBundletype byte (0x08) and shiftedTransactionBundleto 0x09 - Created comprehensive test suite covering single operations, multiple operations, mixed operation types, and signed operations
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/custom-xdr/types.ts | Added OperationsBundle enum value (0x08) and shifted TransactionBundle to 0x09 |
| src/custom-xdr/index.ts | Implemented operationsBundleToMLXDR, MLXDRtoOperationsBundle, and isOperationsBundle functions; exported new methods in MLXDR module |
| src/custom-xdr/index.unit.test.ts | Added comprehensive test suite for operations bundle functionality covering various scenarios including signed operations |
| src/transaction-builder/signing.unit.test.ts | New test file verifying signature consistency between individual operations and bundle operations |
| src/operation/index.unit.test.ts | Fixed import path from external package to local module and corrected describe block name from "Condition" to "Operation" |
| deno.json | Bumped version from 0.5.0 to 0.6.0 |
Comments suppressed due to low confidence (1)
src/custom-xdr/index.ts:385
- The module documentation (JSDoc comment) should be updated to mention operations bundles. The comment currently only mentions "Condition/Operation objects" but now also supports operations bundles.
Consider updating the documentation to:
/**
* * MLXDR Module
*
* This module provides functions to work with Moonlight's custom XDR format (MLXDR).
* It includes utilities to check if data is in MLXDR format, identify the type of MLXDR data,
* and convert between standard Condition/Operation objects, operations bundles, and their MLXDR representations.
*
* All MLXDR data is encoded as a BASE64 string prefixed with 'ML' to distinguish it from standard Stellar XDR.
* The first byte after the prefix indicates the object type (e.g., Create Condition, Deposit Operation, Operations Bundle, etc.).
*
* Example MLXDR encoding for a Spend Operation:
* - Decoded Bytes:
* - 0x30 0xb0: 'ML' Prefix
* - 0x05: Type Byte for Spend Operation
* - 0x...: Actual XDR Data
*//**
* * MLXDR Module
*
* This module provides functions to work with Moonlight's custom XDR format (MLXDR).
* It includes utilities to check if data is in MLXDR format, identify the type of MLXDR data,
* and convert between standard Condition/Operation objects and their MLXDR representations.
*
* All MLXDR data is encoded as a BASE64 string prefixed with 'ML' to distinguish it from standard Stellar XDR.
* The first byte after the prefix indicates the object type (e.g., Create Condition, Deposit Operation, etc.).
*
* Example MLXDR encoding for a Spend Operation:
* - Decoded Bytes:
* - 0x30 0xb0: 'ML' Prefix
* - 0x05: Type Byte for Spend Operation
* - 0x...: Actual XDR Data
*/
…on and update test imports
toruguera
approved these changes
Nov 14, 2025
toruguera
added a commit
that referenced
this pull request
Jan 15, 2026
* feat: Implement the Moonlight transaction builder and operations conditions structure * chore: Implement unit tests for the Moonlight transaction builder add methods * chore: Implement unit tests for internal signatures methods from the Moonlight transaction builder * chore: Update the Stellar SDK imports * chore: Add unit test for the get operation methods * chore: Add unit test for the auth entry and args * chore: Add unit test for the hash and signature XDR methods * chore: Add unit test for the high-level signing methods * chore: Add unit tests for the XDR serialization and the auth entries retrieve method * chore: Add unit test for the deposit, spend, and withdraw operation to XDR methods * chore: Add unit tests for all the available operations and some edge cases * fix: Cast privateKeyBytes and payload to BufferSource in signPayload function for type safety * fix: Cast data to BufferSource in sha256Buffer function for type safety * refactor: Remove unused pool and pool-engine files for codebase cleanup 🧹 - 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. * feat: Update dependencies in deno.json to remove stellar-plus and add colibri * feat: Implement PrivacyChannel and Channel functionality with constants 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. * doc: Enhance PrivacyChannel with detailed JSDoc comments for methods - 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. * fix: Update invoke method to use getclient for invoking contract calls instead of direct invocation * fix: Rename getclient method to getClient for consistency and clarity in PrivacyChannel class 🛠️ * fix: Rename getclient method to getClient for consistency and update references in PrivacyChannel class * fix: Rename PrivacyChannel class to ChannelAuth for consistency and clarity in channel authentication context * fix: Change constructor visibility from private to public in ChannelAuth class for accessibility * fix: Change constructor visibility from private to public in PrivacyChannel class for improved accessibility * fix: Rename ContractConstructorArgs to ChannelAuthConstructorArgs for clarity in channel authentication context 🔧 * fix: Rename ContractConstructorArgs to ChannelConstructorArgs for clarity in channel context 🔧 * fix: Remove unused privacy_pool.wasm file to reduce clutter and improve project maintainability * feat: Add new WASM files for channel authentication and privacy channel functionality * fix: Refactor deno.json to streamline testing tasks and update dependency versions for improved compatibility * feat: Add integration tests for AuthChannel functionality to validate client initialization, contract interaction, and provider management * fix: Update transaction fee in AuthChannel integration test for accurate testing * fix: Correct test suite description for ChannelAuth integration tests to ensure accurate identification and context * refactor: Remove pool-engine integration test file to streamline test suite * feat: Add disableSanitizeConfig to manage sanitization settings for testing * feat: Add assetId property and getter method to PrivacyChannel class for enhanced asset management * fix: Add disableSanitizeConfig to ChannelAuth integration tests for improved test accuracy * feat: Implement PrivacyChannel integration tests for enhanced contract interaction validation - Added comprehensive integration tests for the PrivacyChannel, ensuring proper initialization and contract interactions. - Included tests for reading various contract methods and validating expected outputs. - Utilized disableSanitizeConfig for accurate testing in the testnet environment. * refactor: Change the transaction builder context structure to be more maintainable and contextualized by responsibilities * feat: Add Condition class for UTXO operations with factory methods and type safety - Refactored the Condition class in `src/conditions/index.ts` to implement a private constructor, enforcing the use of static factory methods for creating conditions (create, deposit, withdraw). - Added detailed JSDoc comments for better documentation and usage examples. - Introduced a new enum `UTXOOperation` to represent operation types (CREATE, DEPOSIT, WITHDRAW) for improved clarity. - Updated the `BaseCondition` type and its derived types (CreateCondition, DepositCondition, WithdrawCondition) in `src/conditions/types.ts` to align with the new structure and ensure type safety. - Removed old type definitions and replaced them with a more structured approach to handling UTXO operations. * refactor: Improve type imports and condition handling in transaction builder - Changed imports to use `type` for better clarity and performance in `src/transaction-builder/index.ts`, `src/transaction-builder/types.ts`, and `src/transaction-builder/xdr/ops-to-xdr.ts`. - Updated condition handling in `buildAuthPayloadHash` to use method calls (`isCreate`, `isDeposit`, `isWithdraw`) instead of property checks for improved readability and encapsulation. - Refactored condition mapping to use `toScVal()` method in `src/transaction-builder/xdr/ops-to-xdr.ts` for consistency in converting conditions to XDR format. * test: fix transaction builder tests to use Condition class * test: add unit tests for Condition class operations and error handling - Implemented tests for creating CREATE, DEPOSIT, and WITHDRAW conditions with valid inputs. - Verified correct operation and amount retrieval for each condition type. - Added tests for type guards to identify condition types accurately. - Included tests for converting conditions to XDR and ScVal formats. - Implemented error handling tests for invalid amounts and public key formats. * Update src/conditions/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/conditions/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/conditions/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/conditions/types.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: enhance PrivacyChannel and MoonlightTransactionBuilder with new invoke methods and transaction signing - Added `invokeRaw` method to `PrivacyChannel` for direct contract invocation with operation arguments. - Introduced `getInvokeOperation` method in `MoonlightTransactionBuilder` to create invoke operations. - Updated `signWithProvider` and `signExtWithEd25519` methods to support `TransactionSigner` type. - Enhanced integration tests for `PrivacyChannel` to include contract invocation and UTXO balance checks. - Improved error handling in contract invocation to log transaction details on failure. * chore: update dependencies for @colibri/core and @stellar/stellar-sdk to latest versions for improved compatibility and performance * refactor: update UTXO operation handling in Condition class and related tests - Changed UTXOOperation to UTXOOperationType in Condition class to improve type safety and consistency. - Updated method signatures and return types in BaseCondition, CreateCondition, DepositCondition, and WithdrawCondition to reflect the new UTXOOperationType. - Modified unit tests to align with the updated operation types for create, deposit, and withdraw conditions. * refactor: change import statements to use 'type' for xdr in bundle and deposit auth entry files, remove unused types and utility functions - Updated import statements in `bundle-auth-entry.ts` and `deposit-auth-entry.ts` to use `import type` for better clarity and performance. - Deleted unused `types.ts` and `auth-entries.ts` files to clean up the codebase and remove deprecated types and functions. * refactor: comment out unused imports and code in full-setup.ts and utxo-based-account.integration.test.ts for cleaner codebase - Commented out all import statements and code in `full-setup.ts` to prevent execution during tests and maintain focus on relevant functionality. - Commented out the entire test suite in `utxo-based-account.integration.test.ts` to temporarily disable tests while refactoring and improving the code structure. - Added a lint ignore comment for `no-explicit-any` in `traverse-object-log.ts` to suppress TypeScript warnings for the `obj` parameter. * refactor: update types and imports across multiple files for improved clarity and consistency - Changed `publicKey` type in `IUTXOKeypairBase` to `UTXOPublicKey` in `src/core/utxo-keypair-base/types.ts`. - Updated import statements to use `type` for `BaseDerivator` in `src/core/utxo-keypair/index.ts`. - Modified `fetchBalance` method to accept `UTXOPublicKey` in `src/core/utxo-keypair/types.ts`. - Refactored test imports to use `@std/assert` in `src/core/utxo-keypair/index.unit.test.ts` and `src/derivation/base/index.unit.test.ts`. - Commented out unused code in `src/transaction-builder/xdr/ops-to-xdr.ts` for cleaner codebase. - Updated `generateBundleAuthEntry` and `generateDepositAuthEntry` to use `xdrHelper` in `src/utils/auth/bundle-auth-entry.ts` and `src/utils/auth/deposit-auth-entry.ts`. - Changed secret key type in `StellarDerivator` methods to `Ed25519SecretKey` in `src/derivation/stellar/index.ts`. - Updated UTXOKeypair import to use `type` in `src/utxo-based-account/types.ts`. * feat: implement MoonlightOperation class with UTXO operation handling - Added `MoonlightOperation` class in `src/operation/index.ts` to manage UTXO operations including Create, Deposit, Withdraw, and Spend. - Introduced factory methods for creating instances of each operation type. - Implemented getter methods for retrieving operation details and conditions. - Defined interfaces for each operation type in `src/operation/types.ts` to ensure type safety and clarity. - Enhanced error handling for invalid operations and conditions. * refactor: remove unused XDR operation files for cleaner codebase * Update src/operation/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/operation/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/transaction-builder/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: update conditionsToScVal method to return an empty array instead of null when no conditions are present * test: Add integration tests for the UTXO account management and the Moonlight operations * chore: update version to 0.3.0 in deno.json for release * delete: remove unused integration test file main.integration.tes.ts * refactor(tests): update import paths and clean up assertions in utxo-based-account integration tests - Changed import statements to use the new module paths from "@std/assert" and "@std/testing/bdd". - Removed unnecessary blank lines for improved readability. - Enhanced assertion formatting for better clarity in test cases. * fix(tests): correct variable name from 'stelalrDerivator' to 'stellarDerivator' in UtxoBasedAccount integration test for clarity and consistency * chore(workflow): enhance GitHub Actions workflow for Deno testing and coverage reporting - Updated the branches for push and pull_request events to include both "main" and "dev". - Improved clarity in step names, changing "Check out code" to "Setup repo" and "Set up Deno" to "Setup Deno". - Added steps for generating a coverage report and uploading it to Codecov. - Organized the workflow steps for better readability and maintainability. * fix(deps): update @noble/curves and @noble/hashes dependencies to specific versions for improved stability and compatibility * feat: restructure exports and enhance integration tests for channel and privacy modules - Updated `mod.ts` to include exports from channel-auth, conditions, privacy-channel, operation, and transaction-builder modules for better modularity. - Added `src/utils/secp256r1/index.ts` to centralize secp256r1 utility functions. - Modified integration tests in `channel-auth.integration.test.ts` and `privacy-channel.integration.test.ts` to use new types from the updated module structure. - Refactored constructor argument types in integration tests for clarity and consistency. - Improved import statements across various test files to streamline dependencies and enhance readability. * fix: enhance type definitions and return types in various modules - Updated `AuthSpec` and `ChannelSpec` in `constants.ts` to explicitly define type as `Spec`. - Modified return types in `read` methods of `ChannelAuth` and `PrivacyChannel` classes to use `ReturnType<Contract["invoke"]>`. - Improved method signatures in `MoonlightTransactionBuilder` to return `MoonlightTransactionBuilder` for better method chaining. - Added import for `UTXOPublicKey` in `generateP256KeyPair.ts` to ensure proper type usage. These changes improve type safety and clarity across the codebase, facilitating better integration and usage of the SDK. * refactor: remove commented-out export statements in mod.ts for cleaner codebase 🧹 * fix: update Deno version to 2.2.2 and change publish command to use Deno * feat: implement custom error handling with MoonlightError class and r… (#15) * feat: implement custom error handling with MoonlightError class and related types - Added `MoonlightError` class to provide structured error handling. - Introduced `GeneralErrorCode` enum for standardized error codes. - Created `GEN_ERRORS` constant for mapping error codes to `MoonlightError`. - Defined `MoonlightErrorShape` interface for error structure. - Implemented `Diagnostic` type for detailed error context. - Added tests for `MoonlightError` constructor, serialization, and utility methods. - Updated `mod.ts` to export new error handling modules. * fix: update error source to use "@moonlight" for consistency in MoonlightError class 🛠️ * feat: add assertion utilities for argument validation and condition checks - Implemented `assertRequiredArgs` function in `assert-args.ts` to ensure all provided arguments are neither null nor undefined, throwing a specified error if any argument is invalid. - Added `assert` function in `assert.ts` to validate that a given condition is true, throwing the provided error if the condition is false. - Updated `index.ts` to export both new assertion functions for easier access. * feat: enhance UTXOKeypair tests and add error handling - Refactored tests in `src/core/utxo-keypair/index.unit.test.ts` to use BDD style with `describe` and `it` for better readability and structure. - Added assertions for UTXOKeypair's constructor, state updates, and status helper methods. - Introduced new error handling in `src/derivation/error.ts` with custom error classes for property validation. - Updated `src/derivation/base/index.ts` to utilize new error handling methods and improve property checks. - Enhanced error tests in `src/derivation/base/index.unit.test.ts` to validate new error types. - Updated error aggregation in `src/error/errors.ts` to include derivation errors. * refactor: remove error handling from auto-load in UTXOKeypair constructor for cleaner execution * feat: implement UTXOKeypair error handling and validation - Added UTXOKeypairError class and related error types in src/core/utxo-keypair/error.ts to manage errors specific to UTXOKeypair operations. - Introduced DERIVATOR_NOT_CONFIGURED error to handle cases where the derivator is not properly configured. - Updated UTXOKeypair methods to use assertion utilities for better error handling. - Modified error handling in tests to utilize the new error structure. - Enhanced error domain to include "utxo-keypair" in src/error/types.ts for comprehensive error categorization. * refactor(assert): update error type to Error for improved flexibility and clarity * feat(operation): add error handling for operation-related issues - Introduced OPR_ERRORS for managing operation-specific errors in src/operation/error.ts. - Updated ErrorDomain in src/error/types.ts to include "operation". - Enhanced MoonlightOperation class in src/operation/index.ts with assertions for amount and public key validity, throwing specific operation errors. - Modified unit tests in src/transaction-builder/index.unit.test.ts to validate error handling for zero and negative amounts in CREATE, DEPOSIT, and WITHDRAW operations. * feat(privacy-channel): add PrivacyChannelError handling and integrate with PrivacyChannel - Introduced PrivacyChannelError and associated types in src/privacy-channel/error.ts for better error management. - Updated ErrorDomain in src/error/types.ts to include "privacy-channel". - Enhanced error handling in PrivacyChannel class by throwing PROPERTY_NOT_SET error when accessing unset properties. - Consolidated error exports in src/error/errors.ts to include new privacy channel errors. * feat(transaction-builder): implement error handling for transaction operations - Added new error types for transaction builder operations in `src/transaction-builder/error.ts`, including: - `PROPERTY_NOT_SET` - `UNSUPPORTED_OP_TYPE` - `DUPLICATE_CREATE_OP` - `DUPLICATE_SPEND_OP` - `DUPLICATE_DEPOSIT_OP` - `DUPLICATE_WITHDRAW_OP` - `NO_SPEND_OPS` - `NO_DEPOSIT_OPS` - `NO_WITHDRAW_OPS` - `NO_EXT_OPS` - `MISSING_PROVIDER_SIGNATURE` - Updated `src/transaction-builder/index.ts` to utilize the new error types for better error handling in methods like `addOperation`, `addDeposit`, and `addWithdraw`. - Refactored validation functions in `src/transaction-builder/validators/operations.ts` to throw specific errors instead of generic ones, enhancing clarity and maintainability. - Enhanced unit tests in `src/transaction-builder/index.unit.test.ts` to assert the new error types for various operations, ensuring robust error handling. * feat(utxo-based-account): add error handling for UTXO-based account operations - Implemented custom error classes for UTXO-based account errors, including: - NEGATIVE_INDEX for negative index values - UTXO_TO_DERIVE_TOO_LOW for insufficient UTXOs to derive - MISSING_BATCH_FETCH_FN for missing batch fetch function - MISSING_UTXO_FOR_INDEX for missing UTXO at a given index - Updated error handling in UtxoBasedAccount class methods to utilize new error classes. - Enhanced error domain in types to include "utxo-based-account". - Integrated new error handling in unit tests for improved reliability and clarity. * chore(deno.json): update version to 0.4.0 for release 🚀 * refactor(lint): fix linter issues * refactor(settings): remove unnecessary instruction about emoji usage * feat(operation): enhance signature management - Added new error codes and corresponding error classes in `src/operation/error.ts`: - OP_IS_NOT_SIGNABLE - OP_HAS_NO_CONDITIONS - SIGNER_IS_NOT_DEPOSITOR - OP_ALREADY_SIGNED - Updated `src/operation/index.ts` to include methods for managing UTXO and Ed25519 signatures in `MoonlightOperation` class: - `signWithUTXO` - `signWithEd25519` - `getUTXOSignature` - `getEd25519Signature` - `isSignedByUTXO` - `isSignedByEd25519` - Modified `src/operation/types.ts` to reflect new signature management methods and types. - Refactored `src/transaction-builder/index.ts` to utilize new signature management methods and ensure proper handling of signatures during transaction building. - Updated unit tests in `src/transaction-builder/index.unit.test.ts` to cover new signature functionalities and error handling scenarios. - Adjusted integration tests in `test/integration/privacy-channel.integration.test.ts` and `test/integration/utxo-based-account.integration.test.ts` to use asset IDs instead of asset objects for consistency. * feat(condition): implement MLXDR conversion methods and enhance condition handling - Added MLXDR conversion methods in the Condition class for custom Moonlight XDR format. - Introduced fromMLXDR and toMLXDR methods to facilitate MLXDR serialization and deserialization. - Enhanced fromScVal method to handle various UTXO operation types (CREATE, DEPOSIT, WITHDRAW). - Updated BaseCondition interface to include toMLXDR method. - Added tests to ensure data integrity during XDR and MLXDR conversions in index.unit.test.ts. - Created custom-xdr module for MLXDR handling with type definitions and utility functions. - Defined MLXDRTypeByte enum and MLXDRPrefix for identifying custom XDR types. * feat: Enhance MLXDR support for operations and conditions - Refactor MLXDR type bytes to include specific operation types (Create, Deposit, Withdraw, Spend). - Implement conversion functions for operations to and from MLXDR format. - Add error handling for invalid SCVal types and vectors in operations. - Update MoonlightOperation class to support MLXDR conversions. - Create unit tests for MLXDR conversions for all operation types, ensuring correct serialization and deserialization. - Improve type safety by using type imports for various entities. * feat(coverage): add initial code coverage configuration with target set to 70% * refactor: remove unused MLXDR conversion methods and console logs from tests - Deleted the commented-out `toMLXDR` method in `src/conditions/index.ts` to clean up the code. - Removed console log statements related to MLXDR conversion tests in `src/conditions/index.unit.test.ts` and `src/operation/index.unit.test.ts` for cleaner test output. - Commented-out code in `src/transaction-builder/index.ts` for `getExtAuthEntry` method has been removed to enhance code clarity. * refactor: remove commented out fromXDR and fromScVal methods in BaseCondition interface * refactor: clean up unused UNEXPECTED_ERROR class and comments in error.ts * refactor: remove unused UNEXPECTED_ERROR class and related comments in error.ts * refactor: code for consistency and clarity - Updated function signatures to ensure consistent use of trailing commas in TypeScript files. - Improved error message formatting in UTXO-related error classes for better readability. - Enhanced the `assertRequiredArgs` function to include braces for clarity. - Fixed minor formatting issues in various utility functions and test files for improved code style. - Ensured consistent use of commas in array and function parameter definitions across multiple files. - Refactored integration tests to maintain consistent formatting and improve readability. * refactor: update VSCode settings to enable format on save and set default formatter * fix: replace deprecated deposit-auth-entry copy with updated implementation - 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. * feat: add getBalancesFetcher method to PrivacyChannel for UTXO balance 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. * feat: add getTransactionBuilder method to PrivacyChannel for creating pre-configured transaction builders * fix: correct formatting in JSDoc for getTransactionBuilder method in PrivacyChannel * feat: add getUTXOAccountHandler method to PrivacyChannel for UTXO account 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. * fix: update return types for getBalancesFetcher, getTransactionBuilder, and getUTXOAccountHandler methods in PrivacyChannel; change import to type for UTXOBasedAccountContructorArgs * chore: update version number in deno.json from 0.4.0 to 0.5.0 * fix: correct spelling of UTXOBasedAccountConstructorArgs in types.ts and index.ts * fix: update import path for UTXOPublicKey and enhance JSDoc for getUTXOAccountHandler method in PrivacyChannel * fix: change coverage status from patch to project in codecov.yml for accurate reporting * fix: streamline PrivacyChannel and UtxoBasedStellarAccount integration - 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. * fix: correct error message in getDerivator JSDoc for clarity * fix: ensure options are correctly merged in UtxoBasedStellarAccount.fromPrivacyChannel method * fix: add informational status for patch coverage in codecov.yml * feat: implement MLXDR operations bundle handling (#21) * Bump Colibri version to 0.15.0 (#25) * Bump Colibri version to 0.15.0 * fix: Ignore any casting for now --------- Co-authored-by: Victor Hugo <torugo@MacBook-Pro-de-Victor.local> Co-authored-by: Fabricius Zatti <fazzatti@gmail.com> Co-authored-by: Fifo (Fabricius Zatti) <62725221+fazzatti@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
toruguera
added a commit
that referenced
this pull request
Jan 15, 2026
* feat: Implement the Moonlight transaction builder and operations conditions structure * chore: Implement unit tests for the Moonlight transaction builder add methods * chore: Implement unit tests for internal signatures methods from the Moonlight transaction builder * chore: Update the Stellar SDK imports * chore: Add unit test for the get operation methods * chore: Add unit test for the auth entry and args * chore: Add unit test for the hash and signature XDR methods * chore: Add unit test for the high-level signing methods * chore: Add unit tests for the XDR serialization and the auth entries retrieve method * chore: Add unit test for the deposit, spend, and withdraw operation to XDR methods * chore: Add unit tests for all the available operations and some edge cases * fix: Cast privateKeyBytes and payload to BufferSource in signPayload function for type safety * fix: Cast data to BufferSource in sha256Buffer function for type safety * refactor: Remove unused pool and pool-engine files for codebase cleanup 🧹 - 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. * feat: Update dependencies in deno.json to remove stellar-plus and add colibri * feat: Implement PrivacyChannel and Channel functionality with constants 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. * doc: Enhance PrivacyChannel with detailed JSDoc comments for methods - 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. * fix: Update invoke method to use getclient for invoking contract calls instead of direct invocation * fix: Rename getclient method to getClient for consistency and clarity in PrivacyChannel class 🛠️ * fix: Rename getclient method to getClient for consistency and update references in PrivacyChannel class * fix: Rename PrivacyChannel class to ChannelAuth for consistency and clarity in channel authentication context * fix: Change constructor visibility from private to public in ChannelAuth class for accessibility * fix: Change constructor visibility from private to public in PrivacyChannel class for improved accessibility * fix: Rename ContractConstructorArgs to ChannelAuthConstructorArgs for clarity in channel authentication context 🔧 * fix: Rename ContractConstructorArgs to ChannelConstructorArgs for clarity in channel context 🔧 * fix: Remove unused privacy_pool.wasm file to reduce clutter and improve project maintainability * feat: Add new WASM files for channel authentication and privacy channel functionality * fix: Refactor deno.json to streamline testing tasks and update dependency versions for improved compatibility * feat: Add integration tests for AuthChannel functionality to validate client initialization, contract interaction, and provider management * fix: Update transaction fee in AuthChannel integration test for accurate testing * fix: Correct test suite description for ChannelAuth integration tests to ensure accurate identification and context * refactor: Remove pool-engine integration test file to streamline test suite * feat: Add disableSanitizeConfig to manage sanitization settings for testing * feat: Add assetId property and getter method to PrivacyChannel class for enhanced asset management * fix: Add disableSanitizeConfig to ChannelAuth integration tests for improved test accuracy * feat: Implement PrivacyChannel integration tests for enhanced contract interaction validation - Added comprehensive integration tests for the PrivacyChannel, ensuring proper initialization and contract interactions. - Included tests for reading various contract methods and validating expected outputs. - Utilized disableSanitizeConfig for accurate testing in the testnet environment. * refactor: Change the transaction builder context structure to be more maintainable and contextualized by responsibilities * feat: Add Condition class for UTXO operations with factory methods and type safety - Refactored the Condition class in `src/conditions/index.ts` to implement a private constructor, enforcing the use of static factory methods for creating conditions (create, deposit, withdraw). - Added detailed JSDoc comments for better documentation and usage examples. - Introduced a new enum `UTXOOperation` to represent operation types (CREATE, DEPOSIT, WITHDRAW) for improved clarity. - Updated the `BaseCondition` type and its derived types (CreateCondition, DepositCondition, WithdrawCondition) in `src/conditions/types.ts` to align with the new structure and ensure type safety. - Removed old type definitions and replaced them with a more structured approach to handling UTXO operations. * refactor: Improve type imports and condition handling in transaction builder - Changed imports to use `type` for better clarity and performance in `src/transaction-builder/index.ts`, `src/transaction-builder/types.ts`, and `src/transaction-builder/xdr/ops-to-xdr.ts`. - Updated condition handling in `buildAuthPayloadHash` to use method calls (`isCreate`, `isDeposit`, `isWithdraw`) instead of property checks for improved readability and encapsulation. - Refactored condition mapping to use `toScVal()` method in `src/transaction-builder/xdr/ops-to-xdr.ts` for consistency in converting conditions to XDR format. * test: fix transaction builder tests to use Condition class * test: add unit tests for Condition class operations and error handling - Implemented tests for creating CREATE, DEPOSIT, and WITHDRAW conditions with valid inputs. - Verified correct operation and amount retrieval for each condition type. - Added tests for type guards to identify condition types accurately. - Included tests for converting conditions to XDR and ScVal formats. - Implemented error handling tests for invalid amounts and public key formats. * Update src/conditions/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/conditions/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/conditions/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/conditions/types.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: enhance PrivacyChannel and MoonlightTransactionBuilder with new invoke methods and transaction signing - Added `invokeRaw` method to `PrivacyChannel` for direct contract invocation with operation arguments. - Introduced `getInvokeOperation` method in `MoonlightTransactionBuilder` to create invoke operations. - Updated `signWithProvider` and `signExtWithEd25519` methods to support `TransactionSigner` type. - Enhanced integration tests for `PrivacyChannel` to include contract invocation and UTXO balance checks. - Improved error handling in contract invocation to log transaction details on failure. * chore: update dependencies for @colibri/core and @stellar/stellar-sdk to latest versions for improved compatibility and performance * refactor: update UTXO operation handling in Condition class and related tests - Changed UTXOOperation to UTXOOperationType in Condition class to improve type safety and consistency. - Updated method signatures and return types in BaseCondition, CreateCondition, DepositCondition, and WithdrawCondition to reflect the new UTXOOperationType. - Modified unit tests to align with the updated operation types for create, deposit, and withdraw conditions. * refactor: change import statements to use 'type' for xdr in bundle and deposit auth entry files, remove unused types and utility functions - Updated import statements in `bundle-auth-entry.ts` and `deposit-auth-entry.ts` to use `import type` for better clarity and performance. - Deleted unused `types.ts` and `auth-entries.ts` files to clean up the codebase and remove deprecated types and functions. * refactor: comment out unused imports and code in full-setup.ts and utxo-based-account.integration.test.ts for cleaner codebase - Commented out all import statements and code in `full-setup.ts` to prevent execution during tests and maintain focus on relevant functionality. - Commented out the entire test suite in `utxo-based-account.integration.test.ts` to temporarily disable tests while refactoring and improving the code structure. - Added a lint ignore comment for `no-explicit-any` in `traverse-object-log.ts` to suppress TypeScript warnings for the `obj` parameter. * refactor: update types and imports across multiple files for improved clarity and consistency - Changed `publicKey` type in `IUTXOKeypairBase` to `UTXOPublicKey` in `src/core/utxo-keypair-base/types.ts`. - Updated import statements to use `type` for `BaseDerivator` in `src/core/utxo-keypair/index.ts`. - Modified `fetchBalance` method to accept `UTXOPublicKey` in `src/core/utxo-keypair/types.ts`. - Refactored test imports to use `@std/assert` in `src/core/utxo-keypair/index.unit.test.ts` and `src/derivation/base/index.unit.test.ts`. - Commented out unused code in `src/transaction-builder/xdr/ops-to-xdr.ts` for cleaner codebase. - Updated `generateBundleAuthEntry` and `generateDepositAuthEntry` to use `xdrHelper` in `src/utils/auth/bundle-auth-entry.ts` and `src/utils/auth/deposit-auth-entry.ts`. - Changed secret key type in `StellarDerivator` methods to `Ed25519SecretKey` in `src/derivation/stellar/index.ts`. - Updated UTXOKeypair import to use `type` in `src/utxo-based-account/types.ts`. * feat: implement MoonlightOperation class with UTXO operation handling - Added `MoonlightOperation` class in `src/operation/index.ts` to manage UTXO operations including Create, Deposit, Withdraw, and Spend. - Introduced factory methods for creating instances of each operation type. - Implemented getter methods for retrieving operation details and conditions. - Defined interfaces for each operation type in `src/operation/types.ts` to ensure type safety and clarity. - Enhanced error handling for invalid operations and conditions. * refactor: remove unused XDR operation files for cleaner codebase * Update src/operation/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/operation/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/transaction-builder/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: update conditionsToScVal method to return an empty array instead of null when no conditions are present * test: Add integration tests for the UTXO account management and the Moonlight operations * chore: update version to 0.3.0 in deno.json for release * delete: remove unused integration test file main.integration.tes.ts * refactor(tests): update import paths and clean up assertions in utxo-based-account integration tests - Changed import statements to use the new module paths from "@std/assert" and "@std/testing/bdd". - Removed unnecessary blank lines for improved readability. - Enhanced assertion formatting for better clarity in test cases. * fix(tests): correct variable name from 'stelalrDerivator' to 'stellarDerivator' in UtxoBasedAccount integration test for clarity and consistency * chore(workflow): enhance GitHub Actions workflow for Deno testing and coverage reporting - Updated the branches for push and pull_request events to include both "main" and "dev". - Improved clarity in step names, changing "Check out code" to "Setup repo" and "Set up Deno" to "Setup Deno". - Added steps for generating a coverage report and uploading it to Codecov. - Organized the workflow steps for better readability and maintainability. * fix(deps): update @noble/curves and @noble/hashes dependencies to specific versions for improved stability and compatibility * feat: restructure exports and enhance integration tests for channel and privacy modules - Updated `mod.ts` to include exports from channel-auth, conditions, privacy-channel, operation, and transaction-builder modules for better modularity. - Added `src/utils/secp256r1/index.ts` to centralize secp256r1 utility functions. - Modified integration tests in `channel-auth.integration.test.ts` and `privacy-channel.integration.test.ts` to use new types from the updated module structure. - Refactored constructor argument types in integration tests for clarity and consistency. - Improved import statements across various test files to streamline dependencies and enhance readability. * fix: enhance type definitions and return types in various modules - Updated `AuthSpec` and `ChannelSpec` in `constants.ts` to explicitly define type as `Spec`. - Modified return types in `read` methods of `ChannelAuth` and `PrivacyChannel` classes to use `ReturnType<Contract["invoke"]>`. - Improved method signatures in `MoonlightTransactionBuilder` to return `MoonlightTransactionBuilder` for better method chaining. - Added import for `UTXOPublicKey` in `generateP256KeyPair.ts` to ensure proper type usage. These changes improve type safety and clarity across the codebase, facilitating better integration and usage of the SDK. * refactor: remove commented-out export statements in mod.ts for cleaner codebase 🧹 * fix: update Deno version to 2.2.2 and change publish command to use Deno * feat: implement custom error handling with MoonlightError class and r… (#15) * feat: implement custom error handling with MoonlightError class and related types - Added `MoonlightError` class to provide structured error handling. - Introduced `GeneralErrorCode` enum for standardized error codes. - Created `GEN_ERRORS` constant for mapping error codes to `MoonlightError`. - Defined `MoonlightErrorShape` interface for error structure. - Implemented `Diagnostic` type for detailed error context. - Added tests for `MoonlightError` constructor, serialization, and utility methods. - Updated `mod.ts` to export new error handling modules. * fix: update error source to use "@moonlight" for consistency in MoonlightError class 🛠️ * feat: add assertion utilities for argument validation and condition checks - Implemented `assertRequiredArgs` function in `assert-args.ts` to ensure all provided arguments are neither null nor undefined, throwing a specified error if any argument is invalid. - Added `assert` function in `assert.ts` to validate that a given condition is true, throwing the provided error if the condition is false. - Updated `index.ts` to export both new assertion functions for easier access. * feat: enhance UTXOKeypair tests and add error handling - Refactored tests in `src/core/utxo-keypair/index.unit.test.ts` to use BDD style with `describe` and `it` for better readability and structure. - Added assertions for UTXOKeypair's constructor, state updates, and status helper methods. - Introduced new error handling in `src/derivation/error.ts` with custom error classes for property validation. - Updated `src/derivation/base/index.ts` to utilize new error handling methods and improve property checks. - Enhanced error tests in `src/derivation/base/index.unit.test.ts` to validate new error types. - Updated error aggregation in `src/error/errors.ts` to include derivation errors. * refactor: remove error handling from auto-load in UTXOKeypair constructor for cleaner execution * feat: implement UTXOKeypair error handling and validation - Added UTXOKeypairError class and related error types in src/core/utxo-keypair/error.ts to manage errors specific to UTXOKeypair operations. - Introduced DERIVATOR_NOT_CONFIGURED error to handle cases where the derivator is not properly configured. - Updated UTXOKeypair methods to use assertion utilities for better error handling. - Modified error handling in tests to utilize the new error structure. - Enhanced error domain to include "utxo-keypair" in src/error/types.ts for comprehensive error categorization. * refactor(assert): update error type to Error for improved flexibility and clarity * feat(operation): add error handling for operation-related issues - Introduced OPR_ERRORS for managing operation-specific errors in src/operation/error.ts. - Updated ErrorDomain in src/error/types.ts to include "operation". - Enhanced MoonlightOperation class in src/operation/index.ts with assertions for amount and public key validity, throwing specific operation errors. - Modified unit tests in src/transaction-builder/index.unit.test.ts to validate error handling for zero and negative amounts in CREATE, DEPOSIT, and WITHDRAW operations. * feat(privacy-channel): add PrivacyChannelError handling and integrate with PrivacyChannel - Introduced PrivacyChannelError and associated types in src/privacy-channel/error.ts for better error management. - Updated ErrorDomain in src/error/types.ts to include "privacy-channel". - Enhanced error handling in PrivacyChannel class by throwing PROPERTY_NOT_SET error when accessing unset properties. - Consolidated error exports in src/error/errors.ts to include new privacy channel errors. * feat(transaction-builder): implement error handling for transaction operations - Added new error types for transaction builder operations in `src/transaction-builder/error.ts`, including: - `PROPERTY_NOT_SET` - `UNSUPPORTED_OP_TYPE` - `DUPLICATE_CREATE_OP` - `DUPLICATE_SPEND_OP` - `DUPLICATE_DEPOSIT_OP` - `DUPLICATE_WITHDRAW_OP` - `NO_SPEND_OPS` - `NO_DEPOSIT_OPS` - `NO_WITHDRAW_OPS` - `NO_EXT_OPS` - `MISSING_PROVIDER_SIGNATURE` - Updated `src/transaction-builder/index.ts` to utilize the new error types for better error handling in methods like `addOperation`, `addDeposit`, and `addWithdraw`. - Refactored validation functions in `src/transaction-builder/validators/operations.ts` to throw specific errors instead of generic ones, enhancing clarity and maintainability. - Enhanced unit tests in `src/transaction-builder/index.unit.test.ts` to assert the new error types for various operations, ensuring robust error handling. * feat(utxo-based-account): add error handling for UTXO-based account operations - Implemented custom error classes for UTXO-based account errors, including: - NEGATIVE_INDEX for negative index values - UTXO_TO_DERIVE_TOO_LOW for insufficient UTXOs to derive - MISSING_BATCH_FETCH_FN for missing batch fetch function - MISSING_UTXO_FOR_INDEX for missing UTXO at a given index - Updated error handling in UtxoBasedAccount class methods to utilize new error classes. - Enhanced error domain in types to include "utxo-based-account". - Integrated new error handling in unit tests for improved reliability and clarity. * chore(deno.json): update version to 0.4.0 for release 🚀 * refactor(lint): fix linter issues * refactor(settings): remove unnecessary instruction about emoji usage * feat(operation): enhance signature management - Added new error codes and corresponding error classes in `src/operation/error.ts`: - OP_IS_NOT_SIGNABLE - OP_HAS_NO_CONDITIONS - SIGNER_IS_NOT_DEPOSITOR - OP_ALREADY_SIGNED - Updated `src/operation/index.ts` to include methods for managing UTXO and Ed25519 signatures in `MoonlightOperation` class: - `signWithUTXO` - `signWithEd25519` - `getUTXOSignature` - `getEd25519Signature` - `isSignedByUTXO` - `isSignedByEd25519` - Modified `src/operation/types.ts` to reflect new signature management methods and types. - Refactored `src/transaction-builder/index.ts` to utilize new signature management methods and ensure proper handling of signatures during transaction building. - Updated unit tests in `src/transaction-builder/index.unit.test.ts` to cover new signature functionalities and error handling scenarios. - Adjusted integration tests in `test/integration/privacy-channel.integration.test.ts` and `test/integration/utxo-based-account.integration.test.ts` to use asset IDs instead of asset objects for consistency. * feat(condition): implement MLXDR conversion methods and enhance condition handling - Added MLXDR conversion methods in the Condition class for custom Moonlight XDR format. - Introduced fromMLXDR and toMLXDR methods to facilitate MLXDR serialization and deserialization. - Enhanced fromScVal method to handle various UTXO operation types (CREATE, DEPOSIT, WITHDRAW). - Updated BaseCondition interface to include toMLXDR method. - Added tests to ensure data integrity during XDR and MLXDR conversions in index.unit.test.ts. - Created custom-xdr module for MLXDR handling with type definitions and utility functions. - Defined MLXDRTypeByte enum and MLXDRPrefix for identifying custom XDR types. * feat: Enhance MLXDR support for operations and conditions - Refactor MLXDR type bytes to include specific operation types (Create, Deposit, Withdraw, Spend). - Implement conversion functions for operations to and from MLXDR format. - Add error handling for invalid SCVal types and vectors in operations. - Update MoonlightOperation class to support MLXDR conversions. - Create unit tests for MLXDR conversions for all operation types, ensuring correct serialization and deserialization. - Improve type safety by using type imports for various entities. * feat(coverage): add initial code coverage configuration with target set to 70% * refactor: remove unused MLXDR conversion methods and console logs from tests - Deleted the commented-out `toMLXDR` method in `src/conditions/index.ts` to clean up the code. - Removed console log statements related to MLXDR conversion tests in `src/conditions/index.unit.test.ts` and `src/operation/index.unit.test.ts` for cleaner test output. - Commented-out code in `src/transaction-builder/index.ts` for `getExtAuthEntry` method has been removed to enhance code clarity. * refactor: remove commented out fromXDR and fromScVal methods in BaseCondition interface * refactor: clean up unused UNEXPECTED_ERROR class and comments in error.ts * refactor: remove unused UNEXPECTED_ERROR class and related comments in error.ts * refactor: code for consistency and clarity - Updated function signatures to ensure consistent use of trailing commas in TypeScript files. - Improved error message formatting in UTXO-related error classes for better readability. - Enhanced the `assertRequiredArgs` function to include braces for clarity. - Fixed minor formatting issues in various utility functions and test files for improved code style. - Ensured consistent use of commas in array and function parameter definitions across multiple files. - Refactored integration tests to maintain consistent formatting and improve readability. * refactor: update VSCode settings to enable format on save and set default formatter * fix: replace deprecated deposit-auth-entry copy with updated implementation - 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. * feat: add getBalancesFetcher method to PrivacyChannel for UTXO balance 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. * feat: add getTransactionBuilder method to PrivacyChannel for creating pre-configured transaction builders * fix: correct formatting in JSDoc for getTransactionBuilder method in PrivacyChannel * feat: add getUTXOAccountHandler method to PrivacyChannel for UTXO account 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. * fix: update return types for getBalancesFetcher, getTransactionBuilder, and getUTXOAccountHandler methods in PrivacyChannel; change import to type for UTXOBasedAccountContructorArgs * chore: update version number in deno.json from 0.4.0 to 0.5.0 * fix: correct spelling of UTXOBasedAccountConstructorArgs in types.ts and index.ts * fix: update import path for UTXOPublicKey and enhance JSDoc for getUTXOAccountHandler method in PrivacyChannel * fix: change coverage status from patch to project in codecov.yml for accurate reporting * fix: streamline PrivacyChannel and UtxoBasedStellarAccount integration - 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. * fix: correct error message in getDerivator JSDoc for clarity * fix: ensure options are correctly merged in UtxoBasedStellarAccount.fromPrivacyChannel method * fix: add informational status for patch coverage in codecov.yml * feat: implement MLXDR operations bundle handling (#21) * Bump Colibri version to 0.15.0 (#25) * Bump Colibri version to 0.15.0 * fix: Ignore any casting for now * chore: Update version --------- Co-authored-by: Victor Hugo <torugo@MacBook-Pro-de-Victor.local> Co-authored-by: Fabricius Zatti <fazzatti@gmail.com> Co-authored-by: Fifo (Fabricius Zatti) <62725221+fazzatti@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Added support for operations bundles in MLXDR by introducing new methods:
fromOperationsBundle: Converts an array of Moonlight operations to an MLXDR operations bundle.toOperationsBundle: Converts an MLXDR operations bundle back to an array of Moonlight operations.isOperationsBundle.Updated
MLXDRTypeByteenum to includeOperationsBundleand adjustedTransactionBundlevalue.Created unit tests for operations bundle functionality in
index.unit.test.tsto ensure correct conversion and validation of operations bundles.Refactored imports in
index.unit.test.tsandsigning.unit.test.tsfor consistency and clarity.