diff --git a/src/ocean/utils/SignatureUtils.ts b/src/ocean/utils/SignatureUtils.ts index 21da9bd..04cf97e 100644 --- a/src/ocean/utils/SignatureUtils.ts +++ b/src/ocean/utils/SignatureUtils.ts @@ -43,12 +43,12 @@ export class SignatureUtils { publicKey: string, password?: string ): Promise { + const hash = this.web3.utils.utf8ToHex(text) const isMetaMask = this.web3 && this.web3.currentProvider && (this.web3.currentProvider as any).isMetaMask try { - const hash = this.web3.utils.utf8ToHex(text) return await this.web3.eth.personal.sign(hash, publicKey, password) } catch (e) { if (isMetaMask) { @@ -57,7 +57,7 @@ export class SignatureUtils { this.logger.warn('Error on personal sign.') this.logger.warn(e) try { - return await this.web3.eth.sign(text, publicKey) + return await this.web3.eth.sign(hash, publicKey) } catch (e2) { this.logger.error('Error on sign.') this.logger.error(e2)