Quickstart
Get up and running in under five minutes. Pick the workflow that suits you:
- REST API File Upload
Send a file, fetch it instantly from our testnet, then finalize permanent storage with a single payment. - JavaScript SDK Bundles
Install@liteseed/sdk
, sign your data-item, and post & pay in one atomic call.
Follow the detailed steps below to complete each method.
1. File Upload
Section titled “1. File Upload”-
Send your file
Terminal window curl -X POST https://api.liteseed.xyz/upload \-H 'Content-Type: multipart/form-data' \-F 'file=@/path/to/your/file' -
Receive an upload ID
{ "id": "1234567890" } -
Fetch your file (available immediately, stored on Liteseed testnet for 10 blocks):
Terminal window curl -X GET https://api.liteseed.xyz/data/1234567890 \-H 'Mime-Type: application/octet-stream' -
Finalize storage After reviewing, pay the bundle fee to commit your data permanently on Arweave:
Terminal window curl -X POST https://api.liteseed.xyz/payment/1234567890 \-H 'Content-Type: application/json' \-d '{ "payment_id": "2322323232323232" }'
Pricing is competitive and transparent; you only pay for the data you commit to Arweave.
2. SDK (Data Bundles)
Section titled “2. SDK (Data Bundles)”Prerequisites
Section titled “Prerequisites”- Node.js ≥ 14
- An Arweave wallet keyfile (
.json
) - Your project initialized with
npm init
oryarn init
-
Install the SDK
Terminal window npm install @liteseed/sdkTerminal window yarn add @liteseed/sdkTerminal window pnpm add @liteseed/sdkTerminal window bun add @liteseed/sdk -
Load your Arweave key and instantiate Liteseed Client
import { readFileSync } from 'fs';import { Liteseed } from '@liteseed/sdk';// Replace with your key pathconst jwk = JSON.parse(readFileSync('./arweave-key.json', 'utf-8'));const client = new Liteseed(jwk); -
Sign Your Data - Convert any binary payload (images, JSON, logs, etc.) into a data-item:
const fileBuffer = readFileSync('path/to/image.jpg');const dataItem = await client.signData({ data: fileBuffer });console.log('✅ Data-item ID:', dataItem.id); -
Post & Pay in One Call - The SDK batches the posting of your signed data-item and the on-chain payment:
const receipt = await client.postSignedData({ dataItem });console.log('📜 Receipt:', receipt);const paymentInfo = await client.sendPayment({ dataItem });console.log('💸 Payment:', paymentInfo);receipt
contains your upload ID, cache endpoints, and deadline height.paymentInfo
confirms the AR transaction ID finalizing permanent storage.
-
Fetch Your Data - Once your bundle is finalized on Arweave, retrieve it via HTTP:
Terminal window curl https://api.liteseed.xyz/data/{uploadId} \-H 'Accept: application/octet-stream' \-o downloaded.jpg
Full Example
Section titled “Full Example”import { readFileSync } from 'fs';import { Liteseed } from '@liteseed/sdk';
async function main() { // 1. Init client const jwk = JSON.parse(readFileSync('./arweave-key.json', 'utf-8')); const client = new Liteseed(jwk);
// 2. Read file const data = readFileSync('image.jpg');
// 3. Sign const dataItem = await client.signData({ data }); console.log('Data-item ID:', dataItem.id);
// 4. Post & Pay const receipt = await client.postSignedData({ dataItem }); console.log('Receipt:', receipt);
const paymentTx = await client.sendPayment({ dataItem }); console.log('Payment TX ID:', paymentTx.id);
console.log('🎉 Your data is now permanently stored on Arweave!');}
main().catch(err => { console.error('❌ Upload failed:', err); process.exit(1);});