From 0d98f112b778039d2525f495df8144c788f96bad Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Mon, 19 Aug 2024 23:36:57 +0200 Subject: [PATCH 1/7] config --- package.json | 3 + pnpm-lock.yaml | 255 +++++++++++++++++++++++++++++++++++++++++++ src/App.tsx | 1 + src/header.tsx | 23 ++-- src/walletConfigs.ts | 27 +++++ 5 files changed, 298 insertions(+), 11 deletions(-) create mode 100644 src/walletConfigs.ts diff --git a/package.json b/package.json index a7be721..7b68e7f 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,13 @@ "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.2", + "@reactive-dot/core": "^0.8.0", + "@reactive-dot/react": "^0.8.0", "@tanstack/react-table": "^8.19.3", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "copy-to-clipboard": "^3.3.3", + "dot-connect": "^0.5.0", "lucide-react": "^0.418.0", "next-themes": "^0.3.0", "polkadot-api": "^1.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cfb68df..b05f846 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,6 +47,12 @@ importers: '@radix-ui/react-tooltip': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@reactive-dot/core': + specifier: ^0.8.0 + version: 0.8.0(polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0)) + '@reactive-dot/react': + specifier: ^0.8.0 + version: 0.8.0(@types/react@18.3.3)(polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0))(react@18.3.1) '@tanstack/react-table': specifier: ^8.19.3 version: 8.19.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -59,6 +65,9 @@ importers: copy-to-clipboard: specifier: ^3.3.3 version: 3.3.3 + dot-connect: + specifier: ^0.5.0 + version: 0.5.0(@reactive-dot/core@0.8.0(polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0))) lucide-react: specifier: ^0.418.0 version: 0.418.0(react@18.3.1) @@ -606,6 +615,15 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@lit-labs/preact-signals@1.0.2': + resolution: {integrity: sha512-HFgIhqLB5IiNbvJxEN3+o6n9x/fNZo7pqfElG56NHrOFBsIFW7wswbp6hHeoGzATQDOB2ZmrH/VrRGYdcgl29g==} + + '@lit-labs/ssr-dom-shim@1.2.1': + resolution: {integrity: sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==} + + '@lit/reactive-element@2.0.4': + resolution: {integrity: sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==} + '@noble/curves@1.4.2': resolution: {integrity: sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==} @@ -810,6 +828,9 @@ packages: resolution: {integrity: sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==} engines: {node: '>=18'} + '@preact/signals-core@1.8.0': + resolution: {integrity: sha512-OBvUsRZqNmjzCZXWLxkZfhcgT+Fk8DDcT/8vD6a1xhDemodyy87UJRJfASMuSD8FaAIeGgGm85ydXhm7lr4fyA==} + '@radix-ui/number@1.1.0': resolution: {integrity: sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==} @@ -1196,6 +1217,26 @@ packages: '@radix-ui/rect@1.1.0': resolution: {integrity: sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg==} + '@reactive-dot/core@0.8.0': + resolution: {integrity: sha512-aHJ0Z7vbQTzflvzsMc6gRtF8hPWKeb9KFlegT1kEQiMVxkkGfYPdzKs4iVtYNss5kMAdI4LF7ZMGCDqmIu2s6Q==} + peerDependencies: + '@walletconnect/modal': 2.x + '@walletconnect/universal-provider': 2.x + polkadot-api: ^1.0.0 + peerDependenciesMeta: + '@walletconnect/modal': + optional: true + '@walletconnect/universal-provider': + optional: true + + '@reactive-dot/react@0.8.0': + resolution: {integrity: sha512-OgRaNh1YJdyyOgjTsXDtIyzQ/rFbsLxw+YcfzbOHWEKH+h5aFUrVQqtYpe2KIUtx2v2YPtflNg0Xtg358QEifQ==} + peerDependencies: + react: 18.x + + '@reactive-dot/utils@0.8.0': + resolution: {integrity: sha512-7jHOQB3LvVk+ro/HUeL4Xy1ruE1+Ct9WOc8ULIWIbqOUtWjcxg52kkpSJmfRcPLDVw/ni9bDlKPCHIFVitFf1w==} + '@remix-run/router@1.18.0': resolution: {integrity: sha512-L3jkqmqoSVBVKHfpGZmLrex0lxR5SucGA0sUfFzGctehw+S/ggL9L/0NnC5mw6P8HUWpFZ3nQw3cRApjjWx9Sw==} engines: {node: '>=14.0.0'} @@ -1426,6 +1467,9 @@ packages: '@types/react@18.3.3': resolution: {integrity: sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==} + '@types/trusted-types@2.0.7': + resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + '@typescript-eslint/eslint-plugin@7.18.0': resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1608,6 +1652,10 @@ packages: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} @@ -1642,6 +1690,9 @@ packages: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} + cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + clsx@2.0.0: resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==} engines: {node: '>=6'} @@ -1721,6 +1772,10 @@ packages: supports-color: optional: true + decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -1738,6 +1793,9 @@ packages: didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} + dijkstrajs@1.0.3: + resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1752,6 +1810,11 @@ packages: dot-case@3.0.4: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} + dot-connect@0.5.0: + resolution: {integrity: sha512-vO9Wg+MmuMLxhqNqIldLg89qH0BGdK7tlxGTKMau5cM9Qb1Lu/O4Bjy/voazaR5KvyMu5X3PG6C0mHJO+p6MJw==} + peerDependencies: + '@reactive-dot/core': '*' + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -1944,6 +2007,10 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + get-east-asian-width@1.2.0: resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} engines: {node: '>=18'} @@ -2122,6 +2189,24 @@ packages: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true + jotai-scope@0.7.1: + resolution: {integrity: sha512-oFz91+fHy6U5v2zwLlE4fQja38J56FoY6h4c8SJluNQGwggfSIr/gIG5rXTaDLE/9AuPfx5kWZS7HhAjlZRb1g==} + peerDependencies: + jotai: '>=2.9.2' + react: '>=17.0.0' + + jotai@2.9.3: + resolution: {integrity: sha512-IqMWKoXuEzWSShjd9UhalNsRGbdju5G2FrqNLQJT+Ih6p41VNYe2sav5hnwQx4HJr25jq9wRqvGSWGviGG6Gjw==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=17.0.0' + react: '>=17.0.0' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} @@ -2176,6 +2261,15 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + lit-element@4.1.0: + resolution: {integrity: sha512-gSejRUQJuMQjV2Z59KAS/D4iElUhwKpIyJvZ9w+DIagIQjfJnhR20h2Q5ddpzXGS+fF0tMZ/xEYGMnKmaI/iww==} + + lit-html@3.2.0: + resolution: {integrity: sha512-pwT/HwoxqI9FggTrYVarkBKFN9MlTUpLrDHubTmW4SrkL3kkqW5gxwbxMMUnbbRHBC0WTZnYHcjDSCM559VyfA==} + + lit@3.2.0: + resolution: {integrity: sha512-s6tI33Lf6VpDu7u4YqsSX78D28bYQulM+VAzsGch4fx2H0eLZnJsUBsPWmGYSGoKDNbjtRv02rio1o+UdPVwvw==} + load-tsconfig@0.2.5: resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -2411,6 +2505,10 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + pngjs@5.0.0: + resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} + engines: {node: '>=10.13.0'} + polkadot-api@1.0.1: resolution: {integrity: sha512-XmH3CCUChaAlZLhnQhaf9ZB7uW0ZwkU/GqQVLFIklZy8Kx/f3Q3PDtTPNM7uAMWTr8xuCN1gIja3UalWgPHyMg==} hasBin: true @@ -2493,6 +2591,11 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + qrcode@1.5.4: + resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==} + engines: {node: '>=10.13.0'} + hasBin: true + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -2568,6 +2671,13 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -2619,6 +2729,9 @@ packages: engines: {node: '>=10'} hasBin: true + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -2927,6 +3040,9 @@ packages: whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -2936,6 +3052,10 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -2971,6 +3091,9 @@ packages: utf-8-validate: optional: true + y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -2979,6 +3102,14 @@ packages: engines: {node: '>= 14'} hasBin: true + yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + + yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -3343,6 +3474,17 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@lit-labs/preact-signals@1.0.2': + dependencies: + '@preact/signals-core': 1.8.0 + lit: 3.2.0 + + '@lit-labs/ssr-dom-shim@1.2.1': {} + + '@lit/reactive-element@2.0.4': + dependencies: + '@lit-labs/ssr-dom-shim': 1.2.1 + '@noble/curves@1.4.2': dependencies: '@noble/hashes': 1.4.0 @@ -3637,6 +3779,8 @@ snapshots: '@polkadot/x-global': 12.6.2 tslib: 2.6.3 + '@preact/signals-core@1.8.0': {} + '@radix-ui/number@1.1.0': {} '@radix-ui/primitive@1.1.0': {} @@ -4033,6 +4177,25 @@ snapshots: '@radix-ui/rect@1.1.0': {} + '@reactive-dot/core@0.8.0(polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0))': + dependencies: + '@reactive-dot/utils': 0.8.0 + polkadot-api: 1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0) + + '@reactive-dot/react@0.8.0(@types/react@18.3.3)(polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0))(react@18.3.1)': + dependencies: + '@reactive-dot/core': 0.8.0(polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0)) + jotai: 2.9.3(@types/react@18.3.3)(react@18.3.1) + jotai-scope: 0.7.1(jotai@2.9.3(@types/react@18.3.3)(react@18.3.1))(react@18.3.1) + react: 18.3.1 + transitivePeerDependencies: + - '@types/react' + - '@walletconnect/modal' + - '@walletconnect/universal-provider' + - polkadot-api + + '@reactive-dot/utils@0.8.0': {} + '@remix-run/router@1.18.0': {} '@rollup/pluginutils@5.1.0(rollup@4.19.1)': @@ -4238,6 +4401,8 @@ snapshots: '@types/prop-types': 15.7.12 csstype: 3.1.3 + '@types/trusted-types@2.0.7': {} + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 @@ -4431,6 +4596,8 @@ snapshots: camelcase-css@2.0.1: {} + camelcase@5.3.1: {} + camelcase@6.3.0: {} caniuse-lite@1.0.30001646: {} @@ -4470,6 +4637,12 @@ snapshots: cli-spinners@2.9.2: {} + cliui@6.0.0: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + clsx@2.0.0: {} clsx@2.1.1: {} @@ -4527,6 +4700,8 @@ snapshots: dependencies: ms: 2.1.2 + decamelize@1.2.0: {} + deep-is@0.1.4: {} deepmerge-ts@7.1.0: {} @@ -4537,6 +4712,8 @@ snapshots: didyoumean@1.2.2: {} + dijkstrajs@1.0.3: {} + dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -4552,6 +4729,13 @@ snapshots: no-case: 3.0.4 tslib: 2.6.3 + dot-connect@0.5.0(@reactive-dot/core@0.8.0(polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0))): + dependencies: + '@lit-labs/preact-signals': 1.0.2 + '@reactive-dot/core': 0.8.0(polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0)) + lit: 3.2.0 + qrcode: 1.5.4 + eastasianwidth@0.2.0: {} electron-to-chromium@1.5.4: {} @@ -4824,6 +5008,8 @@ snapshots: gensync@1.0.0-beta.2: {} + get-caller-file@2.0.5: {} + get-east-asian-width@1.2.0: {} get-nonce@1.0.1: {} @@ -4982,6 +5168,16 @@ snapshots: jiti@1.21.6: {} + jotai-scope@0.7.1(jotai@2.9.3(@types/react@18.3.3)(react@18.3.1))(react@18.3.1): + dependencies: + jotai: 2.9.3(@types/react@18.3.3)(react@18.3.1) + react: 18.3.1 + + jotai@2.9.3(@types/react@18.3.3)(react@18.3.1): + optionalDependencies: + '@types/react': 18.3.3 + react: 18.3.1 + joycon@3.1.1: {} js-tokens@4.0.0: {} @@ -5023,6 +5219,22 @@ snapshots: lines-and-columns@1.2.4: {} + lit-element@4.1.0: + dependencies: + '@lit-labs/ssr-dom-shim': 1.2.1 + '@lit/reactive-element': 2.0.4 + lit-html: 3.2.0 + + lit-html@3.2.0: + dependencies: + '@types/trusted-types': 2.0.7 + + lit@3.2.0: + dependencies: + '@lit/reactive-element': 2.0.4 + lit-element: 4.1.0 + lit-html: 3.2.0 + load-tsconfig@0.2.5: {} locate-path@5.0.0: @@ -5236,6 +5448,8 @@ snapshots: dependencies: find-up: 4.1.0 + pngjs@5.0.0: {} + polkadot-api@1.0.1(jiti@1.21.6)(postcss@8.4.40)(rxjs@7.8.1)(smoldot@2.0.30)(yaml@2.5.0): dependencies: '@polkadot-api/cli': 0.7.5(jiti@1.21.6)(postcss@8.4.40)(smoldot@2.0.30)(yaml@2.5.0) @@ -5323,6 +5537,12 @@ snapshots: punycode@2.3.1: {} + qrcode@1.5.4: + dependencies: + dijkstrajs: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 + queue-microtask@1.2.3: {} react-dom@18.3.1(react@18.3.1): @@ -5397,6 +5617,10 @@ snapshots: dependencies: picomatch: 2.3.1 + require-directory@2.1.1: {} + + require-main-filename@2.0.0: {} + resolve-from@4.0.0: {} resolve-from@5.0.0: {} @@ -5458,6 +5682,8 @@ snapshots: semver@7.6.3: {} + set-blocking@2.0.0: {} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 @@ -5754,12 +5980,20 @@ snapshots: tr46: 1.0.1 webidl-conversions: 4.0.2 + which-module@2.0.1: {} + which@2.0.2: dependencies: isexe: 2.0.0 word-wrap@1.2.5: {} + wrap-ansi@6.2.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -5796,10 +6030,31 @@ snapshots: ws@8.18.0: {} + y18n@4.0.3: {} + yallist@3.1.1: {} yaml@2.5.0: {} + yargs-parser@18.1.3: + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + + yargs@15.4.1: + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 + yocto-queue@0.1.0: {} yoctocolors@2.1.1: {} diff --git a/src/App.tsx b/src/App.tsx index 8c84818..3d74c8b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,6 +6,7 @@ import { useLocalStorage } from 'usehooks-ts' import { Toaster } from '@/components/ui/sonner' import './index.css' import { Content } from './Content' +import 'dot-connect/font.css' const App = () => { const [settings] = useLocalStorage('fellowship-settings', { diff --git a/src/header.tsx b/src/header.tsx index ea3c350..e5ecf84 100644 --- a/src/header.tsx +++ b/src/header.tsx @@ -1,12 +1,12 @@ -import { Polkicon } from '@polkadot-ui/react' -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from '@/components/ui/dropdown-menu' +// import { Polkicon } from '@polkadot-ui/react' +// import { +// DropdownMenu, +// DropdownMenuContent, +// DropdownMenuItem, +// DropdownMenuLabel, +// DropdownMenuSeparator, +// DropdownMenuTrigger, +// } from '@/components/ui/dropdown-menu' import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet' import { Button } from '@/components/ui/button' import { routes } from '@/lib/utils' @@ -75,7 +75,8 @@ export const Header = () => {
- + + {/*
diff --git a/src/walletConfigs.ts b/src/walletConfigs.ts new file mode 100644 index 0000000..e8f140d --- /dev/null +++ b/src/walletConfigs.ts @@ -0,0 +1,27 @@ +import { dot, ksm } from '@polkadot-api/descriptors' +import type { Config } from '@reactive-dot/core' +import { InjectedWalletAggregator } from '@reactive-dot/core/wallets.js' +import { getWsProvider } from 'polkadot-api/ws-provider/web' +import { registerDotConnect } from 'dot-connect' +import { SupportedWalletOrAggregator } from 'node_modules/dot-connect/build/types' + +const config: Config = { + chains: { + polkadot: { + descriptor: dot, + provider: getWsProvider('wss://rpc.ibp.network/polkadot'), + }, + kusama: { + descriptor: ksm, + provider: getWsProvider('wss://rpc.ibp.network/kusama'), + }, + }, + wallets: [new InjectedWalletAggregator()], +} + +// Register dot-connect custom elements & configure supported wallets +registerDotConnect({ + wallets: config.wallets as SupportedWalletOrAggregator[], +}) + +export default config From bc2a7c5c538c0756dd114be348030bf747f074fa Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Tue, 20 Aug 2024 00:14:31 +0200 Subject: [PATCH 2/7] infinite loop by providing a chain id --- src/App.tsx | 20 ++++++++++++-------- src/clients.tsx | 2 +- src/header.tsx | 11 ++++++++++- src/redot.d.ts | 6 ++++++ src/walletConfigs.ts | 12 +++--------- 5 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 src/redot.d.ts diff --git a/src/App.tsx b/src/App.tsx index 3d74c8b..6654589 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,6 +7,8 @@ import { Toaster } from '@/components/ui/sonner' import './index.css' import { Content } from './Content' import 'dot-connect/font.css' +import { config } from './walletConfigs' +import { ReDotProvider } from '@reactive-dot/react' const App = () => { const [settings] = useLocalStorage('fellowship-settings', { @@ -16,15 +18,17 @@ const App = () => { return ( <> - -
- -
-
- + + +
+ +
+
+ +
-
- + + diff --git a/src/clients.tsx b/src/clients.tsx index a1f1720..3f78c0b 100644 --- a/src/clients.tsx +++ b/src/clients.tsx @@ -5,7 +5,7 @@ import { getWsProvider } from 'polkadot-api/ws-provider/web' // Connect to the polkadot relay chain. export const dotClient = createClient( - getWsProvider('wss://dot-rpc.stakeworld.io'), + getWsProvider('wss://rpc.ibp.network/polkadot'), ) export const ksmClient = createClient( getWsProvider('wss://rpc.ibp.network/kusama'), diff --git a/src/header.tsx b/src/header.tsx index e5ecf84..e42fd56 100644 --- a/src/header.tsx +++ b/src/header.tsx @@ -12,6 +12,7 @@ import { Button } from '@/components/ui/button' import { routes } from '@/lib/utils' import { Settings2, PanelLeft } from 'lucide-react' +// import { useAccounts } from '@reactive-dot/react' import { Menubar, @@ -24,6 +25,14 @@ import { } from '@/components/ui/menubar' export const Header = () => { + // const accounts = useAccounts() + // Error: No chain ID provided + + // const accounts = useAccounts({ chainId: 'polkadot' }) + + // console.log('accounts', accounts) + // getting infinite loop, although it's a working rpc + // Unable to connect to wss://dot-rpc.stakeworld.io ws-provider.ts:18:18 return (
@@ -75,7 +84,7 @@ export const Header = () => {
- + connect {/* - - - My Account - - Settings - Support - - Logout - - */} + {!accounts.length && ( + Connect + )} + {!!accounts.length && ( + + + + + + {accounts.map((account, index) => ( + <> + selectAccount(account)} + > + + {account.name} + + {index !== accounts.length - 1 && } + + ))} + disconnectAll()} + > + Logout + + + + )}
From 4c585c90a690ad7e0e8cb51a4b97eca41944bfdf Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Tue, 20 Aug 2024 06:26:54 +0200 Subject: [PATCH 7/7] allow lint to pass --- src/contexts/AccountsContext.tsx | 3 ++- src/header.tsx | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/contexts/AccountsContext.tsx b/src/contexts/AccountsContext.tsx index 833a99c..5cee3c2 100644 --- a/src/contexts/AccountsContext.tsx +++ b/src/contexts/AccountsContext.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-refresh/only-export-components */ import React, { useState, createContext, @@ -27,7 +28,7 @@ const AccountContextProvider = ({ children }: AccountContextProps) => { const [selectedAccount, setSelected] = useState() const selectAccount = useCallback((account: InjectedAccount) => { - localStorage.setItem(LOCALSTORAGE_SELECTED_ACCOUNT_KEY, account.address) + localStorage.setItem(LOCALSTORAGE_SELECTED_ACCOUNT_KEY, account?.address) setSelected(account) }, []) diff --git a/src/header.tsx b/src/header.tsx index 18e5786..f35967e 100644 --- a/src/header.tsx +++ b/src/header.tsx @@ -86,10 +86,9 @@ export const Header = () => {