import type { KeetaAnchorHTTPServerConfig } from './http-server/index.js';
import type { HTTPSignedField } from './http-server/common.js';
import type { SignableAccount, VerifiableAccount } from './utils/signing.js';
import type { ServiceMetadataEndpoint, SharedAnchorMetadataLegalExtension, SharedAnchorMetadataSignedExtension } from './metadata.types.js';
import { KeetaNetAnchorHTTPServer } from './http-server/index.js';
/**
 * Namespace tag bound into every service metadata signature.
 */
export declare const METADATA_SIGNATURE_NAMESPACE = "keetanet/anchor/service-metadata/v1";
/**
 * Service metadata shape whose signed fields can be authenticated
 * by {@link KeetaAnchorMetadataServer}.
 */
export type SignableServiceMetadata = SharedAnchorMetadataLegalExtension & {
    operations: {
        [operationName: string]: ServiceMetadataEndpoint | undefined;
    };
};
/**
 * Canonical fields covered by the metadata signature. `namespace` scopes
 * the signature to this protocol/version.
 */
export type SignedServiceMetadataFields = {
    namespace: typeof METADATA_SIGNATURE_NAMESPACE;
    account: string;
    operations: SignableServiceMetadata['operations'];
    legal?: SignableServiceMetadata['legal'];
};
export interface KeetaAnchorMetadataServerConfig extends KeetaAnchorHTTPServerConfig {
    /** Signs the published metadata. Omit for unsigned metadata. */
    metadataSigner?: SignableAccount | undefined;
}
/**
 * Extracts the subset of `metadata` that is covered by the signature.
 * `account` is the public-key string of the claimed signer.
 */
export declare function extractSignedFields(account: string, metadata: SignableServiceMetadata): SignedServiceMetadataFields;
/**
 * Verifies that `signed` was produced by `account` over the signed
 * fields of `metadata` (see {@link extractSignedFields}).
 */
export declare function verifyMetadataSignature(account: VerifiableAccount, metadata: SignableServiceMetadata, signed: HTTPSignedField): Promise<boolean>;
/**
 * Publishes anchor service metadata, optionally signed by `metadataSigner`.
 * Subclasses implement {@link buildServiceMetadata}.
 */
export declare abstract class KeetaAnchorMetadataServer<Built extends SignableServiceMetadata, C extends KeetaAnchorMetadataServerConfig = KeetaAnchorMetadataServerConfig> extends KeetaNetAnchorHTTPServer<C> {
    #private;
    constructor(config: C);
    get metadataSigner(): SignableAccount | undefined;
    protected abstract buildServiceMetadata(): Promise<Built>;
    serviceMetadata(): Promise<Built & SharedAnchorMetadataSignedExtension>;
}
//# sourceMappingURL=anchor-metadata-server.d.ts.map