/** * Stellar Vault Types */ import type { IStellarNetwork } from '../../types/web3'; export type { IStellarNetwork }; /** Parameters for building an unsigned Stellar vault deposit transaction. */ export interface IStellarDepositParams { contractId: string; amount: string; senderAddress: string; network: IStellarNetwork; /** * Optional override Soroban RPC endpoint (e.g. a keyed Alchemy URL). When set * it is the primary, with the SDK's public endpoints kept behind it as * failover. */ sorobanRpcUrl?: string; } /** Parameters for building an unsigned Stellar vault redeem transaction. */ export interface IStellarRedeemParams { contractId: string; shares: string; receiverAddress: string; network: IStellarNetwork; /** * Optional override Soroban RPC endpoint (e.g. a keyed Alchemy URL). When set * it is the primary, with the SDK's public endpoints kept behind it as * failover. */ sorobanRpcUrl?: string; } /** * User vault position returned by on-chain balance queries. * * `decimals` carries the share-token scale used to interpret `shares`. When the * on-chain `decimals()` read fails, it falls back to STELLAR_FALLBACK_DECIMALS * (7) and `decimalsFromFallback` is set to `true`. Callers that size a redeem * from this position MUST check `decimalsFromFallback` and refuse to settle * when it is `true` — trusting a fabricated 7 against an ERC4626 offset vault * (share decimals = asset + offset) under-redeems by `10^offset`. */ export interface IStellarUserPosition { /** Raw share balance in smallest unit, as a non-negative integer string */ shares: string; /** Share-token decimals; may be the fallback — see `decimalsFromFallback`. */ decimals: number; /** * `true` when `decimals` is the fallback (the on-chain `decimals()` read * failed), `false` when it is the authoritative on-chain value. Treat `true` * as a decimals read failure: do not trust `decimals` to scale or redeem. * * Optional for source back-compat (a consumer's existing object literal still * compiles), but `getStellarUserPosition` always populates it — so a position * obtained from the SDK never omits it. */ decimalsFromFallback?: boolean; }