## Summary `TridentClient.subscribeToContract` throws `"not yet implemented"`. Needs a real WebSocket connection with automatic reconnect and clean unsubscribe. ## Acceptance Criteria - [ ] Connect to `{apiUrl}/ws?contractId=...&topic0=...` (replace `https://` with `wss://`) - [ ] Call `onEvent(event: SorobanEvent)` callback for each received message - [ ] Validate inbound messages with `SorobanEvent` Zod schema; log and skip invalid frames - [ ] Auto-reconnect with exponential backoff (500ms initial, 30s max) on unexpected close - [ ] `Subscription.unsubscribe()` closes the socket and cancels reconnect - [ ] Call `onError(err)` callback on parse errors or terminal failures ## Files `sdk/typescript/src/index.ts`, `sdk/typescript/src/subscription.ts` (new)
Summary
TridentClient.subscribeToContractthrows"not yet implemented". Needs a real WebSocket connection with automatic reconnect and clean unsubscribe.Acceptance Criteria
{apiUrl}/ws?contractId=...&topic0=...(replacehttps://withwss://)onEvent(event: SorobanEvent)callback for each received messageSorobanEventZod schema; log and skip invalid framesSubscription.unsubscribe()closes the socket and cancels reconnectonError(err)callback on parse errors or terminal failuresFiles
sdk/typescript/src/index.ts,sdk/typescript/src/subscription.ts(new)