Skip to content

Commit

Permalink
add method to approve privacy
Browse files Browse the repository at this point in the history
  • Loading branch information
minheq committed May 16, 2019
1 parent 55ec0f9 commit 7c6b12f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -67,3 +67,5 @@ main()
- `metamask.confirmTransaction([{ gas, gasLimit }])`: commands MetaMask to submit a transaction. For this to work MetaMask has to be in a transaction confirmation state (basically promting the user to submit/reject a transaction). You can (optionally) pass an object with `gas` and/or `gasLimit`, by default they are `20` and `50000` respectively.

- `metamask.sign()`: commands MetaMask to sign a message. For this to work MetaMask must be in a sign confirmation state.

- `metamask.approve()`: enables the app to connect to MetaMask account in privacy mode
15 changes: 14 additions & 1 deletion index.js
Expand Up @@ -233,7 +233,20 @@ module.exports = {
await button.click()

await waitForUnlockedScreen(metamaskPage);
}
},

approve: async () => {
await metamaskPage.bringToFront()

const confirmButtonSelector = 'button.button.btn-confirm.btn--large.page-container__footer-button'

await metamaskPage.waitFor(confirmButtonSelector);

const button = await metamaskPage.$(confirmButtonSelector);
await button.click()

await waitForUnlockedScreen(metamaskPage);
},
}
}
}
Expand Down

0 comments on commit 7c6b12f

Please sign in to comment.