const signature = await NanoNaCl.detached(this.#hash(), hex.toBytes(input))
this.signature = bytes.toHex(signature)
} else if (typeof input !== 'number' && typeof input !== 'string' && !(input instanceof Wallet)) {
- throw new TypeError('Invalid signing input')
+ throw new TypeError('Invalid signing input', { cause: input })
} else if (input instanceof Wallet && typeof param === 'number') {
const wallet = input
await wallet.sign(param, this)
}
await ledger.sign(index, this)
} else {
- throw new TypeError('Invalid key for block signature', { cause: typeof input })
+ throw new TypeError('Invalid key for block signature', { cause: input })
}
resolve(this)
} catch (err) {