Skip to content

refactor(sdk)!: implement ADR-0003 API design and flatten module structure#7

Merged
tenequm merged 1 commit intomainfrom
feat/implement-solana-splits-sdk-api-improvements
Dec 9, 2025
Merged

refactor(sdk)!: implement ADR-0003 API design and flatten module structure#7
tenequm merged 1 commit intomainfrom
feat/implement-solana-splits-sdk-api-improvements

Conversation

@tenequm
Copy link
Member

@tenequm tenequm commented Dec 9, 2025

Summary

Implements ADR-0003 API design patterns and flattens the SDK module structure for simpler imports.

Breaking Changes

  • Module structure flattened: Imports now from package root, not /solana subpath
  • Removed ExecuteAndConfirmResult type: Use ExecuteResult instead
  • Renamed seeduniqueId in estimateSplitRent()

ADR-0003 Implementation

  • All functions use flat object parameters consistently
  • All result types use lowercase status discriminant
  • splitConfig is primary identifier (not vault)
  • Token program auto-detection enabled by default
  • ATA auto-creation enabled by default with opt-out

Code Quality

  • Removed redundant type assertions
  • Simplified conditional object building with spread syntax
  • Use getSplitConfig instead of deprecated getSplitConfigFromVault
  • Updated ARCHITECTURE.md with correct import paths

Test plan

  • All 128 SDK tests pass
  • Type-check clean for SDK and dashboard
  • Build successful
  • Lint clean

…cture

BREAKING CHANGES:
- Remove `ExecuteAndConfirmResult` type (use `ExecuteResult` instead)
- Rename `seed` parameter to `uniqueId` in `estimateSplitRent()`
- Flatten module structure: imports now from root, not `/solana` subpath

API Design (ADR-0003 compliance):
- All functions use flat object parameters
- All result types use lowercase `status` discriminant
- `splitConfig` is primary identifier (not `vault`)
- Token program auto-detection enabled by default
- ATA auto-creation enabled by default with opt-out

Module Structure Changes:
- Move all source from `src/solana/` to `src/`
- Move `src/solana/client/` to `src/client/`
- Move `src/solana/generated/` to `src/generated/`
- Move `src/solana/web3-compat/` to `src/web3-compat/`
- Update all import paths accordingly

Code Simplifications:
- Remove redundant `as Address` and `as Signature` type assertions
- Replace `Parameters<typeof fn>[N]` with inline object spreads
- Simplify conditional object building with spread syntax
- Use `getSplitConfig` instead of deprecated `getSplitConfigFromVault`

Documentation Updates:
- Fix ARCHITECTURE.md import paths (remove `/solana` prefix)
- Update ADR-0003 status to "Implemented"

All 128 tests pass. Type-check and lint clean.
@tenequm tenequm self-assigned this Dec 9, 2025
@cloudflare-workers-and-pages
Copy link

Deploying splits with  Cloudflare Pages  Cloudflare Pages

Latest commit: 680d871
Status: ✅  Deploy successful!
Preview URL: https://8a235e6e.splits-2l5.pages.dev
Branch Preview URL: https://feat-implement-solana-splits.splits-2l5.pages.dev

View logs

@tenequm tenequm merged commit 6e70a40 into main Dec 9, 2025
1 check passed
@tenequm tenequm deleted the feat/implement-solana-splits-sdk-api-improvements branch December 9, 2025 21:11
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.

1 participant