SDK 0.5.0 adds new activity methods without changing existing trade methods into mixed-event feeds. An upgrade should preserve the old screen first, then introduce liquidity and identity enrichment deliberately.
Pin the release and inspect your usage
npm install @solana-tracker/[email protected]
npm ls @solana-tracker/data-api
Commit the lockfile with your application's dependency change. Inventory direct SDK calls, wrapper return types, persisted cursors, stream helpers, and code that assumes every event has a swap price.
Choose which methods to migrate
| Existing method | Opt-in history method |
|---|---|
getTokenTrades | getTokenTradeHistory |
getPoolTrades | getPoolTradeHistory |
getUserTokenTrades | getUserTokenTradeHistory |
getUserPoolTrades | getUserPoolTradeHistory |
The original methods retain positional arguments and swaps-only semantics. New history methods take an options object and return a cursor that can be a number, string, or null. Do not replace a legacy numeric cursor type globally unless every caller has been migrated.
Migrate a screen in two steps
First use the new method with events: 'trades' and compare the displayed swaps. Then add liquidity modes with an event-type switch and separate rendering. The liquidity implementation guide contains the complete example.
Retain scope, event mode, and sort direction with the cursor. Reset pagination when the user changes a filter. Preserve exact LP strings all the way through storage and display formatting.
Review the streaming lifecycle
The SDK handles heartbeat replies and reconnects by default. Remove competing manual reconnect timers if they were copied from an older tutorial. Listener removal, leaving a server room, and disconnecting are distinct operations.
Use { enriched: true } only where the screen needs identity. Enriched events can arrive later or out of order. Handle partial identity without delaying the whole row.
Version 0.5.0 also fixes subscriptions queued before worker creation. Test the worker path if your application uses it; a successful Node socket test does not cover a browser worker.
Check older migration boundaries
If upgrading from 0.3.0, remove dependencies on its former wallet status/refresh methods and handle queued PnL responses. Prefer subscribe.wallet(wallet).balance() for balances and subscribe.price.aggregated(mint) for aggregate prices.
The release includes compatibility checks against 0.3.1, 0.3.2, and 0.4.0, but your wrapper assumptions still need testing. For prediction markets, getMarketTradersByExchange provides exchange-specific shapes; it does not make Kalshi trader statistics identical to a Polymarket trader page.
Validate with representative cases
Test an empty page, a final null cursor, a numeric cursor, an opaque cursor, missing identity, large LP amounts, several actions in one transaction, a disconnect, and teardown. Add a queued PnL fixture if the product has wallet analytics.
Type-check first, then run read-only staging traffic with authorized credentials. Compare old and new views under the same scope. Avoid making the SDK upgrade and a new trading action part of the same rollout.
FAQ
Must I rewrite every existing trade call?
No. New history behavior is opt-in; existing trade methods retain their older signatures.
Does the SDK retry REST requests?
No. Implement bounded retries for appropriate failures in your application.
Can I expose the Datastream URL to the browser?
It contains a credential. Keep it server-side and forward the required public data through your application.