import { Aptos, AccountAddress, AccountAddressInput } from '@aptos-labs/ts-sdk'; import { StorageProviderInfo } from '../types/storage_providers.js'; import { ShelbyClientConfig } from './ShelbyClientConfig.js'; import '../networks.js'; declare class ShelbyMetadataClient { readonly aptos: Aptos; readonly deployer: AccountAddress; /** * The ShelbyMetadataClient is used to interact with the Shelby contract on the Aptos blockchain. This * includes functions like gathering basic details about the Shelby system, including storage provider information. * * @param config.aptos.config - The Aptos config. * @param config.shelbyDeployer - The deployer account address of the Shelby contract. If not provided, the default deployer address will be used. * * @example * ```typescript * const aptos = new Aptos(new AptosConfig({ network: Network.SHELBYNET })); * const metadataClient = new ShelbyMetadataClient({ aptos }); * ``` */ constructor(config: ShelbyClientConfig); /** * Retrieves storage provider list from the blockchain. * * @returns A list of storage providers, or empty array if none exist. * * @example * ```typescript * const spList = await client.getStorageProviders(); * ``` */ getStorageProviders(): Promise; /** * Retrieves the names of every activated location (region). Locations that are * registered but not yet brought online are admin-internal and not listed. * * @returns The location name list. * * @example * ```typescript * const locations = await client.getLocationNames(); * ``` */ getLocationNames(): Promise; /** * Retrieves the list of placement group addresses in a location. * * @param locationName - The location whose placement groups to list. * @returns The placement group address list, or an empty array if none exist. * * @example * ```typescript * const pgList = await client.getPlacementGroupAddresses("us-east-1"); * ``` */ getPlacementGroupAddresses(locationName: string): Promise; /** * Retrieves the list of slice addresses in a location. * * @param locationName - The location whose slices to list. * @returns The slice group list, or an empty array if none exist. * * @example * ```typescript * const pgList = await client.getSliceAddresses("us-east-1"); * ``` */ getSliceAddresses(locationName: string): Promise; /** * Gets the placement group address for a slice. * * @param sliceAddress - The address of the slice account. * @returns The placement group address as a string. */ private getPlacementGroupAddressForSlice; /** * Retrieves the designated storage providers for a slice. * * Designated SPs are those appointed to store data for their slots: * - Active: Currently serving data * - Receiving: Receiving data during slot transfer * - Repairing: Repairing data after crash or failed transfer * - Reconstructing: Reconstructing data if the repair fails * * @param params.account - The address of the slice account. * @returns An array where result[i] is the designated SP for slot i, or null if no SP is designated. * * @example * ```typescript * const providers = await client.getDesignatedStorageProvidersForSlice({ account: sliceAddress }); * ``` */ getDesignatedStorageProvidersForSlice(params: { account: AccountAddressInput; }): Promise<(AccountAddress | null)[]>; /** * Retrieves the active storage providers for a slice. * * Active SPs have a complete copy of the data for the slot, and are not in any data transfer/repair/reconstruction phase. * Active SP can be audited for the data it contains. * Each slot has at most one active SP. * * @param params.account - The address of the slice account. * @returns An array where result[i] is the active SP for slot i, or null if no SP is active. * * @example * ```typescript * const providers = await client.getActiveStorageProvidersForSlice({ account: sliceAddress }); * ``` */ getActiveStorageProvidersForSlice(params: { account: AccountAddressInput; }): Promise<(AccountAddress | null)[]>; /** * Retrieves the serving storage providers for a slice. * * Serving SPs are those that can respond to read requests. The serving logic is: * - If an Active SP exists for a slot: Only the Active SP is serving * - If no Active SP (transition in progress): Both Designated and Vacating SPs serve * * Each slot may have multiple serving SPs during transitions. * * @param params.account - The address of the slice account. * @returns An array where result[i] contains the serving SPs for slot i. * * @example * ```typescript * const providers = await client.getServingStorageProvidersForSlice({ account: sliceAddress }); * ``` */ getServingStorageProvidersForSlice(params: { account: AccountAddressInput; }): Promise; } export { ShelbyMetadataClient };