Integration
Widget and API
Widget SDK Integration
The widget SDK is not published yet — @ditto-network/sdk is not yet available on npm, and the snippet below describes the planned interface. If you want it for your app, contact us and we will get you into the private beta. The REST API below is live today.
The easiest way to integrate the Yield Split Vault will be our React SDK. It provides a fully responsive, themed UI for deposits, withdrawals, and analytics.
Installation
npm install @ditto-network/sdk lucide-reactBasic Usage
import { VaultCard, PositionCard, HistoricChart, HistoryCard } from '@ditto-network/sdk';
export default function YieldDashboard() {
return (
<div className="flex flex-col gap-4 max-w-md mx-auto">
{/* 1. Core Interaction */}
<VaultCard
vaultAddress="0x62507A876309639096D08E7F77AC9CfB67Df8011"
theme="dark"
/>
{/* 2. User Stats & Graph */}
<PositionCard theme="dark" />
{/* 3. Analytics */}
<HistoricChart
period="30d"
benchmark="market"
theme="dark"
/>
{/* 4. Activity */}
<HistoryCard limit={5} theme="dark" />
</div>
);
}Configuration Props
vaultAddress
string
Required
The address of the Ditto Vault.
theme
dark
light
Interface style
primaryColor
string
'text-cyan-400'
Tailwind text color class for accents.
showSwap
boolean
true
Show the Deposit/Withdraw interface.
showChart
boolean
true
Show the historical APY backtest chart.
showPosition
boolean
true
Show user balance and PnL card.
showHistory
boolean
true
Show transaction history list.
REST API Reference
For custom dashboards, use the Data API.
Base URL: https://api.dittonetwork.io
Auth: Bearer Token (Contact Sales for API Key)
The payloads below are illustrative; figures are not live values.
1 Get Vault Details
Returns TVL, current APY, and strategy allocation.
Endpoint: GET /vaults/{address}
2 Get Historical APY Series
Returns daily data points for building charts.
Endpoint: GET /series
Query Params:
vault,period(7d, 30d, 1y, all)
3 Get Global Transactions
Returns a paginated list of all vault events (User actions + Protocol actions).
Endpoint: GET /transactions
Query Params:
vault: (string) Vault addressdepositor: (string) Depositor addresstype: (string)DEPOSIT,WITHDRAW,REBALANCE,APR_UPDATElimit: (int) Default 20page: (int) Default 1
Usage Examples
Get all active vaults:
Get specific vault details:
Get a user's transactions for a vault:
Last updated

