mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Detect signature errors produced user rejection. #226
This commit is contained in:
parent
18037db43d
commit
d363e3cd2a
@ -10,9 +10,13 @@ export class SignatureUtils extends Instantiable {
|
||||
}
|
||||
|
||||
public async signText(text: string, publicKey: string, password?: string): Promise<string> {
|
||||
const isMetaMask = this.web3 && this.web3.currentProvider && this.web3.currentProvider.isMetaMask
|
||||
try {
|
||||
return await this.web3.eth.personal.sign(text, publicKey, password)
|
||||
} catch (e) {
|
||||
if (isMetaMask) {
|
||||
throw e
|
||||
}
|
||||
this.logger.warn("Error on personal sign.")
|
||||
this.logger.warn(e)
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user