UNPKG

nanocurrency

Version:

A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate seeds, hashes, signatures, proofs of work and blocks.

88 lines (87 loc) 2.39 kB
/** @hidden */ export declare function checkString(candidate: {}): boolean; /** @hidden */ export declare function checkNumber(candidate: {}): boolean; /** * Check if the given amount is valid. * * **Note:** a valid amount means that it can be embedded into a block `balance`. * * @param amount - The amount to check * @returns Valid */ export declare function checkAmount(amount: string): boolean; /** * Check if the given seed is valid. * * **Note:** it only checks the format of the seed. * * @param seed - The seed to check * @returns Valid */ export declare function checkSeed(seed: string): boolean; /** * Check if the given threshold is valid. * * **Note:** it only checks the format of the threshold. * * @param threshold - The threshold to check * @returns Valid */ export declare function checkThreshold(threshold: string): boolean; /** * Check if the given index is valid. * * **Note:** it only checks the format of the index. * * @param index- The index to check * @returns Valid */ export declare function checkIndex(index: number): boolean; /** * Check if the given hash is valid. * * **Note:** it only checks the format of the hash. * * @param hash - The hash to check * @returns Valid */ export declare function checkHash(hash: string): boolean; /** * Check if the given public or secret key is valid. * * **Note:** it only checks the format of the key. * It does not check whether or not the key does exist on the network. * * @param key - The key to check * @returns Valid */ export declare function checkKey(key: string): boolean; /** * Check if the given address is valid. * * **Note:** it checks the format and the checksum of the address. * It does not check whether or not the address does exist on the network. * * @param address - The address to check * @returns Valid */ export declare function checkAddress(address: string): boolean; /** * Check if the given work is valid. * * **Note:** it only checks the format of the work, not its difficulty. * * @param work - The work to check * @returns Valid */ export declare function checkWork(work: string): boolean; /** * Check if the given signature is valid. * * **Note:** it only checks the format of the signature. * * @param signature - The signature to check * @returns Valid */ export declare function checkSignature(signature: string): boolean;