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.
| Parameter | Type | Description |
|---|---|---|
account | Account | The account to register the blob for |
blobName | BlobName | The name/path of the blob |
blobMerkleRoot | string | The merkle root of the blob |
size | number | The size of the blob in bytes |
options | WriteBlobCommitmentsOptions | Optional write blob commitments options |
Returns: Promise<{ transaction: PendingTransactionResponse }>
confirmBlobChunks({signer, account, blobName, signedChunksetChunkCommitments, options})
Confirms the blob chunks for a given blob.
| Parameter | Type | Description |
|---|---|---|
signer | Account | The account to confirm the blob chunks for |
account | AccountAddressInput | The account address |
blobName | string | The name/path of the blob |
signedChunksetChunkCommitments | SignedChunkCommitment[][] | The signed chunk commitments for the blob |
options | ConfirmBlobChunksOptions | Optional confirm blob chunks options |
Returns: Promise<{ transaction: PendingTransactionResponse }>
getBlobMetadata(uid)
Retrieves a blob from the blockchain by its on-chain uid, in any state.
| Parameter | Type | Description |
|---|---|---|
uid | bigint | The 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.
| Parameter | Type | Description |
|---|---|---|
account | AccountAddressInput | The account address to store the blob under |
blobName | string | The name/path of the blob |
blobData | Uint8Array | The blob data to upload |
getBlob({account, blobName, range?})
Downloads blob data as a readable stream with optional byte range support.
| Parameter | Type | Description |
|---|---|---|
account | AccountAddressInput | The account address |
blobName | string | The 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