]> git.ardis.lu - ens2hex/commitdiff
Add JSON-RPC input instead of hardcoding a node
authorArdis Lu <ardisglu@gmail.com>
Wed, 5 Oct 2022 03:27:59 +0000 (20:27 -0700)
committerArdis Lu <ardisglu@gmail.com>
Wed, 5 Oct 2022 03:27:59 +0000 (20:27 -0700)
index.html

index 89ae35946cd7a5166d05b927e1bb8cc80a00f790..9f4ce0bbb2e5b2e7912d3dca84e7dd65c667f563 100644 (file)
           <p id="selected-file"></p>
         </div>
 
+        <details>
+          <summary>Advanced options</summary>
+          <div class="details-body">
+            <label for="rpc">JSON-RPC node:</label>
+            <input type="url" name="rpc" id="rpc" value="https://cloudflare-eth.com" required>
+          </div>
+        </details>
+
         <button>Fetch addresses</button>
         <output name="status" id="status"></output>
 
       const cleaned = [...parsed].filter(name => name.slice(-4) === '.eth'); // Remove anything that does not end in '.eth'
 
       if (cleaned.length === 0) {
-        status.textContent = 'No valid ENS names found.'
+        status.textContent = 'No valid ENS names found.';
         return;
       }
 
         id: index
       }));
 
-      const batchResponse = await fetch('https://cloudflare-eth.com/', {
+      const batchResponse = await fetch(formData.get('rpc'), {
         method: 'POST',
         headers: { 'Content-Type': 'application/json' },
         body: JSON.stringify(batchPayload),
This page took 0.040819 seconds and 4 git commands to generate.