Carbium Library
Working Solana examples on Carbium. Copy the code or download it, and run it.
Use cases
Solana for an industry or a business job, with the Carbium services that do each part.
- RPC rate-limit alerts UC0001
Alert on 429s from a Solana RPC layer before they become an outage: per-method costs, a rolling-window watcher in Node, and when to change plan.
- Solana Pay confirmation UC0002
Confirm a Solana Pay payment from a server: why findReference() returns 403 on a shared endpoint, the two reads it needs, and a Node check on Carbium.
- Stablecoin settlement checks UC0003
How reliable the preBalance and postBalance diff is for a stablecoin settlement, where it misleads, and a read-only Node check on finalized token balances.
- Cross-border USDC payouts UC0004
Pay recipients abroad in USDC on Solana: check each wallet before sending, confirm each transfer, reconcile, with a read-only Node pre-flight.
How to use Solana
One Solana task per page, with a full example that runs on its own.
- SPL token balance HS0001
Read a wallet's SPL token balance, such as USDC, with getTokenAccountBalance in one read-only TypeScript file on Carbium RPC.
- Solana commitment levels HS0003
What the processed, confirmed and finalized commitment levels return on a Solana RPC read, shown with one read-only TypeScript file on Carbium.
- Token mint supply and authorities HS0005
Read an SPL token's supply, decimals, mint authority and freeze authority with one getAccountInfo call in a read-only TypeScript file on Carbium RPC.
- Bulk NFT metadata reader HS0006
Read name, symbol, metadata URI and collection for many NFT mints at once with getMultipleAccounts on Carbium RPC, in one read-only TypeScript file.
Integrations
Connect a product you already use to Solana through Carbium, with the code for both sides.
- Slack slot-lag alerts I0001
Compare the slot on your Carbium RPC with a reference RPC, post to a Slack webhook when the lag passes 2 slots, and write a health file your app can read.
- Custom RPC for wallets I0002
Point a Solana wallet's custom RPC field at Carbium with the key in the URL, check it from Node first, and know what an endpoint can see and get wrong.
- Svelte wallet button I0003
Svelte wallet button: connect through the Wallet Standard and show a SOL balance kept live by Carbium RPC and WebSocket, using Solana Kit.
- Flutter account reads I0004
A small Node service reads Solana accounts through Carbium with the key kept on the server, and a Flutter app fetches them over HTTP.
Blockchain ideas
One product to build on Carbium, as a spec with skeleton code.
- Failed-mint monitor BI0001
Spec and runnable code for a board that lists every failed mint on one program with its logs and error counts, using one WebSocket and no node of your own.
- Live mini explorer BI0002
Spec and runnable code for a small explorer that follows one address live: slot ticker, transaction feed and balance over one Carbium WebSocket.
- Transaction explainer BI0003
Spec and runnable code that turns a transaction signature or an address's recent history into plain lines: status, fee, balance changes and instructions.
- NFT collection transfer feed BI0004
Spec and runnable code for a feed of every transfer in a Metaplex Core collection from one WebSocket subscription, with no subscription per NFT.
AI and blockchain
AI models, agents and tool calling connected to Solana through Carbium.
- Read-only model tools SI0001
getAccountInfo only reads; a fixed method allowlist and two retry rules keep a model's Solana tools to reads.
- Read-only MCP server SI0002
A one-file stdio MCP server with four read-only Solana tools on Carbium RPC, a fixed method table, no signing code and errors the model can read.
- Agent kit RPC setup SI0003
Set up an agent kit's RPC on Carbium: key in a header or ?api-key=, one shared kit client, a 429 retry, and the cell cost of each tool.
- ElizaOS account plugin SI0004
A read-only ElizaOS-style plugin for Solana: one provider adds the current slot to each turn and one action reads an account on request.