import type { IAddress } from './web3'; export interface ISubgraphBase { id: string; contractId_: IAddress; timestamp_: string; transactionHash_: IAddress; block_number: string; } export interface ISubgraphUserHistoryItem extends ISubgraphBase { address: IAddress; amount: string; type: 'withdraw-request' | 'deposit' | 'withdraw-processed'; decimals?: number; isInstant?: boolean; /** * Receipt-token (vault share) amount burned, raw base units. Present on * withdraw-request rows: an async withdrawal burns shares up front, but the * assets ultimately received are only known once the request settles (share * price can move). Consumers showing a pending request should surface these * shares (the concrete on-chain fact) rather than the request's `assets` * preview. Absent on deposits and settled withdraws. */ shares?: string; /** * Deposit asset token address, when known. Pre-deposit vaults accept * multiple deposit assets with differing decimals (e.g. USDS at 18, * USDC at 6), so `amount` cannot be normalized with the vault's own * decimals alone — consumers (notably lifetime PnL) key off this address * to resolve the correct per-asset decimals and USD price. Absent for * single-asset vaults, where the vault `decimals` is correct. */ assetIn?: IAddress; } export interface ISubgraphWithdrawProccessed extends ISubgraphBase { processedOn: string; requestedOn: string; receiverAddr: IAddress; assetsAmount: string; } export interface ISubgraphDeposit extends ISubgraphBase { assets: string; sender: IAddress; shares: string; owner: IAddress; senderAddr?: IAddress; amountIn?: string; /** * Deposit asset token address (evm-2 / pre-deposit vaults). The deposited * asset can differ from the vault's underlying and carry different decimals * (e.g. RLUSD at 18 into a 6-decimal sentUSD vault), so `amountIn` must be * normalized against this token's decimals, not the vault's. Absent for * single-asset vaults. */ assetIn?: IAddress; } export interface ISubgraphWithdrawRequest extends ISubgraphBase { day: string; month: string; year: string; shares: string; assets: string; receiverAddr: IAddress; ownerAddr: IAddress; } export interface ISubgraphWithdraw extends ISubgraphBase { receiver: IAddress; sender: string; assets: string; } /** * A `ReserveDeposit(account, shares, assets)` event: a deposit that mints * shares to `account` without an ERC-4626 `Deposit` event. High Growth ETH * emits it for deposits made through Kelp's gain adapter. */ export interface ISubgraphReserveDeposit extends ISubgraphBase { account: IAddress; shares: string; assets: string; } export interface ISubgraphTransfer extends ISubgraphBase { from: IAddress; to: IAddress; value: string; }