mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 21:00:13 +01:00
b1d090ac4d
* add permissions controller, log, middleware, and restricted method unit tests * fix permissions-related bugs * convert permissions log to controller-like class * add permissions unit test coverage requirements * update rpc-cap Co-Authored-By: Whymarrh Whitby <whymarrh.whitby@gmail.com> Co-Authored-By: Mark Stacey <markjstacey@gmail.com>
22 lines
504 B
JavaScript
22 lines
504 B
JavaScript
export default function getRestrictedMethods (permissionsController) {
|
|
return {
|
|
|
|
'eth_accounts': {
|
|
description: `View the addresses of the user's chosen accounts.`,
|
|
method: (_, res, __, end) => {
|
|
permissionsController.getKeyringAccounts()
|
|
.then((accounts) => {
|
|
res.result = accounts
|
|
end()
|
|
})
|
|
.catch(
|
|
(err) => {
|
|
res.error = err
|
|
end(err)
|
|
}
|
|
)
|
|
},
|
|
},
|
|
}
|
|
}
|