Solana Kit

Shelby Client

The main client for Solana-Shelby integration

The Shelby class is the main entry point for interacting with the Shelby Protocol from a Solana application. It extends the core ShelbyClient with Solana-specific functionality.

Constructor

import { Shelby, Network } from "@shelby-protocol/solana-kit/node";
import { Connection } from "@solana/web3.js";

const shelbyClient = new Shelby({
  network: Network.TESTNET,
  connection: new Connection("https://api.devnet.solana.com"),
  apiKey: "AG-***",
});

Parameters

ParameterTypeRequiredDescription
networkShelbyNetworkYesThe Shelby network to connect with (e.g., Network.TESTNET)
connectionConnectionYesThe Solana network connection
apiKeystringYesYour Shelby API key

Methods

createStorageAccount

Creates a Shelby storage account derived from a Solana keypair.

const storageAccount = shelbyClient.createStorageAccount(solanaKeypair, domain);

Parameters

ParameterTypeDescription
solanaKeypairKeypairThe Solana keypair that will control the storage account
domainstringThe dApp domain for account isolation

Returns

Returns a ShelbyStorageAccount instance that can be used as a signer for transactions.

Inherited Methods

The Shelby class extends ShelbyClient and inherits all its methods:

upload

Upload blobs to the Shelby network.

await shelbyClient.upload({
  blobData: new Uint8Array([1, 2, 3]),
  signer: storageAccount,
  blobName: "example.txt",
  expirationMicros: Date.now() * 1000 + 86400000000,
});

Funding your account

To upload files, you will need to fund your account with two assets:

  1. APT tokens: Fund your storage account with testnet APT through the Aptos Testnet Faucet.
  2. ShelbyUSD tokens: Sign up for early access through the Shelby Discord to receive testnet ShelbyUSD tokens.

For a complete list of inherited methods, see the Shelby SDK documentation.