async sign (wallet: Wallet, index: number, frontier?: Block): Promise<Block>
sign (input: unknown, index?: unknown, frontier?: unknown): Block | Promise<Block> {
if (navigator.userActivation?.isActive === false) {
- throw new Error('Signing request was blocked due to lack of user activation.')
+ throw new DOMException(
+ 'Signing request was blocked due to lack of user activation',
+ 'NotAllowedError'
+ )
}
if (typeof input === 'string' && /^[A-F0-9]{128}$/i.test(input)) {
this.signature = input
*/
static sign (secretKey: string | ArrayBuffer | Uint8Array<ArrayBuffer>, ...input: string[]): string {
if (navigator.userActivation?.isActive === false) {
- throw new Error('Signing request was blocked due to lack of user activation.')
+ throw new DOMException(
+ 'Signing request was blocked due to lack of user activation',
+ 'NotAllowedError'
+ )
}
const k = this.#normalize(secretKey)
try {