*/
export async function verify (key: string, signature: string, ...input: string[]): Promise<boolean> {
const data = hash(input)
- return NanoNaCl.verify(
- hex.toBytes(data),
- hex.toBytes(signature),
- hex.toBytes(key))
+ try {
+ return await NanoNaCl.verify(
+ hex.toBytes(data),
+ hex.toBytes(signature),
+ hex.toBytes(key))
+ } catch (err) {
+ console.error(err)
+ return false
+ }
}
export const Tools = { convert, sign, sweep, verify }