if (typeof input === 'string' && /^[A-F0-9]{64}$/i.test(input)) {
const signature = await NanoNaCl.detached(this.#hash(), hex.toBytes(input))
this.signature = bytes.toHex(signature)
- } else if (input instanceof Wallet && typeof index === 'number') {
+ } else if (input instanceof Wallet && typeof index === 'number'
+ && (frontier === undefined || frontier instanceof Block)
+ ) {
const wallet = input
- await wallet.sign(index, this)
+ await wallet.sign(index, this, frontier)
} else {
throw new TypeError('Invalid input for block signature')
}