The official TypeScript SDK for Outpost 67, a stablecoin prepayment storage network.
Compatible with Node.js and Browser environments.
- Decentralized Storage: Upload files to the Outpost 67 network with various storage tiers.
- Micro-Payments: Built-in support for the x402 payment protocol using EVM (Ethereum compatible) and SVM (Solana) wallets.
- Dual Support: Works seamlessly in both Node.js (Buffers, Streams, Files) and Browser (File, Blob) environments.
- Full Lifecycle Management: Upload, retrieve, list, renew, and delete objects.
npm install @outpost67/sdkYou can initialize the client for either EVM or SVM networks.
EVM (Ethereum, Polygon, Base, etc.)
import { Outpost67Client } from '@outpost67/sdk';
const privateKey = '0x...'; // Your EVM private key
const client = new Outpost67Client('evm', privateKey, {
mode: 'live' // or 'test'
});SVM (Solana)
import { Outpost67Client } from '@outpost67/sdk';
const privateKey = '...'; // Your base58 API/Private key
const client = new Outpost67Client('svm', privateKey, {
mode: 'live' // or 'test'
});Node.js Example
import fs from 'fs';
// Upload a file stream
const stream = fs.createReadStream('./my-document.pdf');
const stats = fs.statSync('./my-document.pdf');
const upload = await client.upload('my-document.pdf', stream, {
tier: 'standard',
duration: 24, // hours
explicitSize: stats.size // Required for streams
});
console.log('Upload successful:', upload.id);Browser Example
const fileInput = document.querySelector('input[type="file"]');
const file = fileInput.files[0];
const upload = await client.upload(file.name, file, {
tier: 'standard',
duration: 24
});
console.log('Upload successful:', upload.id);// Returns a ReadableStream in Node.js or a Blob in the Browser
const result = await client.retrieve(upload.id);
// Node.js: Pipe to file
const dest = fs.createWriteStream('./downloaded.pdf');
result.pipe(dest);
// Browser: Create object URL
const url = URL.createObjectURL(result);
window.open(url);- network:
'evm' | 'svm'- The blockchain network to use for payments. - privateKey:
string- The hex string (EVM) or base58 string (SVM) private key. - options:
ClientOptionsmode:'live' | 'test'(default: 'live')endpoint: Custom API endpoint (optional)
Uploads a file to specific storage tier.
- fileName:
string- The name of the file. - fileItem:
File | Blob | Buffer | Readable | string- The file content or path. - params:
UploadParamstier:'decentralized' | 'fast' | 'standard' | 'infrequent' | 'cold'duration: Storage duration in hours.explicitSize: (Required for Streams) Size of the file in bytes.
List all objects in your storage.
- filter:
string(optional) - Regex filter for the list.
Download a file.
- objectIdOrName:
string- The ID or name of the file. - retrievalToken:
string(optional) - Token for authorization if required.
Extend the storage duration of a file.
- duration:
number- Additional hours to store.
Rotate access tokens for an object.
Delete a file from storage.
Restore a file from cold storage.
- newObjectName:
string- Name for the restored copy. - duration:
number- How long to keep the restored copy.
'decentralized' | 'fast' | 'standard' | 'infrequent' | 'cold'
interface UploadParams {
tier: StorageTier;
duration: number; // hours
explicitSize?: number; // bytes
}