Skip to main content

wallet_scanQRCode

MetaMaskMobile

Requests that the user scan a QR code using their device camera. Introduced by EIP-945.

Params

(1)

1. regex

A regular expression (regex) string for matching arbitrary QR code strings.

string

Result

(ScanQRCodeResult)

A string corresponding to the scanned QR code. If a regex string is provided, the resulting string matches it. If no regex string is provided, the resulting string matches an Ethereum address. If neither condition is met, the method returns an error.

string

Params

regex


Request

await window.ethereum.request({
"method": "wallet_scanQRCode",
"params": [
null
]
});