diff --git a/packages/backend/index.js b/packages/backend/index.js new file mode 100644 index 0000000..ab6c603 --- /dev/null +++ b/packages/backend/index.js @@ -0,0 +1,8 @@ +const { Web3 } = require("web3"); + +const getFaucet = async () => { + const web3 = new Web3("rpc"); + + const accounts = await web3.eth.getAccounts(); + return accounts[0]; +}; diff --git a/packages/backend/package.json b/packages/backend/package.json new file mode 100644 index 0000000..8246520 --- /dev/null +++ b/packages/backend/package.json @@ -0,0 +1,14 @@ +{ + "name": "backend", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "web3": "^4.13.0" + } +} diff --git a/packages/nextjs/components/punk-society/ConfigMenu/AddressQRCodeModal.tsx b/packages/nextjs/components/punk-society/ConfigMenu/AddressQRCodeModal.tsx index d256142..964a9d4 100644 --- a/packages/nextjs/components/punk-society/ConfigMenu/AddressQRCodeModal.tsx +++ b/packages/nextjs/components/punk-society/ConfigMenu/AddressQRCodeModal.tsx @@ -37,7 +37,7 @@ export const AddressQRCodeModal = ({ address, modalId }: AddressQRCodeModalProps diff --git a/packages/nextjs/components/punk-society/PunkConnectButton/AddressQRCodeModal.tsx b/packages/nextjs/components/punk-society/PunkConnectButton/AddressQRCodeModal.tsx index d256142..453734b 100644 --- a/packages/nextjs/components/punk-society/PunkConnectButton/AddressQRCodeModal.tsx +++ b/packages/nextjs/components/punk-society/PunkConnectButton/AddressQRCodeModal.tsx @@ -31,13 +31,13 @@ export const AddressQRCodeModal = ({ address, modalId }: AddressQRCodeModalProps
{address}
- diff --git a/packages/nextjs/components/scaffold-eth/FaucetButton.tsx b/packages/nextjs/components/scaffold-eth/FaucetButton.tsx index 440b70b..f9ae0a9 100644 --- a/packages/nextjs/components/scaffold-eth/FaucetButton.tsx +++ b/packages/nextjs/components/scaffold-eth/FaucetButton.tsx @@ -45,7 +45,7 @@ export const FaucetButton = () => { } }; - // Render only on local chain + // // Render only on local chain if (ConnectedChain?.id !== hardhat.id) { return null; } diff --git a/yarn.lock b/yarn.lock index de202ee..b661088 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,7 +12,7 @@ __metadata: languageName: node linkType: hard -"@adraffy/ens-normalize@npm:1.11.0": +"@adraffy/ens-normalize@npm:1.11.0, @adraffy/ens-normalize@npm:^1.8.8": version: 1.11.0 resolution: "@adraffy/ens-normalize@npm:1.11.0" checksum: b2911269e3e0ec6396a2e5433a99e0e1f9726befc6c167994448cd0e53dbdd0be22b4835b4f619558b568ed9aa7312426b8fa6557a13999463489daa88169ee5 @@ -343,6 +343,15 @@ __metadata: languageName: node linkType: hard +"@ethereumjs/rlp@npm:^5.0.2": + version: 5.0.2 + resolution: "@ethereumjs/rlp@npm:5.0.2" + bin: + rlp: bin/rlp.cjs + checksum: b569061ddb1f4cf56a82f7a677c735ba37f9e94e2bbaf567404beb9e2da7aa1f595e72fc12a17c61f7aec67fd5448443efe542967c685a2fe0ffc435793dcbab + languageName: node + linkType: hard + "@ethereumjs/tx@npm:^4.1.2, @ethereumjs/tx@npm:^4.2.0": version: 4.2.0 resolution: "@ethereumjs/tx@npm:4.2.0" @@ -3179,6 +3188,15 @@ __metadata: languageName: node linkType: hard +"@types/ws@npm:8.5.3": + version: 8.5.3 + resolution: "@types/ws@npm:8.5.3" + dependencies: + "@types/node": "*" + checksum: 0ce46f850d41383fcdc2149bcacc86d7232fa7a233f903d2246dff86e31701a02f8566f40af5f8b56d1834779255c04ec6ec78660fe0f9b2a69cf3d71937e4ae + languageName: node + linkType: hard + "@typescript-eslint/eslint-plugin@npm:~5.40.0": version: 5.40.1 resolution: "@typescript-eslint/eslint-plugin@npm:5.40.1" @@ -4301,6 +4319,19 @@ __metadata: languageName: node linkType: hard +"abitype@npm:0.7.1": + version: 0.7.1 + resolution: "abitype@npm:0.7.1" + peerDependencies: + typescript: ">=4.9.4" + zod: ^3 >=3.19.1 + peerDependenciesMeta: + zod: + optional: true + checksum: de0d7082d28a4835b3d8dc4d8c75e9222c95a1f9eed13d6b2381403b46f46b68ea7a281e8ba6628d259a98c54ea466ebc206eec21db6205fa1641c7393854f5e + languageName: node + linkType: hard + "abitype@npm:0.9.8": version: 0.9.8 resolution: "abitype@npm:0.9.8" @@ -4834,6 +4865,14 @@ __metadata: languageName: node linkType: hard +"backend@workspace:packages/backend": + version: 0.0.0-use.local + resolution: "backend@workspace:packages/backend" + dependencies: + web3: ^4.13.0 + languageName: unknown + linkType: soft + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -5516,7 +5555,7 @@ __metadata: languageName: node linkType: hard -"crc-32@npm:^1.2.0": +"crc-32@npm:^1.2.0, crc-32@npm:^1.2.2": version: 1.2.2 resolution: "crc-32@npm:1.2.2" bin: @@ -8829,6 +8868,15 @@ __metadata: languageName: node linkType: hard +"isomorphic-ws@npm:^5.0.0": + version: 5.0.0 + resolution: "isomorphic-ws@npm:5.0.0" + peerDependencies: + ws: "*" + checksum: e20eb2aee09ba96247465fda40c6d22c1153394c0144fa34fe6609f341af4c8c564f60ea3ba762335a7a9c306809349f9b863c8beedf2beea09b299834ad5398 + languageName: node + linkType: hard + "isows@npm:1.0.3": version: 1.0.3 resolution: "isows@npm:1.0.3" @@ -13854,7 +13902,7 @@ __metadata: languageName: node linkType: hard -"util@npm:^0.12.4": +"util@npm:^0.12.4, util@npm:^0.12.5": version: 0.12.5 resolution: "util@npm:0.12.5" dependencies: @@ -14099,6 +14147,273 @@ __metadata: languageName: node linkType: hard +"web3-core@npm:^4.4.0, web3-core@npm:^4.5.0, web3-core@npm:^4.5.1, web3-core@npm:^4.6.0": + version: 4.6.0 + resolution: "web3-core@npm:4.6.0" + dependencies: + web3-errors: ^1.3.0 + web3-eth-accounts: ^4.2.1 + web3-eth-iban: ^4.0.7 + web3-providers-http: ^4.2.0 + web3-providers-ipc: ^4.0.7 + web3-providers-ws: ^4.0.8 + web3-types: ^1.8.0 + web3-utils: ^4.3.1 + web3-validator: ^2.0.6 + dependenciesMeta: + web3-providers-ipc: + optional: true + checksum: 8be8b45e34b48e94f74bf63f80e0e504278d4e0ee895a8658d7cf4aaa07b1947b5bb9c1d3db98d5ee1ba071b120cef175276e116911349f3472e5c91d8728998 + languageName: node + linkType: hard + +"web3-errors@npm:^1.1.3, web3-errors@npm:^1.2.0, web3-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "web3-errors@npm:1.3.0" + dependencies: + web3-types: ^1.7.0 + checksum: a057d5c5ad1fe3ec376a4287a48d50edaf93059daebf2b67e27dc6bb0a7d6649ea80598dee7150cf6aefaf201ea65b892bba0ef4fee3713fb72e576fb40a77b5 + languageName: node + linkType: hard + +"web3-eth-abi@npm:^4.2.3, web3-eth-abi@npm:^4.2.4": + version: 4.2.4 + resolution: "web3-eth-abi@npm:4.2.4" + dependencies: + abitype: 0.7.1 + web3-errors: ^1.3.0 + web3-types: ^1.8.0 + web3-utils: ^4.3.1 + web3-validator: ^2.0.6 + checksum: aa5677aa45c84f6a45964f902e7b2d7ef3909de2d54ea9e43b7d800ee0de0440a779996335835f2db26724816941d4c45b842cbf06b271db68fe67c285373244 + languageName: node + linkType: hard + +"web3-eth-accounts@npm:^4.2.1": + version: 4.2.1 + resolution: "web3-eth-accounts@npm:4.2.1" + dependencies: + "@ethereumjs/rlp": ^4.0.1 + crc-32: ^1.2.2 + ethereum-cryptography: ^2.0.0 + web3-errors: ^1.3.0 + web3-types: ^1.7.0 + web3-utils: ^4.3.1 + web3-validator: ^2.0.6 + checksum: 0e36e43353d7a805d1071b084580a0b2dc618eda4215cf7d83504ed4c9c9f36fd6cf452a63001d7a479882055caa3090d158aed14d631c096731d832b790c6e4 + languageName: node + linkType: hard + +"web3-eth-contract@npm:^4.5.0, web3-eth-contract@npm:^4.7.0": + version: 4.7.0 + resolution: "web3-eth-contract@npm:4.7.0" + dependencies: + "@ethereumjs/rlp": ^5.0.2 + web3-core: ^4.5.1 + web3-errors: ^1.3.0 + web3-eth: ^4.8.2 + web3-eth-abi: ^4.2.3 + web3-types: ^1.7.0 + web3-utils: ^4.3.1 + web3-validator: ^2.0.6 + checksum: 24cc55505fb82eba556b596d827b67b1b70bc1aaa9b4f1986fcdc7f0763e757941aa558b9a17a0197f231c40c19dd403b037771c72abb22953a1d0224457d457 + languageName: node + linkType: hard + +"web3-eth-ens@npm:^4.4.0": + version: 4.4.0 + resolution: "web3-eth-ens@npm:4.4.0" + dependencies: + "@adraffy/ens-normalize": ^1.8.8 + web3-core: ^4.5.0 + web3-errors: ^1.2.0 + web3-eth: ^4.8.0 + web3-eth-contract: ^4.5.0 + web3-net: ^4.1.0 + web3-types: ^1.7.0 + web3-utils: ^4.3.0 + web3-validator: ^2.0.6 + checksum: f64dd27e679686993fbdbc9d6be22cc61afe0e63ce4bd2472b5812bec3c9c7cbdb1e1f2edfba9418694299f6603be062f8da834944f2cfe33f0b1b2497b412b5 + languageName: node + linkType: hard + +"web3-eth-iban@npm:^4.0.7": + version: 4.0.7 + resolution: "web3-eth-iban@npm:4.0.7" + dependencies: + web3-errors: ^1.1.3 + web3-types: ^1.3.0 + web3-utils: ^4.0.7 + web3-validator: ^2.0.3 + checksum: c21785ece6c69146a605f60ebdd530e8a3faeda4302cbecef4665639c297fc11edd2f0dc8a6f6ba50b3f32d2c252d106687c24e31af3d297d5365a90f9badae0 + languageName: node + linkType: hard + +"web3-eth-personal@npm:^4.1.0": + version: 4.1.0 + resolution: "web3-eth-personal@npm:4.1.0" + dependencies: + web3-core: ^4.6.0 + web3-eth: ^4.9.0 + web3-rpc-methods: ^1.3.0 + web3-types: ^1.8.0 + web3-utils: ^4.3.1 + web3-validator: ^2.0.6 + checksum: fc436e51641bdae4adc18dc41ad8a7359fbd91d3ed42416b095b4269257504e0296514c3ab67748b93a9a474c8d7e65e246eeebb7aab8a1f1a87baf64667406c + languageName: node + linkType: hard + +"web3-eth@npm:^4.8.0, web3-eth@npm:^4.8.2, web3-eth@npm:^4.9.0": + version: 4.9.0 + resolution: "web3-eth@npm:4.9.0" + dependencies: + setimmediate: ^1.0.5 + web3-core: ^4.6.0 + web3-errors: ^1.3.0 + web3-eth-abi: ^4.2.4 + web3-eth-accounts: ^4.2.1 + web3-net: ^4.1.0 + web3-providers-ws: ^4.0.8 + web3-rpc-methods: ^1.3.0 + web3-types: ^1.8.0 + web3-utils: ^4.3.1 + web3-validator: ^2.0.6 + checksum: d1b5c05e6aef16c17ef5138813085198130c8b89260c2a1178d0ac52af4481b84b4e134040fd2b5e37dfac09075867348f2ee0c1cc516434016c35304d0e67a3 + languageName: node + linkType: hard + +"web3-net@npm:^4.1.0": + version: 4.1.0 + resolution: "web3-net@npm:4.1.0" + dependencies: + web3-core: ^4.4.0 + web3-rpc-methods: ^1.3.0 + web3-types: ^1.6.0 + web3-utils: ^4.3.0 + checksum: 8a257fbee5e73de20cf43a974be923f2d0eddcacd8bba39cc1426f97942d38c42816a3658ccf8db09920c8d99710e255c38ff9b84cdda011181c12b8c097a71d + languageName: node + linkType: hard + +"web3-providers-http@npm:^4.2.0": + version: 4.2.0 + resolution: "web3-providers-http@npm:4.2.0" + dependencies: + cross-fetch: ^4.0.0 + web3-errors: ^1.3.0 + web3-types: ^1.7.0 + web3-utils: ^4.3.1 + checksum: 8f65965979dc8a79720a52c9255acea5a564f6f6bd3d69eada60890e439bf71fd555ca3691a81543450f347652075e4a82adacb273b33e0444ec02b3ae6e34ce + languageName: node + linkType: hard + +"web3-providers-ipc@npm:^4.0.7": + version: 4.0.7 + resolution: "web3-providers-ipc@npm:4.0.7" + dependencies: + web3-errors: ^1.1.3 + web3-types: ^1.3.0 + web3-utils: ^4.0.7 + checksum: 83e734d833bd3663bc6d4a802c3eea83144a54244635d81d714913bd2f08a7463610fdb574bbbb1328c730340fea13730d4e33465fbf175d1c747170c142c7a7 + languageName: node + linkType: hard + +"web3-providers-ws@npm:^4.0.8": + version: 4.0.8 + resolution: "web3-providers-ws@npm:4.0.8" + dependencies: + "@types/ws": 8.5.3 + isomorphic-ws: ^5.0.0 + web3-errors: ^1.2.0 + web3-types: ^1.7.0 + web3-utils: ^4.3.1 + ws: ^8.17.1 + checksum: ecbc2324c4a5ae3cb8ad756cf2081b380dd12103f3fe4b451366fa29cd8b2db85f63ead97afe524420603c9afe0519797bab300d6e29b8a96eb3084494855c26 + languageName: node + linkType: hard + +"web3-rpc-methods@npm:^1.3.0": + version: 1.3.0 + resolution: "web3-rpc-methods@npm:1.3.0" + dependencies: + web3-core: ^4.4.0 + web3-types: ^1.6.0 + web3-validator: ^2.0.6 + checksum: 21673d6d2f539b0082a806bd0bf5d62882871584bf06337fc9b8399b6aeacd352c9fb19c6cae1cd25c145a60897c301fd12417848e34648bd5d5c7df7a76e095 + languageName: node + linkType: hard + +"web3-rpc-providers@npm:^1.0.0-rc.2": + version: 1.0.0-rc.2 + resolution: "web3-rpc-providers@npm:1.0.0-rc.2" + dependencies: + web3-errors: ^1.3.0 + web3-providers-http: ^4.2.0 + web3-providers-ws: ^4.0.8 + web3-types: ^1.7.0 + web3-utils: ^4.3.1 + web3-validator: ^2.0.6 + checksum: ab07c1c540eaa8ec3d8f72be840e9642ad3183b8dbc27e3bbd919db954f21d8fc98c6d94f24749fb5d29d1225f6ad8e8af3d8d5869bfb77bba8500a0d9dbfe2b + languageName: node + linkType: hard + +"web3-types@npm:^1.3.0, web3-types@npm:^1.6.0, web3-types@npm:^1.7.0, web3-types@npm:^1.8.0": + version: 1.8.0 + resolution: "web3-types@npm:1.8.0" + checksum: d306f7e54a2e6bb655363bc1691315d76440aa70fd14f3104cf841b9c67a3528038f561a00c4e0aaf3e1343dd65f41352b1a0463802475a2823ad2beb193e278 + languageName: node + linkType: hard + +"web3-utils@npm:^4.0.7, web3-utils@npm:^4.3.0, web3-utils@npm:^4.3.1": + version: 4.3.1 + resolution: "web3-utils@npm:4.3.1" + dependencies: + ethereum-cryptography: ^2.0.0 + eventemitter3: ^5.0.1 + web3-errors: ^1.2.0 + web3-types: ^1.7.0 + web3-validator: ^2.0.6 + checksum: 0f39ea473b7e2bdad3169b1d477328cf30c3f0f016e1ea00b046b11752105853fdace6d9735fedc91831cf573836538b039b5e717218236da6cb0b0165cbc17c + languageName: node + linkType: hard + +"web3-validator@npm:^2.0.3, web3-validator@npm:^2.0.6": + version: 2.0.6 + resolution: "web3-validator@npm:2.0.6" + dependencies: + ethereum-cryptography: ^2.0.0 + util: ^0.12.5 + web3-errors: ^1.2.0 + web3-types: ^1.6.0 + zod: ^3.21.4 + checksum: 15981ffce73cfa75c07f1ce0dbf65fe35fbdedc3ce19876e829b71a2a0e98aaf3aae90df764e6da7df3ff098d8fbf2ab37f58652fa93d7c3f8cb93b00f608c14 + languageName: node + linkType: hard + +"web3@npm:^4.13.0": + version: 4.13.0 + resolution: "web3@npm:4.13.0" + dependencies: + web3-core: ^4.6.0 + web3-errors: ^1.3.0 + web3-eth: ^4.9.0 + web3-eth-abi: ^4.2.4 + web3-eth-accounts: ^4.2.1 + web3-eth-contract: ^4.7.0 + web3-eth-ens: ^4.4.0 + web3-eth-iban: ^4.0.7 + web3-eth-personal: ^4.1.0 + web3-net: ^4.1.0 + web3-providers-http: ^4.2.0 + web3-providers-ws: ^4.0.8 + web3-rpc-methods: ^1.3.0 + web3-rpc-providers: ^1.0.0-rc.2 + web3-types: ^1.8.0 + web3-utils: ^4.3.1 + web3-validator: ^2.0.6 + checksum: e1f763b77620a2511d5a4e7c1571fe33e7ffed861b79c4bf0c5623e4ca317b6a5ea9eb8e66fa80e3b4e8deed85fc063431f26fc9528341c52d69d21953d4584b + languageName: node + linkType: hard + "webauthn-p256@npm:0.0.10": version: 0.0.10 resolution: "webauthn-p256@npm:0.0.10" @@ -14355,7 +14670,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.18.0": +"ws@npm:8.18.0, ws@npm:^8.17.1": version: 8.18.0 resolution: "ws@npm:8.18.0" peerDependencies: @@ -14555,6 +14870,13 @@ __metadata: languageName: node linkType: hard +"zod@npm:^3.21.4": + version: 3.23.8 + resolution: "zod@npm:3.23.8" + checksum: 15949ff82118f59c893dacd9d3c766d02b6fa2e71cf474d5aa888570c469dbf5446ac5ad562bb035bf7ac9650da94f290655c194f4a6de3e766f43febd432c5c + languageName: node + linkType: hard + "zustand@npm:4.4.1": version: 4.4.1 resolution: "zustand@npm:4.4.1"