MetaMaskAbstract
Parameter | Type | Description |
---|---|---|
context | BrowserContext | The Playwright BrowserContext in which the MetaMask extension is running. |
page | Page | The Playwright Page object representing the MetaMask extension’s main page. |
password | string | The password for the MetaMask wallet. |
extensionId ? | string | The ID of the MetaMask extension. Optional if no interaction with dapps is required. |
MetaMask
MetaMaskAbstract.constructor
Property | Modifier | Type | Description | Overrides |
---|---|---|---|---|
context | readonly | BrowserContext | - | - |
crashPage | readonly | CrashPage | This property can be used to access selectors for the crash page. | - |
extensionId? | readonly | string | - | MetaMaskAbstract.extensionId |
homePage | readonly | HomePage | This property can be used to access selectors for the home page. | - |
lockPage | readonly | LockPage | This property can be used to access selectors for the lock page. | - |
notificationPage | readonly | NotificationPage | This property can be used to access selectors for the notification page. | - |
onboardingPage | readonly | OnboardingPage | This property can be used to access selectors for the onboarding page. | - |
page | readonly | Page | - | - |
password | readonly | string | - | MetaMaskAbstract.password |
settingsPage | readonly | SettingsPage | This property can be used to access selectors for the settings page. | - |
Parameter | Type | Description |
---|---|---|
network | object | The network configuration to add. |
network.blockExplorerUrl ? | string | - |
network.chainId | number | - |
network.name | string | - |
network.rpcUrl | string | - |
network.symbol | string | - |
Promise
<void
>
MetaMaskAbstract.addNetwork
Parameter | Type | Description |
---|---|---|
accountName | string | The name for the new account. |
Promise
<void
>
MetaMaskAbstract.addNewAccount
Promise
<void
>
MetaMaskAbstract.addNewToken
Promise
<void
>
MetaMaskAbstract.approveNewNetwork
Promise
<void
>
MetaMaskAbstract.approveSwitchNetwork
Parameter | Type | Description |
---|---|---|
options ? | object | Optional settings for the approval. |
options.gasSetting ? | | "low" | "market" | "aggressive" | "site" | { "gasLimit" : number ; "maxBaseFee" : number ; "priorityFee" : number ; } | - |
options.spendLimit ? | number | "max" | - |
Promise
<void
>
MetaMaskAbstract.approveTokenPermission
Promise
<void
>
MetaMaskAbstract.closeTransactionDetails
Promise
<void
>
MetaMaskAbstract.confirmSignature
Promise
<void
>
MetaMaskAbstract.confirmSignatureWithRisk
Parameter | Type | Description |
---|---|---|
options ? | object | Optional gas settings for the transaction. |
options.gasSetting ? | | "low" | "market" | "aggressive" | "site" | { "gasLimit" : number ; "maxBaseFee" : number ; "priorityFee" : number ; } | - |
Promise
<void
>
MetaMaskAbstract.confirmTransaction
Parameter | Type | Description |
---|---|---|
options ? | object | Optional gas settings for the transaction. |
options.gasSetting ? | | "low" | "market" | "aggressive" | "site" | { "gasLimit" : number ; "maxBaseFee" : number ; "priorityFee" : number ; } | - |
Promise
<void
>
MetaMaskAbstract.confirmTransactionAndWaitForMining
Parameter | Type | Description |
---|---|---|
accounts ? | string [] | Optional array of account addresses to connect. |
Promise
<void
>
MetaMaskAbstract.connectToDapp
Promise
<void
>
MetaMaskAbstract.decrypt
Promise
<void
>
MetaMaskAbstract.disableEthSign
Promise
<string
>
The account address.
MetaMaskAbstract.getAccountAddress
Promise
<void
>
MetaMaskAbstract.goBackToHomePage
Parameter | Type | Description |
---|---|---|
seedPhrase | string | The seed phrase to import. |
Promise
<void
>
MetaMaskAbstract.importWallet
Parameter | Type | Description |
---|---|---|
privateKey | string | The private key to import. |
Promise
<void
>
MetaMaskAbstract.importWalletFromPrivateKey
Promise
<void
>
MetaMaskAbstract.lock
Promise
<void
>
MetaMaskAbstract.openSettings
Parameter | Type | Description |
---|---|---|
menu | SettingsSidebarMenus | The menu to open. |
Promise
<void
>
MetaMaskAbstract.openSidebarMenu
Parameter | Type | Description |
---|---|---|
txIndex | number | The index of the transaction to open. |
Promise
<void
>
MetaMaskAbstract.openTransactionDetails
Promise
<void
>
MetaMaskAbstract.providePublicEncryptionKey
Promise
<void
>
MetaMaskAbstract.rejectNewNetwork
Promise
<void
>
MetaMaskAbstract.rejectSignature
Promise
<void
>
MetaMaskAbstract.rejectSwitchNetwork
Promise
<void
>
MetaMaskAbstract.rejectTokenPermission
Promise
<void
>
MetaMaskAbstract.rejectTransaction
Parameter | Type | Description |
---|---|---|
currentAccountName | string | The current account name. |
newAccountName | string | The new name for the account. |
Promise
<void
>
Promise
<void
>
MetaMaskAbstract.resetAccount
Parameter | Type | Description |
---|---|---|
accountName | string | The name of the account to switch to. |
Promise
<void
>
MetaMaskAbstract.switchAccount
Parameter | Type | Description |
---|---|---|
networkName | string | The name of the network to switch to. |
isTestnet ? | boolean | Whether the network is a testnet. Default is false. |
Promise
<void
>
MetaMaskAbstract.switchNetwork
Promise
<void
>
MetaMaskAbstract.toggleDismissSecretRecoveryPhraseReminder
Promise
<void
>
MetaMaskAbstract.toggleShowTestNetworks
Promise
<void
>
MetaMaskAbstract.unlock
Promise
<void
>
MetaMaskAbstract.unsafe_enableEthSign