JavaScript/ TypeScript SDK
Overview of the @lumera-protocol/sdk-js architecture and modules.
Overview
The JavaScript/ TypeScript SDK is the primary way to interact with Cascade from web and Node.js applications. It works in Node.js v18+ as well as browsers with Keplr and Leap wallets. File operations are routed through SN-API Supernode REST gateway.
Installation
Architecture
The SDK follows a three-layer architecture:
| Layer | Access via | Purpose |
|---|---|---|
| Blockchain | client.Blockchain | Chain queries: actions, supernodes, fees, transactions |
| Cascade | client.Cascade | File upload, download, and task management |
| Wallet | Passed as signer | Transaction signing and ADR-036 authentication |
Client Setup
The signer must support signDirect, signAmino, and signArbitrary (ADR-036). Browser wallets like Keplr provide all three natively. For Node.js, see Client Setup to build a compatible signer from a mnemonic.
Upload a File
Download a File
Query the Chain
Wallet Helpers
The SDK provides helpers for browser wallet integration:
getKeplrSigner returns a unified signer with signDirect, signAmino, and signArbitrary already wired up.
Key Exports
Type Safety
The SDK is fully typed with TypeScript. All SN-API responses are validated against OpenAPI-generated types, and blockchain messages use Telescope-generated protobuf codecs.