Migrates the two core library files from plain JavaScript to TypeScript, adding full type annotations throughout. This improves IDE autocompletion, catches bugs at compile time, and makes the codebase easier for new contributors to extend.
src/lib/stellar.js→src/lib/stellar.ts— full type annotations on all exportssrc/lib/store.js→src/lib/store.ts— typed Zustand store withStoreStateinterfacetsconfig.json— new, strict mode with bundler module resolutionvite.config.js—.tsextensions prioritised in resolution orderpackage.json— addedtypescriptdev dependency
| Export | Type |
|---|---|
NetworkName |
'mainnet' | 'testnet' |
NetworkConfig |
interface with horizonUrl, sorobanUrl, passphrase, optional faucetUrl |
BuilderOperation |
discriminated union of PaymentOperation | CreateAccountOperation |
PathAsset |
{ type: 'native' | 'credit', code, issuer? } |
PaymentPathRecord |
typed Horizon path response including client-side slippagePct |
SimulateResult |
{ fee, operationCount, success, errors, xdr? } |
| All functions | explicit parameter and return types, no implicit any |
StoreStateinterface covers all state fields and setters- Account data typed as
Horizon.AccountResponse - Transactions/operations typed as
ServerApi.TransactionRecord[]/OperationRecord[] - Contract data typed as
SorobanRpc.Api.LedgerEntryResult faucetResulttyped asunknown— genuinely untyped external JSON response
- Scope is strictly the two lib files — no
.jsxcomponents were touched allowJs: true/checkJs: falsein tsconfig keeps existing JSX components working without requiring their migrationtsc --noEmitpasses with zero errors
npx tsc --noEmit # should exit 0 with no output
npm run build # vite build should complete without errors
npm run dev # app should behave identically to beforeCloses #