/******************************************************************************
*
* (C) 2022 AhnLab Blockchain Company, Inc. All rights reserved.
* Any part of this source code can not be copied with any method without
* prior written permission from the author or authorized person.
*
******************************************************************************/
///
import EventEmitter from 'events';
import { MpcService } from '../../usecase/mpc';
import { ProviderConnectionManager } from '../../usecase/provider/connectionManager';
import { Account } from '../../schema/model';
import { AppAccount } from '../transactions/interface';
declare class PersonalMessageManager extends EventEmitter {
private mpcService;
private providerConnectionManager;
messages: any;
/**
* Controller in charge of managing - storing, adding, removing, updating - PersonalMessage.
*
* @typedef {Object} PersonalMessageManager
* @property {Object} memStore The observable store where PersonalMessage are saved.
* @property {Object} memStore.unapprovedPersonalMsgs A collection of all PersonalMessages in the 'unapproved' state
* @property {number} memStore.unapprovedPersonalMsgCount The count of all PersonalMessages in this.memStore.unapprobedMsgs
* @property {Array} messages Holds all messages that have been created by this PersonalMessageManager
*
*/
constructor(mpcService: MpcService, providerConnectionManager: ProviderConnectionManager);
/**
* A getter for the number of 'unapproved' PersonalMessages in this.messages
*
* @returns {number} The number of 'unapproved' PersonalMessages in this.messages
*
*/
get unapprovedPersonalMsgCount(): number;
/**
* A getter for the 'unapproved' PersonalMessages in this.messages
*
* @returns {Object} An index of PersonalMessage ids to PersonalMessages, for all 'unapproved' PersonalMessages in
* this.messages
*
*/
getUnapprovedMsgs(): any;
/**
* Creates a new PersonalMessage with an 'unapproved' status using the passed msgParams. this.addMsg is called to add
* the new PersonalMessage to this.messages, and to save the unapproved PersonalMessages from that list to
* this.memStore.
*
* @param {Object} msgParams - The params for the eth_sign call to be made after the message is approved.
* @param {Object} [req] - The original request object possibly containing the origin
* @param {Object} abcAccount - ABC App Account
* @returns {promise} When the message has been signed or rejected
*
*/
addUnapprovedMessageAsync(req: any, res: any, abcAccount: AppAccount): Promise;
/**
* Creates a new PersonalMessage with an 'unapproved' status using the passed msgParams. this.addMsg is called to add
* the new PersonalMessage to this.messages, and to save the unapproved PersonalMessages from that list to
* this.memStore.
*
* @param {Object} msgParams - The params for the eth_sign call to be made after the message is approved.
* @param {Object} [req] - The original request object possibly containing the origin
* @returns {number} The id of the newly created PersonalMessage.
*
*/
addUnapprovedMessage(req: any): Promise;
getMsgParams(req: any): any;
/**
* Signifies a user's approval to sign a personal_sign message in queue.
* Triggers signing, and the callback function from newUnsignedPersonalMessage.
*
* @param {Object} msgParams - The params of the message to sign & return to the Dapp.
* @returns {Promise