@oydual31/more-vaults-sdk 0.1.5 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -347,4 +347,70 @@ declare function isOnHubChain(currentChainId: number, topology: VaultTopology):
347
347
  */
348
348
  declare function getAllVaultChainIds(topology: VaultTopology): number[];
349
349
 
350
- export { type AsyncRequestStatus as A, type DepositBlockReason as D, type MaxWithdrawable as M, OMNI_FACTORY_ADDRESS as O, type UserBalances as U, type VaultMetadata as V, type AsyncRequestStatusInfo as a, type DepositEligibility as b, type UserPosition as c, type VaultMode as d, type VaultStatus as e, type VaultSummary as f, type VaultTopology as g, canDeposit as h, ensureAllowance as i, getAllVaultChainIds as j, getAsyncRequestStatus as k, getAsyncRequestStatusLabel as l, getFullVaultTopology as m, getMaxWithdrawable as n, getUserBalances as o, getUserPosition as p, getVaultMetadata as q, getVaultStatus as r, getVaultSummary as s, getVaultTopology as t, isAsyncMode as u, isOnHubChain as v, previewDeposit as w, previewRedeem as x, quoteLzFee as y };
350
+ interface SpokeBalance {
351
+ chainId: number;
352
+ totalAssets: bigint;
353
+ /** false if the RPC call to this spoke failed */
354
+ isReachable: boolean;
355
+ }
356
+ interface VaultDistribution {
357
+ hubChainId: number;
358
+ /** Underlying token balance idle on the hub (not deployed to strategies) */
359
+ hubLiquidBalance: bigint;
360
+ /** Hub totalAssets minus hubLiquidBalance (capital in Morpho, Aave, etc.) */
361
+ hubStrategyBalance: bigint;
362
+ /** Hub vault totalAssets() */
363
+ hubTotalAssets: bigint;
364
+ /** What the hub's accounting thinks is deployed on spokes */
365
+ spokesDeployedBalance: bigint;
366
+ /** Actual per-spoke balances read directly from each spoke chain */
367
+ spokeBalances: SpokeBalance[];
368
+ /** hubTotalAssets + sum of reachable spoke totalAssets */
369
+ totalActual: bigint;
370
+ oracleAccountingEnabled: boolean;
371
+ }
372
+ /**
373
+ * Read the full cross-chain capital distribution of a vault.
374
+ *
375
+ * Queries the hub for its status, then reads `totalAssets()` on each spoke
376
+ * chain in parallel. Spoke calls are individually wrapped so a single
377
+ * unreachable RPC never fails the entire call.
378
+ *
379
+ * @param hubClient Public client connected to the hub chain
380
+ * @param vault Vault address (same on all chains via CREATE3)
381
+ * @param spokeClients Map of chainId → PublicClient for each spoke chain
382
+ *
383
+ * @example
384
+ * ```ts
385
+ * const dist = await getVaultDistribution(baseClient, VAULT, {
386
+ * [1]: ethClient,
387
+ * [42161]: arbClient,
388
+ * })
389
+ * console.log(`Hub liquid: ${dist.hubLiquidBalance}`)
390
+ * console.log(`Total actual: ${dist.totalActual}`)
391
+ * ```
392
+ */
393
+ declare function getVaultDistribution(hubClient: PublicClient, vault: Address, spokeClients: Record<number, PublicClient>): Promise<VaultDistribution>;
394
+ /**
395
+ * Hub-only distribution — uses topology to discover spokes but does NOT
396
+ * read spoke chains (no spoke clients needed).
397
+ *
398
+ * Returns hub data plus the list of spoke chainIds from the factory.
399
+ * `spokeBalances` will be empty — callers must provide spoke clients to
400
+ * `getVaultDistribution` for actual spoke reads.
401
+ *
402
+ * @param hubClient Public client connected to the hub chain
403
+ * @param vault Vault address
404
+ *
405
+ * @example
406
+ * ```ts
407
+ * const dist = await getVaultDistributionWithTopology(baseClient, VAULT)
408
+ * // dist.spokeBalances === [] (no spoke clients provided)
409
+ * // dist.spokeChainIds tells you which chains to query
410
+ * ```
411
+ */
412
+ declare function getVaultDistributionWithTopology(hubClient: PublicClient, vault: Address): Promise<VaultDistribution & {
413
+ spokeChainIds: number[];
414
+ }>;
415
+
416
+ export { type AsyncRequestStatus as A, previewRedeem as B, quoteLzFee as C, type DepositBlockReason as D, type MaxWithdrawable as M, OMNI_FACTORY_ADDRESS as O, type SpokeBalance as S, type UserBalances as U, type VaultDistribution as V, type AsyncRequestStatusInfo as a, type DepositEligibility as b, type UserPosition as c, type VaultMetadata as d, type VaultMode as e, type VaultStatus as f, type VaultSummary as g, type VaultTopology as h, canDeposit as i, ensureAllowance as j, getAllVaultChainIds as k, getAsyncRequestStatus as l, getAsyncRequestStatusLabel as m, getFullVaultTopology as n, getMaxWithdrawable as o, getUserBalances as p, getUserPosition as q, getVaultDistribution as r, getVaultDistributionWithTopology as s, getVaultMetadata as t, getVaultStatus as u, getVaultSummary as v, getVaultTopology as w, isAsyncMode as x, isOnHubChain as y, previewDeposit as z };
@@ -347,4 +347,70 @@ declare function isOnHubChain(currentChainId: number, topology: VaultTopology):
347
347
  */
348
348
  declare function getAllVaultChainIds(topology: VaultTopology): number[];
349
349
 
350
- export { type AsyncRequestStatus as A, type DepositBlockReason as D, type MaxWithdrawable as M, OMNI_FACTORY_ADDRESS as O, type UserBalances as U, type VaultMetadata as V, type AsyncRequestStatusInfo as a, type DepositEligibility as b, type UserPosition as c, type VaultMode as d, type VaultStatus as e, type VaultSummary as f, type VaultTopology as g, canDeposit as h, ensureAllowance as i, getAllVaultChainIds as j, getAsyncRequestStatus as k, getAsyncRequestStatusLabel as l, getFullVaultTopology as m, getMaxWithdrawable as n, getUserBalances as o, getUserPosition as p, getVaultMetadata as q, getVaultStatus as r, getVaultSummary as s, getVaultTopology as t, isAsyncMode as u, isOnHubChain as v, previewDeposit as w, previewRedeem as x, quoteLzFee as y };
350
+ interface SpokeBalance {
351
+ chainId: number;
352
+ totalAssets: bigint;
353
+ /** false if the RPC call to this spoke failed */
354
+ isReachable: boolean;
355
+ }
356
+ interface VaultDistribution {
357
+ hubChainId: number;
358
+ /** Underlying token balance idle on the hub (not deployed to strategies) */
359
+ hubLiquidBalance: bigint;
360
+ /** Hub totalAssets minus hubLiquidBalance (capital in Morpho, Aave, etc.) */
361
+ hubStrategyBalance: bigint;
362
+ /** Hub vault totalAssets() */
363
+ hubTotalAssets: bigint;
364
+ /** What the hub's accounting thinks is deployed on spokes */
365
+ spokesDeployedBalance: bigint;
366
+ /** Actual per-spoke balances read directly from each spoke chain */
367
+ spokeBalances: SpokeBalance[];
368
+ /** hubTotalAssets + sum of reachable spoke totalAssets */
369
+ totalActual: bigint;
370
+ oracleAccountingEnabled: boolean;
371
+ }
372
+ /**
373
+ * Read the full cross-chain capital distribution of a vault.
374
+ *
375
+ * Queries the hub for its status, then reads `totalAssets()` on each spoke
376
+ * chain in parallel. Spoke calls are individually wrapped so a single
377
+ * unreachable RPC never fails the entire call.
378
+ *
379
+ * @param hubClient Public client connected to the hub chain
380
+ * @param vault Vault address (same on all chains via CREATE3)
381
+ * @param spokeClients Map of chainId → PublicClient for each spoke chain
382
+ *
383
+ * @example
384
+ * ```ts
385
+ * const dist = await getVaultDistribution(baseClient, VAULT, {
386
+ * [1]: ethClient,
387
+ * [42161]: arbClient,
388
+ * })
389
+ * console.log(`Hub liquid: ${dist.hubLiquidBalance}`)
390
+ * console.log(`Total actual: ${dist.totalActual}`)
391
+ * ```
392
+ */
393
+ declare function getVaultDistribution(hubClient: PublicClient, vault: Address, spokeClients: Record<number, PublicClient>): Promise<VaultDistribution>;
394
+ /**
395
+ * Hub-only distribution — uses topology to discover spokes but does NOT
396
+ * read spoke chains (no spoke clients needed).
397
+ *
398
+ * Returns hub data plus the list of spoke chainIds from the factory.
399
+ * `spokeBalances` will be empty — callers must provide spoke clients to
400
+ * `getVaultDistribution` for actual spoke reads.
401
+ *
402
+ * @param hubClient Public client connected to the hub chain
403
+ * @param vault Vault address
404
+ *
405
+ * @example
406
+ * ```ts
407
+ * const dist = await getVaultDistributionWithTopology(baseClient, VAULT)
408
+ * // dist.spokeBalances === [] (no spoke clients provided)
409
+ * // dist.spokeChainIds tells you which chains to query
410
+ * ```
411
+ */
412
+ declare function getVaultDistributionWithTopology(hubClient: PublicClient, vault: Address): Promise<VaultDistribution & {
413
+ spokeChainIds: number[];
414
+ }>;
415
+
416
+ export { type AsyncRequestStatus as A, previewRedeem as B, quoteLzFee as C, type DepositBlockReason as D, type MaxWithdrawable as M, OMNI_FACTORY_ADDRESS as O, type SpokeBalance as S, type UserBalances as U, type VaultDistribution as V, type AsyncRequestStatusInfo as a, type DepositEligibility as b, type UserPosition as c, type VaultMetadata as d, type VaultMode as e, type VaultStatus as f, type VaultSummary as g, type VaultTopology as h, canDeposit as i, ensureAllowance as j, getAllVaultChainIds as k, getAsyncRequestStatus as l, getAsyncRequestStatusLabel as m, getFullVaultTopology as n, getMaxWithdrawable as o, getUserBalances as p, getUserPosition as q, getVaultDistribution as r, getVaultDistributionWithTopology as s, getVaultMetadata as t, getVaultStatus as u, getVaultSummary as v, getVaultTopology as w, isAsyncMode as x, isOnHubChain as y, previewDeposit as z };
@@ -11,7 +11,7 @@ var CHAIN_IDS = {
11
11
  ethereum: 1
12
12
  };
13
13
  var LZ_EIDS = {
14
- flowMainnet: 30332,
14
+ flowMainnet: 30336,
15
15
  flowTestnet: 30333,
16
16
  arbitrum: 30110,
17
17
  base: 30184,