Developers: TypeScript SDK
The Bashard client, node client and indexer client in packages/sdk.
The SDK in packages/sdk wraps the contracts, storage nodes and indexer. It is built on viem and runs in browsers and Node.js. It is part of the repository and is not published to a package registry.
The Bashard client
| Method | What it does |
|---|---|
quote(capacityMB, epochs) | Cost of a tape in BSHD base units |
reserveTape(capacityMB, epochs) | Approve and reserve; returns tape id, cost and tx hash |
extendTape, expandTape | Add epochs or capacity |
put(tapeId, key, data, opts) | Encode, register, upload, certify. Reports progress stages |
get(trackId, opts) | Fetch, verify and decode from any 7 shards |
deleteTrack(trackId) | Remove a track |
getTrack, getTape, trackIdByKey | Read chain records |
epochInfo, committee(epoch), node(address) | Read network state |
delegate, sharesOf, requestUnstake, withdraw, claimCommission | Staking |
registerNode | Register a node |
balance | BSHD balance of an address |
Usage shape
Illustrative only: there is no mainnet deployment to point the client at yet.
// Once a mainnet deployment exists. bashard is a Bashard client configured for chain 56.
const cost = await bashard.quote(10n, 4); // read-only price check
const tape = await bashard.reserveTape(10n, 4);
const res = await bashard.put(tape.tapeId, "notes.txt", bytes, {
onProgress: (stage, info) => console.log(stage, info),
});
const back = await bashard.get(res.trackId);Progress stages are encode, register, upload (with done and total counts), certify and done. A failed shard upload is reported and the client continues as long as the certificate quorum can still be reached.
ApiClient
A thin read-only wrapper over the indexer: stats, nodes, node, epochs, epoch, tracks, track, tapes, tape, account, events, tx, search, and subscribe for the live event stream.
NodeClient
Talks to a single storage node over HTTP: upload and download shards, fetch roots, request certification signatures and proof-of-access challenges. See node endpoints.