import { StreamID } from '@streamr/protocol'; import { EthereumAddress, TheGraphClient } from '@streamr/utils'; import { Authentication } from '../Authentication'; import { StrictStreamrClientConfig } from '../Config'; import { ContractFactory } from '../ContractFactory'; import { Stream } from '../Stream'; import { StreamFactory } from '../StreamFactory'; import { StreamIDBuilder } from '../StreamIDBuilder'; import { StreamrClientEventEmitter } from '../events'; import { LoggerFactory } from '../utils/LoggerFactory'; export interface StorageNodeAssignmentEvent { readonly streamId: StreamID; readonly nodeAddress: EthereumAddress; readonly blockNumber: number; } /** * Stores storage node assignments (mapping of streamIds <-> storage nodes addresses) */ export declare class StreamStorageRegistry { private streamStorageRegistryContract?; private readonly streamStorageRegistryContractsReadonly; private readonly streamFactory; private readonly streamIdBuilder; private readonly contractFactory; private readonly theGraphClient; private readonly config; private readonly authentication; private readonly logger; constructor(streamFactory: StreamFactory, streamIdBuilder: StreamIDBuilder, contractFactory: ContractFactory, theGraphClient: TheGraphClient, config: Pick, authentication: Authentication, eventEmitter: StreamrClientEventEmitter, loggerFactory: LoggerFactory); private initStreamAssignmentEventListeners; private connectToContract; addStreamToStorageNode(streamIdOrPath: string, nodeAddress: EthereumAddress): Promise; removeStreamFromStorageNode(streamIdOrPath: string, nodeAddress: EthereumAddress): Promise; isStoredStream(streamIdOrPath: string, nodeAddress: EthereumAddress): Promise; getStoredStreams(nodeAddress: EthereumAddress): Promise<{ streams: Stream[]; blockNumber: number; }>; getStorageNodes(streamIdOrPath?: string): Promise; }