@thru/thru-sdk when you want a single TypeScript client for querying Thru data, sending transactions, and working with the SDK’s domain models.
Install
Entry Points
| Import | What it provides |
|---|---|
@thru/thru-sdk | Grouped modules for accounts, blocks, chain, consensus, events, height, keys, node, proofs, slots, streaming, and transactions, plus the core domain classes and helpers. |
@thru/thru-sdk/client | createThruClient, ThruClientConfig, and the bound Thru client interface. |
Start Here
Create a client with your RPC base URL, then call the grouped helpers on the returnedthru object:
accounts.get,accounts.list,accounts.create, andaccounts.streamblocks.get,blocks.getRaw,blocks.list,blocks.getBlockHeight, andblocks.streamtransactions.get,transactions.list,transactions.build,transactions.buildAndSign,transactions.send,transactions.sendAndTrack,transactions.track, andtransactions.streamevents.get,events.list, andevents.streamslots.getMetrics,slots.listMetrics, andslots.streamMetricsproofs.generateandproofs.getStateRootsnode.getPubkey,node.getRecords, andnode.streamRecordschain.getChainInfoandchain.getChainIdversion.getconsensushelpers for version-context selection and status formatting
When to use it
Use@thru/thru-sdk as your default app-facing SDK when you want one package for reads, writes, streams, and domain models. Use @thru/thru-sdk/client when you want the bound client setup flow. Reach for @thru/proto, @thru/token-program, or @thru/bridge-sdk only when you need a lower-level message, token, or bridge-specific layer.
Core Models
The root package also exports the domain types you usually want to keep in your application layer:AccountBlockChainEventTransactionTransactionStatusSnapshotStateProofHeightSnapshotVersionInfoPubkeySignatureTransactionBuilder
Common Helpers
The root package includes grouped helper utilities for the most common SDK tasks:deriveAddressandderiveProgramAddresscollectStream,firstStreamValue, andforEachStreamValueaccounts,blocks,events,transactions, and the other namespace modules for direct function-level access