/** * @license * @preserve * * KeeeX SAS Public code * https://keeex.me * Copyright 2013-2023 KeeeX All Rights Reserved. * * These computer program listings and specifications, herein, * are and remain the property of KeeeX SAS. The intellectual * and technical concepts herein are proprietary to KeeeX SAS * and may be covered by EU and foreign patents, * patents in process, trade secrets and copyright law. * * These listings are published as a way to provide third party * with the ability to process KeeeX data. * As such, support for public inquiries is limited. * They are provided "as-is", without warrany of any kind. * * They shall not be reproduced or copied or used in whole or * in part as the basis for manufacture or sale of items unless * prior written permission is obtained from KeeeX SAS. * * For a license agreement, please contact: * * */ import type { ImportData as BitcoinImportData } from "../bitcoin/iotypes.js"; import type { ImportData as EthereumImportData } from "../ethereum/iotypes.js"; import type { ImportData as X509ImportData } from "../x509/iotypes.js"; import type { Awaitable } from "@keeex/utils/types/types.js"; /** Data types for importing keypair details */ export type ImportData = BitcoinImportData | EthereumImportData | X509ImportData; /** Acceptable signature output format */ export declare enum SignatureFormat { raw = "raw", utf8 = "utf8" } /** Allow embeding extra data in some return values */ export interface OutputWithMetadata { bytes: Uint8Array; metadata: MetadataType; } /** * Normalize the way raw bytes are exposed to the user as strings */ export interface IDataFormatter { /** Convert raw bytes of private key to appropriate string output for the key type */ privateBytesToString: (privateData: Uint8Array) => Awaitable; /** Convert string format from key type to raw private key bytes */ privateStringToBytes: PrivateParams extends undefined ? (privateData: string) => Awaitable> : (privateData: string, privateArgs: PrivateParams) => Awaitable>; /** Convert public key raw bytes to a key address for the key type */ publicBytesToAddress: (publicData: Uint8Array) => Awaitable; /** Convert public key raw bytes to a string output suitable for the key type */ publicBytesToString: (publicData: Uint8Array) => Awaitable; /** Convert public key string representation to raw public key bytes */ publicStringToBytes: (publicData: string) => Awaitable>; /** Convert a signature raw output to a suitable string depending on the key type */ signatureBytesToString: (signatureData: Uint8Array) => Awaitable; /** Convert a signature string representation to raw bytes */ signatureStringToBytes: (signatureData: string) => Awaitable; /** Prepare a raw message input to a signable input in the message format specified */ messageRawToSignable: (message: Uint8Array, messageFormat: MessageFormat) => Awaitable; }