Skip to content

Commit

Permalink
Merge pull request decentraland#25 from NodeFactoryIo/beroburny/impro…
Browse files Browse the repository at this point in the history
…ve-readme

Improve readme
  • Loading branch information
mpetrunic authored Jul 1, 2021
2 parents 7568cb2 + 9bce532 commit 5b3d091
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ async function main() {
const browser = await dappeteer.launch(puppeteer);
const metamask = await dappeteer.setupMetamask(browser);

// create or import an account
// await metamask.createAccount()
await metamask.importAccount('already turtle birth enroll since...');

// you can change the network if you want
await metamask.switchNetwork('ropsten');

Expand All @@ -45,11 +41,7 @@ main();

- `metamaskVersion`: Metamask plugin version (by default it uses latest)

- `dappeteer.setupMetamask(browser)`: returns a promise that resolves to an object that allows you to interact with MetaMask by using the following methods:

- `metamask.createAccount([password])`: it commands MetaMask to create a new account, it resolves when it's done. It can only be used while you haven't signed in yet, otherwise it throws. The password is optional, it defaults to `password1234`.

- `metamask.importAccount(seed[, password])`: it commands MetaMask to import an account, you need to provide the twelve words seed. It can only be used while you haven't signed in yet, otherwise it throws. The password is optional, it defaults to `password1234`.
- `dappeteer.setupMetamask(browser[, {seed, password}])`: returns a promise that resolves to an object that allows you to interact with MetaMask by using the following methods:

- `metamask.switchAccount(accountIndex)`: it commands MetaMask to switch to a different account, by passing the index/position of the account in the accounts list.

Expand All @@ -61,7 +53,7 @@ main();

- `metamask.switchNetwork(networkName)`: it changes the current selected network. `networkName` can take the following values: `"main"`, `"ropsten"`, `"rinkeby"`, `"kovan"`, `"localhost"`.

- `metamask.addNetwork(url)`: it adds a custom network to MetaMask.
- `metamask.addNetwork({ networkName, rpc, chainId[, symbol, explorer]})`: it adds a custom network to MetaMask.

- `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.

Expand Down

0 comments on commit 5b3d091

Please sign in to comment.