TypeScript SDK

Getting Started

Getting Started with the TypeScript SDK reference for Shelby Protocol

TypeScript SDK

The Shelby Protocol TypeScript SDK provides both Node.js and browser support for interacting with the Shelby Protocol. This comprehensive reference covers all available types, functions, and classes.

Installation

npm install @shelby-protocol/sdk @aptos-labs/ts-sdk

Quick Start

Node.js Environment

import fs from "node:fs";
import { Account, Ed25519PrivateKey, Network } from '@aptos-labs/ts-sdk'
import { ShelbyNodeClient } from "@shelby-protocol/sdk/node";
const client = new ShelbyNodeClient({
  network: Network.SHELBYNET,
});
// Use the private key of the Aptos account.
// It will be of the form: ed25519-priv-0x...
const signer = Account.fromPrivateKey({
  privateKey: new Ed25519PrivateKey(
  "ed25519-priv-0x..."),
});
await client.upload({
  signer,
  // This is the local blob to be uploaded.
  blobData: fs.readFileSync("local_blob.bin"),
  // This will be the name of the file in Shelby, owned by the account in signer.
  blobName: "shelby_blob",
  expirationMicros: (1000 * 60 * 60 * 24 * 30 + Date.now()) * 1000, // 30 days
});

Browser Environment

As of now, there are no client-side specific functionality offered by the TypeScript SDK. We are actively working on these features.

API Reference

Explore the complete TypeScript API documentation: