From 4e70d177433083131851b7cb631cc521bc54e791 Mon Sep 17 00:00:00 2001 From: sshmatrix <19473027+sshmatrix@users.noreply.github.com> Date: Tue, 29 Aug 2023 13:21:38 +0530 Subject: [PATCH] Minor Fixes to Search Functionality (#21) * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Avatar Fix Issue#8 * Main page search function fix * Contenthash Fix Issue#8 * Remove out/ * auto-commit: gh-pages * README * auto-commit: gh-pages * Ownerhash & Export Keys features * auto-commit: gh-pages * Ownerhash & Export Keys features: 2 * auto-commit: gh-pages * Wait-On-Load Fix * auto-commit: gh-pages * Cleanup * Cleanup: 2 * Cleanup: console.log * auto-commit: gh-pages * auto-commit: gh-pages * Ownerhash integration * Ownerhash integration: 2 * auto-commit: gh-pages * auto-commit: gh-pages * Subdomain support * Subdomain support: 2 * auto-commit: gh-pages * auto-commit: gh-pages * Subdomain support: Wrapped Subdomains * auto-commit: gh-pages * Loop-through speed-up * auto-commit: gh-pages * Fix for wrapped subdomains * auto-commit: gh-pages * Gas estimate fix * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * RainbowKit placement fix * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * RainbowKit styling * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Fix for Wagmi2.0 and RainbowKit1.0 migration * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Fix for Wagmi2.0 and RainbowKit1.0 migration: 2 * auto-commit: gh-pages * auto-commit: gh-pages * Fix for Wagmi2.0 and RainbowKit1.0 migration: 3 * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * rSync * auto-commit: gh-pages * Mainnet Ready * auto-commit: gh-pages * Refresh buttons * auto-commit: gh-pages * auto-commit: gh-pages * Search function * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Testing Goerli-v7 * HTTP Gateway Integration * auto-commit: gh-pages * HTTP Gateway Integration: 2 * auto-commit: gh-pages * auto-commit: gh-pages * Finetune * Confirmation tab for Ownerhash * auto-commit: gh-pages * Caching while setting Ownerhash * auto-commit: gh-pages * Some triggers fixed * auto-commit: gh-pages * Signer Signature * auto-commit: gh-pages * Export Signatures * Fix for queue * Finetune: 2 * auto-commit: gh-pages * auto-commit: gh-pages * Finetune: 3 * auto-commit: gh-pages * Update Signature text for SIG1 * auto-commit: gh-pages * Password Dialogue improvements * auto-commit: gh-pages * Bad Password Break * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Several bug fixes * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Preview Panel Load Fix * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * rSync * fast * Merge rSync * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Mainnet Release: v1.0.0 * PWA and other improvements * Support for NFT avatars (#17) * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * NFT Avatar Support * Emoji Support (#18) * Support for NFT avatars * Emoji Support * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Client Help Page * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * auto-commit: gh-pages * Cleanup keygen.ts * auto-commit: gh-pages * Minor Fixes in Search Tab * auto-commit: gh-pages * Minor Fixes in Search Tab: 2 * auto-commit: gh-pages * rSync --- .../2023-08-17T08_40_01_412Z-debug-0.log | 36 - components/Preview.tsx | 1078 +++++++++-------- out/404.html | 11 + out/404.html.html | 11 + out/Bioliquid.woff2 | Bin 0 -> 10084 bytes out/Rajdhani.woff2 | Bin 0 -> 107628 bytes out/Roboto-Mono.woff2 | Bin 0 -> 104156 bytes out/SF-Mono.woff2 | Bin 0 -> 17620 bytes out/Spotnik.woff2 | Bin 0 -> 5628 bytes .../static/chunks/1088.04d87f92e05f23c7.js | 1 + .../static/chunks/1608.ec04f07937386922.js | 1 + .../static/chunks/1711.ae2b84d9f5645069.js | 1 + .../static/chunks/1727.af62bd633f21ee69.js | 1 + .../static/chunks/1748.f63b451fd93f590b.js | 1 + .../static/chunks/1894.cf8bb2590ecc3edc.js | 1 + .../static/chunks/1950.c8039f3dc9bb92f5.js | 1 + .../static/chunks/2027.038de301f3a28eb2.js | 1 + .../static/chunks/2604.250be1a3b8354750.js | 1 + .../static/chunks/2746.0a838d09eabc5b43.js | 1 + .../static/chunks/2898.f370a64b5af02f0b.js | 1 + .../static/chunks/3200.6135ea7388cc6e9c.js | 1 + .../static/chunks/3525.53072abba3ca74b8.js | 1 + .../static/chunks/3646.111aba596062de80.js | 1 + .../static/chunks/4253.6be69df622e36e45.js | 1 + .../static/chunks/4419.c4f2007bfe36ec14.js | 1 + .../static/chunks/4794-e32b4f8eb350df2b.js | 1 + .../static/chunks/5023.798aaaf48ec0ce89.js | 1 + .../static/chunks/5119.33e08a0525159056.js | 1 + .../static/chunks/514.d2f047fea62adf58.js | 1 + .../static/chunks/5289.5d8686a37c030aeb.js | 1 + .../static/chunks/541.95ce03e7ab52b9aa.js | 1 + .../static/chunks/5488.ea86c6ce443ba3bd.js | 1 + .../static/chunks/5577.72071e0a504841da.js | 1 + .../static/chunks/5670.2bee96e50f302d0d.js | 1 + .../static/chunks/5806.7abe5840ceba140e.js | 1 + .../static/chunks/5811.39f4dd66d499574b.js | 1 + .../static/chunks/5939.0a433dc6f963fc41.js | 1 + .../static/chunks/6237.f7b1d24c812922e4.js | 1 + .../static/chunks/6253.dcdff54f0dceda1f.js | 1 + .../static/chunks/6328.ea13afa99496d818.js | 1 + .../static/chunks/6521-27faebdea3272670.js | 1 + .../static/chunks/6551.432f96462db0d036.js | 1 + .../static/chunks/6847.a575059dbc72db1a.js | 1 + .../static/chunks/704.484bcd9e0a7f5626.js | 1 + .../static/chunks/7682.b0a3567fac8e0052.js | 1 + .../static/chunks/7749.91ea02a2812002e1.js | 1 + .../static/chunks/794.f18da82915d63734.js | 1 + .../static/chunks/8109-144fa7e49c07249e.js | 1 + .../static/chunks/8137.d6c500ddcf42e542.js | 1 + .../static/chunks/8764-593a836a579a1569.js | 1 + .../static/chunks/8881.8c985300b37d631a.js | 1 + .../static/chunks/9223.882cd6b61a640a13.js | 1 + .../static/chunks/934.405a73de74b58e27.js | 1 + .../static/chunks/9343.f765202d31d21580.js | 1 + .../static/chunks/9459.254fad67ddbc77e2.js | 1 + .../static/chunks/9894.c93f7cb64c560417.js | 1 + .../static/chunks/9941.44044767831d9eb0.js | 1 + .../chunks/de297ff1-639b71474d4cca8e.js | 1 + .../chunks/e97c7a19-8fd5a5ffa79a24ae.js | 1 + .../chunks/framework-28712122b8f24e0e.js | 1 + .../static/chunks/main-235b4afd80b524a5.js | 1 + .../chunks/pages/_app-e1e684d520167dd8.js | 1 + .../chunks/pages/_error-4a934674346210d3.js | 1 + .../chunks/pages/account-20dd7435f398782c.js | 1 + .../chunks/pages/fallback-6fab776daa9ae5fc.js | 1 + .../chunks/pages/index-be29e8a5bbc5f0d9.js | 1 + .../chunks/polyfills-5cd94c89d3acac5f.js | 1 + .../static/chunks/webpack-d1034d76ec3e6743.js | 1 + out/_next/static/css/4bf26507eb88f209.css | 1 + .../static/media/Bioliquid.f2782572.woff2 | Bin 0 -> 10084 bytes .../static/media/Rajdhani.34941911.woff2 | Bin 0 -> 107628 bytes .../static/media/Roboto-Mono.f73e941d.woff2 | Bin 0 -> 104156 bytes out/_next/static/media/SF-Mono.1ef6859c.woff2 | Bin 0 -> 17620 bytes out/_next/static/media/Spotnik.464dbd09.woff2 | Bin 0 -> 5628 bytes .../ylIqudds1-MoOQMmKJgoy/_buildManifest.js | 1 + .../_middlewareManifest.js | 1 + .../ylIqudds1-MoOQMmKJgoy/_ssgManifest.js | 1 + out/account.html | 47 + out/ens-red.png | Bin 0 -> 45410 bytes out/ens-vision.png | Bin 0 -> 34884 bytes out/ens-white.png | Bin 0 -> 98209 bytes out/ens.png | Bin 0 -> 80075 bytes out/eth-dark.png | Bin 0 -> 210467 bytes out/eth-red.png | Bin 0 -> 181819 bytes out/eth.png | Bin 0 -> 203314 bytes out/fallback.html | 1 + out/index.html | 24 + out/logo.png | Bin 0 -> 84560 bytes out/manifest.json | 22 + out/readme/GUIDE.md | 163 +++ out/readme/github-markdown.min.css | 838 +++++++++++++ out/readme/index.js | 58 + out/readme/jquery.min.js | 2 + out/readme/query.js | 7 + out/readme/readme.htm | 31 + out/readme/style.css | 214 ++++ out/readme/theme.min.css | 116 ++ out/readme/zero-md.min.js | 2 + out/shadow.svg | 90 ++ out/sw.js | 1 + package.json | 7 +- pages/account.tsx | 7 +- pages/index.tsx | 9 +- patches/@rainbow-me+rainbowkit+1.0.8.patch | 11 +- public/SF-Mono.woff2 | Bin 11996 -> 17620 bytes public/readme/GUIDE.md | 163 +++ public/readme/github-markdown.min.css | 838 +++++++++++++ public/readme/index.js | 58 + public/readme/jquery.min.js | 2 + public/readme/query.js | 7 + public/readme/readme.htm | 31 + public/readme/style.css | 214 ++++ public/readme/theme.min.css | 116 ++ public/readme/zero-md.min.js | 2 + public/sw.js | 2 +- run_ids.txt | 25 + utils/keygen.ts | 66 +- utils/verifier.ts | 16 + 118 files changed, 3790 insertions(+), 599 deletions(-) delete mode 100644 clean/_logs/2023-08-17T08_40_01_412Z-debug-0.log create mode 100644 out/404.html create mode 100644 out/404.html.html create mode 100644 out/Bioliquid.woff2 create mode 100644 out/Rajdhani.woff2 create mode 100644 out/Roboto-Mono.woff2 create mode 100644 out/SF-Mono.woff2 create mode 100644 out/Spotnik.woff2 create mode 100644 out/_next/static/chunks/1088.04d87f92e05f23c7.js create mode 100644 out/_next/static/chunks/1608.ec04f07937386922.js create mode 100644 out/_next/static/chunks/1711.ae2b84d9f5645069.js create mode 100644 out/_next/static/chunks/1727.af62bd633f21ee69.js create mode 100644 out/_next/static/chunks/1748.f63b451fd93f590b.js create mode 100644 out/_next/static/chunks/1894.cf8bb2590ecc3edc.js create mode 100644 out/_next/static/chunks/1950.c8039f3dc9bb92f5.js create mode 100644 out/_next/static/chunks/2027.038de301f3a28eb2.js create mode 100644 out/_next/static/chunks/2604.250be1a3b8354750.js create mode 100644 out/_next/static/chunks/2746.0a838d09eabc5b43.js create mode 100644 out/_next/static/chunks/2898.f370a64b5af02f0b.js create mode 100644 out/_next/static/chunks/3200.6135ea7388cc6e9c.js create mode 100644 out/_next/static/chunks/3525.53072abba3ca74b8.js create mode 100644 out/_next/static/chunks/3646.111aba596062de80.js create mode 100644 out/_next/static/chunks/4253.6be69df622e36e45.js create mode 100644 out/_next/static/chunks/4419.c4f2007bfe36ec14.js create mode 100644 out/_next/static/chunks/4794-e32b4f8eb350df2b.js create mode 100644 out/_next/static/chunks/5023.798aaaf48ec0ce89.js create mode 100644 out/_next/static/chunks/5119.33e08a0525159056.js create mode 100644 out/_next/static/chunks/514.d2f047fea62adf58.js create mode 100644 out/_next/static/chunks/5289.5d8686a37c030aeb.js create mode 100644 out/_next/static/chunks/541.95ce03e7ab52b9aa.js create mode 100644 out/_next/static/chunks/5488.ea86c6ce443ba3bd.js create mode 100644 out/_next/static/chunks/5577.72071e0a504841da.js create mode 100644 out/_next/static/chunks/5670.2bee96e50f302d0d.js create mode 100644 out/_next/static/chunks/5806.7abe5840ceba140e.js create mode 100644 out/_next/static/chunks/5811.39f4dd66d499574b.js create mode 100644 out/_next/static/chunks/5939.0a433dc6f963fc41.js create mode 100644 out/_next/static/chunks/6237.f7b1d24c812922e4.js create mode 100644 out/_next/static/chunks/6253.dcdff54f0dceda1f.js create mode 100644 out/_next/static/chunks/6328.ea13afa99496d818.js create mode 100644 out/_next/static/chunks/6521-27faebdea3272670.js create mode 100644 out/_next/static/chunks/6551.432f96462db0d036.js create mode 100644 out/_next/static/chunks/6847.a575059dbc72db1a.js create mode 100644 out/_next/static/chunks/704.484bcd9e0a7f5626.js create mode 100644 out/_next/static/chunks/7682.b0a3567fac8e0052.js create mode 100644 out/_next/static/chunks/7749.91ea02a2812002e1.js create mode 100644 out/_next/static/chunks/794.f18da82915d63734.js create mode 100644 out/_next/static/chunks/8109-144fa7e49c07249e.js create mode 100644 out/_next/static/chunks/8137.d6c500ddcf42e542.js create mode 100644 out/_next/static/chunks/8764-593a836a579a1569.js create mode 100644 out/_next/static/chunks/8881.8c985300b37d631a.js create mode 100644 out/_next/static/chunks/9223.882cd6b61a640a13.js create mode 100644 out/_next/static/chunks/934.405a73de74b58e27.js create mode 100644 out/_next/static/chunks/9343.f765202d31d21580.js create mode 100644 out/_next/static/chunks/9459.254fad67ddbc77e2.js create mode 100644 out/_next/static/chunks/9894.c93f7cb64c560417.js create mode 100644 out/_next/static/chunks/9941.44044767831d9eb0.js create mode 100644 out/_next/static/chunks/de297ff1-639b71474d4cca8e.js create mode 100644 out/_next/static/chunks/e97c7a19-8fd5a5ffa79a24ae.js create mode 100644 out/_next/static/chunks/framework-28712122b8f24e0e.js create mode 100644 out/_next/static/chunks/main-235b4afd80b524a5.js create mode 100644 out/_next/static/chunks/pages/_app-e1e684d520167dd8.js create mode 100644 out/_next/static/chunks/pages/_error-4a934674346210d3.js create mode 100644 out/_next/static/chunks/pages/account-20dd7435f398782c.js create mode 100644 out/_next/static/chunks/pages/fallback-6fab776daa9ae5fc.js create mode 100644 out/_next/static/chunks/pages/index-be29e8a5bbc5f0d9.js create mode 100644 out/_next/static/chunks/polyfills-5cd94c89d3acac5f.js create mode 100644 out/_next/static/chunks/webpack-d1034d76ec3e6743.js create mode 100644 out/_next/static/css/4bf26507eb88f209.css create mode 100644 out/_next/static/media/Bioliquid.f2782572.woff2 create mode 100644 out/_next/static/media/Rajdhani.34941911.woff2 create mode 100644 out/_next/static/media/Roboto-Mono.f73e941d.woff2 create mode 100644 out/_next/static/media/SF-Mono.1ef6859c.woff2 create mode 100644 out/_next/static/media/Spotnik.464dbd09.woff2 create mode 100644 out/_next/static/ylIqudds1-MoOQMmKJgoy/_buildManifest.js create mode 100644 out/_next/static/ylIqudds1-MoOQMmKJgoy/_middlewareManifest.js create mode 100644 out/_next/static/ylIqudds1-MoOQMmKJgoy/_ssgManifest.js create mode 100644 out/account.html create mode 100644 out/ens-red.png create mode 100644 out/ens-vision.png create mode 100644 out/ens-white.png create mode 100644 out/ens.png create mode 100644 out/eth-dark.png create mode 100644 out/eth-red.png create mode 100644 out/eth.png create mode 100644 out/fallback.html create mode 100644 out/index.html create mode 100644 out/logo.png create mode 100644 out/manifest.json create mode 100644 out/readme/GUIDE.md create mode 100644 out/readme/github-markdown.min.css create mode 100644 out/readme/index.js create mode 100644 out/readme/jquery.min.js create mode 100644 out/readme/query.js create mode 100644 out/readme/readme.htm create mode 100644 out/readme/style.css create mode 100644 out/readme/theme.min.css create mode 100644 out/readme/zero-md.min.js create mode 100644 out/shadow.svg create mode 100644 out/sw.js create mode 100644 public/readme/GUIDE.md create mode 100644 public/readme/github-markdown.min.css create mode 100644 public/readme/index.js create mode 100644 public/readme/jquery.min.js create mode 100644 public/readme/query.js create mode 100644 public/readme/readme.htm create mode 100644 public/readme/style.css create mode 100644 public/readme/theme.min.css create mode 100644 public/readme/zero-md.min.js create mode 100644 run_ids.txt diff --git a/clean/_logs/2023-08-17T08_40_01_412Z-debug-0.log b/clean/_logs/2023-08-17T08_40_01_412Z-debug-0.log deleted file mode 100644 index 37a34ee6..00000000 --- a/clean/_logs/2023-08-17T08_40_01_412Z-debug-0.log +++ /dev/null @@ -1,36 +0,0 @@ -0 verbose cli /usr/local/bin/node /usr/local/bin/npm -1 info using npm@8.11.0 -2 info using node@v16.15.1 -3 timing npm:load:whichnode Completed in 0ms -4 timing config:load:defaults Completed in 3ms -5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms -6 timing config:load:builtin Completed in 2ms -7 timing config:load:cli Completed in 2ms -8 timing config:load:env Completed in 0ms -9 timing config:load:file:/Users/sshmatrix/Idee/sshmatrix/Buidl/namesys-eth/ccip2-eth-client/.npmrc Completed in 0ms -10 timing config:load:project Completed in 6ms -11 timing config:load:file:/Users/sshmatrix/.npmrc Completed in 0ms -12 timing config:load:user Completed in 1ms -13 timing config:load:file:/usr/local/etc/npmrc Completed in 1ms -14 timing config:load:global Completed in 1ms -15 timing config:load:validate Completed in 0ms -16 timing config:load:credentials Completed in 1ms -17 timing config:load:setEnvs Completed in 1ms -18 timing config:load Completed in 20ms -19 timing npm:load:configload Completed in 20ms -20 timing npm:load:mkdirpcache Completed in 0ms -21 timing npm:load:mkdirplogs Completed in 1ms -22 verbose title npm -23 verbose argv "--cache" "clean" -24 timing npm:load:setTitle Completed in 6ms -25 timing config:load:flatten Completed in 3ms -26 timing npm:load:display Completed in 5ms -27 verbose logfile logs-max:10 dir:/Users/sshmatrix/Idee/sshmatrix/Buidl/namesys-eth/ccip2-eth-client/clean/_logs -28 verbose logfile /Users/sshmatrix/Idee/sshmatrix/Buidl/namesys-eth/ccip2-eth-client/clean/_logs/2023-08-17T08_40_01_412Z-debug-0.log -29 timing npm:load:logFile Completed in 7ms -30 timing npm:load:timers Completed in 0ms -31 timing npm:load:configScope Completed in 0ms -32 timing npm:load Completed in 44ms -33 verbose exit 0 -34 timing npm Completed in 50ms -35 verbose code 1 diff --git a/components/Preview.tsx b/components/Preview.tsx index c0cde75c..ba14b962 100644 --- a/components/Preview.tsx +++ b/components/Preview.tsx @@ -16,10 +16,11 @@ import Loading from '../components/LoadingColors' import Success from '../components/Success' import Confirm from '../components/Confirm' import * as constants from '../utils/constants' -import { _KEYGEN } from '../utils/keygen' +import { KEYGEN } from '../utils/keygen' import * as Name from 'w3name' import * as ed25519_2 from 'ed25519-2.0.0' // @noble/ed25519 v2.0.0 import * as ensContent from '../utils/contenthash' +import * as verifier from '../utils/verifier' import { isMobile } from 'react-device-detect' import { useAccount, @@ -85,6 +86,7 @@ const EMPTY_HISTORY = { contenthash: '', avatar: '', revision: '', + version: '', type: '', timestamp: {...EMPTY_STRING()}, queue: 1 @@ -99,7 +101,7 @@ function checkImageURL(url: string) { return new Promise(function(resolve, reject) { var img = new Image() img.onload = function() { - console.log('Image Loaded Successfully') + console.log('Log:', 'Image Loaded Successfully') resolve(true) } img.onerror = function() { @@ -121,6 +123,27 @@ function isEmpty(object: any) { return true } +async function getIPFSHashFromIPNS(ipnsKey: string, cacheBuster: Number) { + try { + const _response = await fetch( + `https://${ipnsKey}.ipfs2.eth.limo/version.json?t=${String(cacheBuster)}` + ); + if (!_response.ok) { + console.error('Error:', 'Fetch Gone Wrong') + return { + '_sequence': '' + } + } + const data = await _response.json(); + return data + } catch (error) { + console.error('Error:', error) + return { + '_sequence': '' + } + } +} + /** * Preview Modal * @param show : Show modal trigger @@ -143,9 +166,10 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare const [helpModal, setHelpModal] = React.useState(false); // Help modal trigger const [successModal, setSuccessModal] = React.useState(false); // Success modal trigger const [gasModal, setGasModal] = React.useState(false); // Gas savings modal trigger - const [finish, setFinish] = React.useState(false); // Indicates when all records have finished fetching + const [conclude, setConclude] = React.useState(false); // Indicates when all records have finished fetching const [resolver, setResolver] = React.useState(); // Resolver for ENS Domain const [resolveCall, setResolveCall] = React.useState(); // Resolver object for querying records + const [sync, setSync] = React.useState(false); // Records sync flag const [addr, setAddr] = React.useState(''); // Addr record for ENS Domain const [avatar, setAvatar] = React.useState(''); // Avatar record for ENS Domain const [thumbnail, setThumbnail] = React.useState(''); // Avatar record for ENS Domain @@ -246,7 +270,7 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare }) // Wagmi Signature hook // Initialises internal LIST[] object - function setMetadata(_recordhash: string) { + function setMetadata(_recordhash: string, _addr: string, _contenthash: string, _avatar: string) { let _LIST = [ { key: 0, @@ -276,9 +300,9 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare key: 2, header: 'Avatar', type: 'avatar', - value: avatar, + value: _avatar, editable: resolver === ccip2Contract && queue > 0, - active: isAvatar(avatar) && queue > 0, + active: isAvatar(_avatar) && queue > 0, state: false, label: 'Edit', help: 'Set your avatar', @@ -288,9 +312,9 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare key: 3, header: 'Address', type: 'addr', - value: addr, + value: _addr, editable: resolver === ccip2Contract && queue > 0, - active: isAddr(addr) && queue > 0, + active: isAddr(_addr) && queue > 0, state: false, label: 'Edit', help: 'Set your default address', @@ -300,16 +324,16 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare key: 4, header: 'Contenthash', type: 'contenthash', - value: contenthash, + value: _contenthash, editable: resolver === ccip2Contract && queue > 0, - active: isContenthash(contenthash) && queue > 0, + active: isContenthash(_contenthash) && queue > 0, state: false, label: 'Edit', help: 'Set your web contenthash', tooltip: 'Set Contenthash' } ] - finishQuery(_LIST) // Assign _LIST + concludeGet(_LIST) // Assign _LIST } /// Keys & Signature Definitions @@ -875,8 +899,7 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare let namehash = ethers.utils.namehash(ENS) setTokenIDLegacy(namehash) setTokenIDWrapper(ethers.BigNumber.from(namehash).toString()) - getResolver() - + setConclude(true) } // eslint-disable-next-line react-hooks/exhaustive-deps }, [browser, ENS]) @@ -917,7 +940,7 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare setMessage(['Generating IPNS Key', '']) const keygen = async () => { const _origin = hashType !== 'recordhash' ? `eth:${_Wallet_ || constants.zeroAddress}` : ENS - const __keypair = await _KEYGEN(_origin, caip10, sigIPNS, saltModalState.modalData) + const __keypair = await KEYGEN(_origin, caip10, sigIPNS, saltModalState.modalData) setKeypairIPNS(__keypair[0]) setMessage(['IPNS Keypair Generated', '']) } @@ -958,7 +981,7 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare setMessage(['Generating Signer Key', '']) const keygen = async () => { const _origin = hashType !== 'recordhash' ? `eth:${_Wallet_ || constants.zeroAddress}` : ENS - const __keypair = await _KEYGEN(_origin, caip10, sigSigner, saltModalState.modalData) + const __keypair = await KEYGEN(_origin, caip10, sigSigner, saltModalState.modalData) setKeypairSigner(__keypair[1]) setIsSigner(true) setMessage(['Signer Keypair Generated', '']) @@ -1094,14 +1117,28 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare onClose() } - // Finish query for ENS domain records - function finishQuery(data: React.SetStateAction | undefined) { + // Set Records to show for ENS domain + function concludeGet(data: React.SetStateAction | undefined) { if (data) { - setList(data) - setLoading(false) + setPreCache(data) } } + // Concludes fetching records + React.useEffect(() => { + if (sync) { + if (recordhash) { + setMetadata(recordhash, addr, contenthash, avatar) + } else if (ownerhash) { + setMetadata(ownerhash, addr, contenthash, avatar) + } else { + setMetadata('', addr, contenthash, avatar) + } + setLoading(false) + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [sync, recordhash, ownerhash, resolver, addr, contenthash, avatar, hashType]) + // Get Contenthash for ENS domain first async function getContenthash(resolver: ethers.providers.Resolver) { await resolver.getContentHash() @@ -1158,94 +1195,114 @@ const Preview: React.FC = ({ show, onClose, _ENS_, chain, handlePare .then(response => { if (!response) { setAddr('') + setSync(true) } else { setAddr(response) + setSync(true) } - setFinish(true) }) .catch(() => { setAddr('') - setFinish(true) + setSync(true) }) } -// Get Resolver for ENS domain -async function getResolver() { - try { - const _response = await provider.getResolver(ENS) - if (_response?.address) { - setResolver(_response.address) - setResolveCall(_response) - if (_response.address === ccip2Contract) { - getContenthash(_response) - } else { - const _contenthash = await refreshRecord(['contenthash', ''], _response) - setContenthash(_contenthash || '') - let _avatar: string - _avatar = await refreshRecord(['avatar', ''], _response) - if (!_avatar) { - _avatar = await refreshRecord(['text', 'avatar'], _response) + // Get Resolver for ENS domain + async function getResolver(_history: any, _ENS: string) { + try { + const _response = await provider.getResolver(_ENS) + if (_response?.address) { + setResolver(_response.address) + setResolveCall(_response) + if (_response.address === ccip2Contract) { + let _Storage = await verifier.quickRecordhash(_ENS, ccip2Config, getOwner()) + let _IPFS: any + for (var i = 0; i < 2; i++) { + _IPFS = await getIPFSHashFromIPNS(ensContent.decodeContenthash(_Storage).decoded, i) + } + if (Number(_IPFS._sequence) === Number(_history.timestamp.version)) { + setContenthash(_history.contenthash) + setAvatar(_history.avatar) + setAddr(_history.addr) + setSync(true) + } else { + getContenthash(_response) + } + } else { + const _contenthash = await refreshRecord(['contenthash', ''], _response, _ENS, false) + setContenthash(_contenthash || '') + let _avatar: string + _avatar = await refreshRecord(['avatar', ''], _response, _ENS, false) + if (!_avatar) { + _avatar = await refreshRecord(['text', 'avatar'], _response, _ENS, false) + } + setAvatar(_avatar || '') + const _addr = await refreshRecord(['addr', ''], _response, _ENS, false) + setAddr(_addr || '') + setSync(true) } - setAvatar(_avatar || '') - const _addr = await refreshRecord(['addr', ''], _response) - setAddr(_addr || '') - setFinish(true) } + } catch (error) { + console.error('Error in getResolver():', error) } - } catch (error) { - console.error('Error in getResolver():', error) } -} -// Re-try empty records -async function refreshRecord(_record: string[], _resolver: Resolver) { - setRefresh(_record[0]) - try { - if (_record[0] === 'addr') { - const response = await provider.resolveName(ENS) - if (response) { - setAddr(response) - setRefreshedValue(response) - setRefresh('1') - return response - } - } else if (_record[0] === 'avatar') { - const response = await provider.getAvatar(ENS) - if (response) { - setAvatar(response) - setRefreshedValue(response) - setRefresh('1') - return response - } - } else if (_record[0] === 'contenthash') { - const response = await _resolver.getContentHash() - if (response) { - setContenthash(response) - setRefreshedValue(response) - setRefresh('1') - return response - } - } else if (_record[0] === 'text') { - const response = await _resolver.getText(_record[1]) - if (response) { - setAvatar(response) - setRefreshedValue(response) - setRefresh('1') - return response + // Re-try empty records + async function refreshRecord(_record: string[], _resolver: Resolver, _ENS: string, _trigger: boolean) { + if (_trigger) setRefresh(_record[0]) + try { + if (_record[0] === 'addr') { + const _response = await provider.resolveName(_ENS) + if (_response) { + setAddr(_response) + if (_trigger) { + setRefreshedValue(_response) + setRefresh('1') + } + return _response + } + } else if (_record[0] === 'avatar') { + const _response = await provider.getAvatar(_ENS) + if (_response) { + setAvatar(_response) + if (_trigger) { + setRefreshedValue(_response) + setRefresh('1') + } + return _response + } + } else if (_record[0] === 'contenthash') { + const _response = await _resolver.getContentHash() + if (_response) { + setContenthash(_response) + if (_trigger) { + setRefreshedValue(_response) + setRefresh('1') + } + return _response + } + } else if (_record[0] === 'text') { + const _response = await _resolver.getText(_record[1]) + if (_response) { + setAvatar(_response) + if (_trigger) { + setRefreshedValue(_response) + setRefresh('1') + } + return _response + } } + if (_trigger) setRefresh('0') + return '' + } catch (error) { + console.error(`Error in refreshRecord('${_record}'):`, error) + if (_trigger) setRefresh('0') + return '' } - setRefresh('0') - return '' - } catch (error) { - console.error(`Error in refreshRecord('${_record}'):`, error) - setRefresh('0') - return '' } -} - // Function for writing IPNS Revision metadata to NameSys backend; needed for updates - async function writeRevision(revision: Name.Revision, gas: {}) { + async function writeRevision(revision: Name.Revision, gas: {}, timestamp: string) { const request = { ens: ENS, owner: _Wallet_, @@ -1368,16 +1425,16 @@ async function refreshRecord(_record: string[], _resolver: Resolver) { // Get records from history on NameSys backend // Must get Revision for IPNS update - async function getUpdate(_storage: string, _type: string) { + async function getUpdate(_storage: string, _type: string, _hashType: string) { const request = { type: 'read', ens: ENS, - owner: _Wallet_, + owner: getOwner(), recordsTypes: 'all', recordsValues: 'all', chain: chain, - ownerhash: _storage, - hashType: hashType + storage: _storage, + hashType: _hashType } try{ await fetch( @@ -1396,6 +1453,7 @@ async function refreshRecord(_record: string[], _resolver: Resolver) { addr: data.response.addr, avatar: data.response.avatar, contenthash: data.response.contenthash, + version: data.response.version, revision: data.response.revision, timestamp: data.response.timestamp, queue: latestTimestamp(data.response.timestamp), @@ -1421,39 +1479,45 @@ async function refreshRecord(_record: string[], _resolver: Resolver) { // Triggers fetching history from NameSys backend React.useEffect(() => { - if (finish) { + if (conclude) { getUpdate( - recordhash ? recordhash : ownerhash, + recordhash || ownerhash, + recordhash ? 'recordhash' : 'ownerhash', recordhash ? 'recordhash' : 'ownerhash' ) } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [finish, ownerhash, recordhash]) + }, [conclude, ownerhash, recordhash]) + + // Triggers fetching resolver and records + React.useEffect(() => { + if (queue && ENS && !sync) { + getResolver(history, ENS) + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [history, queue, ENS, sync]) // Triggers setting metadata React.useEffect(() => { - if (history && queue && resolver) { + if (history && queue && resolver && !sync) { if (recordhash) { - setMetadata(recordhash) if (recordhash.startsWith('https://')) { setHashType('gateway') } else { setHashType('recordhash') } } else if (ownerhash) { - setMetadata(ownerhash) if (ownerhash.startsWith('https://')) { setHashType('gateway') } else { setHashType('ownerhash') } } else { - setMetadata('') setHashType('storage') } } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [history, queue, resolver, recordhash, ownerhash]) + }, [history, queue, resolver, recordhash, ownerhash, sync]) // Internal state handling of editable/active records during updates by user React.useEffect(() => { @@ -1661,22 +1725,18 @@ async function refreshRecord(_record: string[], _resolver: Resolver) { let _revision_ = Revision.decode(new Uint8Array(Buffer.from(history.revision, "utf-8"))) _revision = await Name.increment(_revision_, toPublish) } + setTimestamp(data.response.timestamp) // Write revision to database - await writeRevision(_revision, gas) + await writeRevision(_revision, gas, data.response.timestamp) // Publish IPNS await Name.publish(_revision, w3name.key) // Wrap up setGas(gas) - setTimeout(() => { - setGasModal(true) - setLoading(false) - states.map((_state) => { - setStates(prevState => prevState.filter(item => item !== _state)) - }) - setLegit(EMPTY_BOOL()) - }, 2000) + setGasModal(true) + setStates([]) + setLegit(EMPTY_BOOL()) + setLoading(false) // Update values in the modal to new ones - setTimestamp(data.response.timestamp) let _updatedList = list.map((item) => { if (!['resolver', 'recordhash'].includes(item.type)) { let _queue = Math.round(Date.now()/1000) - latestTimestamp(data.response.timestamp) - waitingPeriod @@ -1942,18 +2002,16 @@ async function refreshRecord(_record: string[], _resolver: Resolver) { }} > - {!loading && ( - - - close - - - )} + + + close + + {ENS && loading && @@ -1990,7 +2048,7 @@ async function refreshRecord(_record: string[], _resolver: Resolver) { } - {loading && + {ENS && loading &&
} - {list.length > 0 && !loading && + {ENS && list.length > 0 && !loading && -
- - {ENS.split('.eth')[0]} - - - . - - - ETH - -
-
    -
    + {ENS.split('.eth')[0]} + + + . + + + ETH + +
    +
      - {list.map((item) => ( -
    • - -
      + {list.map((item) => ( +
    • - +
      - - { // Label Recordhash/Ownerhash - item.type === 'recordhash' && ( - - { hashType } - - )} - { // Label+ - item.type !== 'recordhash' && ( - - { item.header } - - )} - { // Set Badge if Resolver is migrated and ONLY Ownerhash is set - ['resolver', 'recordhash'].includes(item.type) && resolver === ccip2Contract && !recordhash && ownerhash && ( -
      - - )} - { // Set Badge if Resolver is migrated and Recordhash is set - ['resolver', 'recordhash'].includes(item.type) && resolver === ccip2Contract && recordhash && ( - + )} + { // Set Badge if Resolver is migrated and Recordhash is set + ['resolver', 'recordhash'].includes(item.type) && resolver === ccip2Contract && recordhash && ( +
- - )} - { // Set Badge if Resolver is migrated and no Recordhash or Ownerhash or Gateway is set - ['resolver', 'recordhash'].includes(item.type) && resolver === ccip2Contract && !recordhash && !ownerhash && ( - + )} + { // Set Badge if Resolver is migrated and no Recordhash or Ownerhash or Gateway is set + ['resolver', 'recordhash'].includes(item.type) && resolver === ccip2Contract && !recordhash && !ownerhash && ( +
- - )} - { // Set Badge if Resolver is not migrated and no Recordhash or Ownerhash has been set in the past - ['resolver', 'recordhash'].includes(item.type) && resolver !== ccip2Contract && !recordhash && !ownerhash && ( - + )} + { // Set Badge if Resolver is not migrated and no Recordhash or Ownerhash has been set in the past + ['resolver', 'recordhash'].includes(item.type) && resolver !== ccip2Contract && !recordhash && !ownerhash && ( + - )} - { // Resolver is not migrated but Recordhash has been set in the past - ['resolver', 'recordhash'].includes(item.type) && resolver !== ccip2Contract && (recordhash || ownerhash) && ( - + )} + { // Resolver is not migrated but Recordhash has been set in the past + ['resolver', 'recordhash'].includes(item.type) && resolver !== ccip2Contract && (recordhash || ownerhash) && ( + - )} - - { // Help icons - item.type !== 'resolver' && ( - + )} + + { // Help icons + item.type !== 'resolver' && ( + - )} - - { // Countdown - !['resolver', 'recordhash'].includes(item.type) && !constants.blocked.includes(item.type) - && resolver === ccip2Contract && - (recordhash || ownerhash) && ( - + )} + + { // Countdown + !['resolver', 'recordhash'].includes(item.type) && !constants.blocked.includes(item.type) + && resolver === ccip2Contract && + (recordhash || ownerhash) && ( + - )} - - { // Refresh buttons - !['resolver', 'recordhash'].includes(item.type) && !constants.blocked.includes(item.type) - && resolver === ccip2Contract && - (recordhash || ownerhash) && ( - + )} + + { // Refresh buttons + !['resolver', 'recordhash'].includes(item.type) && !constants.blocked.includes(item.type) + && resolver === ccip2Contract && _Wallet_ && + (recordhash || ownerhash) && ( + + )} + + { // Updated State marker + item.state && (
- sync + { crash && sustain ? 'cancel' : 'task_alt' }
- - )} - - { // Updated State marker - item.state && ( + )} + + + + { - setTrigger(item.type), - setSafeTrigger('1'), - ['resolver', 'recordhash'].includes(item.type) ? setOptions(true) : setWrite(true), // Trigger write for Records - ['resolver', 'recordhash'].includes(item.type) ? setStates(prevState => [...prevState, item.type]) : '' // Update edited keys + onChange={(e) => { + setValues(item.type, e.target.value) }} - data-tooltip={ item.tooltip } - > -
- {item.label} manage_history -
- + /> - { - setValues(item.type, e.target.value) - }} - /> - -
- - ))} - - - {states.length > 1 && ( -
-
+ + {states.length > 1 && ( +
{ - setWrite(true) - setTrigger('records'), - setSafeTrigger('1'), - setWrite(true) + marginTop: '-10px', + marginBottom: '40px' }} - data-tooltip={ 'Set Multiple Records in One Click' } > - - -
- )} - +
+ {'Edit All'} manage_history +
+ + + )} +
}