@taquito/signer
Version:
Software signer implementations and signing utilities for Taquito.
57 lines (56 loc) • 2.02 kB
TypeScript
import { Curves } from './helpers';
import { SignResult, RawSignResult, Signer } from '@taquito/core';
import { PublicKey } from './key-interface';
export interface FromMnemonicParams {
mnemonic: string;
password?: string;
derivationPath?: string;
curve?: Curves;
}
/**
* A local implementation of the signer. Will represent a Tezos account and be able to produce signature in its behalf
*
* @remarks If running in production and dealing with tokens that have real value, it is strongly recommended to use a HSM backed signer so that private key material is not stored in memory or on disk
* @throws InvalidMnemonicError
*/
export declare class InMemorySigner implements Signer {
#private;
static fromFundraiser(email: string, password: string, mnemonic: string): InMemorySigner;
static fromSecretKey(key: string, passphrase?: string): Promise<InMemorySigner>;
/**
*
* Instantiation of an InMemorySigner instance from a mnemonic
* @returns InMemorySigner
* @throws InvalidMnemonicError
*/
static fromMnemonic({ mnemonic, password, derivationPath, curve, }: FromMnemonicParams): InMemorySigner;
/**
*
* @param key Encoded private key
* @param passphrase Passphrase to decrypt the private key if it is encrypted
* @throws InvalidKeyError
*
*/
constructor(key: string, passphrase?: string);
/**
*
* @param message Bytes to sign
* @param watermark Watermark to append to the bytes
*/
sign(message: string | Uint8Array, watermark?: Uint8Array): Promise<SignResult>;
provePossession(): Promise<RawSignResult>;
get canProvePossession(): boolean;
/**
* @returns Encoded public key
*/
publicKey(): Promise<string>;
/**
* @returns Encoded public key hash
*/
publicKeyHash(): Promise<string>;
/**
* @returns Encoded private key
*/
secretKey(): Promise<string>;
}
export declare function publicKeyFromString(src: string): PublicKey;