
Security News
Rust 1.100 Will Add Dependency Cooldowns to Cargo
Rust 1.100 will add opt-in dependency cooldowns to Cargo, giving security scanners and maintainers time to catch malicious crate releases.
A TypeScript library for interacting with Vana Network smart contracts, enabling data contributions, validations, and queries in a simple way.
1480 and Moksha Testnet 14800 out of the box) with easy provider configuration.npm install vana-sdk
import { VanaProvider } from "vana-sdk";
import { privateKeyToAccount } from "viem/accounts";
import { createPublicClient, createWalletClient, http } from "viem";
import { mokshaTestnet } from "vana-sdk/chains";
// Create your viem clients
const publicClient = createPublicClient({
chain: mokshaTestnet,
transport: http("https://rpc.moksha.vana.org"),
});
const signer = privateKeyToAccount("0x..."); // Your private key
const walletClient = createWalletClient({
chain: mokshaTestnet,
transport: http("https://rpc.moksha.vana.org"),
account: signer,
});
// Connect to Vana
const vana = new VanaProvider({
chainId: mokshaTestnet.id,
rpcUrl: "https://rpc.moksha.vana.org",
signer,
});
// Example file URL and encryption key
const fileUrl = "https://example.com/mydata.csv";
const dlpAddress = vana.getContractAddress("DataLiquidityPoolProxy");
const encryptedKey = await encryptFileKey(myFileEncryptionKey, dlpPublicKey);
const signerAddress = await vana.signerAddress();
// Register file in the DataRegistry with permissions
await walletClient.writeContract({
address: vana.contracts.dataRegistry.address,
abi: vana.contracts.dataRegistry.abi,
functionName: "addFileWithPermissions",
args: [
fileUrl,
signerAddress,
dlpAddress,
[{ account: dlpAddress, key: encryptedKey }],
],
});
// Get file ID from DataRegistry
const fileId = await publicClient.readContract({
address: vana.contracts.dataRegistry.address,
abi: vana.contracts.dataRegistry.abi,
functionName: "fileIdByUrl",
args: [fileUrl],
});
// Request TEE validation
await walletClient.writeContract({
address: vana.contracts.teePool.address,
abi: vana.contracts.teePool.abi,
functionName: "requestContributionProof",
args: [fileId],
});
// Wait for validation (in a real app, listen for events)
// ...wait for ProofAdded event...
// Claim reward for contribution
await walletClient.writeContract({
address: vana.contracts.dataLiquidityPool.address,
abi: vana.contracts.dataLiquidityPool.abi,
functionName: "claimReward",
args: [fileId],
});
The SDK provides a streamlined way to interact with Vana smart contracts through the VanaProvider class, which gives you access to contract addresses and ABIs, while leveraging viem's client interface for actual blockchain interactions.
The Vana SDK uses a simple pattern for contract interaction:
VanaProvider to access contract information (address and ABI)publicClient for read operations and walletClient for write operationsimport { VanaProvider } from "vana-sdk";
import { privateKeyToAccount } from "viem/accounts";
import { createPublicClient, createWalletClient, http } from "viem";
import { mokshaTestnet } from "vana-sdk/chains";
// Create viem clients
const publicClient = createPublicClient({
chain: mokshaTestnet,
transport: http("https://rpc.moksha.vana.org"),
});
const signer = privateKeyToAccount("0x...");
const walletClient = createWalletClient({
chain: mokshaTestnet,
transport: http("https://rpc.moksha.vana.org"),
account: signer,
});
// Initialize Vana provider
const vana = new VanaProvider({
chainId: mokshaTestnet.id,
rpcUrl: "https://rpc.moksha.vana.org",
signer,
});
// Read operations
const fileId = await publicClient.readContract({
address: vana.contracts.dataRegistry.address,
abi: vana.contracts.dataRegistry.abi,
functionName: "fileIdByUrl",
args: [fileUrl],
});
// Write operations
await walletClient.writeContract({
address: vana.contracts.dataRegistry.address,
abi: vana.contracts.dataRegistry.abi,
functionName: "addFile",
args: [fileUrl, owner],
});
await walletClient.writeContract({
address: vana.contracts.teePool.address,
abi: vana.contracts.teePool.abi,
functionName: "requestContributionProof",
args: [fileId],
});
The VanaProvider gives you access to the following contracts:
dataRegistry: For registering and managing data filesteePool: For managing TEE computation and validationdataLiquidityPool: For managing token rewardscomputeEngine: For execution of data analyticsThe SDK uses a type-safe approach for contract ABIs:
Contract ABI Definitions: All contract ABIs are defined as TypeScript files in the src/abi directory.
Central Registry: The abi/index.ts file provides a central registry of all available contract ABIs.
Type Safety: The SDK leverages TypeScript's type system to ensure you can only request ABIs for supported contracts:
// Access a contract's ABI
import { getAbi } from "vana-sdk";
const dataRegistryAbi = getAbi("DataRegistry");
This pattern makes it easy to extend the SDK with new contracts while maintaining full type safety.
You can extend the SDK with custom contract wrappers using the BaseContractClient if needed:
import { BaseContractClient, VanaProvider } from "vana-sdk";
import { privateKeyToAccount } from "viem/accounts";
import { createPublicClient, createWalletClient, http } from "viem";
// Create a custom client for a contract
export class MyCustomContractClient extends BaseContractClient<"DataRegistry"> {
constructor(provider: VanaProvider) {
super("DataRegistry", provider);
}
// Use with a provider
static withProvider(privateKey: string, rpcUrl: string) {
const signer = privateKeyToAccount(privateKey);
const provider = new VanaProvider({
chainId: 14800,
rpcUrl,
signer,
});
return new MyCustomContractClient(provider);
}
// Add custom methods
async addFileWithNotification(fileUrl: string, owner: string): Promise<any> {
const walletClient = createWalletClient({
transport: http(this.provider.rpcUrl),
account: this.provider.signer,
});
// Call a write function on the contract
const hash = await walletClient.writeContract({
address: this.contract.address,
abi: this.contract.abi,
functionName: "addFile",
args: [fileUrl, owner],
});
// Custom logic, like sending a notification
console.log(`File added with transaction: ${hash}`);
return hash;
}
}
src/abi – TypeScript definitions of contract ABIs for type-safe interaction.src/config – Network configuration (contract addresses, chains).src/core – Core SDK classes (provider setup, client configuration).src/contracts – Base contract interfaces and controllers.src/utils – Utility functions (encryption helpers, formatters).We welcome contributions! If you want to add support for a new feature or contract:
npm run lint to ensure ESLint passes).ProofAdded event or query completion events instead of manual polling.FAQs
A TypeScript library for interacting with Vana Network smart contracts
The npm package vana-sdk receives a total of 3 weekly downloads. As such, vana-sdk popularity was classified as not popular.
We found that vana-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Rust 1.100 will add opt-in dependency cooldowns to Cargo, giving security scanners and maintainers time to catch malicious crate releases.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.