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
| Parameter | Type | Required | Description |
|---|---|---|---|
network | ShelbyNetwork | Yes | The Shelby network to connect with (e.g., Network.TESTNET) |
connection | Connection | Yes | The Solana network connection |
apiKey | string | Yes | Your Shelby API key |
Methods
createStorageAccount
Creates a Shelby storage account derived from a Solana keypair.
const storageAccount = shelbyClient.createStorageAccount(solanaKeypair, domain);Parameters
| Parameter | Type | Description |
|---|---|---|
solanaKeypair | Keypair | The Solana keypair that will control the storage account |
domain | string | The 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:
- APT tokens: Fund your storage account with testnet APT through the Aptos Testnet Faucet.
- 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.