|
|
|
@ -2,6 +2,7 @@ const EventEmitter = require('events') |
|
|
|
|
const ObservableStore = require('obs-store') |
|
|
|
|
const createId = require('./random-id') |
|
|
|
|
const assert = require('assert') |
|
|
|
|
const { errors: rpcErrors } = require('eth-json-rpc-errors') |
|
|
|
|
const sigUtil = require('eth-sig-util') |
|
|
|
|
const log = require('loglevel') |
|
|
|
|
const jsonschema = require('jsonschema') |
|
|
|
@ -78,7 +79,7 @@ module.exports = class TypedMessageManager extends EventEmitter { |
|
|
|
|
case 'signed': |
|
|
|
|
return resolve(data.rawSig) |
|
|
|
|
case 'rejected': |
|
|
|
|
return reject(new Error('MetaMask Message Signature: User denied message signature.')) |
|
|
|
|
return reject(rpcErrors.eth.userRejectedRequest('MetaMask Message Signature: User denied message signature.')) |
|
|
|
|
case 'errored': |
|
|
|
|
return reject(new Error(`MetaMask Message Signature: ${data.error}`)) |
|
|
|
|
default: |
|
|
|
|