The condition here in the constructor of the NDKNip46Backend class always evaluates to false because a hex string is not an instance of the String class. Consequently, passing a hex string for the privateKeyOrSigner argument results in an "Invalid signer" error.
Modify the condition to properly check if privateKeyOrSigner is a hex string by using a more appropriate method, such as checking the type with typeof or using a regular expression to validate hex string format.
The condition here in the constructor of the NDKNip46Backend class always evaluates to false because a hex string is not an instance of the String class. Consequently, passing a hex string for the privateKeyOrSigner argument results in an "Invalid signer" error.
Modify the condition to properly check if privateKeyOrSigner is a hex string by using a more appropriate method, such as checking the type with typeof or using a regular expression to validate hex string format.