/** * Copyright (c) 2018-2023, BOTLabs GmbH. * * This source code is licensed under the BSD 4-Clause "Original" license * found in the LICENSE file in the root directory of this source tree. */ import type { IAttestation, IDelegationHierarchyDetails, ICredential, DidUri } from '@kiltprotocol/types'; /** * An [[Attestation]] certifies a [[Claim]], sent by a claimer in the form of a [[Credential]]. [[Attestation]]s are **written on the blockchain** and are **revocable**. * * An [[Attestation]] can be queried from the chain. It's stored on-chain in a map: * * the key is the hash of the corresponding claim; * * the value is a tuple ([[CType]] hash, account, id of the Delegation, and revoked flag). * * @packageDocumentation */ /** * Checks whether the input meets all the required criteria of an [[IAttestation]] object. * Throws on invalid input. * * @param input The potentially only partial [[IAttestation]]. */ export declare function verifyDataStructure(input: IAttestation): void; /** * Builds a new instance of an [[Attestation]], from a complete set of input required for an attestation. * * @param credential - The base credential for attestation. * @param attesterDid - The attester's DID, used to attest to the underlying claim. * @returns A new [[Attestation]] object. */ export declare function fromCredentialAndDid(credential: ICredential, attesterDid: DidUri): IAttestation; /** * Tries to fetch the delegationId and if successful fetch the rootId. * * @param input - The ID of the Delegation stored in [[Attestation]] , or the whole Attestation object. * @returns A promise of the affiliated [[DelegationNode]]. */ export declare function getDelegationDetails(input: IAttestation['delegationId'] | IAttestation): Promise; /** * Custom Type Guard to determine input being of type IAttestation. * * @param input The potentially only partial IAttestation. * @returns Boolean whether input is of type IAttestation. */ export declare function isIAttestation(input: unknown): input is IAttestation; /** * Verifies whether the data of the given attestation matches the one from the corresponding credential. It is valid if: * * the [[Credential]] object has valid data (see [[Credential.verifyDataIntegrity]]); * and * * the hash of the [[Credential]] object, and the hash of the [[Attestation]]. * * @param attestation - The attestation to verify. * @param credential - The credential to verify against. */ export declare function verifyAgainstCredential(attestation: IAttestation, credential: ICredential): void;