/** * 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. */ /** * When a [[DelegationNode]] or a [[DelegationHierarchy]] is written on the blockchain, it is encoded. * DelegationDecoder helps to decode them when they're queried from the chain. * * The DelegationDecoder methods transform a Codec type into an object of a KILT type. */ import type { IDelegationNode, IDelegationHierarchyDetails } from '@kiltprotocol/types'; import type { Option } from '@polkadot/types'; import type { Hash } from '@polkadot/types/interfaces/runtime'; import type { DelegationDelegationHierarchyDelegationHierarchyDetails, DelegationDelegationHierarchyDelegationNode } from '@kiltprotocol/augment-api'; export declare type CodecWithId = { id: string; codec: C; }; export declare type DelegationHierarchyDetailsRecord = Pick; export declare function delegationHierarchyDetailsFromChain(encoded: Option): DelegationHierarchyDetailsRecord; export declare type DelegationNodeRecord = Omit; export declare type DelegationNodeId = Hash; export declare function delegationNodeFromChain(encoded: Option): DelegationNodeRecord;