2019-01-04 10:33:02 +01:00
|
|
|
/// <reference types="node" />
|
|
|
|
import { Network } from './networks';
|
|
|
|
interface ECPairOptions {
|
|
|
|
compressed?: boolean;
|
|
|
|
network?: Network;
|
|
|
|
rng?(arg0: Buffer): Buffer;
|
|
|
|
}
|
|
|
|
export interface ECPairInterface {
|
|
|
|
compressed: boolean;
|
|
|
|
network: Network;
|
|
|
|
privateKey?: Buffer;
|
|
|
|
publicKey?: Buffer;
|
|
|
|
toWIF(): string;
|
|
|
|
sign(hash: Buffer): Buffer;
|
|
|
|
verify(hash: Buffer, signature: Buffer): Buffer;
|
|
|
|
getPublicKey?(): Buffer;
|
|
|
|
}
|
|
|
|
declare class ECPair implements ECPairInterface {
|
2019-03-07 04:06:12 +01:00
|
|
|
private __D?;
|
2019-01-04 10:33:02 +01:00
|
|
|
private __Q?;
|
2019-03-20 07:25:48 +01:00
|
|
|
compressed: boolean;
|
|
|
|
network: Network;
|
|
|
|
constructor(__D?: Buffer | undefined, __Q?: Buffer | undefined, options?: ECPairOptions);
|
2019-01-04 10:33:02 +01:00
|
|
|
readonly privateKey: Buffer | undefined;
|
|
|
|
readonly publicKey: Buffer | undefined;
|
|
|
|
toWIF(): string;
|
|
|
|
sign(hash: Buffer): Buffer;
|
|
|
|
verify(hash: Buffer, signature: Buffer): Buffer;
|
|
|
|
}
|
|
|
|
declare function fromPrivateKey(buffer: Buffer, options?: ECPairOptions): ECPair;
|
|
|
|
declare function fromPublicKey(buffer: Buffer, options?: ECPairOptions): ECPair;
|
2019-03-07 04:06:12 +01:00
|
|
|
declare function fromWIF(wifString: string, network?: Network | Network[]): ECPair;
|
2019-01-04 10:33:02 +01:00
|
|
|
declare function makeRandom(options?: ECPairOptions): ECPair;
|
|
|
|
export { makeRandom, fromPrivateKey, fromPublicKey, fromWIF };
|