TypeScript SDK

Specifications

Core types and functions shared between Node.js and browser environments

ShelbyBlobClient

Blockchain-focused client for managing blob commitments and metadata on-chain.

Prop

Type

Methods

registerBlob({account, blobName, blobMerkleRoot, size, options})

Registers a blob on the blockchain by writing its commitments.

ParameterTypeDescription
accountAccountThe account to register the blob for
blobNameBlobNameThe name/path of the blob
blobMerkleRootstringThe merkle root of the blob
sizenumberThe size of the blob in bytes
optionsWriteBlobCommitmentsOptionsOptional write blob commitments options

Returns: Promise<{ transaction: PendingTransactionResponse }>

confirmBlobChunks({signer, account, blobName, signedChunksetChunkCommitments, options})

Confirms the blob chunks for a given blob.

ParameterTypeDescription
signerAccountThe account to confirm the blob chunks for
accountAccountAddressInputThe account address
blobNamestringThe name/path of the blob
signedChunksetChunkCommitmentsSignedChunkCommitment[][]The signed chunk commitments for the blob
optionsConfirmBlobChunksOptionsOptional confirm blob chunks options

Returns: Promise<{ transaction: PendingTransactionResponse }>

getBlobMetadata(uid)

Retrieves a blob from the blockchain by its on-chain uid, in any state.

ParameterTypeDescription
uidbigintThe blob's on-chain uid

Returns: Promise<BlobMetadata | undefined>

To resolve an object name instead, use ShelbyIndexerClient.getObject, then read the blob it resolves to by uid.


ShelbyRPCClient

The client to interact with the Shelby RPC node which is responsible for storing, confirming, and retrieving blobs from the storage layer.

Prop

Type

Methods

putBlob({account, blobName, blobData})

Uploads blob data to Shelby storage using multipart upload for reliability.

ParameterTypeDescription
accountAccountAddressInputThe account address to store the blob under
blobNamestringThe name/path of the blob
blobDataUint8ArrayThe blob data to upload

getBlob({account, blobName, range?})

Downloads blob data as a readable stream with optional byte range support.

ParameterTypeDescription
accountAccountAddressInputThe account address
blobNamestringThe name/path of the blob
range{ start: number; end?: number }Optional byte range

Returns: Promise<ShelbyBlob>


ShelbyBlob

A blob is a representation of a file (or a part of a file) that is stored on the Shelby network.

Prop

Type

BlobMetadata

A blob as the chain knows it: how its bytes are stored, placed, and paid for. Keyed by uid and carrying no object name.

Prop

Type

ShelbyObject

What an object name resolves to, as the index describes it.

Prop

Type

ClayEncoding

The encoding of a blob that describes the encoding of the blob.

Prop

Type