mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Merge pull request #90 from oceanprotocol/fix/signing
add detection for meta mask
This commit is contained in:
commit
d6af0d8c9a
@ -86,8 +86,14 @@ export default class ServiceAgreement extends OceanBase {
|
||||
valueHashes,
|
||||
timeoutValues)
|
||||
|
||||
const serviceAgreementHashSignature = await Web3Provider
|
||||
.getWeb3().eth.sign(serviceAgreementHash, consumer.getId())
|
||||
let serviceAgreementHashSignature: string
|
||||
const web3 = Web3Provider.getWeb3()
|
||||
if (web3.currentProvider.isMetaMask) {
|
||||
// password is injected by metamask, dont try to set it!
|
||||
serviceAgreementHashSignature = await web3.eth.personal.sign(serviceAgreementHash, consumer.getId(), null)
|
||||
} else {
|
||||
serviceAgreementHashSignature = await web3.eth.sign(serviceAgreementHash, consumer.getId())
|
||||
}
|
||||
|
||||
return serviceAgreementHashSignature
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user