import { Address, Hex, PublicClient } from 'viem'; import { KeyEpochs, OnChainBtcPubkey, VaultBasicInfo, VaultData, VaultProtocolInfo, VaultRegistryReader } from './types'; /** * Concrete vault registry reader using viem. * * Usage: * ```ts * const reader = new ViemVaultRegistryReader(publicClient, registryAddress); * const data = await reader.getVaultData(vaultId); * ``` */ export declare class ViemVaultRegistryReader implements VaultRegistryReader { private publicClient; private contractAddress; constructor(publicClient: PublicClient, contractAddress: Address); /** * Read the VP's **genesis** (registration) x-only BTC pubkey — the key bonded * at version 0, which never moves when the operator rotates. * * Resolved as "the operation key at epoch 0" rather than through the * dedicated `getVaultProviderBTCKey` getter, which * https://github.com/babylonlabs-io/vault-contracts-aave-v4/pull/539 removes. * Epoch 0 predates any rotation — appended versions are stamped at epoch 1 or * later — so it resolves to the registration key, and the contracts team has * confirmed that is a property we can rely on rather than an implementation * detail. The devnet comparison behind that claim — both getters returning the * identical key for a provider that *has* rotated, while * `getCurrentOperationBtcKey` differed — is recorded in * https://github.com/babylonlabs-io/babylon-toolkit/issues/2188. * * This makes the read RFC-006-only, where the removed getter also existed on a * legacy registry. That costs nothing: every caller of this method already * resolves participant keys through `OperationKeyReader`, so all of them * require an RFC-006 registry regardless. * * Validates length, hex form, and secp256k1 curve membership before minting * the brand. Returns 64-char lowercase hex without the `0x` prefix. */ getVaultProviderGenesisBtcPubKey(vpAddress: Address): Promise; /** * Read a vault provider's *current* RFC-006 operation BTC key. * * Falls back on-chain to the registration key when the provider has never * rotated, so this returns the same value as * `getVaultProviderGenesisBtcPubKey` until the first rotation. * * This is the key the VP's server signs its BIP-322 auth tokens with — a * live per-operator identity, not a per-vault binding, so the auth pin uses * the current key rather than any vault's frozen epoch. */ getCurrentVaultProviderOperationBtcKey(vpAddress: Address): Promise; /** * Read a vault's frozen RFC-006 operation-key epochs. * * Reads `getBtcVaultProtocolInfo` through the **extended** ABI, which is only * valid against an RFC-006 registry: against one whose `BTCVaultProtocolInfo` * struct is not extended this call does not fail for a populated vault, it * silently returns three words of tail data as epochs. Nothing here can detect * that, so the guarantee is a deployment one — every network this ships to has * the RFC-006 getters, and mainnet is a fresh RFC-006 deploy. * * A registry missing the operation-key getters entirely is the *safer* of the * two cases: `resolveParticipantKeysAtEpochs` reverts downstream and these * epochs never reach key resolution. See {@link UINT64_EXCLUSIVE_UPPER_BOUND} * for which state the range check actually guards, and * `BTCVaultRegistryKeyEpochs.abi.ts` for the decode hazard. */ getVaultKeyEpochs(vaultId: Hex): Promise; getVaultKeyEpochsBatch(vaultIds: readonly Hex[]): Promise; getVaultBasicInfo(vaultId: Hex): Promise; getVaultProtocolInfo(vaultId: Hex): Promise; getProtocolInfoBatch(vaultIds: readonly Hex[]): Promise; /** * Read the protocol pegin fee (in wei) for a given vault provider. * Mirrors the `getPegInFee(address)` view on BTCVaultRegistry. */ getPegInFee(vaultProvider: Address): Promise; /** * Read a vault provider's current commission in basis points from * BTCVaultRegistry. The contract enforces `commissionBps < 10000`, so the * legitimate range is `[0, 9999]`; anything outside indicates a wrong * contract address or ABI drift and is surfaced as an error rather than * trusted. */ getVaultProviderCommission(vaultProvider: Address): Promise; getVaultData(vaultId: Hex): Promise; } //# sourceMappingURL=vault-registry-reader.d.ts.map