Skip to main content
The tusky.account module provides access to your account details, managed wallet information, and usage statistics. Use it to check balances, monitor consumption, and integrate billing visibility into your applications.

Get Account Details

Retrieve your account information and managed wallet status:
const account = await tusky.account.get();

console.log("Account ID:", account.id);
console.log("Email:", account.email);
console.log("Plan:", account.plan);

Managed Wallet

Every Tusky account includes a dedicated managed wallet used for publishing blobs to the Walrus network. Check your wallet balance at any time:
const account = await tusky.account.get();
const wallet = account.managedWallet;

console.log("Wallet address:", wallet.address);
console.log("SUI balance:", wallet.suiBalance);
console.log("WAL balance:", wallet.walBalance);
Your managed wallet is automatically provisioned when you create your Tusky account. Fund it via prepaid deposits to ensure uninterrupted uploads.

Account Object

FieldTypeDescription
idstringUnique account identifier.
emailstring | nullAssociated email address if set.
planstringCurrent billing plan (free, pro, enterprise).
managedWalletobjectManaged wallet details (see below).
createdAtstringISO 8601 account creation timestamp.

Managed Wallet Object

FieldTypeDescription
addressstringSui address of the managed wallet.
suiBalancestringCurrent SUI balance (in MIST).
walBalancestringCurrent WAL balance.

Get Usage Statistics

Monitor your storage consumption and API usage:
const usage = await tusky.account.usage();

console.log("Uploads:", usage.uploads);
console.log("Deletions:", usage.deletions);
console.log("Extends:", usage.extends);
console.log("Ingress:", usage.ingressBytes, "bytes");
console.log("Egress:", usage.egressBytes, "bytes");
console.log("Storage used:", usage.usedBytes, "bytes");
console.log("Active files:", usage.activeFiles);
console.log("Expired files:", usage.expiredFiles);
console.log("Blobs:", usage.blobs);
console.log("Quilts:", usage.quilts);
console.log("Environments:", usage.environments);
console.log("Publishers:", usage.publishers);
console.log("Aggregators:", usage.aggregators);
console.log("SUI spent:", usage.suiSpent);
console.log("WAL spent:", usage.walSpent);

Usage Object

FieldTypeDescription
uploadsnumberNumber of file uploads in the period.
deletionsnumberNumber of file deletions in the period.
extendsnumberNumber of storage extensions in the period.
ingressBytesnumberData uploaded in the period (bytes).
egressBytesnumberData downloaded / served via aggregators in the period (bytes).
usedBytesnumberTotal bytes currently stored on Walrus.
activeFilesnumberNumber of active files.
expiredFilesnumberNumber of files whose storage epochs have already expired.
blobsnumberNumber of Walrus blobs currently stored (standalone blobs).
quiltsnumberNumber of Walrus quilts currently stored (batched blobs).
environmentsnumberNumber of environments on the account.
publishersnumberNumber of publishers on the account.
aggregatorsnumberNumber of aggregators on the account.
suiSpentstringSUI spent in the period (gas fees + conversions).
walSpentstringWAL spent in the period (Walrus storage).
Use tusky.account.usage() in monitoring dashboards or alerting systems to track consumption and avoid unexpected charges.

Complete Example

import { Tusky } from "@tusky-io/ts-sdk";

const tusky = new Tusky({ apiKey: process.env.TUSKY_API_KEY });

// Account overview
const account = await tusky.account.get();
console.log(`Account: ${account.id} (${account.plan})`);
console.log(`Wallet: ${account.managedWallet.address}`);
console.log(`SUI: ${account.managedWallet.suiBalance}`);
console.log(`WAL: ${account.managedWallet.walBalance}`);

// Usage stats
const usage = await tusky.account.usage();
console.log(`Uploads: ${usage.uploads}`);
console.log(`Deletions: ${usage.deletions}`);
console.log(`Extends: ${usage.extends}`);
console.log(`Storage: ${(usage.usedBytes / 1e9).toFixed(2)} GB`);
console.log(`Active files: ${usage.activeFiles}`);
console.log(`Blobs: ${usage.blobs}, Quilts: ${usage.quilts}`);
console.log(`Egress: ${(usage.egressBytes / 1e9).toFixed(2)} GB`);

What’s Next