diff --git a/.github/workflows/deploy-api.yml b/.github/workflows/deploy-api.yml deleted file mode 100644 index d9c737e..0000000 --- a/.github/workflows/deploy-api.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Deploy API - -on: - workflow_dispatch: - -jobs: - deploy-api: - runs-on: ubuntu-latest - steps: - - name: Repository Checkout - uses: actions/checkout@v4 - - - name: Setup NodeJS - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'yarn' - - - name: Install Netlify - run: npm install netlify-cli@17.10.1 -g - - - name: Install npm dependencies - run: yarn --immutable - - - name: Deploy to Netlify - id: netlify_deploy - run: | - netlify deploy \ - --dir packages/functions \ - --filter=functions \ - --prod \ - --functions=. \ - --site ${{ secrets.NETLIFY_SITE_ID }} \ - --auth ${{ secrets.NETLIFY_API_TOKEN }} diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml index cc482aa..3a42c9a 100644 --- a/.github/workflows/publish-site.yml +++ b/.github/workflows/publish-site.yml @@ -22,26 +22,17 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: 'yarn' - - name: Install npm dependencies - run: yarn --immutable - - name: Run build script - run: yarn workspace site build - name: Prepare for deployment run: | - echo "lxp-snap.linea.build" > packages/site/public/CNAME - echo "User-Agent: *" > packages/site/public/robots.txt - echo "Disallow: /" >> packages/site/public/robots.txt + echo "lxp-snap.linea.build" > packages/site/src/CNAME + echo "User-Agent: *" > packages/site/src/robots.txt + echo "Disallow: /" >> packages/site/src/robots.txt - name: Setup Pages uses: actions/configure-pages@v3 - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: - path: './packages/site/public' + path: './packages/site/src' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 8dce5c9..0000000 --- a/docs/index.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - LXP Snap - - - - - - - - - - -
-
- -
-

LXP Snap

-

Follow your Linea Voyage

-

View your Linea XP balance, POH status, and current activations inside of MetaMask!

-

Loading...

-
-

After installing the Snap, open the Snaps menu in MetaMask and click on LXP to view your Linea XP balance, Proof of Humanity status, and current activations.

-
- - - - - \ No newline at end of file diff --git a/package.json b/package.json index b6b95af..8eb84b6 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "lint": "yarn lint:eslint && yarn lint:misc --check", "lint:eslint": "eslint . --cache --ext js,jsx,ts,tsx", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", - "lint:misc": "prettier '**/*.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' --ignore-path .gitignore", + "lint:misc": "prettier '**/*.html' '**/*.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' --ignore-path .gitignore", "start": "yarn workspaces foreach --parallel --interlaced --verbose run start", "test": "yarn workspace @consensys/lxp-snap run test" }, diff --git a/packages/site/.env.production b/packages/dev-site/.env.production similarity index 100% rename from packages/site/.env.production rename to packages/dev-site/.env.production diff --git a/packages/dev-site/.eslintrc.js b/packages/dev-site/.eslintrc.js new file mode 100644 index 0000000..da63584 --- /dev/null +++ b/packages/dev-site/.eslintrc.js @@ -0,0 +1,16 @@ +module.exports = { + extends: ['../../.eslintrc.js'], + + parserOptions: { + tsconfigRootDir: __dirname, + }, + + overrides: [ + { + files: ['*.ts', '*.tsx'], + extends: ['@metamask/eslint-config-browser'], + }, + ], + + ignorePatterns: ['.cache/', 'public/'], +}; diff --git a/packages/dev-site/README.md b/packages/dev-site/README.md new file mode 100644 index 0000000..f6f0748 --- /dev/null +++ b/packages/dev-site/README.md @@ -0,0 +1,43 @@ +# TypeScript Example Snap Front-end + +This project was bootstrapped with [Gatsby](https://www.gatsbyjs.com/). + +## Available Scripts + +In the project directory, you can run: + +### `yarn start` + +Runs the app in the development mode.\ +Open [http://localhost:8000](http://localhost:8000) to view it in the browser. + +The page will reload if you make edits.\ +You will also see any lint errors in the console. + +### `yarn build` + +Builds the app for production to the `public` folder.\ +It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.\ +Your app is ready to be deployed! + +See the section about [deployment](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/) for more information. + +## Environment variables + +Gatsby has built-in support for loading environment variables into the browser and Functions. Loading environment variables into Node.js requires a small code snippet. + +In development, Gatsby will load environment variables from a file named `.env.development`. For builds, it will load from `.env.production`. + +By default you can use the `SNAP_ORIGIN` variable (used in `src/config/snap.ts`) to define a production origin for you snap (eg. `npm:MyPackageName`). If not defined it will defaults to `local:http://localhost:8080`. + +A `.env` file template is available, to use it rename `.env.production.dist` to `.env.production` + +To learn more visit [Gatsby documentation](https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables/) + +## Learn More + +You can learn more in the [Gatsby documentation](https://www.gatsbyjs.com/docs/). + +To learn React, check out the [React documentation](https://reactjs.org/). diff --git a/packages/site/gatsby-browser.tsx b/packages/dev-site/gatsby-browser.tsx similarity index 100% rename from packages/site/gatsby-browser.tsx rename to packages/dev-site/gatsby-browser.tsx diff --git a/packages/site/gatsby-config.ts b/packages/dev-site/gatsby-config.ts similarity index 100% rename from packages/site/gatsby-config.ts rename to packages/dev-site/gatsby-config.ts diff --git a/packages/site/gatsby-ssr.tsx b/packages/dev-site/gatsby-ssr.tsx similarity index 100% rename from packages/site/gatsby-ssr.tsx rename to packages/dev-site/gatsby-ssr.tsx diff --git a/packages/dev-site/package.json b/packages/dev-site/package.json new file mode 100644 index 0000000..f47ea79 --- /dev/null +++ b/packages/dev-site/package.json @@ -0,0 +1,72 @@ +{ + "name": "dev-site", + "version": "0.1.0", + "private": true, + "license": "(MIT-0 OR Apache-2.0)", + "scripts": { + "allow-scripts": "yarn workspace root allow-scripts", + "build": "GATSBY_TELEMETRY_DISABLED=1 gatsby build", + "clean": "rimraf public", + "lint": "yarn lint:eslint && yarn lint:misc --check", + "lint:eslint": "eslint . --cache --ext js,ts", + "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", + "lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path .gitignore", + "start": "GATSBY_TELEMETRY_DISABLED=1 gatsby develop" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "dependencies": { + "@metamask/providers": "^15.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-is": "^18.2.0", + "styled-components": "5.3.3" + }, + "devDependencies": { + "@metamask/eslint-config": "^12.2.0", + "@metamask/eslint-config-browser": "^12.1.0", + "@metamask/eslint-config-jest": "^12.1.0", + "@metamask/eslint-config-nodejs": "^12.1.0", + "@metamask/eslint-config-typescript": "^12.1.0", + "@svgr/webpack": "^6.4.0", + "@testing-library/dom": "^8.17.1", + "@testing-library/jest-dom": "^5.16.4", + "@testing-library/react": "^13.3.0", + "@testing-library/user-event": "^13.5.0", + "@types/jest": "^27.5.2", + "@types/react": "^18.0.15", + "@types/react-dom": "^18.0.6", + "@types/styled-components": "^5.1.25", + "@typescript-eslint/eslint-plugin": "^5.42.1", + "@typescript-eslint/parser": "^5.42.1", + "eslint": "^8.45.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "~2.26.0", + "eslint-plugin-jest": "^27.1.5", + "eslint-plugin-jsdoc": "^41.1.2", + "eslint-plugin-n": "^15.7.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-promise": "^6.1.1", + "gatsby": "^5.13.3", + "gatsby-plugin-manifest": "^5.13.1", + "gatsby-plugin-styled-components": "^6.13.1", + "gatsby-plugin-svgr": "^3.0.0-beta.0", + "prettier": "^2.7.1", + "prettier-plugin-packagejson": "^2.2.18", + "rimraf": "^3.0.2", + "typescript": "^4.7.4" + }, + "engines": { + "node": ">=18.6.0" + } +} diff --git a/packages/site/src/App.tsx b/packages/dev-site/src/App.tsx similarity index 100% rename from packages/site/src/App.tsx rename to packages/dev-site/src/App.tsx diff --git a/packages/site/src/Root.tsx b/packages/dev-site/src/Root.tsx similarity index 100% rename from packages/site/src/Root.tsx rename to packages/dev-site/src/Root.tsx diff --git a/packages/site/src/assets/flask_fox.svg b/packages/dev-site/src/assets/flask_fox.svg similarity index 100% rename from packages/site/src/assets/flask_fox.svg rename to packages/dev-site/src/assets/flask_fox.svg diff --git a/packages/site/src/assets/logo.svg b/packages/dev-site/src/assets/logo.svg similarity index 100% rename from packages/site/src/assets/logo.svg rename to packages/dev-site/src/assets/logo.svg diff --git a/packages/site/src/assets/metamask_fox.svg b/packages/dev-site/src/assets/metamask_fox.svg similarity index 100% rename from packages/site/src/assets/metamask_fox.svg rename to packages/dev-site/src/assets/metamask_fox.svg diff --git a/packages/site/src/components/Buttons.tsx b/packages/dev-site/src/components/Buttons.tsx similarity index 100% rename from packages/site/src/components/Buttons.tsx rename to packages/dev-site/src/components/Buttons.tsx diff --git a/packages/site/src/components/Card.tsx b/packages/dev-site/src/components/Card.tsx similarity index 100% rename from packages/site/src/components/Card.tsx rename to packages/dev-site/src/components/Card.tsx diff --git a/packages/site/src/components/Footer.tsx b/packages/dev-site/src/components/Footer.tsx similarity index 100% rename from packages/site/src/components/Footer.tsx rename to packages/dev-site/src/components/Footer.tsx diff --git a/packages/site/src/components/Header.tsx b/packages/dev-site/src/components/Header.tsx similarity index 100% rename from packages/site/src/components/Header.tsx rename to packages/dev-site/src/components/Header.tsx diff --git a/packages/site/src/components/MetaMask.tsx b/packages/dev-site/src/components/MetaMask.tsx similarity index 100% rename from packages/site/src/components/MetaMask.tsx rename to packages/dev-site/src/components/MetaMask.tsx diff --git a/packages/site/src/components/Other/Input.tsx b/packages/dev-site/src/components/Other/Input.tsx similarity index 100% rename from packages/site/src/components/Other/Input.tsx rename to packages/dev-site/src/components/Other/Input.tsx diff --git a/packages/site/src/components/PoweredBy.tsx b/packages/dev-site/src/components/PoweredBy.tsx similarity index 100% rename from packages/site/src/components/PoweredBy.tsx rename to packages/dev-site/src/components/PoweredBy.tsx diff --git a/packages/site/src/components/SnapLogo.tsx b/packages/dev-site/src/components/SnapLogo.tsx similarity index 100% rename from packages/site/src/components/SnapLogo.tsx rename to packages/dev-site/src/components/SnapLogo.tsx diff --git a/packages/site/src/components/Toggle.tsx b/packages/dev-site/src/components/Toggle.tsx similarity index 100% rename from packages/site/src/components/Toggle.tsx rename to packages/dev-site/src/components/Toggle.tsx diff --git a/packages/site/src/components/index.ts b/packages/dev-site/src/components/index.ts similarity index 100% rename from packages/site/src/components/index.ts rename to packages/dev-site/src/components/index.ts diff --git a/packages/site/src/config/index.ts b/packages/dev-site/src/config/index.ts similarity index 100% rename from packages/site/src/config/index.ts rename to packages/dev-site/src/config/index.ts diff --git a/packages/site/src/config/snap.ts b/packages/dev-site/src/config/snap.ts similarity index 100% rename from packages/site/src/config/snap.ts rename to packages/dev-site/src/config/snap.ts diff --git a/packages/site/src/config/theme.ts b/packages/dev-site/src/config/theme.ts similarity index 100% rename from packages/site/src/config/theme.ts rename to packages/dev-site/src/config/theme.ts diff --git a/packages/site/src/hooks/MetamaskContext.tsx b/packages/dev-site/src/hooks/MetamaskContext.tsx similarity index 100% rename from packages/site/src/hooks/MetamaskContext.tsx rename to packages/dev-site/src/hooks/MetamaskContext.tsx diff --git a/packages/site/src/hooks/index.ts b/packages/dev-site/src/hooks/index.ts similarity index 100% rename from packages/site/src/hooks/index.ts rename to packages/dev-site/src/hooks/index.ts diff --git a/packages/site/src/pages/index.tsx b/packages/dev-site/src/pages/index.tsx similarity index 63% rename from packages/site/src/pages/index.tsx rename to packages/dev-site/src/pages/index.tsx index b834a53..eec71e1 100644 --- a/packages/site/src/pages/index.tsx +++ b/packages/dev-site/src/pages/index.tsx @@ -1,4 +1,4 @@ -import { useContext, useEffect, useState } from 'react'; +import { useContext, useState } from 'react'; import styled from 'styled-components'; import { @@ -6,7 +6,6 @@ import { ConnectButton, GetLxpAddressButton, InstallFlaskButton, - PersonalSign, ReconnectButton, SetLxpAddressButton, } from '../components'; @@ -17,7 +16,6 @@ import { getSnap, isLocalSnap, shouldDisplayReconnectButton, - stringToHex, truncateAddress, } from '../utils'; @@ -80,9 +78,7 @@ const ErrorMessage = styled.div` const Index = () => { const { state, dispatch, provider } = useContext(MetaMaskContext); - const [claimMessage, setClaimMessage] = useState(); const [snapLxpAddress, setSnapLxpAddress] = useState(); - const [connectedAccount, setConnectedAccount] = useState(); const isMetaMaskReady = isLocalSnap(defaultSnapOrigin) ? state.isFlask @@ -142,102 +138,6 @@ const Index = () => { } }; - const handlePersonalSign = async () => { - setClaimMessage('Pending...'); - try { - const payload = { - address: connectedAccount, - signedOn: Date.now(), - subject: 'LXP Snap Activation', - }; - const message = `0x${stringToHex(JSON.stringify(payload))}`; - - const signature = await window.ethereum.request({ - method: 'personal_sign', - params: [message, connectedAccount], - }); - - const res = await window.ethereum.request<{ - status: string; - message?: string; - }>({ - method: 'wallet_invokeSnap', - params: { - snapId: defaultSnapOrigin, - request: { - method: 'personalSign', - params: { - signature, - payload, - }, - }, - }, - }); - - if (res?.status === 'ok') { - setClaimMessage('Claimed successfully 🎉'); - } else { - setClaimMessage(`Something went wrong 😔 ${res?.message ?? ''}`); - } - } catch (error) { - setClaimMessage(undefined); - console.error(error); - } - }; - - useEffect(() => { - const connectAccount = async () => { - if (state.installedSnap) { - const accounts = await window.ethereum - .request({ method: 'eth_requestAccounts' }) - .catch((error) => { - console.error(error); - }); - - if (!accounts) { - return; - } - - setConnectedAccount(accounts[0]); - - await handleGetLxpAddress(); - } - }; - - connectAccount().then().catch(console.error); - }, [state.installedSnap]); - - const isClaimDisabled = ( - installedSnap: boolean, - lxpAddressInSnap?: string, - connectedAccountInDapp?: string, - ) => { - return ( - !installedSnap || - !lxpAddressInSnap || - !connectedAccountInDapp || - lxpAddressInSnap.toLowerCase() !== connectedAccountInDapp.toLowerCase() - ); - }; - - const getClaimDescription = (message?: string) => { - if (message) { - return message; - } else if (!state.installedSnap) { - return 'You need to install the LXP Snap first'; - } else if (!connectedAccount) { - return 'You need to connect your wallet first'; - } else if (!snapLxpAddress) { - return 'You need to set your LXP address first'; - } else if ( - snapLxpAddress.toLowerCase() !== connectedAccount.toLowerCase() - ) { - return 'You need to connect with the same wallet as the one set in the LXP Snap'; - } - - return 'Claim your LXP by signing a message with your wallet'; - }; - return ( @@ -322,27 +222,6 @@ const Index = () => { }} disabled={!state.installedSnap} /> - - ), - }} - disabled={isClaimDisabled( - Boolean(state.installedSnap), - snapLxpAddress, - connectedAccount, - )} - /> ); diff --git a/packages/site/src/types/custom.d.ts b/packages/dev-site/src/types/custom.d.ts similarity index 100% rename from packages/site/src/types/custom.d.ts rename to packages/dev-site/src/types/custom.d.ts diff --git a/packages/site/src/types/index.ts b/packages/dev-site/src/types/index.ts similarity index 100% rename from packages/site/src/types/index.ts rename to packages/dev-site/src/types/index.ts diff --git a/packages/site/src/types/snap.ts b/packages/dev-site/src/types/snap.ts similarity index 100% rename from packages/site/src/types/snap.ts rename to packages/dev-site/src/types/snap.ts diff --git a/packages/site/src/types/styled.d.ts b/packages/dev-site/src/types/styled.d.ts similarity index 100% rename from packages/site/src/types/styled.d.ts rename to packages/dev-site/src/types/styled.d.ts diff --git a/packages/site/src/types/svg.d.ts b/packages/dev-site/src/types/svg.d.ts similarity index 100% rename from packages/site/src/types/svg.d.ts rename to packages/dev-site/src/types/svg.d.ts diff --git a/packages/site/src/utils/button.ts b/packages/dev-site/src/utils/button.ts similarity index 100% rename from packages/site/src/utils/button.ts rename to packages/dev-site/src/utils/button.ts diff --git a/packages/site/src/utils/index.ts b/packages/dev-site/src/utils/index.ts similarity index 100% rename from packages/site/src/utils/index.ts rename to packages/dev-site/src/utils/index.ts diff --git a/packages/site/src/utils/localStorage.ts b/packages/dev-site/src/utils/localStorage.ts similarity index 100% rename from packages/site/src/utils/localStorage.ts rename to packages/dev-site/src/utils/localStorage.ts diff --git a/packages/site/src/utils/metamask.ts b/packages/dev-site/src/utils/metamask.ts similarity index 100% rename from packages/site/src/utils/metamask.ts rename to packages/dev-site/src/utils/metamask.ts diff --git a/packages/site/src/utils/misc.ts b/packages/dev-site/src/utils/misc.ts similarity index 78% rename from packages/site/src/utils/misc.ts rename to packages/dev-site/src/utils/misc.ts index b832734..54b764e 100644 --- a/packages/site/src/utils/misc.ts +++ b/packages/dev-site/src/utils/misc.ts @@ -1,6 +1,6 @@ export const truncateAddress = (address: string) => - `${address.slice(0, 6)}••••${address.slice( - address.length - 4, + `${address.slice(0, 7)}...${address.slice( + address.length - 5, address.length, )}`; diff --git a/packages/site/src/utils/snap.ts b/packages/dev-site/src/utils/snap.ts similarity index 100% rename from packages/site/src/utils/snap.ts rename to packages/dev-site/src/utils/snap.ts diff --git a/packages/site/src/utils/theme.ts b/packages/dev-site/src/utils/theme.ts similarity index 100% rename from packages/site/src/utils/theme.ts rename to packages/dev-site/src/utils/theme.ts diff --git a/packages/site/static/robots.txt b/packages/dev-site/static/robots.txt similarity index 100% rename from packages/site/static/robots.txt rename to packages/dev-site/static/robots.txt diff --git a/packages/dev-site/tsconfig.json b/packages/dev-site/tsconfig.json new file mode 100644 index 0000000..a428470 --- /dev/null +++ b/packages/dev-site/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": "./", + "resolveJsonModule": true, + "jsx": "preserve" + }, + "include": ["src", "gatsby-browser.tsx", "gatsby-config.ts", "gatsby-ssr.tsx"] +} diff --git a/packages/functions/api.ts b/packages/functions/api.ts deleted file mode 100644 index ade094a..0000000 --- a/packages/functions/api.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { JWT } from 'google-auth-library'; -import { GoogleSpreadsheet } from 'google-spreadsheet'; -import type { Activation } from '@consensys/lxp-snap/src/types'; -import type { Address, Hex } from 'viem'; -import { verifyMessage } from 'viem'; - -const headers = { - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Methods': 'POST, OPTIONS', - 'Access-Control-Allow-Headers': 'Content-Type', - 'Content-Type': 'application/json', -}; - -export type Payload = { - address: Address; - signedOn: number; - subject: string; -}; - -/** - * This function is called on every network call. - * @param event - The event object. - * @param event.httpMethod - The HTTP method used by the caller. - * @param event.body - The HTTP request body. - * @returns The response object. - */ -export async function handler(event: { body: string; httpMethod: string }) { - if (event.httpMethod === 'OPTIONS') { - return { - statusCode: 204, - headers, - body: '', - }; - } - - if (event.httpMethod === 'GET') { - return getActivations(); - } else if (event.httpMethod === 'POST') { - return checkSignature(event.body); - } - - return { - statusCode: 405, - headers, - body: JSON.stringify({ - message: 'Method not allowed', - }), - }; -} - -/** - * Get current active activations from Contentful. - * @returns The activations object. - */ -async function getActivations() { - const { CONTENTFUL_API_KEY } = process.env; - const GET_XP_TAG = '4WJBpV24ju4wlbr6Kvi2pt'; - - if (!CONTENTFUL_API_KEY) { - return { - statusCode: 500, - body: JSON.stringify({ - message: 'Contentful API key not set', - }), - }; - } - - const response = await fetch( - 'https://api.contentful.com/spaces/64upluvbiuck/environments/master/entries/?content_type=activationsCard', - { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - Authorization: CONTENTFUL_API_KEY, - }, - }, - ); - - const result = await response.json(); - - const allActivations = result?.items ?? []; - const lxpActivations = allActivations.filter((activation: Activation) => { - const isCurrent = - new Date(activation?.fields?.endDate?.['en-US']) > new Date(); - const hasXpTag = activation?.fields?.tags?.['en-US']?.find( - (tag) => tag?.sys?.id === GET_XP_TAG, - ); - return isCurrent && hasXpTag; - }); - - return { - statusCode: 200, - headers, - body: JSON.stringify({ - lxpActivations, - }), - }; -} - -/** - * Check the signature and register the corresponding address. - * @param body - The request body. - * @returns The response object. - */ -async function checkSignature(body: string) { - const { CLIENT_EMAIL, PRIVATE_KEY, GSHEET_ID } = process.env; - - if (!CLIENT_EMAIL || !PRIVATE_KEY || !GSHEET_ID) { - return { - statusCode: 500, - headers, - body: JSON.stringify({ - message: 'Google IDs not set', - }), - }; - } - - const { signature, payload }: { signature: Hex; payload: Payload } = - JSON.parse(body); - - if (!signature || !payload) { - return { - statusCode: 400, - headers, - body: JSON.stringify({ - message: 'Signature or payload not provided', - }), - }; - } - - const message = JSON.stringify(payload); - const valid = await verifyMessage({ - address: payload.address, - message, - signature, - }); - - if (!valid) { - return { - statusCode: 400, - headers, - body: JSON.stringify({ - message: 'Invalid signature', - }), - }; - } - - try { - const SCOPES = ['https://www.googleapis.com/auth/spreadsheets']; - - const jwt = new JWT({ - email: CLIENT_EMAIL, - key: PRIVATE_KEY.replace(/\\n/gu, '\n'), - scopes: SCOPES, - }); - - const doc = new GoogleSpreadsheet(GSHEET_ID, jwt); - await doc.loadInfo(); - const sheet = doc.sheetsByIndex[0]; - - if (!sheet) { - return { - statusCode: 500, - headers, - body: JSON.stringify({ - message: 'Sheet not found', - }), - }; - } - - // Google Sheet Columns : timestamp, address, signedOn, subject, signature - await sheet.addRow([ - Date.now(), - payload.address as string, - payload.signedOn, - payload.subject, - signature, - ]); - - return { - statusCode: 201, - headers, - body: JSON.stringify({ message: 'Address successfully registered' }), - }; - } catch (error) { - return { - statusCode: 500, - headers, - body: JSON.stringify({ - message: `Something went wrong: ${JSON.stringify(error, null, 2)}`, - }), - }; - } -} diff --git a/packages/functions/package.json b/packages/functions/package.json deleted file mode 100644 index 5d9bfac..0000000 --- a/packages/functions/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "functions", - "version": "0.1.0", - "private": true, - "description": "", - "license": "(MIT-0 OR Apache-2.0)", - "author": "", - "scripts": { - "allow-scripts": "yarn workspace root allow-scripts" - }, - "dependencies": { - "google-auth-library": "^9.6.3", - "google-spreadsheet": "^4.1.1", - "viem": "^2.7.22" - } -} diff --git a/packages/site/.eslintrc.js b/packages/site/.eslintrc.js index da63584..a47fd0b 100644 --- a/packages/site/.eslintrc.js +++ b/packages/site/.eslintrc.js @@ -4,13 +4,4 @@ module.exports = { parserOptions: { tsconfigRootDir: __dirname, }, - - overrides: [ - { - files: ['*.ts', '*.tsx'], - extends: ['@metamask/eslint-config-browser'], - }, - ], - - ignorePatterns: ['.cache/', 'public/'], }; diff --git a/packages/site/package.json b/packages/site/package.json index 524c973..e67382c 100644 --- a/packages/site/package.json +++ b/packages/site/package.json @@ -5,68 +5,22 @@ "license": "(MIT-0 OR Apache-2.0)", "scripts": { "allow-scripts": "yarn workspace root allow-scripts", - "build": "GATSBY_TELEMETRY_DISABLED=1 gatsby build", - "clean": "rimraf public", - "lint": "yarn lint:eslint && yarn lint:misc --check", - "lint:eslint": "eslint . --cache --ext js,ts", - "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", - "lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path .gitignore", - "start": "GATSBY_TELEMETRY_DISABLED=1 gatsby develop" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "dependencies": { - "@metamask/providers": "^15.0.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-is": "^18.2.0", - "styled-components": "5.3.3" + "lint": "yarn lint:misc --check", + "lint:fix": "yarn lint:misc --write", + "lint:misc": "prettier '**/*.html' '**/*.json' '**/*.md'" }, "devDependencies": { "@metamask/eslint-config": "^12.2.0", "@metamask/eslint-config-browser": "^12.1.0", - "@metamask/eslint-config-jest": "^12.1.0", - "@metamask/eslint-config-nodejs": "^12.1.0", - "@metamask/eslint-config-typescript": "^12.1.0", - "@svgr/webpack": "^6.4.0", - "@testing-library/dom": "^8.17.1", - "@testing-library/jest-dom": "^5.16.4", - "@testing-library/react": "^13.3.0", - "@testing-library/user-event": "^13.5.0", - "@types/jest": "^27.5.2", - "@types/react": "^18.0.15", - "@types/react-dom": "^18.0.6", - "@types/styled-components": "^5.1.25", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "eslint": "^8.45.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "~2.26.0", - "eslint-plugin-jest": "^27.1.5", - "eslint-plugin-jsdoc": "^41.1.2", "eslint-plugin-n": "^15.7.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-promise": "^6.1.1", - "gatsby": "^5.13.3", - "gatsby-plugin-manifest": "^5.13.1", - "gatsby-plugin-styled-components": "^6.13.1", - "gatsby-plugin-svgr": "^3.0.0-beta.0", "prettier": "^2.7.1", - "prettier-plugin-packagejson": "^2.2.18", - "rimraf": "^3.0.2", - "typescript": "^4.7.4" - }, - "engines": { - "node": ">=18.6.0" + "prettier-plugin-packagejson": "^2.2.18" } } diff --git a/docs/demo.mp4 b/packages/site/src/demo.mp4 similarity index 100% rename from docs/demo.mp4 rename to packages/site/src/demo.mp4 diff --git a/docs/icon.png b/packages/site/src/icon.png similarity index 100% rename from docs/icon.png rename to packages/site/src/icon.png diff --git a/packages/site/src/index.html b/packages/site/src/index.html new file mode 100644 index 0000000..d776161 --- /dev/null +++ b/packages/site/src/index.html @@ -0,0 +1,343 @@ + + + + LXP Snap + + + + + + + + + + +
+
+ +
+

+ LXP Snap +

+

Follow your Linea Voyage

+

+ View your Linea XP balance, POH status, and current activations inside + of MetaMask! +

+

Loading...

+
+

+ After installing the Snap, open the Snaps menu in MetaMask and click on + LXP to view your Linea XP balance, Proof of Humanity status, and current + activations. +

+
+ + + + + diff --git a/docs/overlay.png b/packages/site/src/overlay.png similarity index 100% rename from docs/overlay.png rename to packages/site/src/overlay.png diff --git a/packages/site/tsconfig.json b/packages/site/tsconfig.json index a428470..596e2cf 100644 --- a/packages/site/tsconfig.json +++ b/packages/site/tsconfig.json @@ -1,9 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "baseUrl": "./", - "resolveJsonModule": true, - "jsx": "preserve" - }, - "include": ["src", "gatsby-browser.tsx", "gatsby-config.ts", "gatsby-ssr.tsx"] + "include": ["src"] } diff --git a/packages/snap/package.json b/packages/snap/package.json index 8c199b8..0e54dcb 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -1,6 +1,6 @@ { "name": "@consensys/lxp-snap", - "version": "0.3.0", + "version": "0.4.0", "description": "View your minted Linea XP balance, POH status, and current activations.", "repository": { "type": "git", diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 667c9eb..a9b03d9 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -1,5 +1,5 @@ { - "version": "0.3.0", + "version": "0.4.0", "description": "View your minted Linea XP balance, POH status, and current activations.", "proposedName": "LXP", "repository": { @@ -7,7 +7,7 @@ "url": "https://github.com/Consensys/lxp-snap" }, "source": { - "shasum": "JyPHZzSi3CcB///9M3ATXFjNmrCCfQbxyEgnKIH6UC0=", + "shasum": "nB3iq1i7Yb1W5MXJUZe+n4dYf1xkjUfybNlv4IdZvYk=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snap/src/api.ts b/packages/snap/src/api.ts index 4d974fe..6f16cfb 100644 --- a/packages/snap/src/api.ts +++ b/packages/snap/src/api.ts @@ -1,5 +1,3 @@ -import type { Payload } from './types'; - const getData = async (url: string) => { const response = await fetch(url, { method: 'GET', @@ -13,17 +11,6 @@ const getData = async (url: string) => { return response.json(); }; -const postData = async (url: string, data: unknown) => { - return await fetch(url, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(data), - mode: 'cors', - }); -}; - export const fetchBalanceFromLineascan = async (address: string) => { const res = await getData( `https://api.lineascan.build/api?module=account&action=tokenbalance&contractaddress=0xd83af4fbD77f3AB65C3B1Dc4B38D7e67AEcf599A&address=${address}&tag=latest`, @@ -42,25 +29,3 @@ export const fetchLxpActivations = async () => { ); return result.lxpActivations; }; - -export const postAddressRegistration = async ( - signature: string, - payload: Payload, -) => { - const response = await postData( - 'https://lxp-snap-api.netlify.app/.netlify/functions/api', - { - signature, - payload, - }, - ); - - if (response.status === 201) { - return { status: 'ok' }; - } - - const body = await response.json(); - const message = body.message ?? 'Unknown error'; - console.error(`Failed to register address: ${message as string}`); - return { status: 'error', message }; -}; diff --git a/packages/snap/src/index.ts b/packages/snap/src/index.ts index abff319..04f5f97 100644 --- a/packages/snap/src/index.ts +++ b/packages/snap/src/index.ts @@ -10,7 +10,6 @@ import { getCurrentActivations, getLxpBalanceForAddress, getPohStatus, - registerAddress, } from './service'; import { renderMainUi, @@ -83,11 +82,6 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => { return null; } - case 'personalSign': { - const { signature, payload } = params; - return registerAddress(signature, payload); - } - case 'watchLxpAddress': { await loadCaptions(); const lxpAddress = await snap.request({ diff --git a/packages/snap/src/service.ts b/packages/snap/src/service.ts index c4ec767..6c462d7 100644 --- a/packages/snap/src/service.ts +++ b/packages/snap/src/service.ts @@ -2,10 +2,8 @@ import { fetchBalanceFromLineascan, fetchLxpActivations, fetchPohStatus, - postAddressRegistration, } from './api'; -import type { Payload } from './types'; -import { convertBalanceToDisplay, getState } from './utils'; +import { convertBalanceToDisplay } from './utils'; /** * Get the LXP balance for an address from Lineascan. @@ -91,19 +89,3 @@ export async function getCurrentActivations() { return []; } } - -/** - * Registers the address as using the snap. - * @param signature - The signature to check before registering the address. - * @param payload - The content of the message that was signed. - * @returns The status of the registration. - */ -export async function registerAddress(signature: string, payload: Payload) { - const { lxpAddress } = await getState(); - - if (!lxpAddress) { - throw new Error('No LXP address found.'); - } - - return await postAddressRegistration(signature, payload); -} diff --git a/yarn.lock b/yarn.lock index 521d5d9..645189e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,13 +12,6 @@ __metadata: languageName: node linkType: hard -"@adraffy/ens-normalize@npm:1.10.0": - version: 1.10.0 - resolution: "@adraffy/ens-normalize@npm:1.10.0" - checksum: af0540f963a2632da2bbc37e36ea6593dcfc607b937857133791781e246d47f870d5e3d21fa70d5cfe94e772c284588c81ea3f5b7f4ea8fbb824369444e4dbcb - languageName: node - linkType: hard - "@ampproject/remapping@npm:^2.2.0": version: 2.2.1 resolution: "@ampproject/remapping@npm:2.2.1" @@ -3358,15 +3351,6 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.2.0, @noble/curves@npm:~1.2.0": - version: 1.2.0 - resolution: "@noble/curves@npm:1.2.0" - dependencies: - "@noble/hashes": 1.3.2 - checksum: bb798d7a66d8e43789e93bc3c2ddff91a1e19fdb79a99b86cd98f1e5eff0ee2024a2672902c2576ef3577b6f282f3b5c778bebd55761ddbb30e36bf275e83dd0 - languageName: node - linkType: hard - "@noble/curves@npm:^1.2.0": version: 1.3.0 resolution: "@noble/curves@npm:1.3.0" @@ -3390,13 +3374,6 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.2": - version: 1.3.2 - resolution: "@noble/hashes@npm:1.3.2" - checksum: fe23536b436539d13f90e4b9be843cc63b1b17666a07634a2b1259dded6f490be3d050249e6af98076ea8f2ea0d56f578773c2197f2aa0eeaa5fba5bc18ba474 - languageName: node - linkType: hard - "@noble/hashes@npm:1.3.3, @noble/hashes@npm:^1.0.0, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.3.2, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1, @noble/hashes@npm:~1.3.2": version: 1.3.3 resolution: "@noble/hashes@npm:1.3.3" @@ -4131,13 +4108,6 @@ __metadata: languageName: node linkType: hard -"@scure/base@npm:~1.1.2": - version: 1.1.5 - resolution: "@scure/base@npm:1.1.5" - checksum: 9e9ee6088cb3aa0fb91f5a48497d26682c7829df3019b1251d088d166d7a8c0f941c68aaa8e7b96bbad20c71eb210397cb1099062cde3e29d4bad6b975c18519 - languageName: node - linkType: hard - "@scure/bip32@npm:1.3.1": version: 1.3.1 resolution: "@scure/bip32@npm:1.3.1" @@ -4149,17 +4119,6 @@ __metadata: languageName: node linkType: hard -"@scure/bip32@npm:1.3.2": - version: 1.3.2 - resolution: "@scure/bip32@npm:1.3.2" - dependencies: - "@noble/curves": ~1.2.0 - "@noble/hashes": ~1.3.2 - "@scure/base": ~1.1.2 - checksum: c5ae84fae43490853693b481531132b89e056d45c945fc8b92b9d032577f753dfd79c5a7bbcbf0a7f035951006ff0311b6cf7a389e26c9ec6335e42b20c53157 - languageName: node - linkType: hard - "@scure/bip39@npm:1.2.1": version: 1.2.1 resolution: "@scure/bip39@npm:1.2.1" @@ -5528,21 +5487,6 @@ __metadata: languageName: node linkType: hard -"abitype@npm:1.0.0": - version: 1.0.0 - resolution: "abitype@npm:1.0.0" - peerDependencies: - typescript: ">=5.0.4" - zod: ^3 >=3.22.0 - peerDependenciesMeta: - typescript: - optional: true - zod: - optional: true - checksum: ea2c0548c3ba58c37a6de7483d63389074da498e63d803b742bbe94eb4eaa1f51a35d000c424058b2583aef56698cf07c696eb3bc4dd0303bc20c6f0826a241a - languageName: node - linkType: hard - "abort-controller@npm:^3.0.0": version: 3.0.0 resolution: "abort-controller@npm:3.0.0" @@ -5664,15 +5608,6 @@ __metadata: languageName: node linkType: hard -"agent-base@npm:^7.0.2": - version: 7.1.0 - resolution: "agent-base@npm:7.1.0" - dependencies: - debug: ^4.3.4 - checksum: f7828f991470a0cc22cb579c86a18cbae83d8a3cbed39992ab34fc7217c4d126017f1c74d0ab66be87f71455318a8ea3e757d6a37881b8d0f2a2c6aa55e5418f - languageName: node - linkType: hard - "agentkeepalive@npm:^4.2.1": version: 4.2.1 resolution: "agentkeepalive@npm:4.2.1" @@ -6161,17 +6096,6 @@ __metadata: languageName: node linkType: hard -"axios@npm:^1.4.0": - version: 1.6.7 - resolution: "axios@npm:1.6.7" - dependencies: - follow-redirects: ^1.15.4 - form-data: ^4.0.0 - proxy-from-env: ^1.1.0 - checksum: 87d4d429927d09942771f3b3a6c13580c183e31d7be0ee12f09be6d5655304996bb033d85e54be81606f4e89684df43be7bf52d14becb73a12727bf33298a082 - languageName: node - linkType: hard - "axobject-query@npm:^3.2.1": version: 3.2.1 resolution: "axobject-query@npm:3.2.1" @@ -6522,7 +6446,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.0.2, base64-js@npm:^1.3.0, base64-js@npm:^1.3.1": +"base64-js@npm:^1.0.2, base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 @@ -6552,13 +6476,6 @@ __metadata: languageName: node linkType: hard -"bignumber.js@npm:^9.0.0": - version: 9.1.2 - resolution: "bignumber.js@npm:9.1.2" - checksum: 582c03af77ec9cb0ebd682a373ee6c66475db94a4325f92299621d544aa4bd45cb45fd60001610e94aef8ae98a0905fa538241d9638d4422d57abbeeac6fadaf - languageName: node - linkType: hard - "bin-links@npm:4.0.1": version: 4.0.1 resolution: "bin-links@npm:4.0.1" @@ -6903,13 +6820,6 @@ __metadata: languageName: node linkType: hard -"buffer-equal-constant-time@npm:1.0.1": - version: 1.0.1 - resolution: "buffer-equal-constant-time@npm:1.0.1" - checksum: 80bb945f5d782a56f374b292770901065bad21420e34936ecbe949e57724b4a13874f735850dd1cc61f078773c4fb5493a41391e7bda40d1fa388d6bd80daaab - languageName: node - linkType: hard - "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -8506,6 +8416,50 @@ __metadata: languageName: node linkType: hard +"dev-site@workspace:packages/dev-site": + version: 0.0.0-use.local + resolution: "dev-site@workspace:packages/dev-site" + dependencies: + "@metamask/eslint-config": ^12.2.0 + "@metamask/eslint-config-browser": ^12.1.0 + "@metamask/eslint-config-jest": ^12.1.0 + "@metamask/eslint-config-nodejs": ^12.1.0 + "@metamask/eslint-config-typescript": ^12.1.0 + "@metamask/providers": ^15.0.0 + "@svgr/webpack": ^6.4.0 + "@testing-library/dom": ^8.17.1 + "@testing-library/jest-dom": ^5.16.4 + "@testing-library/react": ^13.3.0 + "@testing-library/user-event": ^13.5.0 + "@types/jest": ^27.5.2 + "@types/react": ^18.0.15 + "@types/react-dom": ^18.0.6 + "@types/styled-components": ^5.1.25 + "@typescript-eslint/eslint-plugin": ^5.42.1 + "@typescript-eslint/parser": ^5.42.1 + eslint: ^8.45.0 + eslint-config-prettier: ^8.5.0 + eslint-plugin-import: ~2.26.0 + eslint-plugin-jest: ^27.1.5 + eslint-plugin-jsdoc: ^41.1.2 + eslint-plugin-n: ^15.7.0 + eslint-plugin-prettier: ^4.2.1 + eslint-plugin-promise: ^6.1.1 + gatsby: ^5.13.3 + gatsby-plugin-manifest: ^5.13.1 + gatsby-plugin-styled-components: ^6.13.1 + gatsby-plugin-svgr: ^3.0.0-beta.0 + prettier: ^2.7.1 + prettier-plugin-packagejson: ^2.2.18 + react: ^18.2.0 + react-dom: ^18.2.0 + react-is: ^18.2.0 + rimraf: ^3.0.2 + styled-components: 5.3.3 + typescript: ^4.7.4 + languageName: unknown + linkType: soft + "devcert@npm:^1.2.2": version: 1.2.2 resolution: "devcert@npm:1.2.2" @@ -8727,15 +8681,6 @@ __metadata: languageName: node linkType: hard -"ecdsa-sig-formatter@npm:1.0.11, ecdsa-sig-formatter@npm:^1.0.11": - version: 1.0.11 - resolution: "ecdsa-sig-formatter@npm:1.0.11" - dependencies: - safe-buffer: ^5.0.1 - checksum: 207f9ab1c2669b8e65540bce29506134613dd5f122cccf1e6a560f4d63f2732d427d938f8481df175505aad94583bcb32c688737bb39a6df0625f903d6d93c03 - languageName: node - linkType: hard - "ee-first@npm:1.1.1": version: 1.1.1 resolution: "ee-first@npm:1.1.1" @@ -9939,13 +9884,6 @@ __metadata: languageName: node linkType: hard -"extend@npm:^3.0.2": - version: 3.0.2 - resolution: "extend@npm:3.0.2" - checksum: a50a8309ca65ea5d426382ff09f33586527882cf532931cb08ca786ea3146c0553310bda688710ff61d7668eba9f96b923fe1420cdf56a2c3eaf30fcab87b515 - languageName: node - linkType: hard - "extension-port-stream@npm:^3.0.0": version: 3.0.0 resolution: "extension-port-stream@npm:3.0.0" @@ -10235,16 +10173,6 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.15.4": - version: 1.15.5 - resolution: "follow-redirects@npm:1.15.5" - peerDependenciesMeta: - debug: - optional: true - checksum: 5ca49b5ce6f44338cbfc3546823357e7a70813cecc9b7b768158a1d32c1e62e7407c944402a918ea8c38ae2e78266312d617dc68783fac502cbb55e1047b34ec - languageName: node - linkType: hard - "for-each@npm:^0.3.3": version: 0.3.3 resolution: "for-each@npm:0.3.3" @@ -10303,17 +10231,6 @@ __metadata: languageName: node linkType: hard -"form-data@npm:^4.0.0": - version: 4.0.0 - resolution: "form-data@npm:4.0.0" - dependencies: - asynckit: ^0.4.0 - combined-stream: ^1.0.8 - mime-types: ^2.1.12 - checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c - languageName: node - linkType: hard - "forwarded@npm:0.2.0": version: 0.2.0 resolution: "forwarded@npm:0.2.0" @@ -10447,16 +10364,6 @@ __metadata: languageName: node linkType: hard -"functions@workspace:packages/functions": - version: 0.0.0-use.local - resolution: "functions@workspace:packages/functions" - dependencies: - google-auth-library: ^9.6.3 - google-spreadsheet: ^4.1.1 - viem: ^2.7.22 - languageName: unknown - linkType: soft - "gatsby-cli@npm:^5.13.2": version: 5.13.2 resolution: "gatsby-cli@npm:5.13.2" @@ -10967,28 +10874,6 @@ __metadata: languageName: node linkType: hard -"gaxios@npm:^6.0.0, gaxios@npm:^6.1.1": - version: 6.3.0 - resolution: "gaxios@npm:6.3.0" - dependencies: - extend: ^3.0.2 - https-proxy-agent: ^7.0.1 - is-stream: ^2.0.0 - node-fetch: ^2.6.9 - checksum: 4d4a8db32d833f8012435e2016cb0c919cac288e821bf81f877504e4284ef12b444cd903448e738c4031cd5219adf1e8d68e7df2b3dba774db9fde27f71109d4 - languageName: node - linkType: hard - -"gcp-metadata@npm:^6.1.0": - version: 6.1.0 - resolution: "gcp-metadata@npm:6.1.0" - dependencies: - gaxios: ^6.0.0 - json-bigint: ^1.0.0 - checksum: 55de8ae4a6b7664379a093abf7e758ae06e82f244d41bd58d881a470bf34db94c4067ce9e1b425d9455b7705636d5f8baad844e49bb73879c338753ba7785b2b - languageName: node - linkType: hard - "gensync@npm:^1.0.0-beta.2": version: 1.0.0-beta.2 resolution: "gensync@npm:1.0.0-beta.2" @@ -11229,35 +11114,6 @@ __metadata: languageName: node linkType: hard -"google-auth-library@npm:^9.6.3": - version: 9.6.3 - resolution: "google-auth-library@npm:9.6.3" - dependencies: - base64-js: ^1.3.0 - ecdsa-sig-formatter: ^1.0.11 - gaxios: ^6.1.1 - gcp-metadata: ^6.1.0 - gtoken: ^7.0.0 - jws: ^4.0.0 - checksum: 46174191de15ec56110ac0394ae9d1c56fb6aa293809d45170b2ff570130d7e3f3e82fa78d413908862a2d0da3fa946b72f1074000f4d52579eb17367e49e44d - languageName: node - linkType: hard - -"google-spreadsheet@npm:^4.1.1": - version: 4.1.1 - resolution: "google-spreadsheet@npm:4.1.1" - dependencies: - axios: ^1.4.0 - lodash: ^4.17.21 - peerDependencies: - google-auth-library: ^8.8.0 || ^9.0.0 - peerDependenciesMeta: - google-auth-library: - optional: true - checksum: 273ed0c150f69e8a11a1ea4bf621c8c608debbbd9b470e55f270adb241e1a29ead5aff258bea9d7c70081b76d64c851b48726dfaf7c08d22789b4af8722fc571 - languageName: node - linkType: hard - "gopd@npm:^1.0.1": version: 1.0.1 resolution: "gopd@npm:1.0.1" @@ -11371,16 +11227,6 @@ __metadata: languageName: node linkType: hard -"gtoken@npm:^7.0.0": - version: 7.1.0 - resolution: "gtoken@npm:7.1.0" - dependencies: - gaxios: ^6.0.0 - jws: ^4.0.0 - checksum: 1f338dced78f9d895ea03cd507454eb5a7b77e841ecd1d45e44483b08c1e64d16a9b0342358d37586d87462ffc2d5f5bff5dfe77ed8d4f0aafc3b5b0347d5d16 - languageName: node - linkType: hard - "gzip-size@npm:^6.0.0": version: 6.0.0 resolution: "gzip-size@npm:6.0.0" @@ -11655,16 +11501,6 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:^7.0.1": - version: 7.0.4 - resolution: "https-proxy-agent@npm:7.0.4" - dependencies: - agent-base: ^7.0.2 - debug: 4 - checksum: daaab857a967a2519ddc724f91edbbd388d766ff141b9025b629f92b9408fc83cee8a27e11a907aede392938e9c398e240d643e178408a59e4073539cde8cfe9 - languageName: node - linkType: hard - "human-signals@npm:^2.1.0": version: 2.1.0 resolution: "human-signals@npm:2.1.0" @@ -12510,15 +12346,6 @@ __metadata: languageName: node linkType: hard -"isows@npm:1.0.3": - version: 1.0.3 - resolution: "isows@npm:1.0.3" - peerDependencies: - ws: "*" - checksum: 9cacd5cf59f67deb51e825580cd445ab1725ecb05a67c704050383fb772856f3cd5e7da8ad08f5a3bd2823680d77d099459d0c6a7037972a74d6429af61af440 - languageName: node - linkType: hard - "istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": version: 3.2.0 resolution: "istanbul-lib-coverage@npm:3.2.0" @@ -13192,15 +13019,6 @@ __metadata: languageName: node linkType: hard -"json-bigint@npm:^1.0.0": - version: 1.0.0 - resolution: "json-bigint@npm:1.0.0" - dependencies: - bignumber.js: ^9.0.0 - checksum: c67bb93ccb3c291e60eb4b62931403e378906aab113ec1c2a8dd0f9a7f065ad6fd9713d627b732abefae2e244ac9ce1721c7a3142b2979532f12b258634ce6f6 - languageName: node - linkType: hard - "json-buffer@npm:3.0.1": version: 3.0.1 resolution: "json-buffer@npm:3.0.1" @@ -13321,27 +13139,6 @@ __metadata: languageName: node linkType: hard -"jwa@npm:^2.0.0": - version: 2.0.0 - resolution: "jwa@npm:2.0.0" - dependencies: - buffer-equal-constant-time: 1.0.1 - ecdsa-sig-formatter: 1.0.11 - safe-buffer: ^5.0.1 - checksum: 8f00b71ad5fe94cb55006d0d19202f8f56889109caada2f7eeb63ca81755769ce87f4f48101967f398462e3b8ae4faebfbd5a0269cb755dead5d63c77ba4d2f1 - languageName: node - linkType: hard - -"jws@npm:^4.0.0": - version: 4.0.0 - resolution: "jws@npm:4.0.0" - dependencies: - jwa: ^2.0.0 - safe-buffer: ^5.0.1 - checksum: d68d07aa6d1b8cb35c363a9bd2b48f15064d342a5d9dc18a250dbbce8dc06bd7e4792516c50baa16b8d14f61167c19e851fd7f66b59ecc68b7f6a013759765f7 - languageName: node - linkType: hard - "keccak@npm:^3.0.0": version: 3.0.3 resolution: "keccak@npm:3.0.3" @@ -14471,7 +14268,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.6.11, node-fetch@npm:^2.6.9": +"node-fetch@npm:^2.6.11": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" dependencies: @@ -15962,13 +15759,6 @@ __metadata: languageName: node linkType: hard -"proxy-from-env@npm:^1.1.0": - version: 1.1.0 - resolution: "proxy-from-env@npm:1.1.0" - checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4 - languageName: node - linkType: hard - "pseudomap@npm:^1.0.1": version: 1.0.2 resolution: "pseudomap@npm:1.0.2" @@ -17243,41 +17033,16 @@ __metadata: dependencies: "@metamask/eslint-config": ^12.2.0 "@metamask/eslint-config-browser": ^12.1.0 - "@metamask/eslint-config-jest": ^12.1.0 - "@metamask/eslint-config-nodejs": ^12.1.0 - "@metamask/eslint-config-typescript": ^12.1.0 - "@metamask/providers": ^15.0.0 - "@svgr/webpack": ^6.4.0 - "@testing-library/dom": ^8.17.1 - "@testing-library/jest-dom": ^5.16.4 - "@testing-library/react": ^13.3.0 - "@testing-library/user-event": ^13.5.0 - "@types/jest": ^27.5.2 - "@types/react": ^18.0.15 - "@types/react-dom": ^18.0.6 - "@types/styled-components": ^5.1.25 "@typescript-eslint/eslint-plugin": ^5.42.1 "@typescript-eslint/parser": ^5.42.1 eslint: ^8.45.0 eslint-config-prettier: ^8.5.0 eslint-plugin-import: ~2.26.0 - eslint-plugin-jest: ^27.1.5 - eslint-plugin-jsdoc: ^41.1.2 eslint-plugin-n: ^15.7.0 eslint-plugin-prettier: ^4.2.1 eslint-plugin-promise: ^6.1.1 - gatsby: ^5.13.3 - gatsby-plugin-manifest: ^5.13.1 - gatsby-plugin-styled-components: ^6.13.1 - gatsby-plugin-svgr: ^3.0.0-beta.0 prettier: ^2.7.1 prettier-plugin-packagejson: ^2.2.18 - react: ^18.2.0 - react-dom: ^18.2.0 - react-is: ^18.2.0 - rimraf: ^3.0.2 - styled-components: 5.3.3 - typescript: ^4.7.4 languageName: unknown linkType: soft @@ -18896,27 +18661,6 @@ __metadata: languageName: node linkType: hard -"viem@npm:^2.7.22": - version: 2.7.22 - resolution: "viem@npm:2.7.22" - dependencies: - "@adraffy/ens-normalize": 1.10.0 - "@noble/curves": 1.2.0 - "@noble/hashes": 1.3.2 - "@scure/bip32": 1.3.2 - "@scure/bip39": 1.2.1 - abitype: 1.0.0 - isows: 1.0.3 - ws: 8.13.0 - peerDependencies: - typescript: ">=5.0.4" - peerDependenciesMeta: - typescript: - optional: true - checksum: 1c06e0fd3fe4878f8049b7a32f3d30671a542500ac4e28cd0cf46ead67f86ee9cc474d455b90f7ee9e0e5611a99552fbf7f7a8a8ead88303993ddbea113c98aa - languageName: node - linkType: hard - "vm-browserify@npm:^1.0.0, vm-browserify@npm:^1.1.2": version: 1.1.2 resolution: "vm-browserify@npm:1.1.2" @@ -19261,21 +19005,6 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.13.0": - version: 8.13.0 - resolution: "ws@npm:8.13.0" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 53e991bbf928faf5dc6efac9b8eb9ab6497c69feeb94f963d648b7a3530a720b19ec2e0ec037344257e05a4f35bd9ad04d9de6f289615ffb133282031b18c61c - languageName: node - linkType: hard - "ws@npm:~8.11.0": version: 8.11.0 resolution: "ws@npm:8.11.0"