DirectSecp256k1HdWallet signer replaces browser wallet extensions.
You build two small scripts. One uploads a file to Cascade and prints its action ID, the permanent on-chain reference for the file. The other downloads the file again.
What you need
Build the scripts
1
Install dependencies
"type": "module" in your package.json.2
Create a programmatic signer
In Node.js there is no Keplr or Leap wallet. Use
DirectSecp256k1HdWallet for transaction signing and build a custom signer that adds signArbitrary (ADR-036) for Cascade’s off-chain signatures.signer.ts
3
Set your mnemonic
The scripts read the account mnemonic from the
LUMERA_MNEMONIC environment variable.4
Upload a file
The upload registers an action on chain, escrows the storage fee, and transfers the file to a SuperNode. The optional
expirationTime sets a deadline for the upload. If the upload fails or expires, the escrowed fee is refunded.upload.ts
5
Download a file
Downloads arrive as a stream of chunks. Reassemble them and write the result to disk.
download.ts
Server-side alternatives
If you prefer Go on the server, the Go SDK covers the same Cascade upload and download operations.Next steps
Build a browser app
Run the same flows in the browser with Keplr.
JavaScript SDK reference
Look up every client method and option.
Error handling
Handle failed uploads, timeouts, and retries.