๐คTypes
Complete TypeScript interface reference for the August Digital SDK. All types are exported from the main package.
Core Types
IAddress
Ethereum address type.
type IAddress = `0x${string}`;
Example:
const vaultAddress: IAddress = '0x1234567890abcdef1234567890abcdef12345678';
IChainId
Chain identifier type.
type IChainId = number;
Common Chain IDs:
1
: Ethereum Mainnet42161
: Arbitrum One8453
: Base56
: BSC43114
: Avalanche-1
: Solana Mainnet-2
: Solana Devnet
INormalizedNumber
Number representation with both normalized and raw values.
type INormalizedNumber = {
normalized: string; // Human-readable format (e.g., "1.5")
raw: string; // Raw blockchain format (e.g., "1500000000000000000")
};
Example:
const amount: INormalizedNumber = {
normalized: "1.5",
raw: "1500000000000000000" // 1.5 ETH in wei
};
console.log(`Amount: ${amount.normalized} ETH`);
IEnv
Environment mode for logging.
type IEnv = 'DEV' | 'PROD';
Vault Types
IVault
Complete vault information interface.
interface IVault {
// Basic Info
address: string;
chainId: number;
name: string;
logoUrl: string;
description: string;
status: 'active' | 'closed' | 'testing';
version: 'evm-0' | 'evm-1' | 'evm-2' | 'sol-0';
decimals: number;
tags: string[];
reserveTarget: number;
reserveTolerance: number;
lagDuration: number;
maxDailyDrawdown: number;
risk: string;
startDatetime: string;
// Receipt Token
receipt: {
address: string;
symbol: string;
decimals: number;
};
// Deposit Assets (includes adapter tokens when available)
depositAssets: Array<{
address: string;
symbol: string;
decimals: number;
}>;
// Vault Stats
totalAssets: INormalizedNumber;
totalSupply: INormalizedNumber;
maxSupply: INormalizedNumber;
idleAssets: INormalizedNumber;
// APY & Rewards
apy: {
apy: number;
explainer: string;
liquidApy: number;
rewardsClaimable: number;
rewardsCompounded: number;
underlyingApy: number;
};
rewards: {
points: string;
multiplier: number;
multipliers: Array<{ value: number; timestamp: number }>;
additionalPoints: string[];
};
// Management
operator: string;
strategists: Array<{
address: string;
logo: string;
name: string;
}>;
fees: {
management: number;
isManagementWaived: boolean;
performance: number;
isPerformanceWaived: boolean;
};
// Settings
isFeatured: boolean;
isVisible: boolean;
isWithdrawalPaused: boolean;
isDepositPaused: boolean;
// Optional Enrichments
loans?: IVaultLoan[];
allocations?: IVaultAllocations;
position?: IVaultPosition;
}
Example:
const vault: IVault = await sdk.getVault({
vault: '0x1234...',
chainId: 42161,
});
console.log(`Name: ${vault.name}`);
console.log(`TVL: ${vault.totalAssets.normalized}`);
console.log(`APY: ${vault.apy.apy}%`);
console.log(`Status: ${vault.status}`);
console.log(`Deposit Asset: ${vault.depositAssets[0].symbol}`);
IVaultVersion
Vault contract version.
type IVaultVersion = 'evm-0' | 'evm-1' | 'evm-2' | 'sol-0';
evm-0
: Legacy EVM vault v1.0evm-1
: Legacy EVM vault v1.5evm-2
: Current EVM vault with separate receipt tokenssol-0
: Solana program-based vault
IVaultApy
APY breakdown for a vault.
interface IVaultApy {
apy: number; // Total APY (%)
underlyingApy: number; // APY from underlying assets
liquidApy: number; // APY from liquid positions
rewardsClaimable: number; // APY from claimable rewards
rewardsCompounded: number; // APY from compounded rewards
explainer: string; // Human-readable explanation
}
Example:
const apy: IVaultApy = vault.apy;
console.log(`Total APY: ${apy.apy}%`);
console.log(`Breakdown:`);
console.log(` Underlying: ${apy.underlyingApy}%`);
console.log(` Liquid: ${apy.liquidApy}%`);
console.log(` Rewards: ${apy.rewardsClaimable + apy.rewardsCompounded}%`);
console.log(`\n${apy.explainer}`);
IVaultStrategist
Vault strategist information.
interface IVaultStrategist {
address: IAddress;
name: string;
logo: string;
}
Position Types
IVaultPosition
User's position in a vault.
interface IVaultPosition {
vault: IVault; // Full vault object
shares: INormalizedNumber; // User's share balance
balance: INormalizedNumber; // Converted asset balance
claimable: INormalizedNumber; // Claimable redemptions
availableRedemptions: IVaultAvailableRedemption[]; // Ready to claim
pendingRedemptions: IVaultAvailableRedemption[]; // Still in lag period
redeemable: INormalizedNumber; // Total redeemable amount
walletBalance: INormalizedNumber; // Receipt token balance
status: string; // Position status
}
Example:
const positions: IVaultPosition[] = await sdk.getVaultPositions({
wallet: '0xYourWallet...',
});
positions.forEach(position => {
console.log(`\nVault: ${position.vault.name}`);
console.log(`Shares: ${position.shares.normalized}`);
console.log(`Balance: ${position.balance.normalized} ${position.vault.depositAssets[0].symbol}`);
console.log(`Claimable: ${position.claimable.normalized}`);
console.log(`Available Redemptions: ${position.availableRedemptions.length}`);
});
IVaultAvailableRedemption
Redemption request that can be claimed.
type IVaultAvailableRedemption = {
id: string;
hash: string;
timestamp: number;
receiver: IAddress;
amount: INormalizedNumber;
vault: IAddress;
date: Date;
year: INormalizedNumber;
month: INormalizedNumber;
day: INormalizedNumber;
};
Example:
const redemptions: IVaultAvailableRedemption[] = await sdk.getVaultAvailableRedemptions({
vault: '0x1234...',
wallet: '0xYourWallet...',
});
redemptions.forEach(redemption => {
console.log(`Request ${redemption.id}:`);
console.log(` Amount: ${redemption.amount.normalized}`);
console.log(` Ready since: ${redemption.date.toLocaleDateString()}`);
});
Loan Types
IVaultLoan
Active loan deployed from a vault.
interface IVaultLoan {
vault: IAddress;
address: IAddress;
lender: IAddress;
borrower: IAddress;
state: string;
principalToken: IWSTokenEntry;
principalAmount: number;
initialPrincipalAmount: number;
interestAmount: number;
totalRepaid: number;
apr: number;
deployedDate: string;
paymentInterval: number;
isIdleCapital: boolean;
allocation: number;
upcomingPayment: {
amount: number;
dueDate: string;
};
}
Example:
const loans: IVaultLoan[] = await sdk.getVaultLoans({
vault: '0x1234...',
chainId: 42161,
});
loans.forEach(loan => {
console.log(`Borrower: ${loan.borrower}`);
console.log(`Principal: ${loan.principalAmount} ${loan.principalToken.symbol}`);
console.log(`APR: ${loan.apr}%`);
console.log(`State: ${loan.state}`);
console.log(`Next Payment: ${loan.upcomingPayment.amount} due ${loan.upcomingPayment.dueDate}`);
});
Allocation Types
IVaultAllocations
Vault asset allocations across different categories.
interface IVaultAllocations {
defi: IDebankProtocolExposure[]; // DeFi protocol positions
tokens: IDebankTokenExposure[]; // Token holdings
cefi: IWSSubaccountCefi[]; // CeFi exchange balances
unfilteredTokens: IDebankTokenExposure[]; // All tokens (unfiltered)
otc: Record<string, IOTCPosition>; // OTC positions
netValue?: number; // Total net value
exposurePerCategory?: IExposurePerCategory; // Categorized breakdown
defiPerBorrower: Record<`0x${string}`, { // Per-borrower DeFi
exposure: any[];
positions: any[];
}>;
}
Example:
const allocations: IVaultAllocations = await sdk.getVaultAllocations({
vault: '0x1234...',
});
console.log(`Net Value: $${allocations.netValue}`);
console.log(`DeFi Protocols: ${allocations.defi.length}`);
console.log(`Token Holdings: ${allocations.tokens.length}`);
console.log(`CeFi Balances: ${allocations.cefi.length}`);
IExposurePerCategory
Exposure breakdown by category.
type IExposurePerCategory = {
borrowing: IVaultExposureItem[];
supplying: IVaultExposureItem[];
lending: IWSSubaccountLoan[];
wallet: IVaultExposureItem[];
cefiBalance: number;
defiBalance: number;
walletBalance: number;
loanBalance: number;
};
IVaultExposureItem
Individual exposure item.
type IVaultExposureItem = {
id: string;
name: string;
symbol: string;
amount: number;
decimals: number;
chain: string;
logoUrl?: string;
protocol?: string;
exposureType?: string;
};
Reward Types
IVaultRewards
Vault rewards information.
type IVaultRewards = {
points: string;
multiplier: number;
multipliers: {
value: number;
timestamp: number;
}[];
additionalPoints: string[];
};
Example:
const rewards: IVaultRewards = vault.rewards;
console.log(`Total Points: ${rewards.points}`);
console.log(`Current Multiplier: ${rewards.multiplier}x`);
console.log(`Additional Points:`);
rewards.additionalPoints.forEach(points => {
console.log(` - ${points}`);
});
Historical Types
IVaultUserHistoryItem
User's historical transaction.
type IVaultUserHistoryItem = {
timestamp: number;
address: IAddress;
amount: INormalizedNumber;
pool: IAddress;
chainId: number;
type: 'withdraw-request' | 'deposit' | 'withdraw-processed';
transactionHash: IAddress;
};
Example:
const history: IVaultUserHistoryItem[] = await sdk.getVaultUserHistory({
wallet: '0xYourWallet...',
});
history.forEach(tx => {
const date = new Date(tx.timestamp * 1000);
console.log(`${date.toLocaleDateString()} - ${tx.type}`);
console.log(` Amount: ${tx.amount.normalized}`);
console.log(` TX: ${tx.transactionHash}`);
});
IVaultHistoricalParams
Parameters for historical data queries.
type IVaultHistoricalParams = {
daysAgo?: number;
order?: 'asc' | 'desc';
interval?: 'days' | 'weeks' | 'months' | 'years';
};
Example:
const historicalTvl = await sdk.getVaultTvl({
vault: '0x1234...',
historical: {
daysAgo: 30,
order: 'asc',
interval: 'days',
},
});
IVaultRedemptionHistoryItem
Historical redemption record.
type IVaultRedemptionHistoryItem = {
receiver: IAddress;
amount: INormalizedNumber;
processed: Date;
requested: Date;
vault: IAddress;
};
Web3 Types
IChainObj
Chain information object.
type IChainObj = {
chainId: number;
name: string;
explorer: string;
};
Example:
const arbitrum: IChainObj = {
chainId: 42161,
name: 'Arbitrum One',
explorer: 'https://arbiscan.io',
};
IProvidersConfig
RPC provider configuration.
type IProvidersConfig = Partial<Record<IChainId, string>>;
Example:
const providers: IProvidersConfig = {
1: 'https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY',
42161: 'https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY',
-1: 'https://api.mainnet-beta.solana.com',
};
ISolanaNetwork
Solana network type.
type ISolanaNetwork = 'devnet' | 'mainnet-beta' | 'testnet' | 'localnet';
Last updated