/** * @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 * as crypto from "../utils/crypto.js"; import * as recovery from "../utils/recovery.js"; import * as btcTypes from "./types.js"; /** Raw JSON export/import format (legacy v1) */ export interface JSONImportDataV1 { privateKey?: string; publicKey: string; type: "bitcoin"; version: 1; } /** Raw JSON export/import format (v2) (deprecated) */ export interface JSONImportDataV2 { address: string; type: "bitcoin"; version: 2; wif?: string; } /** Raw JSON export/import format (v3) */ export interface JSONImportDataV3 { address: string; publicKey?: string; type: "bitcoin"; version: 3; wif?: string; } export interface JSONSealV1 { privateKey: crypto.EncryptedData; publicKey: string; type: "bitcoin"; version: 1; } export interface JSONSealV2 { address: string; encryptedWIF: crypto.EncryptedData; publicKey?: string; type: "bitcoin"; version: 2; } export type JSONSeal = JSONSealV1 | JSONSealV2; export declare const isJSONSeal: import("@keeex/utils/types/types.js").TypePredicate; /** Possible JSON import type */ export type JSONImportData = JSONImportDataV1 | JSONImportDataV2 | JSONImportDataV3; export declare const isJSONImportData: import("@keeex/utils/types/types.js").TypePredicate; /** Possible JSON export type */ export type JSONExport = JSONImportDataV3; interface ImportFromPrivateKeyOld { compressed?: boolean; /** @deprecated Use `value` instead */ privateKeyHex: string; testnet?: boolean; type: "bitcoinPrivateKey"; } interface ImportFromPrivateKeyNew { addressType?: btcTypes.AddressType; compressed?: boolean; testnet?: boolean; type: "bitcoinPrivateKey"; value: string; } export declare const isImportFromPrivateKeyNew: import("@keeex/utils/types/types.js").TypePredicate; export type ImportFromPrivateKey = ImportFromPrivateKeyOld | ImportFromPrivateKeyNew; interface ImportFromWIFOld { type: "wif"; /** @deprecated Use `value` instead */ wif: string; } export interface ImportFromWIFNew { address?: string; addressType?: btcTypes.AddressType; type: "wif"; value: string; } export declare const isImportFromWIFNew: import("@keeex/utils/types/types.js").TypePredicate; /** Parameter when creating a keypair from a WIF */ export type ImportFromWIF = ImportFromWIFOld | ImportFromWIFNew; interface ImportFromPassphraseOld { compressed?: boolean; /** @deprecated Use `value` instead */ passphrase: string; testnet?: boolean; type: "passphrase"; } interface ImportFromPassphraseNew { addressType?: btcTypes.AddressType; compressed?: boolean; testnet?: boolean; type: "passphrase"; value: string; } export declare const isImportFromPassphraseNew: import("@keeex/utils/types/types.js").TypePredicate; /** Parameter when creating a keypair from a passphrase */ export type ImportFromPassphrase = ImportFromPassphraseOld | ImportFromPassphraseNew; interface ImportFromPublicKeyOld { type: "publicKey"; /** @deprecated Use `value` instead */ publicKey: Uint8Array; testnet?: boolean; } interface ImportFromPublicKeyNew { addressType?: btcTypes.AddressType; testnet?: boolean; type: "publicKey"; value: Uint8Array; } export declare const isImportFromPublicKeyNew: import("@keeex/utils/types/types.js").TypePredicate; export type ImportFromPublicKey = ImportFromPublicKeyOld | ImportFromPublicKeyNew; interface ImportFromAddressOld { /** @deprecated Use `value` instead */ address: string; compressed?: boolean; type: "address"; } interface ImportFromAddressNew { compressed?: boolean; type: "address"; value: string; } export declare const isImportFromAddressNew: import("@keeex/utils/types/types.js").TypePredicate; /** Parameter when creating a keypair from an address (verif only) */ export type ImportFromAddress = ImportFromAddressNew | ImportFromAddressOld; /** Parameter when creating a keypair from a JSON export */ export interface ImportFromJSON { password?: string; type: "json" | "seal"; value: string | JSONImportData | JSONSeal | Uint8Array; } interface ImportFromRecoveryOld { compressed?: boolean; /** @deprecated Use `value` instead */ recovery: recovery.RecoveryData; testnet?: boolean; type: "recovery"; } interface ImportFromRecoveryNew { compressed?: boolean; testnet?: boolean; type: "recovery"; value: recovery.RecoveryData; } export declare const isImportFromRecoveryNew: import("@keeex/utils/types/types.js").TypePredicate; export type ImportFromRecovery = ImportFromRecoveryOld | ImportFromRecoveryNew; /** All possible import parameter types */ export type ImportData = ImportFromWIF | ImportFromPrivateKey | ImportFromPassphrase | ImportFromAddress | ImportFromPublicKey | ImportFromJSON | ImportFromRecovery; export declare const isBitcoinImportData: import("@keeex/utils/types/types.js").TypePredicate; export interface ExportJSONOptions { publicKey?: boolean; } export interface ExportOptionsJSON { options?: ExportJSONOptions; password?: string; salt?: Uint8Array; type: "json"; } export interface ExportOptionsSeal { password: string; salt?: Uint8Array; type: "seal"; } export type ExportOptions = ExportOptionsJSON | ExportOptionsSeal; export {};