Client SDKs
TypeScript SDKs for building and reading on the Sui rail. They wrap the same contract as the REST API — anything they do, you can also do with plain HTTP.
:::info SDK release status
@tbookdev/vault-sdk-sui, @tbookdev/vault-react-sui, and @tbookdev/vault-node are published on the public npm registry — install them with npm install like any other dependency. The REST contract is the normative interface.
:::
Packages
| Package | Purpose |
|---|---|
@tbookdev/vault-sdk-sui | Sui rail: reads + unsigned PTB builders (rcUSDP vault, XAUa AlphaVault) |
@tbookdev/vault-react-sui | Headless React hooks on top of the Sui SDK — see React Hooks |
@tbookdev/vault-node | Server-side: typed API client + webhook verification — see Server SDK |
What client SDKs are for
Use @tbookdev/vault-sdk-sui when you build transactions in the browser (or any environment with your own signer) against a connected wallet, rather than through your backend. The SDK produces unsigned transaction bytes — no signing, no React:
import { SuiGrpcClient } from "@mysten/sui/grpc";
import { getSuiVaultConfig, buildDepositTx } from "@tbookdev/vault-sdk-sui";
// @mysten/sui 2.x — Sui's network-wide JSON-RPC service was switched off in
// July 2026, so builders take a gRPC (or GraphQL) client.
const client = new SuiGrpcClient({
network: "testnet",
baseUrl: "https://fullnode.testnet.sui.io:443",
});
const vault = getSuiVaultConfig("rcusdp-sui", "testnet");
// Amounts are raw USDC units (6 decimals): 100.00 USDC = 100_000_000n
const { txBytesBase64, message } = await buildDepositTx(client, vault, {
sender: wallet.address,
amount: 100_000_000n,
});
// sign with @mysten/dapp-kit-react: useDAppKit().signAndExecuteTransaction({ transaction: txBytesBase64 })
The full builder set covers the rcUSDP lifecycle — buildDepositTx, buildQueueRedeemTx, buildInstantRedeemTx, buildCancelDepositTx, buildClaimTx, buildTransferUsdcTx — plus reads (getUserPosition, getVaultState, getUserRecords) and XAUa AlphaVault helpers (getAlphaVaultConfig, buildSubscribeTx, buildRequestRedemptionTx, buildCancelRequestTx, buildClaimUsdcTx, getAlphaPosition). Transient RPC failures can be wrapped with the exported withRetry helper, which recognises gRPC transport statuses (UNAVAILABLE, DEADLINE_EXCEEDED, RESOURCE_EXHAUSTED) as well as HTTP ones.
For server-driven integrations (most fintech apps, all omnibus/treasury setups), prefer the REST API — it adds intent tracking, idempotency, and attribution automatically.