Methods provided by dAppeteer.
For additional information read root readme
interface LaunchOptions {
metamaskVersion: 'latest' | string; // Metamask plugin version
metamaskLocation?: Path; // Custom location of download and extract path
}
type Path = string | { download: string; extract: string; };
returns an instance of browser
, same as puppeteer.launch
, but it also installs the MetaMask extension. It supports all the regular puppeteer.launch
options
interface MetamaskOptions {
seed?: string;
password?: string;
}
metamask
is used as placeholder for dAppeteer returned by setupMetamask
or getMetamaskWindow
it commands MetaMask to switch to a different account, by passing the index/position of the account in the accounts list.
it commands MetaMask to import an private key. It can only be used while you haven't signed in yet, otherwise it throws.
signs out from MetaMask. It can only be used if you arelady signed it, otherwise it throws.
it unlocks the MetaMask extension. It can only be used in you locked/signed out before, otherwise it throws. The password is optional, it defaults to password1234
.
it changes the current selected network. networkName
can take the following values: "main"
, "ropsten"
, "rinkeby"
, "kovan"
, "localhost"
.
interface AddNetwork {
networkName: string;
rpc: string;
chainId: number;
symbol?: string;
explorer?: string;
}
it adds a custom network to MetaMask.
interface TransactionOptions {
gas?: number;
gasLimit?: number;
}
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.
commands MetaMask to sign a message. For this to work MetaMask must be in a sign confirmation state.
enables the app to connect to MetaMask account in privacy mode
for advanced usages in case you need custom features.