FIX typings

pull/1/head
pubkey 7 years ago
parent aa9dc125d1
commit a56e42d5f8
  1. 71
      typings/index.d.ts

71
typings/index.d.ts vendored

@ -1,37 +1,54 @@
import Web3 from 'web3';
export function publicKeyToAddress(publicKey: string): string;
export function createPrivateKey(): string;
export function publicKeyFromPrivateKey(privateKey: string): string;
export function hash(message: string): string;
export function signHash(
export function addressByPublicKey(publicKey: string): string;
export function createIdentity(): {
privateKey: string,
hash: string
): string;
export function verifyHashSignature(
publicKey: string,
hash: string,
signature: string
): string;
address: string
};
export type Signature = {
v: string,
r: string,
s: string
};
export type Encrypted = {
iv: string,
ephemPublicKey: string,
ciphertext: string,
mac: string
};
export function decryptWithPrivateKey(privateKey: string, encrypted: Encrypted): Promise<string>;
export function encryptWithPublicKey(publicKey: string, message: string): Promise<Encrypted>;
export function publicKeyByPrivateKey(privateKey: string): string;
export function recover(sig: Signature, message: string);
export function sign(privateKEy: string, message: string): Signature;
export type hash = {
solidityHash(msg: string): string;
signHash(msg: string): string;
};
export type util = {
web3: Web3
};
export function publicKeyToAddress(publicKey: string): string;
export function encryptWithPublicKey(
publicKey: string,
message: string
): string;
export function decryptWithPrivateKey(
privateKey: string,
encrypted: string
): string;
declare const _default: {
publicKeyToAddress,
createPrivateKey,
publicKeyFromPrivateKey,
hash,
signHash,
verifyHashSignature,
addressByPublicKey,
createIdentity,
decryptWithPrivateKey,
encryptWithPublicKey,
decryptWithPrivateKey
publicKeyByPrivateKey,
recover,
sign,
hash,
util
};
export default _default;

Loading…
Cancel
Save