/** * 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, IDelegationNode, KiltAddress } from '@kiltprotocol/types'; import * as Did from '@kiltprotocol/did'; import { DelegationNode } from './DelegationNode.js'; /** * Encodes the delegation and the signature for usage as arguments of `api.tx.delegation.addDelegation()`. * * @param delegation The delegation node to store under the hierarchy specified as part of the node. * @param signature The DID signature of the delegate owner of the new delegation node. * @returns The array of arguments for `addDelegation`. */ export declare function addDelegationToChainArgs(delegation: DelegationNode, signature: Did.EncodedSignature): [ DelegationNode['id'], string, KiltAddress, Uint8Array, Did.EncodedSignature ]; /** * Fetch a delegation node from the blockchain given its identifier. * * @param delegationId The delegation node ID to fetch. * @returns The retrieved [[DelegationNode]]. */ export declare function fetch(delegationId: IDelegationNode['id']): Promise; /** * Query the blockchain to retrieve the number of **direct** children of a given delegation node. * * @param delegationNode The delegation node to perform the lookup for. * @returns A list of [[DelegationNode]] containing all the direct children of the provided node. */ export declare function getChildren(delegationNode: DelegationNode): Promise; /** * Query the blockchain to retrieve all the attestations (their claim hashes) created with the provided delegation. * * @param id The identifier of the delegation node to retrieve delegated attestations for. * @returns A list of claim hashes issued using the provided delegation. */ export declare function getAttestationHashes(id: IDelegationNode['id']): Promise>;