Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #58 from MetaMask/getTxById
Browse files Browse the repository at this point in the history
Adds getTxById to restricted methods available to plugins
  • Loading branch information
danfinlay authored Oct 9, 2019
2 parents d7ab8d8 + 201bb98 commit 5cae165
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/scripts/controllers/permissions/restrictedMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const pluginRestrictedMethodDescriptions = {
getApprovedAccounts: 'Get a list of all approved accounts',
getFilteredTxList: 'Get a list of filtered transactions',
getGasPrice: 'Estimates a good gas price at recent prices',
getTxById: 'Get full data of a transaction with a given metamask tx id',
getState: 'Get a JSON representation of MetaMask data, including sensitive data. This is only for testing purposes and will NOT be included in production.',
importAccountWithStrategy: 'Imports an account with the specified import strategy',
isNonceTaken: 'Check if a given nonce is available for use',
Expand Down
2 changes: 2 additions & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ module.exports = class MetamaskController extends EventEmitter {
updatePluginState: this.pluginsController.updatePluginState.bind(this.pluginController),
getPluginState: this.pluginsController.getPluginState.bind(this.pluginController),
onNewTx: this.txController.on.bind(this.txController, 'newUnapprovedTx'),
getTxById: this.txController.txStateManager.getTx.bind(this.txController.txStateManager),
},
getApi: this.getPluginsApi.bind(this),
metamaskEventMethods: this.pluginsController.generateMetaMaskListenerMethodsMap(),
Expand Down Expand Up @@ -661,6 +662,7 @@ module.exports = class MetamaskController extends EventEmitter {
getFilteredTxList: nodeify(txController.getFilteredTxList, txController),
isNonceTaken: nodeify(txController.isNonceTaken, txController),
estimateGas: nodeify(this.estimateGas, this),
getTxById: this.txController.txStateManager.getTx.bind(this.txController.txStateManager),

// messageManager
signMessage: nodeify(this.signMessage, this),
Expand Down

0 comments on commit 5cae165

Please sign in to comment.