Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Contributor Proposal] [Do not merge] Account Abstraction - (Nextjs, WebAuthn, Safe) #223

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
"useGitignore": true,
"language": "en",
"words": [
"webauthn",
"Creds",
"loginform",
"ount",
"ress",
"ubqfi",
"TLDR",
"wordlists",
"hdnode",
"generichash",
"binkey",
"binsec",
"chainlist",
Expand Down
134 changes: 98 additions & 36 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,47 @@
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"],
"project": [
"./tsconfig.json"
]
},
"plugins": ["@typescript-eslint", "sonarjs"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:sonarjs/recommended"],
"ignorePatterns": ["**/*.js"],
"plugins": [
"@typescript-eslint",
"sonarjs"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended"
],
"ignorePatterns": [
"**/*.js"
],
"rules": {
"prefer-arrow-callback": [
"warn",
{
"allowNamedFunctions": true,
},
"allowNamedFunctions": true
}
],
"func-style": [
"warn",
"declaration",
{
"allowArrowFunctions": false,
},
"allowArrowFunctions": false
}
],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"constructor-super": "error",
"no-invalid-this": "off",
"@typescript-eslint/no-invalid-this": ["error"],
"no-restricted-syntax": ["error", "ForInStatement"],
"@typescript-eslint/no-invalid-this": [
"error"
],
"no-restricted-syntax": [
"error",
"ForInStatement"
],
"use-isnan": "error",
"@typescript-eslint/no-unused-vars": [
"error",
Expand All @@ -35,8 +51,8 @@
"ignoreRestSiblings": true,
"vars": "all",
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_",
},
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-misused-new": "error",
Expand All @@ -51,58 +67,104 @@
"error",
{
"selector": "interface",
"format": ["PascalCase"],
"format": [
"PascalCase"
],
"custom": {
"regex": "^I[A-Z]",
"match": false,
},
"match": false
}
},
{
"selector": "memberLike",
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require",
"modifiers": [
"private"
],
"format": [
"camelCase"
],
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": ["PascalCase"],
"format": [
"PascalCase"
]
},
{
"selector": "typeParameter",
"format": ["PascalCase"],
"prefix": ["T"],
"format": [
"PascalCase"
],
"prefix": [
"T"
]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"],
"format": [
"camelCase",
"UPPER_CASE"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "variable",
"format": ["camelCase"],
"format": [
"camelCase"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "variable",
"modifiers": ["destructured"],
"format": null,
"modifiers": [
"destructured"
],
"format": null
},
{
"selector": "variable",
"types": ["boolean"],
"format": ["PascalCase"],
"prefix": ["is", "should", "has", "can", "did", "will", "does"],
"types": [
"boolean"
],
"format": [
"PascalCase"
],
"prefix": [
"is",
"should",
"has",
"can",
"did",
"will",
"does"
]
},
{
"selector": "variableLike",
"format": ["camelCase"],
"format": [
"camelCase"
]
},
{
"selector": ["function", "variable"],
"format": ["camelCase"],
"selector": [
"variable"
],
"format": [
"camelCase"
]
},
],
},
}
{
"selector": [
"function"
],
"format": [
"camelCase",
"PascalCase"
]
}
]
}
}
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
script: |
const { owner, repo } = context.repo;
const sha = "${{ github.event.workflow_run.head_sha }}";

const response = await github.rest.search.issuesAndPullRequests({
q: `repo:${owner}/${repo} is:pr sha:${sha}`,
per_page: 1,
Expand All @@ -82,11 +82,11 @@ jobs:
repo,
issue_number,
});

// Find the comment to update or create a new one if not found
let existingComment = comments.data.find(comment => comment.user.login === 'github-actions[bot]');
let body = '| Preview Deployment |\n| ------------------ |\n';

// If the comment exists, update its body
if (existingComment) {
// Check if the SHA already exists in the comment body to avoid duplicates
Expand Down
39 changes: 38 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,41 @@ commit.txt
# yarn2
.pnp.cjs
.pnp.loader.mjs
static/dist
static/dist

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
2 changes: 1 addition & 1 deletion .knip.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["static/scripts/rewards/init.ts"],
"ignore": ["lib/**"]
"ignore": ["lib/**"],
}
14 changes: 14 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { execSync } from "child_process";
const commitHash = execSync("git rev-parse --short HEAD").toString().trim();

/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
SUPABASE_URL: process.env.SUPABASE_URL,
SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY,
COMMIT_HASH: commitHash,
SALT: process.env.SALT,
},
};

export default nextConfig;
30 changes: 25 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"node": ">=20.10.0"
},
"scripts": {
"start": "run-s start:sign start:ui",
"esbuild:start": "run-s start:sign start:ui",
"watch": "nodemon -e ts,tsx --exec yarn start",
"watch:ui": "nodemon -e ts,tsx --exec yarn start:ui",
"format": "run-s format:lint format:prettier format:cspell",
"build": "run-s utils:build",
"esbuild:build": "run-s utils:build",
"start:ui": "tsx build/esbuild-server.ts",
"start:sign": "tsx scripts/typescript/generate-permit2-url.ts",
"utils:build": "tsx build/esbuild-build.ts",
Expand All @@ -22,7 +22,11 @@
"format:prettier": "prettier --write .",
"format:cspell": "cspell **/*",
"prepare": "husky install",
"postinstall": "git submodule update --init --recursive"
"postinstall": "git submodule update --init --recursive",
"build": "next build",
"start": "next start",
"lint": "next lint",
"dev": "yarn start:sign && next dev -p 8080"
},
"keywords": [
"typescript",
Expand All @@ -33,14 +37,22 @@
],
"dependencies": {
"@ethersproject/providers": "^5.7.2",
"@safe-global/auth-kit": "^2.0.4",
"@safe-global/protocol-kit": "^3.1.0",
"@sinclair/typebox": "^0.32.15",
"@supabase/supabase-js": "^2.39.8",
"@tanstack/react-query": "^5.29.2",
"@ubiquibot/permit-generation": "1.2.2",
"@uniswap/permit2-sdk": "^1.2.0",
"@web3auth/safeauth-embed": "^0.0.0",
"axios": "^1.6.7",
"dotenv": "^16.4.4",
"ethers": "^5.7.2",
"npm-run-all": "^4.1.5"
"ethers": "^6.7.1",
"libsodium-wrappers": "^0.7.13",
"npm-run-all": "^4.1.5",
"next": "14.1.4",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@commitlint/cli": "^18.6.1",
Expand All @@ -49,19 +61,27 @@
"@cspell/dict-software-terms": "^3.3.18",
"@cspell/dict-typescript": "^3.1.2",
"@types/ethereum-protocol": "^1.0.5",
"@types/libsodium-wrappers": "^0.7.14",
"@types/node": "^20.11.19",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"autoprefixer": "^10.4.19",
"buffer": "^6.0.3",
"cspell": "^8.3.2",
"esbuild": "^0.20.0",
"eslint": "^8.56.0",
"eslint-config-next": "14.1.4",
"eslint-plugin-sonarjs": "^0.24.0",
"husky": "^9.0.11",
"knip": "^5.0.1",
"lint-staged": "^15.2.2",
"nodemon": "^3.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"tsx": "^4.7.1",
"typescript": "^5.3.3"
},
Expand Down
Loading
Loading