@quiverdepin/sdk
v0.1.0
Published
Quiver routing layer SDK — best-path routing for decentralized GPU compute.
Maintainers
Readme
@quiverdepin/sdk
Minimal JavaScript/TypeScript SDK for Quiver — best-path routing for decentralized GPU compute on Solana. One call routes your job to the cheapest provider, escrows payment on-chain, and gives you an endpoint to the running container — no accounts on multiple GPU networks required.
npm install @quiverdepin/sdk @solana/web3.jsQuick start
import { QuiverClient } from "@quiverdepin/sdk";
import { Keypair } from "@solana/web3.js";
const quiver = new QuiverClient({ baseUrl: "https://api.quiver.example" });
// 1) Compare prices / get the best route (no payment)
const route = await quiver.route({ gpuClass: "H100", durationHours: 1, region: "EU" });
console.log(route.offer.source, route.estimatedTotalUsd);
// 2) Submit a job: route + on-chain escrow + dispatch, in one call
const signer = Keypair.fromSecretKey(/* your devnet keypair */);
const { jobId, signature } = await quiver.submit(
{ gpuClass: "H100", durationHours: 0.25, image: "your-org/model:latest", port: 8000 },
signer,
{ rpcUrl: "https://api.devnet.solana.com" }
);
// 3) Poll status until the container is up
let job = await quiver.status(jobId);
while (job.phase === "queued" || job.phase === "dispatching" || !job.endpointUrl) {
await new Promise(r => setTimeout(r, 5000));
job = await quiver.status(jobId);
}
// 4) Use your GPU container through Quiver (provider stays hidden)
console.log("endpoint:", quiver.endpoint(jobId)); // -> https://api.quiver.example/gpu/<jobId>/API
Routing & index (no wallet)
| Method | Returns | Description |
|---|---|---|
| route(spec) | RouteResult | Best-path provider + price for a job spec |
| routeTop(spec, n?) | RouteResult[] | Top-N candidate routes |
| index(filters?) | IndexResponse | Live normalized price index (filter by source/gpuClass/region) |
| stats() | StatsResponse | Aggregated index stats |
Jobs (on-chain)
| Method | Returns | Description |
|---|---|---|
| submit(spec, signer, opts?) | SubmitResult | Route + escrow deposit (signed by signer) + dispatch → jobId |
| status(jobId) | JobStatus | Poll job phase, endpointUrl, settlement tx |
| endpoint(jobId) | string | Public Quiver URL to the running container |
spec (SubmitJobSpec): { gpuClass, durationHours, region?, vramGb?, reliabilityFloor?, image?, port? }.
opts: { rpcUrl?, commitment?, programId?, provider? } (defaults to devnet + the deployed program).
Auth & governance
getNonce(wallet), login(wallet, signatureBase58), me(),
listProposals(status?), getProposal(id), createProposal(...), vote(id, choice).
Notes
submit()signs a real Solana escrowdeposit_fundstransaction with the providedKeypair(built for backend / AI-agent use). In the browser, build the same instruction with a wallet adapter.- The job runs for the paid duration on a real provider GPU;
endpointUrlappears once the container is serving. - Errors throw
QuiverApiError { status, message, body }.
MIT
