@steerprotocol/sdk 4.0.0-next.3 → 4.0.0-next.4
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.
- package/README.md +17 -0
- package/dist/index.cjs +27 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -13
- package/dist/index.d.mts +18 -13
- package/dist/index.mjs +27 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -422,9 +422,9 @@ export declare class VaultResolver {
|
|
|
422
422
|
readonly amms: DeploymentRegistry<AmmAdapter>;
|
|
423
423
|
readonly lending: DeploymentRegistry<LendingAdapter>;
|
|
424
424
|
constructor(definition: VaultResolverDefinition, amms: DeploymentRegistry<AmmAdapter>, lending: DeploymentRegistry<LendingAdapter>);
|
|
425
|
-
resolve(steer: SteerNetwork, address: Address, options?:
|
|
425
|
+
resolve(steer: SteerNetwork, address: Address, options?: VaultLoadOptions): Promise<KnownSteerVault>;
|
|
426
426
|
/** Bounded bulk identity pages at one block; compatibility uses four active loads. */
|
|
427
|
-
resolveMany(steer: SteerNetwork, addresses: readonly Address[], options?:
|
|
427
|
+
resolveMany(steer: SteerNetwork, addresses: readonly Address[], options?: VaultLoadOptions): Promise<readonly KnownSteerVault[]>;
|
|
428
428
|
/** Identity and accounting share a pinned block; dispatch custom constructors and methods. */
|
|
429
429
|
snapshots(steer: SteerNetwork, addresses: readonly Address[], options?: ReadOptions): Promise<readonly LiquidityVaultSnapshot[]>;
|
|
430
430
|
}
|
|
@@ -450,13 +450,13 @@ export declare class SteerNetwork {
|
|
|
450
450
|
get subgraphUrl(): string | undefined;
|
|
451
451
|
listUserVaults(request: UserVaultListRequest, options?: DataAdapterRequestOptions): Promise<UserVaultPage>;
|
|
452
452
|
listVaults(request?: VaultListRequest, options?: DataAdapterRequestOptions): Promise<Page<VaultMetadata>>;
|
|
453
|
-
getVault(address: Address, options?:
|
|
454
|
-
getVaults(addresses: readonly Address[], options?:
|
|
453
|
+
getVault(address: Address, options?: VaultLoadOptions): Promise<KnownSteerVault>;
|
|
454
|
+
getVaults(addresses: readonly Address[], options?: VaultLoadOptions): Promise<readonly KnownSteerVault[]>;
|
|
455
455
|
getVaultSnapshots(addresses: readonly Address[], options?: ReadOptions): Promise<readonly LiquidityVaultSnapshot<LiquidityPool>[]>;
|
|
456
456
|
getVaultUserPositions(addresses: readonly Address[], account: Address, options?: ReadOptions): Promise<readonly VaultUserPosition[]>;
|
|
457
|
-
getLiquidityVault(address: Address, options?:
|
|
458
|
-
getLendingVault(address: Address, options?:
|
|
459
|
-
getCompositeVault(address: Address, options?:
|
|
457
|
+
getLiquidityVault(address: Address, options?: VaultLoadOptions): Promise<LiquidityVault>;
|
|
458
|
+
getLendingVault(address: Address, options?: VaultLoadOptions): Promise<LendingVault>;
|
|
459
|
+
getCompositeVault(address: Address, options?: VaultLoadOptions): Promise<CompositeVault>;
|
|
460
460
|
}
|
|
461
461
|
//#endregion
|
|
462
462
|
//#region src/vault/vault.d.ts
|
|
@@ -520,6 +520,11 @@ interface VaultMetadata {
|
|
|
520
520
|
readonly id: string;
|
|
521
521
|
} | null;
|
|
522
522
|
}
|
|
523
|
+
/** Loading options. Supplied indexed metadata never replaces onchain identity checks. */
|
|
524
|
+
interface VaultLoadOptions extends ReadOptions {
|
|
525
|
+
/** Complete records for the requested addresses; omit to fetch from the subgraph. */
|
|
526
|
+
readonly metadata?: readonly VaultMetadata[];
|
|
527
|
+
}
|
|
523
528
|
interface VaultListRequest extends PageRequest {
|
|
524
529
|
/** Select a configured AMM using the same protocol/version rules as getAmm(). */
|
|
525
530
|
readonly amm?: VaultAmmFilter;
|
|
@@ -3545,15 +3550,15 @@ export declare class SteerClient {
|
|
|
3545
3550
|
readonly amm: InfinityCLAdapter;
|
|
3546
3551
|
})[]>;
|
|
3547
3552
|
getPools(request: PoolsLookupRequest): Promise<readonly DiscoveredPool[]>;
|
|
3548
|
-
getVault(chainId: number, address: Address, options?:
|
|
3549
|
-
getVaults(chainId: number, addresses: readonly Address[], options?:
|
|
3553
|
+
getVault(chainId: number, address: Address, options?: VaultLoadOptions): Promise<KnownSteerVault>;
|
|
3554
|
+
getVaults(chainId: number, addresses: readonly Address[], options?: VaultLoadOptions): Promise<readonly KnownSteerVault[]>;
|
|
3550
3555
|
getVaultSnapshots(chainId: number, addresses: readonly Address[], options?: ReadOptions): Promise<readonly LiquidityVaultSnapshot<LiquidityPool>[]>;
|
|
3551
3556
|
getVaultUserPositions(chainId: number, addresses: readonly Address[], account: Address, options?: ReadOptions): Promise<readonly VaultUserPosition[]>;
|
|
3552
3557
|
listUserVaults(request: UserVaultDiscoveryRequest, options?: DataAdapterRequestOptions): Promise<UserVaultPage>;
|
|
3553
3558
|
listVaults(request: VaultDiscoveryRequest, options?: DataAdapterRequestOptions): Promise<Page<VaultMetadata>>;
|
|
3554
|
-
getLiquidityVault(chainId: number, address: Address, options?:
|
|
3555
|
-
getLendingVault(chainId: number, address: Address, options?:
|
|
3556
|
-
getCompositeVault(chainId: number, address: Address, options?:
|
|
3559
|
+
getLiquidityVault(chainId: number, address: Address, options?: VaultLoadOptions): Promise<LiquidityVault<AmmAdapter<unknown, unknown, Readonly<Record<string, ContractDeployment>>, unknown>, LiquidityPool>>;
|
|
3560
|
+
getLendingVault(chainId: number, address: Address, options?: VaultLoadOptions): Promise<LendingVault<LendingAdapter<unknown, unknown, Readonly<Record<string, ContractDeployment>>>>>;
|
|
3561
|
+
getCompositeVault(chainId: number, address: Address, options?: VaultLoadOptions): Promise<CompositeVault>;
|
|
3557
3562
|
}
|
|
3558
3563
|
//#endregion
|
|
3559
3564
|
//#region src/data/uniswap-v3.d.ts
|
|
@@ -3670,5 +3675,5 @@ export declare class UniswapV4Vault extends LiquidityVault<UniswapV4Adapter, V4V
|
|
|
3670
3675
|
prepareDeposit(request: PrepareDepositRequest, options?: ReadOptions): Promise<DepositPlan>;
|
|
3671
3676
|
}
|
|
3672
3677
|
//#endregion
|
|
3673
|
-
export { type AerodromeDepositPlan, type AerodromeDepositPreview, type AerodromeVaultSnapshot, type AerodromeWithdrawPlan, type AerodromeWithdrawPreview, type AlgebraContracts, type AlgebraIntegralContracts, type AlgebraIntegralPoolState, type AlgebraLegacyContracts, type AlgebraLegacyPoolLookupRequest, type AlgebraLegacyPoolState, type AlgebraLegacyPoolsLookupRequest, type AlgebraPoolLookupRequest, type AlgebraPoolReference, type AlgebraPoolState, type AlgebraPoolsLookupRequest, type AlgebraSwapFee, type AmmLookupRequest, type AmmProtocolAdapter, type AmmProtocolAdapters, type AmmProtocolVersion, type AmmVersion, type AssetAmount, type ConcentratedPoolState, type DepositPlan, type DepositPreview, type DepositQuote, type DepositRequest, type DiscoveredPool, type IndexerConfig, type InfinityCLContracts, type InfinityCLDirectionalFees, type InfinityCLPoolFees, type InfinityCLPoolIdReference, type InfinityCLPoolKey, type InfinityCLPoolKeyInput, type InfinityCLPoolLookupRequest, type InfinityCLPoolReference, type InfinityCLPoolState, type InfinityCLPoolsLookupRequest, type InfinityCLSwapQuoteRequest, type KnownSteerVault, type LiquidityDepositPreview, type LiquidityDepth, type LiquidityDepthRequest, type LiquidityDistribution, type LiquidityFees, type LiquidityInterval, type LiquidityPool, type LiquidityPosition, type LiquidityPositionRange, type LiquidityVaultRewards, type LiquidityVaultSnapshot, type LiquidityVaultUserPosition, type LogEvent, type Logger, type PoolLookupRequest, type PoolPrice, type PoolReadOptions, type PoolState, type PoolTicks, type PoolTokenBalance, type PoolsLookupRequest, type PrepareDepositRequest, type PrepareWithdrawRequest, type SlipstreamContracts, type SlipstreamPoolFees, type SlipstreamPoolLookupRequest, type SlipstreamPoolState, type SlipstreamPoolsLookupRequest, type SlipstreamQuoteOptions, type StrategyPosition, type SurroundingTicks, type SwapQuote, type SwapQuoteRequest, type TheGraphIndexerConfig, type TickLiquidity, type TickPoolState, type TickRange, type TokenPairAmounts, type UserVaultDiscoveryRequest, type UserVaultListRequest, type UserVaultPage, type V3Contracts, type V3PoolFees, type V3PoolLookupRequest, type V3PoolState, type V3PoolsLookupRequest, type V4Contracts, type V4DirectionalFees, type V4PoolFees, type V4PoolKey, type V4PoolLookupRequest, type V4PoolReference, type V4PoolState, type V4PoolsLookupRequest, type V4ReadOptions, type V4SwapQuoteRequest, type V4VaultPool, type VaultAmmFilter, type VaultDiscoveryRequest, type VaultListRequest, type VaultMetadata, type VaultRewardPayout, type VaultUnderlying, type VaultUserPosition, type WithdrawPlan, type WithdrawPreview, type WithdrawRequest, type WithdrawRewards, ethereumContracts as mainnetContracts };
|
|
3678
|
+
export { type AerodromeDepositPlan, type AerodromeDepositPreview, type AerodromeVaultSnapshot, type AerodromeWithdrawPlan, type AerodromeWithdrawPreview, type AlgebraContracts, type AlgebraIntegralContracts, type AlgebraIntegralPoolState, type AlgebraLegacyContracts, type AlgebraLegacyPoolLookupRequest, type AlgebraLegacyPoolState, type AlgebraLegacyPoolsLookupRequest, type AlgebraPoolLookupRequest, type AlgebraPoolReference, type AlgebraPoolState, type AlgebraPoolsLookupRequest, type AlgebraSwapFee, type AmmLookupRequest, type AmmProtocolAdapter, type AmmProtocolAdapters, type AmmProtocolVersion, type AmmVersion, type AssetAmount, type ConcentratedPoolState, type DepositPlan, type DepositPreview, type DepositQuote, type DepositRequest, type DiscoveredPool, type IndexerConfig, type InfinityCLContracts, type InfinityCLDirectionalFees, type InfinityCLPoolFees, type InfinityCLPoolIdReference, type InfinityCLPoolKey, type InfinityCLPoolKeyInput, type InfinityCLPoolLookupRequest, type InfinityCLPoolReference, type InfinityCLPoolState, type InfinityCLPoolsLookupRequest, type InfinityCLSwapQuoteRequest, type KnownSteerVault, type LiquidityDepositPreview, type LiquidityDepth, type LiquidityDepthRequest, type LiquidityDistribution, type LiquidityFees, type LiquidityInterval, type LiquidityPool, type LiquidityPosition, type LiquidityPositionRange, type LiquidityVaultRewards, type LiquidityVaultSnapshot, type LiquidityVaultUserPosition, type LogEvent, type Logger, type PoolLookupRequest, type PoolPrice, type PoolReadOptions, type PoolState, type PoolTicks, type PoolTokenBalance, type PoolsLookupRequest, type PrepareDepositRequest, type PrepareWithdrawRequest, type SlipstreamContracts, type SlipstreamPoolFees, type SlipstreamPoolLookupRequest, type SlipstreamPoolState, type SlipstreamPoolsLookupRequest, type SlipstreamQuoteOptions, type StrategyPosition, type SurroundingTicks, type SwapQuote, type SwapQuoteRequest, type TheGraphIndexerConfig, type TickLiquidity, type TickPoolState, type TickRange, type TokenPairAmounts, type UserVaultDiscoveryRequest, type UserVaultListRequest, type UserVaultPage, type V3Contracts, type V3PoolFees, type V3PoolLookupRequest, type V3PoolState, type V3PoolsLookupRequest, type V4Contracts, type V4DirectionalFees, type V4PoolFees, type V4PoolKey, type V4PoolLookupRequest, type V4PoolReference, type V4PoolState, type V4PoolsLookupRequest, type V4ReadOptions, type V4SwapQuoteRequest, type V4VaultPool, type VaultAmmFilter, type VaultDiscoveryRequest, type VaultListRequest, type VaultLoadOptions, type VaultMetadata, type VaultRewardPayout, type VaultUnderlying, type VaultUserPosition, type WithdrawPlan, type WithdrawPreview, type WithdrawRequest, type WithdrawRewards, ethereumContracts as mainnetContracts };
|
|
3674
3679
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -422,9 +422,9 @@ export declare class VaultResolver {
|
|
|
422
422
|
readonly amms: DeploymentRegistry<AmmAdapter>;
|
|
423
423
|
readonly lending: DeploymentRegistry<LendingAdapter>;
|
|
424
424
|
constructor(definition: VaultResolverDefinition, amms: DeploymentRegistry<AmmAdapter>, lending: DeploymentRegistry<LendingAdapter>);
|
|
425
|
-
resolve(steer: SteerNetwork, address: Address, options?:
|
|
425
|
+
resolve(steer: SteerNetwork, address: Address, options?: VaultLoadOptions): Promise<KnownSteerVault>;
|
|
426
426
|
/** Bounded bulk identity pages at one block; compatibility uses four active loads. */
|
|
427
|
-
resolveMany(steer: SteerNetwork, addresses: readonly Address[], options?:
|
|
427
|
+
resolveMany(steer: SteerNetwork, addresses: readonly Address[], options?: VaultLoadOptions): Promise<readonly KnownSteerVault[]>;
|
|
428
428
|
/** Identity and accounting share a pinned block; dispatch custom constructors and methods. */
|
|
429
429
|
snapshots(steer: SteerNetwork, addresses: readonly Address[], options?: ReadOptions): Promise<readonly LiquidityVaultSnapshot[]>;
|
|
430
430
|
}
|
|
@@ -450,13 +450,13 @@ export declare class SteerNetwork {
|
|
|
450
450
|
get subgraphUrl(): string | undefined;
|
|
451
451
|
listUserVaults(request: UserVaultListRequest, options?: DataAdapterRequestOptions): Promise<UserVaultPage>;
|
|
452
452
|
listVaults(request?: VaultListRequest, options?: DataAdapterRequestOptions): Promise<Page<VaultMetadata>>;
|
|
453
|
-
getVault(address: Address, options?:
|
|
454
|
-
getVaults(addresses: readonly Address[], options?:
|
|
453
|
+
getVault(address: Address, options?: VaultLoadOptions): Promise<KnownSteerVault>;
|
|
454
|
+
getVaults(addresses: readonly Address[], options?: VaultLoadOptions): Promise<readonly KnownSteerVault[]>;
|
|
455
455
|
getVaultSnapshots(addresses: readonly Address[], options?: ReadOptions): Promise<readonly LiquidityVaultSnapshot<LiquidityPool>[]>;
|
|
456
456
|
getVaultUserPositions(addresses: readonly Address[], account: Address, options?: ReadOptions): Promise<readonly VaultUserPosition[]>;
|
|
457
|
-
getLiquidityVault(address: Address, options?:
|
|
458
|
-
getLendingVault(address: Address, options?:
|
|
459
|
-
getCompositeVault(address: Address, options?:
|
|
457
|
+
getLiquidityVault(address: Address, options?: VaultLoadOptions): Promise<LiquidityVault>;
|
|
458
|
+
getLendingVault(address: Address, options?: VaultLoadOptions): Promise<LendingVault>;
|
|
459
|
+
getCompositeVault(address: Address, options?: VaultLoadOptions): Promise<CompositeVault>;
|
|
460
460
|
}
|
|
461
461
|
//#endregion
|
|
462
462
|
//#region src/vault/vault.d.ts
|
|
@@ -520,6 +520,11 @@ interface VaultMetadata {
|
|
|
520
520
|
readonly id: string;
|
|
521
521
|
} | null;
|
|
522
522
|
}
|
|
523
|
+
/** Loading options. Supplied indexed metadata never replaces onchain identity checks. */
|
|
524
|
+
interface VaultLoadOptions extends ReadOptions {
|
|
525
|
+
/** Complete records for the requested addresses; omit to fetch from the subgraph. */
|
|
526
|
+
readonly metadata?: readonly VaultMetadata[];
|
|
527
|
+
}
|
|
523
528
|
interface VaultListRequest extends PageRequest {
|
|
524
529
|
/** Select a configured AMM using the same protocol/version rules as getAmm(). */
|
|
525
530
|
readonly amm?: VaultAmmFilter;
|
|
@@ -3545,15 +3550,15 @@ export declare class SteerClient {
|
|
|
3545
3550
|
readonly amm: InfinityCLAdapter;
|
|
3546
3551
|
})[]>;
|
|
3547
3552
|
getPools(request: PoolsLookupRequest): Promise<readonly DiscoveredPool[]>;
|
|
3548
|
-
getVault(chainId: number, address: Address, options?:
|
|
3549
|
-
getVaults(chainId: number, addresses: readonly Address[], options?:
|
|
3553
|
+
getVault(chainId: number, address: Address, options?: VaultLoadOptions): Promise<KnownSteerVault>;
|
|
3554
|
+
getVaults(chainId: number, addresses: readonly Address[], options?: VaultLoadOptions): Promise<readonly KnownSteerVault[]>;
|
|
3550
3555
|
getVaultSnapshots(chainId: number, addresses: readonly Address[], options?: ReadOptions): Promise<readonly LiquidityVaultSnapshot<LiquidityPool>[]>;
|
|
3551
3556
|
getVaultUserPositions(chainId: number, addresses: readonly Address[], account: Address, options?: ReadOptions): Promise<readonly VaultUserPosition[]>;
|
|
3552
3557
|
listUserVaults(request: UserVaultDiscoveryRequest, options?: DataAdapterRequestOptions): Promise<UserVaultPage>;
|
|
3553
3558
|
listVaults(request: VaultDiscoveryRequest, options?: DataAdapterRequestOptions): Promise<Page<VaultMetadata>>;
|
|
3554
|
-
getLiquidityVault(chainId: number, address: Address, options?:
|
|
3555
|
-
getLendingVault(chainId: number, address: Address, options?:
|
|
3556
|
-
getCompositeVault(chainId: number, address: Address, options?:
|
|
3559
|
+
getLiquidityVault(chainId: number, address: Address, options?: VaultLoadOptions): Promise<LiquidityVault<AmmAdapter<unknown, unknown, Readonly<Record<string, ContractDeployment>>, unknown>, LiquidityPool>>;
|
|
3560
|
+
getLendingVault(chainId: number, address: Address, options?: VaultLoadOptions): Promise<LendingVault<LendingAdapter<unknown, unknown, Readonly<Record<string, ContractDeployment>>>>>;
|
|
3561
|
+
getCompositeVault(chainId: number, address: Address, options?: VaultLoadOptions): Promise<CompositeVault>;
|
|
3557
3562
|
}
|
|
3558
3563
|
//#endregion
|
|
3559
3564
|
//#region src/data/uniswap-v3.d.ts
|
|
@@ -3670,5 +3675,5 @@ export declare class UniswapV4Vault extends LiquidityVault<UniswapV4Adapter, V4V
|
|
|
3670
3675
|
prepareDeposit(request: PrepareDepositRequest, options?: ReadOptions): Promise<DepositPlan>;
|
|
3671
3676
|
}
|
|
3672
3677
|
//#endregion
|
|
3673
|
-
export { type AerodromeDepositPlan, type AerodromeDepositPreview, type AerodromeVaultSnapshot, type AerodromeWithdrawPlan, type AerodromeWithdrawPreview, type AlgebraContracts, type AlgebraIntegralContracts, type AlgebraIntegralPoolState, type AlgebraLegacyContracts, type AlgebraLegacyPoolLookupRequest, type AlgebraLegacyPoolState, type AlgebraLegacyPoolsLookupRequest, type AlgebraPoolLookupRequest, type AlgebraPoolReference, type AlgebraPoolState, type AlgebraPoolsLookupRequest, type AlgebraSwapFee, type AmmLookupRequest, type AmmProtocolAdapter, type AmmProtocolAdapters, type AmmProtocolVersion, type AmmVersion, type AssetAmount, type ConcentratedPoolState, type DepositPlan, type DepositPreview, type DepositQuote, type DepositRequest, type DiscoveredPool, type IndexerConfig, type InfinityCLContracts, type InfinityCLDirectionalFees, type InfinityCLPoolFees, type InfinityCLPoolIdReference, type InfinityCLPoolKey, type InfinityCLPoolKeyInput, type InfinityCLPoolLookupRequest, type InfinityCLPoolReference, type InfinityCLPoolState, type InfinityCLPoolsLookupRequest, type InfinityCLSwapQuoteRequest, type KnownSteerVault, type LiquidityDepositPreview, type LiquidityDepth, type LiquidityDepthRequest, type LiquidityDistribution, type LiquidityFees, type LiquidityInterval, type LiquidityPool, type LiquidityPosition, type LiquidityPositionRange, type LiquidityVaultRewards, type LiquidityVaultSnapshot, type LiquidityVaultUserPosition, type LogEvent, type Logger, type PoolLookupRequest, type PoolPrice, type PoolReadOptions, type PoolState, type PoolTicks, type PoolTokenBalance, type PoolsLookupRequest, type PrepareDepositRequest, type PrepareWithdrawRequest, type SlipstreamContracts, type SlipstreamPoolFees, type SlipstreamPoolLookupRequest, type SlipstreamPoolState, type SlipstreamPoolsLookupRequest, type SlipstreamQuoteOptions, type StrategyPosition, type SurroundingTicks, type SwapQuote, type SwapQuoteRequest, type TheGraphIndexerConfig, type TickLiquidity, type TickPoolState, type TickRange, type TokenPairAmounts, type UserVaultDiscoveryRequest, type UserVaultListRequest, type UserVaultPage, type V3Contracts, type V3PoolFees, type V3PoolLookupRequest, type V3PoolState, type V3PoolsLookupRequest, type V4Contracts, type V4DirectionalFees, type V4PoolFees, type V4PoolKey, type V4PoolLookupRequest, type V4PoolReference, type V4PoolState, type V4PoolsLookupRequest, type V4ReadOptions, type V4SwapQuoteRequest, type V4VaultPool, type VaultAmmFilter, type VaultDiscoveryRequest, type VaultListRequest, type VaultMetadata, type VaultRewardPayout, type VaultUnderlying, type VaultUserPosition, type WithdrawPlan, type WithdrawPreview, type WithdrawRequest, type WithdrawRewards, ethereumContracts as mainnetContracts };
|
|
3678
|
+
export { type AerodromeDepositPlan, type AerodromeDepositPreview, type AerodromeVaultSnapshot, type AerodromeWithdrawPlan, type AerodromeWithdrawPreview, type AlgebraContracts, type AlgebraIntegralContracts, type AlgebraIntegralPoolState, type AlgebraLegacyContracts, type AlgebraLegacyPoolLookupRequest, type AlgebraLegacyPoolState, type AlgebraLegacyPoolsLookupRequest, type AlgebraPoolLookupRequest, type AlgebraPoolReference, type AlgebraPoolState, type AlgebraPoolsLookupRequest, type AlgebraSwapFee, type AmmLookupRequest, type AmmProtocolAdapter, type AmmProtocolAdapters, type AmmProtocolVersion, type AmmVersion, type AssetAmount, type ConcentratedPoolState, type DepositPlan, type DepositPreview, type DepositQuote, type DepositRequest, type DiscoveredPool, type IndexerConfig, type InfinityCLContracts, type InfinityCLDirectionalFees, type InfinityCLPoolFees, type InfinityCLPoolIdReference, type InfinityCLPoolKey, type InfinityCLPoolKeyInput, type InfinityCLPoolLookupRequest, type InfinityCLPoolReference, type InfinityCLPoolState, type InfinityCLPoolsLookupRequest, type InfinityCLSwapQuoteRequest, type KnownSteerVault, type LiquidityDepositPreview, type LiquidityDepth, type LiquidityDepthRequest, type LiquidityDistribution, type LiquidityFees, type LiquidityInterval, type LiquidityPool, type LiquidityPosition, type LiquidityPositionRange, type LiquidityVaultRewards, type LiquidityVaultSnapshot, type LiquidityVaultUserPosition, type LogEvent, type Logger, type PoolLookupRequest, type PoolPrice, type PoolReadOptions, type PoolState, type PoolTicks, type PoolTokenBalance, type PoolsLookupRequest, type PrepareDepositRequest, type PrepareWithdrawRequest, type SlipstreamContracts, type SlipstreamPoolFees, type SlipstreamPoolLookupRequest, type SlipstreamPoolState, type SlipstreamPoolsLookupRequest, type SlipstreamQuoteOptions, type StrategyPosition, type SurroundingTicks, type SwapQuote, type SwapQuoteRequest, type TheGraphIndexerConfig, type TickLiquidity, type TickPoolState, type TickRange, type TokenPairAmounts, type UserVaultDiscoveryRequest, type UserVaultListRequest, type UserVaultPage, type V3Contracts, type V3PoolFees, type V3PoolLookupRequest, type V3PoolState, type V3PoolsLookupRequest, type V4Contracts, type V4DirectionalFees, type V4PoolFees, type V4PoolKey, type V4PoolLookupRequest, type V4PoolReference, type V4PoolState, type V4PoolsLookupRequest, type V4ReadOptions, type V4SwapQuoteRequest, type V4VaultPool, type VaultAmmFilter, type VaultDiscoveryRequest, type VaultListRequest, type VaultLoadOptions, type VaultMetadata, type VaultRewardPayout, type VaultUnderlying, type VaultUserPosition, type WithdrawPlan, type WithdrawPreview, type WithdrawRequest, type WithdrawRewards, ethereumContracts as mainnetContracts };
|
|
3674
3679
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -11432,6 +11432,20 @@ function vaultMetadata(value) {
|
|
|
11432
11432
|
strategyToken: strategy === null ? null : Object.freeze({ id: String(strategy.id) })
|
|
11433
11433
|
});
|
|
11434
11434
|
}
|
|
11435
|
+
/** Validate and detach caller-owned metadata before any asynchronous resolution. */
|
|
11436
|
+
function captureVaultMetadata(addresses, values) {
|
|
11437
|
+
if (!Array.isArray(values)) throw new Error("Supplied vault metadata must be an array");
|
|
11438
|
+
const requested = new Set(addresses.map((address) => address.toLowerCase()));
|
|
11439
|
+
const records = /* @__PURE__ */ new Map();
|
|
11440
|
+
for (const value of values) {
|
|
11441
|
+
const metadata = vaultMetadata(value);
|
|
11442
|
+
if (!requested.has(metadata.id)) throw new Error(`Supplied vault metadata contains an unrequested address: ${metadata.id}`);
|
|
11443
|
+
if (records.has(metadata.id)) throw new Error(`Supplied vault metadata contains a duplicate address: ${metadata.id}`);
|
|
11444
|
+
records.set(metadata.id, metadata);
|
|
11445
|
+
}
|
|
11446
|
+
for (const address of requested) if (!records.has(address)) throw new Error(`Supplied vault metadata is missing address: ${address}`);
|
|
11447
|
+
return records;
|
|
11448
|
+
}
|
|
11435
11449
|
//#endregion
|
|
11436
11450
|
//#region src/vault/resolver-types.ts
|
|
11437
11451
|
let ProtocolContractRole = /* @__PURE__ */ function(ProtocolContractRole) {
|
|
@@ -20953,9 +20967,14 @@ var VaultResolver = class {
|
|
|
20953
20967
|
if (snapshot.blockNumber !== blockNumber || !vault.underlying.some((position) => position.kind === "liquidity" && sameLiquidityPool(position.pool, snapshot.pool))) throw new Error("Vault returned another accounting snapshot");
|
|
20954
20968
|
return readValidatedVaultSnapshot(vault, snapshot, vault.steer.context);
|
|
20955
20969
|
}
|
|
20956
|
-
#metadata(steer, addresses) {
|
|
20970
|
+
#metadata(steer, addresses, supplied) {
|
|
20957
20971
|
let pending;
|
|
20958
20972
|
return async (address) => {
|
|
20973
|
+
if (supplied) {
|
|
20974
|
+
const metadata = supplied.get(address.toLowerCase());
|
|
20975
|
+
if (!metadata) throw new Error(`Supplied vault metadata is missing address: ${address}`);
|
|
20976
|
+
return metadata;
|
|
20977
|
+
}
|
|
20959
20978
|
pending ??= steer.dataAdapter.getVaultMetadata(addresses);
|
|
20960
20979
|
const metadata = (await pending).find((record) => record.id.toLowerCase() === address.toLowerCase());
|
|
20961
20980
|
if (!metadata) throw new Error("Vault metadata is not indexed");
|
|
@@ -20966,13 +20985,15 @@ var VaultResolver = class {
|
|
|
20966
20985
|
async resolveMany(steer, addresses, options) {
|
|
20967
20986
|
const inputs = [...addresses];
|
|
20968
20987
|
for (const address of inputs) addressKey(address);
|
|
20988
|
+
const supplied = options?.metadata;
|
|
20989
|
+
const metadata = supplied === void 0 ? void 0 : captureVaultMetadata(inputs, supplied);
|
|
20969
20990
|
if (!inputs.length) return Object.freeze([]);
|
|
20970
20991
|
const blockNumber = await this.#blockNumber(steer, options);
|
|
20971
20992
|
const result = [];
|
|
20972
20993
|
let bulkSupported = !!this.#reader.readMany;
|
|
20973
20994
|
for (let start = 0; start < inputs.length; start += 64) {
|
|
20974
20995
|
const batch = inputs.slice(start, start + 64);
|
|
20975
|
-
const loadMetadata = this.#metadata(steer, batch);
|
|
20996
|
+
const loadMetadata = this.#metadata(steer, batch, metadata);
|
|
20976
20997
|
const contexts = batch.map((address) => Object.freeze({
|
|
20977
20998
|
steer,
|
|
20978
20999
|
address,
|
|
@@ -21129,7 +21150,10 @@ var SteerNetwork = class {
|
|
|
21129
21150
|
return this.#vaultResolver().resolve(this, address, options);
|
|
21130
21151
|
}
|
|
21131
21152
|
async getVaults(addresses, options) {
|
|
21132
|
-
if (!addresses.length)
|
|
21153
|
+
if (!addresses.length) {
|
|
21154
|
+
if (options?.metadata !== void 0) captureVaultMetadata(addresses, options.metadata);
|
|
21155
|
+
return Object.freeze([]);
|
|
21156
|
+
}
|
|
21133
21157
|
return this.#vaultResolver().resolveMany(this, addresses, options);
|
|
21134
21158
|
}
|
|
21135
21159
|
getVaultSnapshots(addresses, options) {
|