Skip to content

feat(adapter-stellar): complete project refactoring and enhanced address validation #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pasevin
Copy link
Collaborator

@pasevin pasevin commented Aug 21, 2025

Stellar Adapter Refactoring and Enhanced Address Validation

Project Structure Refactoring

  • Rename → for better clarity
  • Create and directories
  • Move configuration files from to root
  • Update all internal imports to reflect new structure

Enhanced Address Validation

  • Move address validation from to
  • Implement proper Stellar SDK validation using instead of regex
  • Support for all 7 Stellar address types:
    • (G...) - Standard account addresses
    • (C...) - Contract addresses
    • (M...) - Muxed account addresses
    • (S...) - Secret seeds (when explicitly requested)
    • (P...) - Signed payload addresses
    • (T...) - Pre-authorized transactions
    • (X...) - Hash-x conditions

Cross-Chain Architecture Improvements

  • Extended interface with optional parameter
  • Updated EVM adapter to support new signature with backward compatibility
  • Maintained chain-agnostic design principles

Dependencies & Configuration

  • Add and dependencies
  • Add Vitest configuration for testing
  • Fix version compatibility issues

Testing

  • Comprehensive test suite with 20 test cases
  • Security-first validation design (excludes secrets by default)
  • Proper error handling and edge cases
  • All tests passing, TypeScript compilation successful, linting compliant

…ess validation

- Rename src/definition to src/contract directory
- Create src/operations and src/validation directories
- Move address validation from utils/validator.ts to validation/address.ts
- Move configuration files to src root and remove directory
- Add @stellar/stellar-sdk and @creit.tech/stellar-wallets-kit dependencies
- Implement comprehensive Stellar address validation with StrKey
- Support 7 address types: account, contract, muxed, secret, signed-payload, pre-auth-tx, hash-x
- Add optional addressType parameter to ContractAdapter.isValidAddress()
- Update EVM adapter to support new signature with backward compatibility
- Create 20 comprehensive test cases with security-first design
- Add vitest configuration and fix version compatibility issues
- Update all imports and maintain chain-agnostic architecture
@pasevin pasevin requested a review from a team as a code owner August 21, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant