Skip to content

Conversation

@github-actions
Copy link

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

* feat: Add Spark blockchain payout support

- Implement SparkClient for blockchain RPC communication
- Add SparkFeeService for dynamic fee estimation
- Create PayoutSparkService extending Bitcoin-based payout pattern
- Implement Spark strategies for prepare and payout operations
- Add comprehensive unit tests for Spark services
- Register Spark components in payout and blockchain modules
- Support batch transactions with up to 100 outputs
- Enable UTXO-based transaction handling similar to Bitcoin

* fix: Resolve TypeScript compilation errors for Spark implementation

- Use environment variables instead of Config.blockchain.spark
- Make SparkClient extend BlockchainClient properly
- Implement missing abstract methods from BlockchainClient
- Fix type conversion issues in PayoutSparkService
- Add proper response type handling in RPC calls

* Remove unnecessary SPARK_WALLET_ADDRESS configuration

- Remove SPARK_WALLET_ADDRESS from .env.example
- Remove walletAddress from Config (auto-generated by SDK)
- Add SPARK_WALLET_SEED to .env.example with random seed
- Update documentation to reflect SDK generates address from seed

* Fix and improve Spark tests comprehensively

- Fix SparkService tests to mock SparkClient instead of HttpService
- Fix PayoutSparkService tests to use correct PayoutGroup type (array)
- Add comprehensive SparkClient test suite with SDK mocking
- Remove UTXO references (Spark is Layer-2, not UTXO-based)
- Fix confirmation counts (Spark uses binary: 0=pending, 1=confirmed)
- Add tests for error handling, edge cases, and SDK initialization
- Fix walletAddress getter to use SDK-generated address
- Ensure all tests properly validate Spark-specific behavior

* Add missing Spark integration to BlockchainRegistryService

- Import SparkService and SparkClient
- Add to type unions for BlockchainClientType and BlockchainServiceType
- Add sparkService to constructor dependencies
- Handle Blockchain.SPARK case in getService() switch statement

This completes the Spark blockchain integration by ensuring it's properly registered in the central blockchain registry service.

* Remove unnecessary code from Spark implementation

- Remove unused config properties (explorerUrl, addressPrefix, fee, minTxAmount)
  - explorerUrl is managed centrally in blockchain.util.ts
  - Other properties were never used
- Remove unused roundAmount() method from SparkClient
- Remove unused Util import
- Simplify SparkFeeService by removing irrelevant UTXO-based calculations
  - Remove transaction size calculations (not relevant for Layer-2)
  - Remove fee validation (always 0)
  - Remove historical fee rates (always 0)
  - Remove unused constants

Keep only what's actually needed for Spark Layer-2 operations

* fix: Fix Spark implementation tests and add referral reward configuration

- Fix lazy wallet initialization in SparkClient to prevent test failures
- Add Config mock for Spark tests
- Fix boolean conversion in PayoutSparkService.getPayoutCompletionData
- Configure Spark referral reward payout limit (1 EUR)
- All 61 Spark tests now passing successfully

* refactor: Simplify Spark implementation by removing unnecessary complexity

- Simplify SparkFeeService to single method (always returns 0)
- Remove SparkFeeTarget enum (unnecessary for fee-free system)
- Remove validatePayout override (base class validation sufficient)
- Remove averageTransactionSize variable (irrelevant for L2)
- Remove unnecessary comments about removed features
- All 61 tests still passing

* refactor: Remove SparkFeeService and further simplify implementation

- Delete SparkFeeService entirely (unnecessary for fee-free system)
- Remove SparkNetwork enum and NETWORK_PREFIXES map
- Simplify getAddressPrefix method
- Clean up test files to remove fee service references
- All 61 tests still passing

* refactor: Drastically simplify Spark implementation

- Reduce PayoutSparkService from 77 to 31 lines (-60%)
- Remove redundant proxy methods (validateAddress, getBalance, etc.)
- Simplify BlockchainClient interface methods (return 0/null for tokens)
- Remove unnecessary method duplicates (getWalletBalance)
- Simplify fee methods comments
- Update tests to match simplified implementation
- All 50 tests passing (reduced from 61 due to removed methods)

* Fix linting errors in Spark implementation

- Replace require() with ES6 imports in tests
- Prefix unused variables with underscore
- Remove unused imports

* fix: Correct Spark blockchain coin name to BTC

* Refactoring

* Removed tests

* Added tests

* Refactoring 2

* fix: merge fixes

* fix: fixed formatting

---------

Co-authored-by: David May <david.leo.may@gmail.com>
@TaprootFreak TaprootFreak merged commit d265516 into main Jan 12, 2026
7 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.

2 participants