import type CID from 'cids' ; import type { Observable } from 'rxjs' ; import type { AnchorProof , AnchorStatus } from './stream' ; import type { CeramicApi } from './ceramic-api' ; import type { StreamID } from '@ceramicnetwork/streamid' ; export interface AnchorServicePending { readonly status : AnchorStatus . PENDING ; readonly streamId : StreamID ; readonly cid : CID ; readonly message : string ; readonly anchorScheduledFor : number ; } export interface AnchorServiceProcessing { readonly status : AnchorStatus . PROCESSING ; readonly streamId : StreamID ; readonly cid : CID ; readonly message : string ; } export interface AnchorServiceAnchored { readonly status : AnchorStatus . ANCHORED ; readonly streamId : StreamID ; readonly cid : CID ; readonly message : string ; readonly anchorCommit : CID ; } export interface AnchorServiceFailed { readonly status : AnchorStatus . FAILED ; readonly streamId : StreamID ; readonly cid : CID ; readonly message : string ; } /**
 * Describes anchor service response
 */ export type AnchorServiceResponse = AnchorServicePending | AnchorServiceProcessing | AnchorServiceAnchored | AnchorServiceFailed ; /**
 * Describes anchoring service behavior
 */ export interface AnchorService { /**
     * Performs whatever initialization work is required by the specific anchor service implementation
     */ init ( ) : Promise < void > ; param ceramic ceramic : CeramicApi ; /**
     * URL of the connected anchor service
     */ url : string ; param streamId param tip requestAnchor ( streamId , tip ) : Observable < AnchorServiceResponse > ; param streamId param tip pollForAnchorResponse ( streamId , tip ) : Observable < AnchorServiceResponse > ; returns getSupportedChains ( ) : Promise < Array < string > > ; } /**
 * Describes behavior for validation anchor commit inclusion on chain
 */ export interface AnchorValidator { /**
     * Performs whatever initialization work is required to validate commits anchored on the
     * configured blockchain.
     */ init ( chainId ) : Promise < void > ; param anchorProof validateChainInclusion ( anchorProof ) : Promise < void > ; }