@metamask/message-manager
Advanced tools
Comparing version 7.3.9 to 8.0.0
@@ -10,2 +10,15 @@ # Changelog | ||
## [8.0.0] | ||
### Added | ||
- **BREAKING**: Add ESM build ([#3998](https://github.com/MetaMask/core/pull/3998)) | ||
- It's no longer possible to import files from `./dist` directly. | ||
### Changed | ||
- **BREAKING:** Bump `@metamask/base-controller` to `^5.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039)) | ||
- This version has a number of breaking changes. See the changelog for more. | ||
- Bump `@metamask/controller-utils` to `^9.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039)) | ||
## [7.3.9] | ||
@@ -213,3 +226,4 @@ | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/message-manager@7.3.9...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.0...HEAD | ||
[8.0.0]: https://github.com/MetaMask/core/compare/@metamask/message-manager@7.3.9...@metamask/message-manager@8.0.0 | ||
[7.3.9]: https://github.com/MetaMask/core/compare/@metamask/message-manager@7.3.8...@metamask/message-manager@7.3.9 | ||
@@ -216,0 +230,0 @@ [7.3.8]: https://github.com/MetaMask/core/compare/@metamask/message-manager@7.3.7...@metamask/message-manager@7.3.8 |
@@ -1,294 +0,9 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AbstractMessageManager = void 0; | ||
const base_controller_1 = require("@metamask/base-controller"); | ||
const events_1 = require("events"); | ||
/** | ||
* Controller in charge of managing - storing, adding, removing, updating - Messages. | ||
*/ | ||
class AbstractMessageManager extends base_controller_1.BaseControllerV1 { | ||
/** | ||
* Creates an AbstractMessageManager instance. | ||
* | ||
* @param config - Initial options used to configure this controller. | ||
* @param state - Initial state to set on this controller. | ||
* @param securityProviderRequest - A function for verifying a message, whether it is malicious or not. | ||
* @param additionalFinishStatuses - Optional list of statuses that are accepted to emit a finished event. | ||
* @param getCurrentChainId - Optional function to get the current chainId. | ||
*/ | ||
constructor(config, state, securityProviderRequest, additionalFinishStatuses, getCurrentChainId) { | ||
super(config, state); | ||
/** | ||
* EventEmitter instance used to listen to specific message events | ||
*/ | ||
this.hub = new events_1.EventEmitter(); | ||
/** | ||
* Name of this controller used during composition | ||
*/ | ||
this.name = 'AbstractMessageManager'; | ||
this.defaultState = { | ||
unapprovedMessages: {}, | ||
unapprovedMessagesCount: 0, | ||
}; | ||
this.messages = []; | ||
this.securityProviderRequest = securityProviderRequest; | ||
this.additionalFinishStatuses = additionalFinishStatuses !== null && additionalFinishStatuses !== void 0 ? additionalFinishStatuses : []; | ||
this.getCurrentChainId = getCurrentChainId; | ||
this.initialize(); | ||
} | ||
/** | ||
* Saves the unapproved messages, and their count to state. | ||
* | ||
* @param emitUpdateBadge - Whether to emit the updateBadge event. | ||
*/ | ||
saveMessageList(emitUpdateBadge = true) { | ||
const unapprovedMessages = this.getUnapprovedMessages(); | ||
const unapprovedMessagesCount = this.getUnapprovedMessagesCount(); | ||
this.update({ unapprovedMessages, unapprovedMessagesCount }); | ||
if (emitUpdateBadge) { | ||
this.hub.emit('updateBadge'); | ||
} | ||
} | ||
/** | ||
* Updates the status of a Message in this.messages. | ||
* | ||
* @param messageId - The id of the Message to update. | ||
* @param status - The new status of the Message. | ||
*/ | ||
setMessageStatus(messageId, status) { | ||
const message = this.getMessage(messageId); | ||
if (!message) { | ||
throw new Error(`${this.name}: Message not found for id: ${messageId}.`); | ||
} | ||
message.status = status; | ||
this.updateMessage(message); | ||
this.hub.emit(`${messageId}:${status}`, message); | ||
if (status === 'rejected' || | ||
status === 'signed' || | ||
status === 'errored' || | ||
this.additionalFinishStatuses.includes(status)) { | ||
this.hub.emit(`${messageId}:finished`, message); | ||
} | ||
} | ||
/** | ||
* Sets a Message in this.messages to the passed Message if the ids are equal. | ||
* Then saves the unapprovedMessage list to storage. | ||
* | ||
* @param message - A Message that will replace an existing Message (with the id) in this.messages. | ||
* @param emitUpdateBadge - Whether to emit the updateBadge event. | ||
*/ | ||
updateMessage(message, emitUpdateBadge = true) { | ||
const index = this.messages.findIndex((msg) => message.id === msg.id); | ||
/* istanbul ignore next */ | ||
if (index !== -1) { | ||
this.messages[index] = message; | ||
} | ||
this.saveMessageList(emitUpdateBadge); | ||
} | ||
/** | ||
* Verifies a message is malicious or not by checking it against a security provider. | ||
* | ||
* @param message - The message to verify. | ||
* @returns A promise that resolves to a secured message with additional security provider response data. | ||
*/ | ||
securityCheck(message) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (this.securityProviderRequest) { | ||
const securityProviderResponse = yield this.securityProviderRequest(message, message.type); | ||
return Object.assign(Object.assign({}, message), { securityProviderResponse }); | ||
} | ||
return message; | ||
}); | ||
} | ||
/** | ||
* A getter for the number of 'unapproved' Messages in this.messages. | ||
* | ||
* @returns The number of 'unapproved' Messages in this.messages. | ||
*/ | ||
getUnapprovedMessagesCount() { | ||
return Object.keys(this.getUnapprovedMessages()).length; | ||
} | ||
/** | ||
* A getter for the 'unapproved' Messages in state messages. | ||
* | ||
* @returns An index of Message ids to Messages, for all 'unapproved' Messages in this.messages. | ||
*/ | ||
getUnapprovedMessages() { | ||
return this.messages | ||
.filter((message) => message.status === 'unapproved') | ||
.reduce((result, message) => { | ||
result[message.id] = message; | ||
return result; | ||
}, {}); | ||
} | ||
/** | ||
* Adds a passed Message to this.messages, and calls this.saveMessageList() to save | ||
* the unapproved Messages from that list to this.messages. | ||
* | ||
* @param message - The Message to add to this.messages. | ||
*/ | ||
addMessage(message) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const securedMessage = yield this.securityCheck(message); | ||
this.messages.push(securedMessage); | ||
this.saveMessageList(); | ||
}); | ||
} | ||
/** | ||
* Returns a specified Message. | ||
* | ||
* @param messageId - The id of the Message to get. | ||
* @returns The Message with the id that matches the passed messageId, or undefined | ||
* if no Message has that id. | ||
*/ | ||
getMessage(messageId) { | ||
return this.messages.find((message) => message.id === messageId); | ||
} | ||
/** | ||
* Returns all the messages. | ||
* | ||
* @returns An array of messages. | ||
*/ | ||
getAllMessages() { | ||
return this.messages; | ||
} | ||
/** | ||
* Approves a Message. Sets the message status via a call to this.setMessageStatusApproved, | ||
* and returns a promise with any the message params modified for proper signing. | ||
* | ||
* @param messageParams - The messageParams to be used when signing method is called, | ||
* plus data added by MetaMask. | ||
* @returns Promise resolving to the messageParams with the metamaskId property removed. | ||
*/ | ||
approveMessage(messageParams) { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
this.setMessageStatusApproved(messageParams.metamaskId); | ||
return this.prepMessageForSigning(messageParams); | ||
} | ||
/** | ||
* Sets a Message status to 'approved' via a call to this.setMessageStatus. | ||
* | ||
* @param messageId - The id of the Message to approve. | ||
*/ | ||
setMessageStatusApproved(messageId) { | ||
this.setMessageStatus(messageId, 'approved'); | ||
} | ||
/** | ||
* Sets message status to inProgress in order to allow users to use extension | ||
* while waiting for a custodian signature. | ||
* | ||
* @param messageId - The id of the message to set to inProgress | ||
*/ | ||
setMessageStatusInProgress(messageId) { | ||
this.setMessageStatus(messageId, 'inProgress'); | ||
} | ||
/** | ||
* Sets a Message status to 'signed' via a call to this.setMessageStatus and updates | ||
* that Message in this.messages by adding the raw signature data of the signature | ||
* request to the Message. | ||
* | ||
* @param messageId - The id of the Message to sign. | ||
* @param rawSig - The raw data of the signature request. | ||
*/ | ||
setMessageStatusSigned(messageId, rawSig) { | ||
this.setMessageStatusAndResult(messageId, rawSig, 'signed'); | ||
} | ||
/** | ||
* Sets the message via a call to this.setResult and updates status of the message. | ||
* | ||
* @param messageId - The id of the Message to sign. | ||
* @param rawSig - The data to update rawSig in the message. | ||
* @param status - The new message status. | ||
*/ | ||
setMessageStatusAndResult(messageId, rawSig, status) { | ||
this.setResult(messageId, rawSig); | ||
this.setMessageStatus(messageId, status); | ||
} | ||
/** | ||
* Sets the message result. | ||
* | ||
* @param messageId - The id of the Message to sign. | ||
* @param result - The data to update result in the message. | ||
*/ | ||
setResult(messageId, result) { | ||
const message = this.getMessage(messageId); | ||
/* istanbul ignore if */ | ||
if (!message) { | ||
return; | ||
} | ||
message.rawSig = result; | ||
this.updateMessage(message, false); | ||
} | ||
/** | ||
* Sets the messsage metadata | ||
* | ||
* @param messageId - The id of the Message to update | ||
* @param metadata - The data with which to replace the metadata property in the message | ||
*/ | ||
setMetadata(messageId, metadata) { | ||
const message = this.getMessage(messageId); | ||
if (!message) { | ||
throw new Error(`${this.name}: Message not found for id: ${messageId}.`); | ||
} | ||
message.metadata = metadata; | ||
this.updateMessage(message, false); | ||
} | ||
/** | ||
* Sets a Message status to 'rejected' via a call to this.setMessageStatus. | ||
* | ||
* @param messageId - The id of the Message to reject. | ||
*/ | ||
rejectMessage(messageId) { | ||
this.setMessageStatus(messageId, 'rejected'); | ||
} | ||
/** | ||
* Creates a promise which will resolve or reject when the message process is finished. | ||
* | ||
* @param messageParamsWithId - The params for the personal_sign call to be made after the message is approved. | ||
* @param messageName - The name of the message | ||
* @returns Promise resolving to the raw data of the signature request. | ||
*/ | ||
waitForFinishStatus(messageParamsWithId, messageName) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { metamaskId: messageId } = messageParamsWithId, messageParams = __rest(messageParamsWithId, ["metamaskId"]); | ||
return new Promise((resolve, reject) => { | ||
this.hub.once(`${messageId}:finished`, (data) => { | ||
switch (data.status) { | ||
case 'signed': | ||
return resolve(data.rawSig); | ||
case 'rejected': | ||
return reject(new Error(`MetaMask ${messageName} Signature: User denied message signature.`)); | ||
case 'errored': | ||
return reject(new Error(`MetaMask ${messageName} Signature: ${data.error}`)); | ||
default: | ||
return reject(new Error(`MetaMask ${messageName} Signature: Unknown problem: ${JSON.stringify(messageParams)}`)); | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
exports.AbstractMessageManager = AbstractMessageManager; | ||
exports.default = AbstractMessageManager; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkXIE54L35js = require('./chunk-XIE54L35.js'); | ||
exports.AbstractMessageManager = _chunkXIE54L35js.AbstractMessageManager; exports.default = _chunkXIE54L35js.AbstractMessageManager_default; | ||
//# sourceMappingURL=AbstractMessageManager.js.map |
@@ -1,97 +0,9 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DecryptMessageManager = void 0; | ||
const uuid_1 = require("uuid"); | ||
const AbstractMessageManager_1 = require("./AbstractMessageManager"); | ||
const utils_1 = require("./utils"); | ||
/** | ||
* Controller in charge of managing - storing, adding, removing, updating - DecryptMessages. | ||
*/ | ||
class DecryptMessageManager extends AbstractMessageManager_1.AbstractMessageManager { | ||
constructor() { | ||
super(...arguments); | ||
/** | ||
* Name of this controller used during composition | ||
*/ | ||
this.name = 'DecryptMessageManager'; | ||
} | ||
/** | ||
* Creates a new Message with an 'unapproved' status using the passed messageParams. | ||
* this.addMessage is called to add the new Message to this.messages, and to save the unapproved Messages. | ||
* | ||
* @param messageParams - The params for the personal_sign call to be made after the message is approved. | ||
* @param req - The original request object possibly containing the origin. | ||
* @returns Promise resolving to the raw data of the signature request. | ||
*/ | ||
addUnapprovedMessageAsync(messageParams, req) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
(0, utils_1.validateDecryptedMessageData)(messageParams); | ||
const messageId = yield this.addUnapprovedMessage(messageParams, req); | ||
return new Promise((resolve, reject) => { | ||
this.hub.once(`${messageId}:finished`, (data) => { | ||
switch (data.status) { | ||
case 'decrypted': | ||
return resolve(data.rawSig); | ||
case 'rejected': | ||
return reject(new Error('MetaMask DecryptMessage: User denied message decryption.')); | ||
case 'errored': | ||
return reject(new Error('MetaMask DecryptMessage: This message cannot be decrypted.')); | ||
default: | ||
return reject(new Error(`MetaMask DecryptMessage: Unknown problem: ${JSON.stringify(messageParams)}`)); | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
/** | ||
* Creates a new Message with an 'unapproved' status using the passed messageParams. | ||
* this.addMessage is called to add the new Message to this.messages, and to save the | ||
* unapproved Messages. | ||
* | ||
* @param messageParams - The params for the personal_sign call to be made after the message | ||
* is approved. | ||
* @param req - The original request object possibly containing the origin. | ||
* @returns The id of the newly created message. | ||
*/ | ||
addUnapprovedMessage(messageParams, req) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (req) { | ||
messageParams.origin = req.origin; | ||
} | ||
messageParams.data = (0, utils_1.normalizeMessageData)(messageParams.data); | ||
const messageId = (0, uuid_1.v1)(); | ||
const messageData = { | ||
id: messageId, | ||
messageParams, | ||
status: 'unapproved', | ||
time: Date.now(), | ||
type: 'eth_decrypt', | ||
}; | ||
yield this.addMessage(messageData); | ||
this.hub.emit(`unapprovedMessage`, Object.assign(Object.assign({}, messageParams), { metamaskId: messageId })); | ||
return messageId; | ||
}); | ||
} | ||
/** | ||
* Removes the metamaskId property from passed messageParams and returns a promise which | ||
* resolves the updated messageParams. | ||
* | ||
* @param messageParams - The messageParams to modify. | ||
* @returns Promise resolving to the messageParams with the metamaskId property removed. | ||
*/ | ||
prepMessageForSigning(messageParams) { | ||
delete messageParams.metamaskId; | ||
return Promise.resolve(messageParams); | ||
} | ||
} | ||
exports.DecryptMessageManager = DecryptMessageManager; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunk2M3SPS5Bjs = require('./chunk-2M3SPS5B.js'); | ||
require('./chunk-XIE54L35.js'); | ||
require('./chunk-3K7FRO6K.js'); | ||
exports.DecryptMessageManager = _chunk2M3SPS5Bjs.DecryptMessageManager; | ||
//# sourceMappingURL=DecryptMessageManager.js.map |
@@ -1,95 +0,11 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EncryptionPublicKeyManager = void 0; | ||
const uuid_1 = require("uuid"); | ||
const AbstractMessageManager_1 = require("./AbstractMessageManager"); | ||
const utils_1 = require("./utils"); | ||
/** | ||
* Controller in charge of managing - storing, adding, removing, updating - Messages. | ||
*/ | ||
class EncryptionPublicKeyManager extends AbstractMessageManager_1.AbstractMessageManager { | ||
constructor() { | ||
super(...arguments); | ||
/** | ||
* Name of this controller used during composition | ||
*/ | ||
this.name = 'EncryptionPublicKeyManager'; | ||
} | ||
/** | ||
* Creates a new Message with an 'unapproved' status using the passed messageParams. | ||
* this.addMessage is called to add the new Message to this.messages, and to save the unapproved Messages. | ||
* | ||
* @param messageParams - The params for the eth_getEncryptionPublicKey call to be made after the message is approved. | ||
* @param req - The original request object possibly containing the origin. | ||
* @returns Promise resolving to the raw data of the request. | ||
*/ | ||
addUnapprovedMessageAsync(messageParams, req) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
(0, utils_1.validateEncryptionPublicKeyMessageData)(messageParams); | ||
const messageId = yield this.addUnapprovedMessage(messageParams, req); | ||
return new Promise((resolve, reject) => { | ||
this.hub.once(`${messageId}:finished`, (data) => { | ||
switch (data.status) { | ||
case 'received': | ||
return resolve(data.rawSig); | ||
case 'rejected': | ||
return reject(new Error('MetaMask EncryptionPublicKey: User denied message EncryptionPublicKey.')); | ||
default: | ||
return reject(new Error(`MetaMask EncryptionPublicKey: Unknown problem: ${JSON.stringify(messageParams)}`)); | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
/** | ||
* Creates a new Message with an 'unapproved' status using the passed messageParams. | ||
* this.addMessage is called to add the new Message to this.messages, and to save the | ||
* unapproved Messages. | ||
* | ||
* @param messageParams - The params for the eth_getEncryptionPublicKey call to be made after the message | ||
* is approved. | ||
* @param req - The original request object possibly containing the origin. | ||
* @returns The id of the newly created message. | ||
*/ | ||
addUnapprovedMessage(messageParams, req) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (req) { | ||
messageParams.origin = req.origin; | ||
} | ||
const messageId = (0, uuid_1.v1)(); | ||
const messageData = { | ||
id: messageId, | ||
messageParams, | ||
status: 'unapproved', | ||
time: Date.now(), | ||
type: 'eth_getEncryptionPublicKey', | ||
}; | ||
yield this.addMessage(messageData); | ||
this.hub.emit(`unapprovedMessage`, Object.assign(Object.assign({}, messageParams), { metamaskId: messageId })); | ||
return messageId; | ||
}); | ||
} | ||
/** | ||
* Removes the metamaskId property from passed messageParams and returns a promise which | ||
* resolves the updated messageParams. | ||
* | ||
* @param messageParams - The messageParams to modify. | ||
* @returns Promise resolving to the messageParams with the metamaskId property removed. | ||
*/ | ||
prepMessageForSigning(messageParams) { | ||
delete messageParams.metamaskId; | ||
return Promise.resolve({ from: messageParams.data }); | ||
} | ||
} | ||
exports.EncryptionPublicKeyManager = EncryptionPublicKeyManager; | ||
exports.default = EncryptionPublicKeyManager; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkJTLHKEF7js = require('./chunk-JTLHKEF7.js'); | ||
require('./chunk-XIE54L35.js'); | ||
require('./chunk-3K7FRO6K.js'); | ||
exports.EncryptionPublicKeyManager = _chunkJTLHKEF7js.EncryptionPublicKeyManager; exports.default = _chunkJTLHKEF7js.EncryptionPublicKeyManager_default; | ||
//# sourceMappingURL=EncryptionPublicKeyManager.js.map |
@@ -1,23 +0,28 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./AbstractMessageManager"), exports); | ||
__exportStar(require("./MessageManager"), exports); | ||
__exportStar(require("./PersonalMessageManager"), exports); | ||
__exportStar(require("./TypedMessageManager"), exports); | ||
__exportStar(require("./EncryptionPublicKeyManager"), exports); | ||
__exportStar(require("./DecryptMessageManager"), exports); | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunk2M3SPS5Bjs = require('./chunk-2M3SPS5B.js'); | ||
var _chunkJTLHKEF7js = require('./chunk-JTLHKEF7.js'); | ||
var _chunkT7TBKAYHjs = require('./chunk-T7TBKAYH.js'); | ||
var _chunkZJWOSEYFjs = require('./chunk-ZJWOSEYF.js'); | ||
var _chunkLU4CK2YWjs = require('./chunk-LU4CK2YW.js'); | ||
var _chunkXIE54L35js = require('./chunk-XIE54L35.js'); | ||
require('./chunk-3K7FRO6K.js'); | ||
exports.AbstractMessageManager = _chunkXIE54L35js.AbstractMessageManager; exports.DecryptMessageManager = _chunk2M3SPS5Bjs.DecryptMessageManager; exports.EncryptionPublicKeyManager = _chunkJTLHKEF7js.EncryptionPublicKeyManager; exports.MessageManager = _chunkT7TBKAYHjs.MessageManager; exports.PersonalMessageManager = _chunkZJWOSEYFjs.PersonalMessageManager; exports.TypedMessageManager = _chunkLU4CK2YWjs.TypedMessageManager; | ||
//# sourceMappingURL=index.js.map |
@@ -1,84 +0,11 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MessageManager = void 0; | ||
const uuid_1 = require("uuid"); | ||
const AbstractMessageManager_1 = require("./AbstractMessageManager"); | ||
const utils_1 = require("./utils"); | ||
/** | ||
* Controller in charge of managing - storing, adding, removing, updating - Messages. | ||
*/ | ||
class MessageManager extends AbstractMessageManager_1.AbstractMessageManager { | ||
constructor() { | ||
super(...arguments); | ||
/** | ||
* Name of this controller used during composition | ||
*/ | ||
this.name = 'MessageManager'; | ||
} | ||
/** | ||
* Creates a new Message with an 'unapproved' status using the passed messageParams. | ||
* this.addMessage is called to add the new Message to this.messages, and to save the | ||
* unapproved Messages. | ||
* | ||
* @param messageParams - The params for the eth_sign call to be made after the message | ||
* is approved. | ||
* @param req - The original request object possibly containing the origin. | ||
* @returns The id of the newly created message. | ||
*/ | ||
addUnapprovedMessage(messageParams, req) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
(0, utils_1.validateSignMessageData)(messageParams); | ||
if (req) { | ||
messageParams.origin = req.origin; | ||
} | ||
messageParams.data = (0, utils_1.normalizeMessageData)(messageParams.data); | ||
const messageId = (0, uuid_1.v1)(); | ||
const messageData = { | ||
id: messageId, | ||
messageParams, | ||
securityAlertResponse: req === null || req === void 0 ? void 0 : req.securityAlertResponse, | ||
status: 'unapproved', | ||
time: Date.now(), | ||
type: 'eth_sign', | ||
}; | ||
yield this.addMessage(messageData); | ||
this.hub.emit(`unapprovedMessage`, Object.assign(Object.assign({}, messageParams), { metamaskId: messageId })); | ||
return messageId; | ||
}); | ||
} | ||
/** | ||
* Removes the metamaskId property from passed messageParams and returns a promise which | ||
* resolves the updated messageParams. | ||
* | ||
* @param messageParams - The messageParams to modify. | ||
* @returns Promise resolving to the messageParams with the metamaskId property removed. | ||
*/ | ||
prepMessageForSigning(messageParams) { | ||
// Using delete operation will throw an error on frozen messageParams | ||
const { metamaskId: _metamaskId } = messageParams, messageParamsWithoutId = __rest(messageParams, ["metamaskId"]); | ||
return Promise.resolve(messageParamsWithoutId); | ||
} | ||
} | ||
exports.MessageManager = MessageManager; | ||
exports.default = MessageManager; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkT7TBKAYHjs = require('./chunk-T7TBKAYH.js'); | ||
require('./chunk-XIE54L35.js'); | ||
require('./chunk-3K7FRO6K.js'); | ||
exports.MessageManager = _chunkT7TBKAYHjs.MessageManager; exports.default = _chunkT7TBKAYHjs.MessageManager_default; | ||
//# sourceMappingURL=MessageManager.js.map |
@@ -1,87 +0,11 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PersonalMessageManager = void 0; | ||
const controller_utils_1 = require("@metamask/controller-utils"); | ||
const uuid_1 = require("uuid"); | ||
const AbstractMessageManager_1 = require("./AbstractMessageManager"); | ||
const utils_1 = require("./utils"); | ||
/** | ||
* Controller in charge of managing - storing, adding, removing, updating - Messages. | ||
*/ | ||
class PersonalMessageManager extends AbstractMessageManager_1.AbstractMessageManager { | ||
constructor() { | ||
super(...arguments); | ||
/** | ||
* Name of this controller used during composition | ||
*/ | ||
this.name = 'PersonalMessageManager'; | ||
} | ||
/** | ||
* Creates a new Message with an 'unapproved' status using the passed messageParams. | ||
* this.addMessage is called to add the new Message to this.messages, and to save the | ||
* unapproved Messages. | ||
* | ||
* @param messageParams - The params for the personal_sign call to be made after the message | ||
* is approved. | ||
* @param req - The original request object possibly containing the origin. | ||
* @returns The id of the newly created message. | ||
*/ | ||
addUnapprovedMessage(messageParams, req) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
(0, utils_1.validateSignMessageData)(messageParams); | ||
if (req) { | ||
messageParams.origin = req.origin; | ||
} | ||
messageParams.data = (0, utils_1.normalizeMessageData)(messageParams.data); | ||
const ethereumSignInData = (0, controller_utils_1.detectSIWE)(messageParams); | ||
const finalMsgParams = Object.assign(Object.assign({}, messageParams), { siwe: ethereumSignInData }); | ||
const messageId = (0, uuid_1.v1)(); | ||
const messageData = { | ||
id: messageId, | ||
messageParams: finalMsgParams, | ||
securityAlertResponse: req === null || req === void 0 ? void 0 : req.securityAlertResponse, | ||
status: 'unapproved', | ||
time: Date.now(), | ||
type: 'personal_sign', | ||
}; | ||
yield this.addMessage(messageData); | ||
this.hub.emit(`unapprovedMessage`, Object.assign(Object.assign({}, finalMsgParams), { metamaskId: messageId })); | ||
return messageId; | ||
}); | ||
} | ||
/** | ||
* Removes the metamaskId property from passed messageParams and returns a promise which | ||
* resolves the updated messageParams. | ||
* | ||
* @param messageParams - The messageParams to modify. | ||
* @returns Promise resolving to the messageParams with the metamaskId property removed. | ||
*/ | ||
prepMessageForSigning(messageParams) { | ||
// Using delete operation will throw an error on frozen messageParams | ||
const { metamaskId: _metamaskId } = messageParams, messageParamsWithoutId = __rest(messageParams, ["metamaskId"]); | ||
return Promise.resolve(messageParamsWithoutId); | ||
} | ||
} | ||
exports.PersonalMessageManager = PersonalMessageManager; | ||
exports.default = PersonalMessageManager; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkZJWOSEYFjs = require('./chunk-ZJWOSEYF.js'); | ||
require('./chunk-XIE54L35.js'); | ||
require('./chunk-3K7FRO6K.js'); | ||
exports.PersonalMessageManager = _chunkZJWOSEYFjs.PersonalMessageManager; exports.default = _chunkZJWOSEYFjs.PersonalMessageManager_default; | ||
//# sourceMappingURL=PersonalMessageManager.js.map |
@@ -1,112 +0,11 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TypedMessageManager = void 0; | ||
const uuid_1 = require("uuid"); | ||
const AbstractMessageManager_1 = require("./AbstractMessageManager"); | ||
const utils_1 = require("./utils"); | ||
/** | ||
* Controller in charge of managing - storing, adding, removing, updating - TypedMessages. | ||
*/ | ||
class TypedMessageManager extends AbstractMessageManager_1.AbstractMessageManager { | ||
constructor() { | ||
super(...arguments); | ||
/** | ||
* Name of this controller used during composition | ||
*/ | ||
this.name = 'TypedMessageManager'; | ||
} | ||
/** | ||
* Creates a new TypedMessage with an 'unapproved' status using the passed messageParams. | ||
* this.addMessage is called to add the new TypedMessage to this.messages, and to save the | ||
* unapproved TypedMessages. | ||
* | ||
* @param messageParams - The params for the 'eth_signTypedData' call to be made after the message | ||
* is approved. | ||
* @param req - The original request object possibly containing the origin. | ||
* @param version - Compatibility version EIP712. | ||
* @returns The id of the newly created TypedMessage. | ||
*/ | ||
addUnapprovedMessage(messageParams, req, version) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (version === 'V1') { | ||
(0, utils_1.validateTypedSignMessageDataV1)(messageParams); | ||
} | ||
if (version === 'V3' || version === 'V4') { | ||
const currentChainId = (_a = this.getCurrentChainId) === null || _a === void 0 ? void 0 : _a.call(this); | ||
(0, utils_1.validateTypedSignMessageDataV3V4)(messageParams, currentChainId); | ||
} | ||
if (typeof messageParams.data !== 'string' && | ||
(version === 'V3' || version === 'V4')) { | ||
messageParams.data = JSON.stringify(messageParams.data); | ||
} | ||
const messageId = (0, uuid_1.v1)(); | ||
const messageParamsMetamask = Object.assign(Object.assign({}, messageParams), { metamaskId: messageId, version }); | ||
if (req) { | ||
messageParams.origin = req.origin; | ||
} | ||
const messageData = { | ||
id: messageId, | ||
messageParams, | ||
securityAlertResponse: req === null || req === void 0 ? void 0 : req.securityAlertResponse, | ||
status: 'unapproved', | ||
time: Date.now(), | ||
type: 'eth_signTypedData', | ||
}; | ||
yield this.addMessage(messageData); | ||
this.hub.emit(`unapprovedMessage`, messageParamsMetamask); | ||
return messageId; | ||
}); | ||
} | ||
/** | ||
* Sets a TypedMessage status to 'errored' via a call to this.setMessageStatus. | ||
* | ||
* @param messageId - The id of the TypedMessage to error. | ||
* @param error - The error to be included in TypedMessage. | ||
*/ | ||
setMessageStatusErrored(messageId, error) { | ||
const message = this.getMessage(messageId); | ||
/* istanbul ignore if */ | ||
if (!message) { | ||
return; | ||
} | ||
message.error = error; | ||
this.updateMessage(message); | ||
this.setMessageStatus(messageId, 'errored'); | ||
} | ||
/** | ||
* Removes the metamaskId and version properties from passed messageParams and returns a promise which | ||
* resolves the updated messageParams. | ||
* | ||
* @param messageParams - The messageParams to modify. | ||
* @returns Promise resolving to the messageParams with the metamaskId and version properties removed. | ||
*/ | ||
prepMessageForSigning(messageParams) { | ||
// Using delete operation will throw an error on frozen messageParams | ||
const { metamaskId: _metamaskId, version: _version } = messageParams, messageParamsWithoutId = __rest(messageParams, ["metamaskId", "version"]); | ||
return Promise.resolve(messageParamsWithoutId); | ||
} | ||
} | ||
exports.TypedMessageManager = TypedMessageManager; | ||
exports.default = TypedMessageManager; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkLU4CK2YWjs = require('./chunk-LU4CK2YW.js'); | ||
require('./chunk-XIE54L35.js'); | ||
require('./chunk-3K7FRO6K.js'); | ||
exports.TypedMessageManager = _chunkLU4CK2YWjs.TypedMessageManager; exports.default = _chunkLU4CK2YWjs.TypedMessageManager_default; | ||
//# sourceMappingURL=TypedMessageManager.js.map |
@@ -1,147 +0,17 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.validateDecryptedMessageData = exports.validateEncryptionPublicKeyMessageData = exports.validateTypedSignMessageDataV3V4 = exports.validateTypedSignMessageDataV1 = exports.validateSignMessageData = exports.normalizeMessageData = void 0; | ||
const controller_utils_1 = require("@metamask/controller-utils"); | ||
const eth_sig_util_1 = require("@metamask/eth-sig-util"); | ||
const utils_1 = require("@metamask/utils"); | ||
const jsonschema_1 = require("jsonschema"); | ||
const hexRe = /^[0-9A-Fa-f]+$/gu; | ||
/** | ||
* Validates an address string and throws in the event of any validation error. | ||
* | ||
* @param address - The address to validate. | ||
* @param propertyName - The name of the property source to use in the error message. | ||
*/ | ||
function validateAddress(address, propertyName) { | ||
if (!address || typeof address !== 'string' || !(0, controller_utils_1.isValidHexAddress)(address)) { | ||
throw new Error(`Invalid "${propertyName}" address: ${address} must be a valid string.`); | ||
} | ||
} | ||
/** | ||
* A helper function that converts rawmessageData buffer data to a hex, or just returns the data if | ||
* it is already formatted as a hex. | ||
* | ||
* @param data - The buffer data to convert to a hex. | ||
* @returns A hex string conversion of the buffer data. | ||
*/ | ||
function normalizeMessageData(data) { | ||
try { | ||
const stripped = (0, utils_1.remove0x)(data); | ||
if (stripped.match(hexRe)) { | ||
return (0, utils_1.add0x)(stripped); | ||
} | ||
} | ||
catch (e) { | ||
/* istanbul ignore next */ | ||
} | ||
return (0, utils_1.bytesToHex)(Buffer.from(data, 'utf8')); | ||
} | ||
exports.normalizeMessageData = normalizeMessageData; | ||
/** | ||
* Validates a PersonalMessageParams and MessageParams objects for required properties and throws in | ||
* the event of any validation error. | ||
* | ||
* @param messageData - PersonalMessageParams object to validate. | ||
*/ | ||
function validateSignMessageData(messageData) { | ||
const { from, data } = messageData; | ||
validateAddress(from, 'from'); | ||
if (!data || typeof data !== 'string') { | ||
throw new Error(`Invalid message "data": ${data} must be a valid string.`); | ||
} | ||
} | ||
exports.validateSignMessageData = validateSignMessageData; | ||
/** | ||
* Validates a TypedMessageParams object for required properties and throws in | ||
* the event of any validation error for eth_signTypedMessage_V1. | ||
* | ||
* @param messageData - TypedMessageParams object to validate. | ||
*/ | ||
function validateTypedSignMessageDataV1(messageData) { | ||
validateAddress(messageData.from, 'from'); | ||
if (!messageData.data || !Array.isArray(messageData.data)) { | ||
throw new Error(`Invalid message "data": ${messageData.data} must be a valid array.`); | ||
} | ||
try { | ||
// typedSignatureHash will throw if the data is invalid. | ||
// TODO: Replace `any` with type | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
(0, eth_sig_util_1.typedSignatureHash)(messageData.data); | ||
} | ||
catch (e) { | ||
throw new Error(`Expected EIP712 typed data.`); | ||
} | ||
} | ||
exports.validateTypedSignMessageDataV1 = validateTypedSignMessageDataV1; | ||
/** | ||
* Validates a TypedMessageParams object for required properties and throws in | ||
* the event of any validation error for eth_signTypedMessage_V3. | ||
* | ||
* @param messageData - TypedMessageParams object to validate. | ||
* @param currentChainId - The current chainId. | ||
*/ | ||
function validateTypedSignMessageDataV3V4(messageData, currentChainId) { | ||
validateAddress(messageData.from, 'from'); | ||
if (!messageData.data || | ||
Array.isArray(messageData.data) || | ||
(typeof messageData.data !== 'object' && | ||
typeof messageData.data !== 'string')) { | ||
throw new Error(`Invalid message "data": Must be a valid string or object.`); | ||
} | ||
let data; | ||
if (typeof messageData.data === 'object') { | ||
data = messageData.data; | ||
} | ||
else { | ||
try { | ||
data = JSON.parse(messageData.data); | ||
} | ||
catch (e) { | ||
throw new Error('Data must be passed as a valid JSON string.'); | ||
} | ||
} | ||
const validation = (0, jsonschema_1.validate)(data, eth_sig_util_1.TYPED_MESSAGE_SCHEMA); | ||
if (validation.errors.length > 0) { | ||
throw new Error('Data must conform to EIP-712 schema. See https://git.io/fNtcx.'); | ||
} | ||
if (!currentChainId) { | ||
throw new Error('Current chainId cannot be null or undefined.'); | ||
} | ||
let { chainId } = data.domain; | ||
if (chainId) { | ||
if (typeof chainId === 'string') { | ||
chainId = parseInt(chainId, chainId.startsWith('0x') ? 16 : 10); | ||
} | ||
const activeChainId = parseInt(currentChainId, 16); | ||
if (Number.isNaN(activeChainId)) { | ||
throw new Error(`Cannot sign messages for chainId "${chainId}", because MetaMask is switching networks.`); | ||
} | ||
if (chainId !== activeChainId) { | ||
throw new Error(`Provided chainId "${chainId}" must match the active chainId "${activeChainId}"`); | ||
} | ||
} | ||
} | ||
exports.validateTypedSignMessageDataV3V4 = validateTypedSignMessageDataV3V4; | ||
/** | ||
* Validates messageData for the eth_getEncryptionPublicKey message and throws in | ||
* the event of any validation error. | ||
* | ||
* @param messageData - address string to validate. | ||
*/ | ||
function validateEncryptionPublicKeyMessageData(messageData) { | ||
const { from } = messageData; | ||
validateAddress(from, 'from'); | ||
} | ||
exports.validateEncryptionPublicKeyMessageData = validateEncryptionPublicKeyMessageData; | ||
/** | ||
* Validates messageData for the eth_decrypt message and throws in | ||
* the event of any validation error. | ||
* | ||
* @param messageData - address string to validate. | ||
*/ | ||
function validateDecryptedMessageData(messageData) { | ||
const { from } = messageData; | ||
validateAddress(from, 'from'); | ||
} | ||
exports.validateDecryptedMessageData = validateDecryptedMessageData; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunk3K7FRO6Kjs = require('./chunk-3K7FRO6K.js'); | ||
exports.normalizeMessageData = _chunk3K7FRO6Kjs.normalizeMessageData; exports.validateDecryptedMessageData = _chunk3K7FRO6Kjs.validateDecryptedMessageData; exports.validateEncryptionPublicKeyMessageData = _chunk3K7FRO6Kjs.validateEncryptionPublicKeyMessageData; exports.validateSignMessageData = _chunk3K7FRO6Kjs.validateSignMessageData; exports.validateTypedSignMessageDataV1 = _chunk3K7FRO6Kjs.validateTypedSignMessageDataV1; exports.validateTypedSignMessageDataV3V4 = _chunk3K7FRO6Kjs.validateTypedSignMessageDataV3V4; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@metamask/message-manager", | ||
"version": "7.3.9", | ||
"version": "8.0.0", | ||
"description": "Stores and manages interactions with signing requests", | ||
@@ -18,2 +18,11 @@ "keywords": [ | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js", | ||
"types": "./dist/types/index.d.ts" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "./dist/index.js", | ||
@@ -25,2 +34,3 @@ "types": "./dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsup --config ../../tsup.config.ts --tsconfig ./tsconfig.build.json --clean", | ||
"build:docs": "typedoc", | ||
@@ -36,4 +46,4 @@ "changelog:update": "../../scripts/update-changelog.sh @metamask/message-manager", | ||
"dependencies": { | ||
"@metamask/base-controller": "^4.1.1", | ||
"@metamask/controller-utils": "^8.0.4", | ||
"@metamask/base-controller": "^5.0.0", | ||
"@metamask/controller-utils": "^9.0.0", | ||
"@metamask/eth-sig-util": "^7.0.1", | ||
@@ -40,0 +50,0 @@ "@metamask/utils": "^8.3.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
293936
81
2413
1
+ Added@metamask/base-controller@5.0.2(transitive)
+ Added@metamask/controller-utils@9.1.0(transitive)
+ Added@spruceid/siwe-parser@2.1.0(transitive)
+ Added@types/bn.js@5.1.6(transitive)
+ Added@types/node@22.10.1(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedvalid-url@1.0.9(transitive)
- Removed@metamask/base-controller@4.1.1(transitive)
- Removed@metamask/controller-utils@8.0.4(transitive)
- Removed@spruceid/siwe-parser@1.1.3(transitive)