SDK Reference

Enterprise integration surface for protocol teams and infrastructure operators.

SDK in Active Development

Our team is working hard to perfect this SDK. We are continuously improving performance, adding new features, and ensuring production-grade reliability. Stay tuned for updates and releases.

SDK Philosophy

The Vellinium SDK provides explicit, type-safe interfaces for all protocol operations. Every method clearly delineates read-only versus execution boundaries, ensuring predictable behavior and audit-friendly integration patterns.

Supported Environments

Node.js
Server-side and script integration
  • • Node.js 18.x or higher
  • • TypeScript 5.0+ recommended
  • • Full execution and read interfaces
Browser
Web application integration
  • • Modern browsers (ES2020+)
  • • Web3 wallet required for execution
  • • Read-only methods available without wallet

Execution Boundaries

Execution Methods

All methods that modify on-chain state require explicit user intent, wallet connection, and gas payment. Transactions are submitted asynchronously with receipt confirmation.

Read-Only Methods

State queries and analytics methods execute without gas cost or wallet requirement. Results are returned synchronously from RPC endpoints.

Capabilities Overview

Execution Interfaces
Write operations for vault interactions, swaps, and yield routing with full transaction control.
Read-Only Interfaces
Gas-free analytics and state queries for monitoring and integration purposes.
Event Subscriptions
Real-time event streams for position changes, routing decisions, and validation results.
Validation Utilities
Client-side validation helpers for pre-flight transaction verification.

Code Examples

Installation
Install the Vellinium SDK via npm or yarn
npm install @vellinium/sdk
# or
yarn add @vellinium/sdk
Initialization
Initialize the SDK with your configuration
import { VelliniumSDK } from '@vellinium/sdk';

const sdk = new VelliniumSDK({
  rpcUrl: 'https://mainnet.infura.io/v3/YOUR-API-KEY',
  contractAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
  network: 'mainnet'
});
Read Vault State
Query vault information without gas costs
// Query total vault value
const totalValue = await sdk.vault.getTotalValue();
console.log('Total Value:', totalValue);

// Get user position
const userPosition = await sdk.vault.getPosition(userAddress);
console.log('User Position:', userPosition);

// Check yield APY
const currentAPY = await sdk.analytics.getCurrentAPY();
console.log('Current APY:', currentAPY);
Execute Deposit
Deposit assets into a vault with full transaction control
// Connect wallet first
await sdk.connect(walletProvider);

// Prepare deposit transaction
const depositAmount = ethers.parseEther('100');
const tx = await sdk.vault.deposit({
  asset: 'USDC',
  amount: depositAmount,
  recipient: userAddress
});

// Wait for confirmation
const receipt = await tx.wait();
console.log('Deposit confirmed:', receipt.transactionHash);
Subscribe to Events
Listen to real-time protocol events
// Subscribe to deposit events
sdk.events.onDeposit((event) => {
  console.log('New deposit:', event);
  console.log('User:', event.user);
  console.log('Amount:', event.amount);
});

// Subscribe to rebalance events
sdk.events.onRebalance((event) => {
  console.log('Rebalance executed:', event);
  console.log('From:', event.fromStrategy);
  console.log('To:', event.toStrategy);
});

// Unsubscribe when done
sdk.events.removeAllListeners();
Validation Utilities
Pre-flight transaction validation
// Validate deposit before execution
const validation = await sdk.validate.deposit({
  asset: 'USDC',
  amount: depositAmount,
  recipient: userAddress
});

if (!validation.valid) {
  console.error('Validation failed:', validation.errors);
  return;
}

// Proceed with deposit
const tx = await sdk.vault.deposit({...});

Installation & Usage

Comprehensive installation instructions, code examples, and integration patterns are available in the full documentation. SDK methods follow explicit naming conventions to distinguish execution from query operations.

View Integration Guide