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.
+