Skip to content

Feat/solvo - #572

Merged
BigBen-7 merged 4 commits into
Lead-Studios:mainfrom
DevMuhdishaq:feat/Solvo
Aug 30, 2026
Merged

Feat/solvo#572
BigBen-7 merged 4 commits into
Lead-Studios:mainfrom
DevMuhdishaq:feat/Solvo

Conversation

@DevMuhdishaq

Copy link
Copy Markdown
Contributor

Summary

Closes

Closes #511

Checklist

  • Tests added or updated
  • Docs updated (JSDoc / README)
  • CHANGELOG.md updated under [Unreleased] (required by CI if src/ changed — see CONTRIBUTING.md)
  • API surface change is intentional, not accidental (public method signatures / exported types)
  • npm run build passes
  • npm test passes
  • npm run lint passes

ykargeee-bit and others added 4 commits August 29, 2026 18:10
…the paused field is correctly returned by

've successfully added the requested tests to tests/recurring.test.ts to confirm that the paused field is correctly returned by RecurringModule.getRecurring. Here's what was implemented:

Key changes made:
Added a new test suite RecurringModule.getRecurring paused field parsing at the end of the file to group these specific tests
Included a mapEntry helper function to create valid XDR ScMap entries, following the same pattern used in escrow.test.ts
Implemented both requested test cases:
getRecurring returns paused:true when the contract record is paused - mocks a contract record with paused: true and verifies the parsed result has paused: true
getRecurring returns paused:false for an active recurring record - mocks a contract record with paused: false and verifies the parsed result has paused: false
Implementation details:
Used the existing makeRecurringClient helper to create a connected test client
Constructed valid raw Soroban ScvMap objects with all required fields for a recurring payment record
Used nativeToScVal from @stellar/stellar-sdk to properly encode values to their correct XDR types
Added non-null assertion (!) to record! since we know the mock will always return a valid record
Included all required fields (id, payer, payee, amount, interval, active, paused, last_charged_ledger) to ensure the parser receives a complete record
These tests will catch any future regressions in the parser that might cause the paused field to be incorrectly parsed, ensuring the bug fix that was implemented in parsers.ts remains effective.
…ted:

All the required files are created. Let's summarize what we've completed:

✅ Tasks Completed
1. Added VSCode Workspace Settings
Created .vscode/extensions.json with all recommended extensions:
dbaeumer.vscode-eslint (ESLint)
esbenp.prettier-vscode (Prettier)
orta.vscode-jest (Jest test runner)
ms-vscode.vscode-typescript-next (latest TypeScript)
Created .vscode/settings.json with:
Format on save enabled
Prettier set as default formatter
Correct TypeScript SDK path pointing to node_modules
2. Added Read-Only Client Guard Tests
Added the test suite to tests/client.test.ts:
makeReadOnlyClient() helper that creates a client without a keypair (read-only mode)
Test that token.mint() throws ReadOnlyClient error
Test that escrow.createEscrow() throws ReadOnlyClient error
Test that read operations like token.balance() work fine on read-only clients, with proper mocking to prevent network calls
The tests properly use VeriTixErrorCode.ReadOnlyClient to validate the error code is correct
All requirements from the task description have been fully implemented. The VSCode settings will make onboarding new contributors instant, and the new tests ensure the read-only client functionality is properly validated.
…dd missing tests

## Summary
This PR adds the required Node.js and npm version constraints, fixes an inconsistency in error codes in the BatchModule, and adds all the missing tests for network configuration and recurring payment methods.

## Changes Made

### 1. Package.json Updates
- Added `engines` field declaring minimum Node.js >=18.0.0 and npm >=9.0.0 to prevent cryptic errors from incompatible versions
- Moved @stellar/stellar-sdk from dependencies to peerDependencies with minimum version >=12.3.0 (the minimum tested version)

### 2. BatchModule Bug Fix
- Updated the shared `writeCall` method in `src/modules/batch.ts` to throw `VeriTixErrorCode.ReadOnlyClient` instead of `AdminUnauthorized` when no keypair is provided
- This aligns the BatchModule with all other modules in the codebase that correctly use ReadOnlyClient for read-only client write attempts
- Updated the error message to match the standard read-only client message across the codebase

### 3. Tests Added
- **Created `tests/config.test.ts`**: Added tests to verify getTestnetConfig and getMainnetConfig return correct network strings and valid RPC URLs
- **Updated `tests/batch.test.ts`**:
  - Added makeReadOnlyClient helper function
  - Added tests confirming unfreezeBatch method exists and throws ReadOnlyClient when no keypair
  - Updated all existing tests in batch.test.ts that were expecting AdminUnauthorized to instead expect ReadOnlyClient
- **Updated `tests/recurring.test.ts`**:
  - Added makeReadOnlyClient helper function
  - Added tests confirming pauseRecurring and resumeRecurring methods exist
  - Added test that pauseRecurring throws ReadOnlyClient when no keypair

## Why These Changes Matter
- Prevents users from installing the SDK on incompatible Node.js versions with unclear error messages
- Fixes a bug where the BatchModule was throwing the wrong error code for read-only clients, making error handling inconsistent across the SDK
- Adds test coverage for critical network configuration functions that are the primary entry point for new users
- Adds test coverage for the recently fixed pauseRecurring, resumeRecurring, and unfreezeBatch methods to prevent regression

## Testing
All tests have been updated to match the new error code behavior, and the new tests verify that all fixed methods exist and function correctly.
Adds the required Apache-2.0 license file and updates all necessary files to declare the correct license for the SDK.

Changes made:
- Created LICENSE file with full Apache-2.0 license text and correct copyright notice
- Updated package.json to set "license": "Apache-2.0" (previously MIT)
- Added Apache-2.0 license badge to README.md
- Updated the License section in the README to reflect the new license

This ensures consumers and contributors have clear visibility into the license terms, making the SDK fully compliant with open source standards.
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@DevMuhdishaq Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@BigBen-7
BigBen-7 merged commit 364b672 into Lead-Studios:main Aug 30, 2026
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.

chore: add LICENSE file — Apache-2.0 for open source compliance

5 participants