nanocurrency
Version:
A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate seeds, hashes, signatures, proofs of work and blocks.
31 lines (30 loc) • 888 B
TypeScript
/** Sign block parameters. */
export interface SignBlockParams {
/** The hash of the block to sign */
hash: string;
/** The secret key to sign the block with, in hexadecimal format */
secretKey: string;
}
/**
* Sign a block.
*
* @param params - Parameters
* @returns Signature, in hexadecimal format
*/
export declare function signBlock(params: SignBlockParams): string;
/** Verify block parameters. */
export interface VerifyBlockParams {
/** The hash of the block to verify */
hash: string;
/** The signature of the block to verify, in hexadecimal format */
signature: string;
/** The public key to verify the block against, in hexadecimal format */
publicKey: string;
}
/**
* Verify a block against a public key.
*
* @param params Parameters
* @returns Valid
*/
export declare function verifyBlock(params: VerifyBlockParams): boolean;