From 416930eb394e8d74ebd601621ca97cd538228483 Mon Sep 17 00:00:00 2001 From: Marko Gracin Date: Mon, 16 Dec 2024 15:55:02 +0100 Subject: [PATCH 1/3] =?UTF-8?q?feat(frontend):=20=F0=9F=8E=B8add=20pinata?= =?UTF-8?q?=20SDK=20and=20file=20upload=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.env.example | 5 +- frontend/package.json | 1 - frontend/src/lib/index.ts | 1 - frontend/src/lib/pinata/pinata.server.ts | 8 + .../src/routes/api/pinata/upload/+server.ts | 49 +++++ pnpm-lock.yaml | 199 ++++++++++++++++++ 6 files changed, 260 insertions(+), 3 deletions(-) delete mode 100644 frontend/src/lib/index.ts create mode 100644 frontend/src/lib/pinata/pinata.server.ts create mode 100644 frontend/src/routes/api/pinata/upload/+server.ts diff --git a/frontend/.env.example b/frontend/.env.example index 97458b6..3f89fd3 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -1,6 +1,5 @@ HEDERA_ACCOUNT_ID= HEDERA_PRIVATE_KEY= - # testnet / mainnet HEDERA_ENVIRONMENT= # the reown (formerly walletconnect) project id used for hashpack @@ -9,3 +8,7 @@ PUBLIC_HASHCONNECT_PROJECT_ID=3918c43fa2467261721ed00df472e8be PUBLIC_DEPLOYMENT_CONTRACT_ID=0.0.5272938 PUBLIC_DEPLOYMENT_NFT_TOKEN_ID=0.0.5272939 PUBLIC_IPFS_GATEWAY_BASE_URL=https://flk-ipfs.xyz/ipfs +# pinata +PINATA_JWT= +PINATA_GROUP_ID= +PUBLIC_GATEWAY_URL= diff --git a/frontend/package.json b/frontend/package.json index 0886f9c..019eb23 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -25,7 +25,6 @@ "eslint-plugin-svelte": "^2.46.1", "globals": "^15.13.0", "hashconnect": "^3.0.13", - "prettier": "^3.4.2", "prettier-plugin-css-order": "^2.1.2", "prettier-plugin-organize-imports": "^4.1.0", "prettier-plugin-svelte": "^3.3.2", diff --git a/frontend/src/lib/index.ts b/frontend/src/lib/index.ts deleted file mode 100644 index 856f2b6..0000000 --- a/frontend/src/lib/index.ts +++ /dev/null @@ -1 +0,0 @@ -// place files you want to import through the `$lib` alias in this folder. diff --git a/frontend/src/lib/pinata/pinata.server.ts b/frontend/src/lib/pinata/pinata.server.ts new file mode 100644 index 0000000..280bb15 --- /dev/null +++ b/frontend/src/lib/pinata/pinata.server.ts @@ -0,0 +1,8 @@ +import { PINATA_JWT } from '$env/static/private' +import { PUBLIC_GATEWAY_URL } from '$env/static/public' +import { PinataSDK } from 'pinata-web3' + +export const pinata = new PinataSDK({ + pinataJwt: PINATA_JWT, + pinataGateway: PUBLIC_GATEWAY_URL, +}) diff --git a/frontend/src/routes/api/pinata/upload/+server.ts b/frontend/src/routes/api/pinata/upload/+server.ts new file mode 100644 index 0000000..10adcc7 --- /dev/null +++ b/frontend/src/routes/api/pinata/upload/+server.ts @@ -0,0 +1,49 @@ +// https://docs.pinata.cloud/web3/sdk/getting-started + +import { pinata } from '$lib/pinata/pinata.server' +import { json } from '@sveltejs/kit' +import type { RequestHandler } from './$types' + +import { PINATA_GROUP_ID } from '$env/static/private' + +export const POST: RequestHandler = async ({ request }) => { + try { + const formData = await request.formData() + + // todo we wont need file uplaod in the future, as the image will be generated randomly! + const uploadedFile = formData.get('file') as File + const metadata = JSON.parse(formData.get('metadata') as string) + + if (!uploadedFile?.name || uploadedFile.size === 0) { + return json({ error: 'You must provide a file to upload' }, { status: 400 }) + } + + // Upload image todo for some reason the group id gets ignored? + const imageUpload = await pinata.upload.file(uploadedFile).group(PINATA_GROUP_ID) + + const imageIpfsUrl = `ipfs://${imageUpload.IpfsHash}` + + // Create and upload metadata (containing IPFS image url) + const fullMetadata = { + ...metadata, + type: 'image/jpg', + format: 'none', + image: imageIpfsUrl, + } + + // Upload metadata to IPFS + const metadataUpload = await pinata.upload.json(fullMetadata) + const metadataUrl = `ipfs://${metadataUpload.IpfsHash}` + + return json({ + imageUrl: await pinata.gateways.convert(imageUpload.IpfsHash), + metadataUrl, // this is the only thing that matters id say, and we will pass this as metadata on mint process + imageIpfsHash: imageUpload.IpfsHash, + metadataIpfsHash: metadataUpload.IpfsHash, + }) + } catch (throwable) { + console.error('Upload failed:', throwable) + const error = throwable instanceof Error ? throwable : new Error(String(throwable)) + return json({ error: error.message }, { status: 500 }) + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 23dc9ba..f18ddb8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,6 +65,9 @@ importers: hashconnect: specifier: ^3.0.13 version: 3.0.13(react@18.3.1) + pinata-web3: + specifier: ^0.5.3 + version: 0.5.3 prettier: specifier: ^3.4.2 version: 3.4.2 @@ -102,6 +105,12 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@chainsafe/is-ip@2.0.2': + resolution: {integrity: sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==} + + '@chainsafe/netmask@2.0.0': + resolution: {integrity: sha512-I3Z+6SWUoaljh3TBzCnCxjlUyN8tA+NAk5L6m9IxvCf1BENQTePzPMis97CoN/iMW1St3WN+AWCCRp+TTBRiDg==} + '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -477,6 +486,9 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@leichtgewicht/ip-codec@2.0.5': + resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} + '@lit-labs/ssr-dom-shim@1.2.1': resolution: {integrity: sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==} @@ -512,6 +524,15 @@ packages: resolution: {integrity: sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg==} deprecated: Motion One for Vue is deprecated. Use Oku Motion instead https://oku-ui.com/motion + '@multiformats/dns@1.0.6': + resolution: {integrity: sha512-nt/5UqjMPtyvkG9BQYdJ4GfLK3nMqGpFZOzf4hAmIa0sJh2LlS9YKXZ4FgwBDsaHvzZqR/rUFIywIc7pkHNNuw==} + + '@multiformats/mafmt@12.1.6': + resolution: {integrity: sha512-tlJRfL21X+AKn9b5i5VnaTD6bNttpSpcqwKVmDmSHLwxoz97fAHaepqFOk/l1fIu94nImIXneNbhsJx/RQNIww==} + + '@multiformats/multiaddr@12.3.4': + resolution: {integrity: sha512-R4pEEUyWGrRo16TSflz80Yr6XNbPirix1pfPqDLXsDZ4aaIrhZ7cez9jnyRQgci6DuuqSyZAdJKV6SdxpZ7Oiw==} + '@noble/curves@1.2.0': resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} @@ -1081,6 +1102,9 @@ packages: '@types/cookie@0.6.0': resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} + '@types/dns-packet@5.6.5': + resolution: {integrity: sha512-qXOC7XLOEe43ehtWJCMnQXvgcIpv6rPmQ1jXT98Ad8A3TB1Ue50jsCbSSSyuazScEuZ/Q026vHbrOTVkmwA+7Q==} + '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} @@ -1754,6 +1778,10 @@ packages: engines: {node: '>=4'} hasBin: true + data-uri-to-buffer@4.0.1: + resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} + engines: {node: '>= 12'} + dateformat@4.6.3: resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} @@ -1842,6 +1870,10 @@ packages: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} + dns-packet@5.6.1: + resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==} + engines: {node: '>=6'} + dotenv@16.4.7: resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} engines: {node: '>=12'} @@ -2058,6 +2090,9 @@ packages: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} + eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -2106,6 +2141,10 @@ packages: picomatch: optional: true + fetch-blob@3.2.0: + resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} + engines: {node: ^12.20 || >= 14.13} + file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -2162,6 +2201,10 @@ packages: resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} engines: {node: '>= 6'} + formdata-polyfill@4.0.10: + resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} + engines: {node: '>=12.20.0'} + fp-ts@1.19.3: resolution: {integrity: sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==} @@ -2329,6 +2372,9 @@ packages: hashconnect@3.0.13: resolution: {integrity: sha512-K4jL0gzSdQZFLA2krcyoLe0eq5waHzEI+MsQ8Kaa/XvwHMB2NwNIdaPx3MDWKx2Q87DTd2jhY8+VOesW1JIkwg==} + hashlru@2.3.0: + resolution: {integrity: sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A==} + hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -2462,6 +2508,10 @@ packages: engines: {node: '>=14.16'} hasBin: true + is-ipfs@8.0.4: + resolution: {integrity: sha512-upkO6a8WgBSZMMmuPzmF2NQLWXtiJtHxdEfEiMWrOzCKoZ+XEiM0XlK4fFMfo/PyiRmPMJ4PsNrXyvJeqMrJXA==} + engines: {node: '>=16.0.0', npm: '>=7.0.0'} + is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -2498,6 +2548,10 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + iso-url@1.2.1: + resolution: {integrity: sha512-9JPDgCN4B7QPkLtYAAOrEuAWvP9rWvR5offAr0/SeF046wIkglqH3VXgYYP6NcsKslH80UIVgmPqNe3j7tG2ng==} + engines: {node: '>=12'} + isomorphic-unfetch@3.1.0: resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==} @@ -2758,6 +2812,9 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + multiformats@13.3.1: + resolution: {integrity: sha512-QxowxTNwJ3r5RMctoGA5p13w5RbRT2QDkoM+yFlqfLiioBp78nhDjnRLvmSBI9+KAqN4VdgOVWM9c0CHd86m3g==} + multiformats@9.9.0: resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} @@ -2781,6 +2838,10 @@ packages: node-addon-api@7.1.1: resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} + node-domexception@1.0.0: + resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} + engines: {node: '>=10.5.0'} + node-emoji@1.11.0: resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==} @@ -2796,6 +2857,10 @@ packages: encoding: optional: true + node-fetch@3.3.2: + resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + node-forge@1.3.1: resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} engines: {node: '>= 6.13.0'} @@ -2894,6 +2959,14 @@ packages: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} + p-queue@8.0.1: + resolution: {integrity: sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==} + engines: {node: '>=18'} + + p-timeout@6.1.3: + resolution: {integrity: sha512-UJUyfKbwvr/uZSV6btANfb+0t/mOhKV/KXcCUTp8FcQI+v/0d+wXqH4htrW0E4rR6WiEO/EPvUFiV9D5OI4vlw==} + engines: {node: '>=14.16'} + p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} @@ -2957,6 +3030,9 @@ packages: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} + pinata-web3@0.5.3: + resolution: {integrity: sha512-0OWm7dFel5Dib/BiOWxPnyMPmv1jviijpnohid8A804D6uZgWiPVBsU/2RbP4E3AEvNiWxPBw7+BqRFOuSLJIw==} + pino-abstract-transport@0.5.0: resolution: {integrity: sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==} @@ -3086,6 +3162,9 @@ packages: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} + progress-events@1.0.1: + resolution: {integrity: sha512-MOzLIwhpt64KIVN64h1MwdKWiyKFNc/S6BoYKPIVUHFg0/eIEyBulhWCgn678v/4c0ri3FdGuzXymNCv02MUIw==} + promise@8.3.0: resolution: {integrity: sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==} @@ -3679,12 +3758,21 @@ packages: engines: {node: '>=0.8.0'} hasBin: true + uint8-varint@2.0.4: + resolution: {integrity: sha512-FwpTa7ZGA/f/EssWAb5/YV6pHgVF1fViKdW8cWaEarjB8t7NyofSWBdOTyFPaGuUG4gx3v1O3PQ8etsiOs3lcw==} + + uint8arraylist@2.4.8: + resolution: {integrity: sha512-vc1PlGOzglLF0eae1M8mLRTBivsvrGsdmJ5RbK3e+QRvRLOZfZhQROTwH/OfyF3+ZVUg9/8hE8bmKP2CvP9quQ==} + uint8arrays@3.1.0: resolution: {integrity: sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==} uint8arrays@3.1.1: resolution: {integrity: sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==} + uint8arrays@5.1.0: + resolution: {integrity: sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==} + uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} @@ -3839,6 +3927,10 @@ packages: vite: optional: true + web-streams-polyfill@3.3.3: + resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} + engines: {node: '>= 8'} + web3-utils@1.10.4: resolution: {integrity: sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==} engines: {node: '>=8.0.0'} @@ -3995,6 +4087,12 @@ snapshots: '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 + '@chainsafe/is-ip@2.0.2': {} + + '@chainsafe/netmask@2.0.0': + dependencies: + '@chainsafe/is-ip': 2.0.2 + '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -4508,6 +4606,8 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@leichtgewicht/ip-codec@2.0.5': {} + '@lit-labs/ssr-dom-shim@1.2.1': {} '@lit/reactive-element@1.6.3': @@ -4567,6 +4667,29 @@ snapshots: '@motionone/dom': 10.18.0 tslib: 2.8.1 + '@multiformats/dns@1.0.6': + dependencies: + '@types/dns-packet': 5.6.5 + buffer: 6.0.3 + dns-packet: 5.6.1 + hashlru: 2.3.0 + p-queue: 8.0.1 + progress-events: 1.0.1 + uint8arrays: 5.1.0 + + '@multiformats/mafmt@12.1.6': + dependencies: + '@multiformats/multiaddr': 12.3.4 + + '@multiformats/multiaddr@12.3.4': + dependencies: + '@chainsafe/is-ip': 2.0.2 + '@chainsafe/netmask': 2.0.0 + '@multiformats/dns': 1.0.6 + multiformats: 13.3.1 + uint8-varint: 2.0.4 + uint8arrays: 5.1.0 + '@noble/curves@1.2.0': dependencies: '@noble/hashes': 1.3.2 @@ -5131,6 +5254,10 @@ snapshots: '@types/cookie@0.6.0': {} + '@types/dns-packet@5.6.5': + dependencies: + '@types/node': 20.17.10 + '@types/estree@1.0.6': {} '@types/form-data@0.0.33': @@ -6282,6 +6409,8 @@ snapshots: cssesc@3.0.0: {} + data-uri-to-buffer@4.0.1: {} + dateformat@4.6.3: {} death@1.1.0: {} @@ -6338,6 +6467,10 @@ snapshots: dependencies: path-type: 4.0.0 + dns-packet@5.6.1: + dependencies: + '@leichtgewicht/ip-codec': 2.0.5 + dotenv@16.4.7: {} dunder-proto@1.0.1: @@ -6709,6 +6842,8 @@ snapshots: event-target-shim@5.0.1: {} + eventemitter3@5.0.1: {} + events@3.3.0: {} evp_bytestokey@1.0.3: @@ -6758,6 +6893,11 @@ snapshots: optionalDependencies: picomatch: 4.0.2 + fetch-blob@3.2.0: + dependencies: + node-domexception: 1.0.0 + web-streams-polyfill: 3.3.3 + file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -6812,6 +6952,10 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 + formdata-polyfill@4.0.10: + dependencies: + fetch-blob: 3.2.0 + fp-ts@1.19.3: {} fs-extra@7.0.1: @@ -7090,6 +7234,8 @@ snapshots: - react - utf-8-validate + hashlru@2.3.0: {} + hasown@2.0.2: dependencies: function-bind: 1.1.2 @@ -7204,6 +7350,14 @@ snapshots: dependencies: is-docker: 3.0.0 + is-ipfs@8.0.4: + dependencies: + '@multiformats/mafmt': 12.1.6 + '@multiformats/multiaddr': 12.3.4 + iso-url: 1.2.1 + multiformats: 13.3.1 + uint8arrays: 5.1.0 + is-number@7.0.0: {} is-plain-obj@2.1.0: {} @@ -7230,6 +7384,8 @@ snapshots: isexe@2.0.0: {} + iso-url@1.2.1: {} + isomorphic-unfetch@3.1.0: dependencies: node-fetch: 2.7.0 @@ -7505,6 +7661,8 @@ snapshots: ms@2.1.3: {} + multiformats@13.3.1: {} + multiformats@9.9.0: {} nanoid@3.3.8: {} @@ -7519,6 +7677,8 @@ snapshots: node-addon-api@7.1.1: {} + node-domexception@1.0.0: {} + node-emoji@1.11.0: dependencies: lodash: 4.17.21 @@ -7529,6 +7689,12 @@ snapshots: dependencies: whatwg-url: 5.0.0 + node-fetch@3.3.2: + dependencies: + data-uri-to-buffer: 4.0.1 + fetch-blob: 3.2.0 + formdata-polyfill: 4.0.10 + node-forge@1.3.1: {} node-gyp-build@4.8.4: {} @@ -7622,6 +7788,13 @@ snapshots: dependencies: aggregate-error: 3.1.0 + p-queue@8.0.1: + dependencies: + eventemitter3: 5.0.1 + p-timeout: 6.1.3 + + p-timeout@6.1.3: {} + p-try@2.2.0: {} parent-module@1.0.1: @@ -7664,6 +7837,15 @@ snapshots: pify@4.0.1: {} + pinata-web3@0.5.3: + dependencies: + axios: 1.7.9 + form-data: 4.0.1 + is-ipfs: 8.0.4 + node-fetch: 3.3.2 + transitivePeerDependencies: + - debug + pino-abstract-transport@0.5.0: dependencies: duplexify: 4.1.3 @@ -7801,6 +7983,8 @@ snapshots: process@0.11.10: {} + progress-events@1.0.1: {} + promise@8.3.0: dependencies: asap: 2.0.6 @@ -8482,6 +8666,15 @@ snapshots: uglify-js@3.19.3: optional: true + uint8-varint@2.0.4: + dependencies: + uint8arraylist: 2.4.8 + uint8arrays: 5.1.0 + + uint8arraylist@2.4.8: + dependencies: + uint8arrays: 5.1.0 + uint8arrays@3.1.0: dependencies: multiformats: 9.9.0 @@ -8490,6 +8683,10 @@ snapshots: dependencies: multiformats: 9.9.0 + uint8arrays@5.1.0: + dependencies: + multiformats: 13.3.1 + uncrypto@0.1.3: {} undici-types@6.19.8: {} @@ -8575,6 +8772,8 @@ snapshots: optionalDependencies: vite: 5.4.11(@types/node@22.10.2) + web-streams-polyfill@3.3.3: {} + web3-utils@1.10.4: dependencies: '@ethereumjs/util': 8.1.0 From a77e068e32acae0ce3ced09e73f122ed084c2b4e Mon Sep 17 00:00:00 2001 From: aptt Date: Tue, 17 Dec 2024 09:54:58 +0100 Subject: [PATCH 2/3] =?UTF-8?q?chore(ci):=20=F0=9F=A4=96=20add=20ipfs=20up?= =?UTF-8?q?load=20variables=20to=20ci=20jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/continuousIntgration.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/continuousIntgration.yml b/.github/workflows/continuousIntgration.yml index 8ac2fc4..09b7306 100644 --- a/.github/workflows/continuousIntgration.yml +++ b/.github/workflows/continuousIntgration.yml @@ -14,6 +14,9 @@ jobs: PUBLIC_DEPLOYMENT_CONTRACT_ID: ${{ vars.PUBLIC_DEPLOYMENT_CONTRACT_ID }} PUBLIC_DEPLOYMENT_NFT_TOKEN_ID: ${{ vars.PUBLIC_DEPLOYMENT_NFT_TOKEN_ID }} PUBLIC_IPFS_GATEWAY_BASE_URL: ${{ vars.PUBLIC_IPFS_GATEWAY_BASE_URL }} + PUBLIC_GATEWAY_URL: ${{ vars.PUBLIC_GATEWAY_URL }} + PINATA_GROUP_ID: ${{ secrets,PINATA_GROUP_ID }} + PINATA_JWT: ${{ secrets.PINATA_JWT }} steps: # setup - uses: actions/checkout@v4 @@ -40,6 +43,9 @@ jobs: PUBLIC_DEPLOYMENT_CONTRACT_ID: ${{ vars.PUBLIC_DEPLOYMENT_CONTRACT_ID }} PUBLIC_DEPLOYMENT_NFT_TOKEN_ID: ${{ vars.PUBLIC_DEPLOYMENT_NFT_TOKEN_ID }} PUBLIC_IPFS_GATEWAY_BASE_URL: ${{ vars.PUBLIC_IPFS_GATEWAY_BASE_URL }} + PUBLIC_GATEWAY_URL: ${{ vars.PUBLIC_GATEWAY_URL }} + PINATA_GROUP_ID: ${{ secrets,PINATA_GROUP_ID }} + PINATA_JWT: ${{ secrets.PINATA_JWT }} steps: # setup - uses: actions/checkout@v4 From 8e1e37949ef0b6c7f56f3650474dbc04964deb3c Mon Sep 17 00:00:00 2001 From: aptt Date: Tue, 17 Dec 2024 10:43:26 +0100 Subject: [PATCH 3/3] =?UTF-8?q?fix(frontend):=20=F0=9F=90=9B=20add=20missi?= =?UTF-8?q?ng=20dependencies=20(bad=20rebase)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 2 ++ pnpm-lock.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 019eb23..8731f21 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -25,6 +25,8 @@ "eslint-plugin-svelte": "^2.46.1", "globals": "^15.13.0", "hashconnect": "^3.0.13", + "pinata-web3": "^0.5.3", + "prettier": "^3.4.2", "prettier-plugin-css-order": "^2.1.2", "prettier-plugin-organize-imports": "^4.1.0", "prettier-plugin-svelte": "^3.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f18ddb8..746aece 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5256,7 +5256,7 @@ snapshots: '@types/dns-packet@5.6.5': dependencies: - '@types/node': 20.17.10 + '@types/node': 22.10.2 '@types/estree@1.0.6': {}