{"_id":"@0xkaleab/sdk-js","_rev":"2-42b95cf2d9ab859212cf8c37ebccf0c1","name":"@0xkaleab/sdk-js","dist-tags":{"latest":"0.2.8"},"versions":{"0.2.7":{"name":"@0xkaleab/sdk-js","version":"0.2.7","license":"Apache-2.0","_id":"@0xkaleab/sdk-js@0.2.7","maintainers":[{"name":"0xkaleab","email":"kaleababayneh65@gmail.com"}],"dist":{"shasum":"9fdaeeed0c9bb0da010aa4392a67636b54e5e2c4","tarball":"https://registry.npmjs.org/@0xkaleab/sdk-js/-/sdk-js-0.2.7.tgz","fileCount":1378,"integrity":"sha512-u/pKPoRQAD6tEogRR7PouswvWsEn1cv7eB+D7lLx6TnE8TD2SvG7CpvUlBIBRwvpd+371muusf9zlUK11fRV6A==","signatures":[{"sig":"MEQCIC+kKkYhgA3dlgZ1RNQB1Q288ZX7q2AUoDjjAffjxsLEAiAVu7C9tCqWKtS2NiWQwCBGgn4kvhyf800KKAmvURXlGw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17287996},"main":"dist/cjs/index.js","pnpm":{"overrides":{"minimatch":"^8.0.0"}},"type":"module","types":"dist/types/index.d.ts","module":"dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./compat/zstd":{"node":"./dist/esm/compat/zstd.node.js","types":"./dist/types/compat/zstd.node.d.ts","browser":"./dist/esm/compat/zstd.browser.js"},"./compat/blake3":{"node":"./dist/esm/compat/blake3.node.js","types":"./dist/types/compat/blake3.node.d.ts","browser":"./dist/esm/compat/blake3.browser.js"}},"gitHead":"06e33f86958f3a6777f7b30c85facc51d0aefc62","scripts":{"dev":"vitest","docs":"typedoc --out docs/api src/index.ts","lint":"eslint 'src/**/*.{ts,tsx}'","test":"vitest run","build":"npm run clean && npm run build:esm && npm run build:cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json","clean":"rm -rf dist","codegen":"telescope transpile --config telescope.json","coverage":"vitest run --coverage","generate":"npm run codegen:full && npm run codegen:fix","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.json","gen:snapi":"openapi-typescript docs/snapi-swagger.json -o src/types/snapi.gen.ts","codegen:fix":"ts-node scripts/post-codegen-fix.ts","e2e:browser":"node scripts/e2e-browser-example.mjs","proto:clean":"rm -rf proto","codegen:full":"npm run codegen:clean && npm run proto:download && npm run codegen","codegen:clean":"rm -rf src/codegen","generate:watch":"telescope transpile --config telescope.json --watch","proto:download":"npm run proto:clean && npm run proto:download:lumera && npm run proto:download:deps","proto:download:deps":"buf export buf.build/cosmos/cosmos-sdk:5a6ab7bc14314acaa912d5e53aef1c2f -o protos && buf export buf.build/cosmos/cosmos-proto:04467658e59e44bbb22fe568206e1f70 -o protos && buf export buf.build/googleapis/googleapis:004180b77378443887d3b55cabc00384 -o protos","proto:download:lumera":"buf export buf.build/lumera-protocol/lumera:76f5a5038df84649b0b0557064206d4e -o protos"},"_npmUser":{"name":"0xkaleab","email":"kaleababayneh65@gmail.com"},"repository":{"url":"github.com/LumeraProtocol/sdk-js","type":"git"},"_npmVersion":"11.6.0","description":"Lumera JS/TS SDK — CosmJS+REST blockchain client and Cascade (sn-api) client","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.23.8","bs58":"^6.0.0","blake3":"^2.1.7","undici":"^6.19.8","cosmjs-types":"^0.9.0","@cosmjs/amino":"^0.36.0","formdata-node":"^6.0.3","@cosmjs/crypto":"^0.36.0","rq-library-wasm":"^1.0.2","@cosmjs/encoding":"^0.36.0","@cosmjs/stargate":"^0.36.0","@mongodb-js/zstd":"^2.0.0","@bokuweb/zstd-wasm":"^0.0.27","@bufbuild/protobuf":"^2.2.2","@interchainjs/math":"^1.18.0","@interchainjs/types":"^1.18.0","@interchainjs/utils":"^1.18.0","@interchainjs/cosmos":"^1.18.0","@interchainjs/pubkey":"^1.18.0","@cosmjs/proto-signing":"^0.36.0","@cosmjs/tendermint-rpc":"^0.36.0","@interchainjs/encoding":"^1.18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^10.4.2","eslint":"^9.11.1","rimraf":"^6.0.1","vitest":"^2.1.2","shelljs":"^0.10.0","ts-node":"^10.9.2","typedoc":"^0.28.14","prettier":"^3.3.3","fast-glob":"^3.3.3","happy-dom":"^15.8.3","minimatch":"^10.0.3","playwright":"^1.57.0","typescript":"^5.5.3","@types/node":"^20.14.10","@vitest/browser":"^2.1.2","openapi-typescript":"^7.4.0","@hyperweb/telescope":"^2.0.3","eslint-config-prettier":"^9.1.0","typedoc-plugin-markdown":"^4.9.0","@typescript-eslint/parser":"^8.10.0","@typescript-eslint/eslint-plugin":"^8.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-js_0.2.7_1774122107942_0.12715003311549755","host":"s3://npm-registry-packages-npm-production"}},"0.2.8":{"name":"@0xkaleab/sdk-js","version":"0.2.8","description":"Lumera JS/TS SDK — CosmJS+REST blockchain client and Cascade (sn-api) client","publishConfig":{"access":"public"},"type":"module","main":"dist/cjs/index.js","module":"dist/esm/index.js","types":"dist/types/index.d.ts","exports":{".":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js","types":"./dist/types/index.d.ts"},"./compat/blake3":{"browser":"./dist/esm/compat/blake3.browser.js","node":"./dist/esm/compat/blake3.node.js","types":"./dist/types/compat/blake3.node.d.ts"},"./compat/zstd":{"browser":"./dist/esm/compat/zstd.browser.js","node":"./dist/esm/compat/zstd.node.js","types":"./dist/types/compat/zstd.node.d.ts"}},"sideEffects":false,"scripts":{"clean":"rm -rf dist","build:esm":"tsc -p tsconfig.json","build:cjs":"tsc -p tsconfig.cjs.json","build":"npm run clean && npm run build:esm && npm run build:cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json","gen:snapi":"openapi-typescript docs/snapi-swagger.json -o src/types/snapi.gen.ts","lint":"eslint 'src/**/*.{ts,tsx}'","test":"vitest run","coverage":"vitest run --coverage","dev":"vitest","docs":"typedoc --out docs/api src/index.ts","e2e:browser":"node scripts/e2e-browser-example.mjs","proto:clean":"rm -rf proto","proto:download":"npm run proto:clean && npm run proto:download:lumera && npm run proto:download:deps","proto:download:lumera":"buf export buf.build/lumera-protocol/lumera:76f5a5038df84649b0b0557064206d4e -o protos","proto:download:deps":"buf export buf.build/cosmos/cosmos-sdk:5a6ab7bc14314acaa912d5e53aef1c2f -o protos && buf export buf.build/cosmos/cosmos-proto:04467658e59e44bbb22fe568206e1f70 -o protos && buf export buf.build/googleapis/googleapis:004180b77378443887d3b55cabc00384 -o protos","codegen:clean":"rm -rf src/codegen","codegen":"telescope transpile --config telescope.json","codegen:fix":"ts-node scripts/post-codegen-fix.ts","codegen:full":"npm run codegen:clean && npm run proto:download && npm run codegen","generate":"npm run codegen:full && npm run codegen:fix","generate:watch":"telescope transpile --config telescope.json --watch"},"dependencies":{"@bufbuild/protobuf":"^2.2.2","@cosmjs/amino":"^0.36.0","@cosmjs/crypto":"^0.36.0","@cosmjs/encoding":"^0.36.0","@cosmjs/proto-signing":"^0.36.0","@cosmjs/stargate":"^0.36.0","@cosmjs/tendermint-rpc":"^0.36.0","@interchainjs/cosmos":"^1.18.0","@interchainjs/encoding":"^1.18.0","@interchainjs/math":"^1.18.0","@interchainjs/pubkey":"^1.18.0","@interchainjs/types":"^1.18.0","@interchainjs/utils":"^1.18.0","@mongodb-js/zstd":"^2.0.0","@bokuweb/zstd-wasm":"^0.0.27","blake3":"^2.1.7","bs58":"^6.0.0","cosmjs-types":"^0.9.0","formdata-node":"^6.0.3","rq-library-wasm":"^1.0.2","undici":"^6.19.8","zod":"^3.23.8"},"devDependencies":{"@hyperweb/telescope":"^2.0.3","@types/node":"^20.14.10","@typescript-eslint/eslint-plugin":"^8.10.0","@typescript-eslint/parser":"^8.10.0","@vitest/browser":"^2.1.2","playwright":"^1.57.0","eslint":"^9.11.1","eslint-config-prettier":"^9.1.0","fast-glob":"^3.3.3","glob":"^10.4.2","happy-dom":"^15.8.3","minimatch":"^10.0.3","openapi-typescript":"^7.4.0","prettier":"^3.3.3","rimraf":"^6.0.1","shelljs":"^0.10.0","ts-node":"^10.9.2","typedoc":"^0.28.14","typedoc-plugin-markdown":"^4.9.0","typescript":"^5.5.3","vitest":"^2.1.2"},"engines":{"node":">=18"},"pnpm":{"overrides":{"minimatch":"^8.0.0"}},"license":"Apache-2.0","repository":{"type":"git","url":"github.com/LumeraProtocol/sdk-js"},"_id":"@0xkaleab/sdk-js@0.2.8","gitHead":"4c2a7a970d165a70e108d8076d271f99f9e88cfe","_nodeVersion":"22.17.1","_npmVersion":"11.6.0","dist":{"integrity":"sha512-/7mdm6g2iw4Kr1QE/AgH61I8cqDnMqqv3Icso0iMhxn9ted0Cud9U2g5WkJvDOdZLZ1d83LqSCHqUyHi2MQHpg==","shasum":"e1ccdf1f48c32064bba421ef99fdaeaf4c201e17","tarball":"https://registry.npmjs.org/@0xkaleab/sdk-js/-/sdk-js-0.2.8.tgz","fileCount":1378,"unpackedSize":17288100,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIECJxIbEijUfryc0wA+u+ZDVtnMbfI8eJVYV3s32AHroAiBUEmbCiFUvTnEuF17n7f04oz+Y09iSHjnGW9NXUP9jvQ=="}]},"_npmUser":{"name":"0xkaleab","email":"kaleababayneh65@gmail.com"},"directories":{},"maintainers":[{"name":"0xkaleab","email":"kaleababayneh65@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-js_0.2.8_1774124187041_0.19483152021292804"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-21T19:41:47.794Z","modified":"2026-03-21T20:16:27.464Z","0.2.7":"2026-03-21T19:41:48.222Z","0.2.8":"2026-03-21T20:16:27.356Z"},"license":"Apache-2.0","repository":{"type":"git","url":"github.com/LumeraProtocol/sdk-js"},"description":"Lumera JS/TS SDK — CosmJS+REST blockchain client and Cascade (sn-api) client","maintainers":[{"name":"0xkaleab","email":"kaleababayneh65@gmail.com"}],"readme":"# @lumera-protocol/sdk-js\n\n**Official JavaScript/TypeScript SDK for Lumera Protocol**\n\nA unified SDK providing seamless access to the Lumera blockchain and Cascade distributed storage network. Built with modern TypeScript, featuring comprehensive type safety, and designed for both Node.js and browser environments.\n\n## ✨ Features\n\n- **🔗 Unified Client Interface** - Single entry point for all Lumera operations\n- **⛓️ Blockchain Operations** - Complete CosmJS integration with LCD/REST queries\n  - Transaction simulation, signing, and broadcasting\n  - Action module queries and operations\n  - Supernode module queries\n  - Chain parameter queries\n- **📦 Cascade Storage** - Full-featured distributed file storage client\n  - Upload/download with progress tracking\n  - Automatic file chunking and Reed-Solomon encoding\n  - Task management with polling and status updates\n  - Stream-based downloads for memory efficiency\n- **🔐 Wallet Integration** - Support for multiple wallet types\n  - Keplr wallet integration\n  - Leap wallet integration  \n  - Programmatic signing with DirectSecp256k1HdWallet\n- **🎯 Type Safety** - Full TypeScript support with comprehensive types\n- **🌐 Cross-Platform** - Works in Node.js (v18+) and modern browsers\n- **📝 Extensive Documentation** - Complete API reference and examples\n\n## 📦 Installation\n\n```bash\npnpm install @lumera-protocol/sdk-js\n```\n\n### Peer Dependencies\n\nFor blockchain operations, you'll also need CosmJS packages:\n\n```bash\npnpm install @cosmjs/proto-signing @cosmjs/stargate\n```\n\n## 🚀 Quick Start\n\n### 1. Initialize the Client\n\n```typescript\nimport { createLumeraClient } from \"@lumera-protocol/sdk-js\";\nimport { DirectSecp256k1HdWallet } from \"@cosmjs/proto-signing\";\n\n// Create a wallet\nconst wallet = await DirectSecp256k1HdWallet.fromMnemonic(\n  \"your mnemonic phrase here\",\n  { prefix: \"lumera\" }\n);\n\nconst [account] = await wallet.getAccounts();\n\n// Create the client using testnet preset\nconst client = await createLumeraClient({\n  preset: \"testnet\",\n  signer: wallet,\n  address: account.address,\n  gasPrice: \"0.025ulume\"\n});\n```\n\n### 2. Query the Blockchain\n\n```typescript\n// Get chain information\nconst chainId = await client.Blockchain.getChainId();\nconsole.log(\"Chain ID:\", chainId);\n\n// Query action module parameters\nconst actionParams = await client.Blockchain.Action.getParams();\nconsole.log(\"Action params:\", actionParams);\n\n// Query supernode module parameters  \nconst supernodeParams = await client.Blockchain.Supernode.getParams();\nconsole.log(\"Supernode params:\", supernodeParams);\n```\n\n### 3. Upload a File to Cascade\n\n```typescript\n// Prepare your file\nconst fileContent = \"Hello, Lumera!\";\nconst fileBytes = new TextEncoder().encode(fileContent);\n\n// Upload to Cascade\nconst uploadResult = await client.Cascade.uploader.uploadFile(fileBytes, {\n  actionId: `my-file-${Date.now()}`,\n  rq_ids_ic: 1000,\n  rq_ids_max: actionParams.rq_ids_max,\n  taskOptions: {\n    pollInterval: 2000,\n    timeout: 300000,\n  },\n});\n\nconsole.log(\"Upload completed:\", uploadResult);\n```\n\n### 4. Download a File from Cascade\n\n```typescript\n// Download using the action ID\nconst downloadStream = await client.Cascade.downloader.download(\n  uploadResult.actionId\n);\n\n// Read the stream\nconst reader = downloadStream.getReader();\nconst chunks: Uint8Array[] = [];\n\nwhile (true) {\n  const { done, value } = await reader.read();\n  if (done) break;\n  chunks.push(value);\n}\n\n// Combine chunks\nconst totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);\nconst downloadedBytes = new Uint8Array(totalLength);\nlet offset = 0;\nfor (const chunk of chunks) {\n  downloadedBytes.set(chunk, offset);\n  offset += chunk.length;\n}\n\nconst downloadedContent = new TextDecoder().decode(downloadedBytes);\nconsole.log(\"Downloaded:\", downloadedContent);\n```\n\n## 📚 Documentation\n\n- **[Developer Guide](./docs/developer-guide.md)** - Environment setup, codegen, testing, and publishing workflows\n- **[API Reference](./docs/api/index.html)** - Complete TypeScript API documentation (Typedoc HTML output)\n- **[Migration Guide](./MIGRATION.md)** - Migrate from direct fetch/LCD calls to the SDK\n- **[Examples](./examples/)** - Working code examples\n  - [Node.js Examples](./examples/node/) - Full workflow and standalone examples\n  - [Browser Example](./examples/browser/) - Browser-based upload/download demo\n\n## 🎯 Core Concepts\n\n### Chain Presets\n\nThe SDK includes built-in presets for quick setup:\n\n```typescript\nconst client = await createLumeraClient({\n  preset: \"testnet\", // or \"mainnet\"\n  signer: wallet,\n  address: account.address,\n});\n```\n\nAvailable presets:\n\n- `testnet` - Lumera testnet configuration\n- `mainnet` - Lumera mainnet configuration\n\n### Manual Configuration\n\nFor custom chains or advanced setups:\n\n```typescript\nconst client = await createLumeraClient({\n  rpcUrl: \"https://your-rpc-url.com\",\n  lcdUrl: \"https://your-lcd-url.com\",\n  chainId: \"your-chain-id\",\n  signer: wallet,\n  address: account.address,\n  gasPrice: \"0.025ulume\",\n  cascade: {\n    snapiBaseUrl: \"https://your-snapi-url.com\"\n  }\n});\n```\n\n### Blockchain Client\n\nDirect access to blockchain operations:\n\n```typescript\n// Transaction operations\nconst msgs = [...]; // Your messages\nconst gas = await client.Blockchain.Tx.simulate(address, msgs);\nconst result = await client.Blockchain.Tx.broadcast(signedTx);\n\n// Query operations\nconst actionList = await client.Blockchain.Action.listActions();\nconst supernodeList = await client.Blockchain.Supernode.listAll();\n```\n\n### Cascade Client\n\nFile storage operations:\n\n```typescript\n// Upload with progress tracking\nconst uploader = client.Cascade.uploader;\nconst result = await uploader.uploadFile(fileBytes, {\n  actionId: \"my-action\",\n  rq_ids_ic: 1000,\n  rq_ids_max: 10000,\n});\n\n// Download as stream\nconst downloader = client.Cascade.downloader;\nconst stream = await downloader.download(\"action-id\");\n```\n\n### LEP-1 Helpers & Deterministic IDs\n\nFor low-level control over LEP-1 layout generation and ID derivation, the SDK exposes helpers:\n\n```typescript\nimport {\n  createSingleBlockLayout,\n  generateIds,\n  buildIndexFile,\n} from \"@lumera-protocol/sdk-js\";\n\n// 1. Create a single-block RaptorQ layout from file bytes\nconst layoutBytes = await createSingleBlockLayout(fileBytes);\n\n// 2. Sign the canonical JSON layout bytes with your wallet (ADR-036)\n//    and obtain the base64-encoded signature string.\n\n// 3. Derive deterministic layout IDs (must match on-chain validation)\nconst layoutIds = await generateIds(\n  layoutFileB64,\n  layoutSignatureB64,\n  rq_ids_ic,\n  rq_ids_max,\n);\n\n// 4. Build the LEP-1 index file\nconst index = buildIndexFile(layoutIds, layoutSignatureB64);\n```\n\nTo debug or validate determinism across Go and JS implementations, use the\n[`lep1-id-lab`](../lep1-id-lab/README.md) golden-vector setup at the repo root.\n\n## 🧪 Development\n\n```bash\n# Install dependencies\npnpm install\n\n# Run tests\npnpm test\n\n# Run tests with coverage\npnpm run coverage\n\n# Build the SDK\npnpm build\n\n# Generate API documentation\npnpm run docs\n\n# Lint code\npnpm lint\n```\n\n## 📋 Requirements\n\n- Node.js v18 or higher\n- TypeScript 5.x (for development)\n- Modern browser with ES2020+ support (for browser usage)\n\n## 🤝 Contributing\n\nContributions are welcome! Please read our contributing guidelines before submitting PRs.\n\n## 📄 License\n\nApache-2.0 - see LICENSE file for details.\n\n## 🔗 Links\n\n- [GitHub Repository](https://github.com/LumeraProtocol/sdk-js)\n- [Lumera Protocol](https://lumera.io)\n- [Documentation](./docs/api/README.md)\n\n## 💡 Support\n\n- For bug reports and feature requests, please open an issue on GitHub\n- For questions and discussions, join our community channels\n\n---\n\n**Built with ❤️ by the Lumera Protocol team**\n","readmeFilename":"README.md"}