/** * 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 { DidUri, IAttestation, IDelegationNode } from '@kiltprotocol/types'; /** * Creates a bitset from the permissions in the array where each enum value * is used to set the bit flag in the set. * * ATTEST has `0000000000000001` (decimal 1). * DELEGATE has `0000000000000010` (decimal 2). * * Adding the enum values results in a decimal representation of the bitset. * * @param delegation The delegation from which you want to convert the permissions to bitset. * @returns The bitset as single value uint8 array. */ export declare function permissionsAsBitset(delegation: IDelegationNode): Uint8Array; /** * Traverses a delegation tree and counts the number of delegation nodes between an attestation and an ancestral delegation node owned by `attester`. * * @param attester Identity to be located in the delegation tree. * @param attestation Attestation whose delegation tree to search. * @returns 0 if `attester` is the owner of `attestation`, the number of delegation nodes traversed otherwise. */ export declare function countNodeDepth(attester: DidUri, attestation: IAttestation): Promise; /** * Checks for errors on delegation node data. * * @param delegationNodeInput Delegation node data. */ export declare function errorCheck(delegationNodeInput: IDelegationNode): void;