diff --git a/.eslintrc.js b/.eslintrc.js index e8542989..bd10bb91 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -18,6 +18,12 @@ module.exports = { sourceType: 'module', }, }, + { + files: ['src/request.js'], + parserOptions: { + sourceType: 'script', + }, + }, ], ignorePatterns: ['!.eslintrc.js', 'dist'], diff --git a/README.md b/README.md index 86824149..bb185b4a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ If you wish to use this dapp in your e2e tests, install this package and set up static-server node_modules/@metamask/test-dapp/dist --port 9011 ``` +The main page of the test dapp includes a simple UI featuring buttons for common dapp interactions. + +There is a second page (`request.html`) that allows making requests directly to the provider using query parameters. This provides a simple way of testing RPC methods using an in-page provider. + +It can be used by navigating to `/request.html?method=${METHOD}¶ms=${PARAMS}` (e.g. `/request.html?method=eth_getLogs¶ms=[{ "address": "0x0000000000000000000000000000000000000000" }]`). The page will make a request with the given RPC method and parameters using `ethereum.request`, and report the result as plain text. + ## Contributing ### Setup diff --git a/src/index.html b/src/index.html index 92105ad8..5484fd4b 100644 --- a/src/index.html +++ b/src/index.html @@ -1029,6 +1029,6 @@