mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-03 23:42:50 +00:00
Note that this *trivially* updates project urls by adding the NPM url to the end, even when the urls are almost identical or the DT one is outdated. I'll clean up the urls in a later commit. This PR is unfinished! Please do not merge it yet.
42 lines
1.8 KiB
TypeScript
42 lines
1.8 KiB
TypeScript
// Type definitions for bip38 2.0
|
|
// Project: https://github.com/bitcoinjs/bip38, http://cryptocoinjs.com/modules/currency/bip38
|
|
// Definitions by: Satana Charuwichitratana <https://github.com/micksatana>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.2
|
|
|
|
/// <reference types="node" />
|
|
|
|
// Note: When there is @types/scryptsy, ProgressStatus and ScryptParams should be referred from the definition instead
|
|
export interface ProgressStatus {
|
|
current: number;
|
|
total: number;
|
|
percent: number;
|
|
}
|
|
export interface ScryptParams {
|
|
N: number;
|
|
r: number;
|
|
p: number;
|
|
}
|
|
|
|
export function decrypt(string: string, passphrase: string,
|
|
progressCallback?: (status: ProgressStatus) => void,
|
|
scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean };
|
|
|
|
export function decryptECMult(buffer: Buffer, passphrase: string,
|
|
progressCallback?: (status: ProgressStatus) => void,
|
|
scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean };
|
|
|
|
export function decryptRaw(buffer: Buffer, passphrase: string,
|
|
progressCallback?: (status: ProgressStatus) => void,
|
|
scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean };
|
|
|
|
export function encrypt(buffer: Buffer, compressed: boolean, passphrase: string,
|
|
progressCallback?: (status: ProgressStatus) => void,
|
|
scryptParams?: ScryptParams): string;
|
|
|
|
export function encryptRaw(buffer: Buffer, compressed: boolean, passphrase: string,
|
|
progressCallback?: (status: ProgressStatus) => void,
|
|
scryptParams?: ScryptParams): Buffer;
|
|
|
|
export function verify(string: string): boolean;
|