Skip to content

Commit

Permalink
Revert "Sync ERC permits"
Browse files Browse the repository at this point in the history
  • Loading branch information
molecula451 authored Mar 3, 2024
1 parent e96d10c commit 6a6f90a
Show file tree
Hide file tree
Showing 49 changed files with 669 additions and 1,314 deletions.
2 changes: 0 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"binsec",
"chainlist",
"cirip",
"Claimability",
"dataurl",
"devpool",
"ethersproject",
Expand All @@ -28,7 +27,6 @@
"servedir",
"solmate",
"sonarjs",
"SUPABASE",
"typebox",
"TYPEHASH",
"ubiquibot",
Expand Down
42 changes: 21 additions & 21 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"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"],
Expand All @@ -11,15 +11,15 @@
"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",
Expand All @@ -35,8 +35,8 @@
"ignoreRestSiblings": true,
"vars": "all",
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_",
},
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-misused-new": "error",
Expand All @@ -54,55 +54,55 @@
"format": ["PascalCase"],
"custom": {
"regex": "^I[A-Z]",
"match": false,
},
"match": false
}
},
{
"selector": "memberLike",
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require",
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": ["PascalCase"],
"format": ["PascalCase"]
},
{
"selector": "typeParameter",
"format": ["PascalCase"],
"prefix": ["T"],
"prefix": ["T"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "variable",
"format": ["camelCase"],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "variable",
"modifiers": ["destructured"],
"format": null,
"format": null
},
{
"selector": "variable",
"types": ["boolean"],
"format": ["PascalCase"],
"prefix": ["is", "should", "has", "can", "did", "will", "does"],
"prefix": ["is", "should", "has", "can", "did", "will", "does"]
},
{
"selector": "variableLike",
"format": ["camelCase"],
"format": ["camelCase"]
},
{
"selector": ["function", "variable"],
"format": ["camelCase"],
},
],
},
"format": ["camelCase"]
}
]
}
}
1 change: 0 additions & 1 deletion .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Conventional Commits

on:
push:
pull_request:

jobs:
conventional-commits:
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/kebab-case.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/scripts/kebab-case.sh

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/scripts/kebabalize.sh

This file was deleted.

23 changes: 9 additions & 14 deletions build/esbuild-build.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { execSync } from "child_process";
import * as dotenv from "dotenv";
import esbuild from "esbuild";
import extraRpcs from "../lib/chainlist/constants/extraRpcs";

import esbuild from "esbuild";
import * as dotenv from "dotenv";
const typescriptEntries = [
"static/scripts/rewards/init.ts",
"static/scripts/rewards/index.ts",
"static/scripts/audit-report/audit.ts",
"static/scripts/onboarding/onboarding.ts",
"static/scripts/key-generator/keygen.ts",
Expand Down Expand Up @@ -35,10 +33,7 @@ export const esBuildContext: esbuild.BuildOptions = {
".svg": "dataurl",
},
outdir: "static/out",
define: createEnvDefines(["SUPABASE_URL", "SUPABASE_ANON_KEY"], {
extraRpcs: allNetworkUrls,
commitHash: execSync(`git rev-parse --short HEAD`).toString().trim(),
}),
define: createEnvDefines(["SUPABASE_URL", "SUPABASE_ANON_KEY"], { extraRpcs: allNetworkUrls }),
};

esbuild
Expand All @@ -51,20 +46,20 @@ esbuild
process.exit(1);
});

function createEnvDefines(environmentVariables: string[], generatedAtBuild: Record<string, unknown>): Record<string, string> {
function createEnvDefines(envVarNames: string[], extras: Record<string, unknown>): Record<string, string> {
const defines: Record<string, string> = {};
dotenv.config();
for (const name of environmentVariables) {
for (const name of envVarNames) {
const envVar = process.env[name];
if (envVar !== undefined) {
defines[name] = JSON.stringify(envVar);
} else {
throw new Error(`Missing environment variable: ${name}`);
}
}
for (const key in generatedAtBuild) {
if (Object.prototype.hasOwnProperty.call(generatedAtBuild, key)) {
defines[key] = JSON.stringify(generatedAtBuild[key]);
for (const key in extras) {
if (Object.prototype.hasOwnProperty.call(extras, key)) {
defines[key] = JSON.stringify(extras[key]);
}
}
return defines;
Expand Down
14 changes: 12 additions & 2 deletions globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import { Ethereum } from "ethereum-protocol";
export interface EthereumIsh {
autoRefreshOnNetworkChange: boolean;
chainId: string;
isMetaMask?: boolean;
isStatus?: boolean;
networkVersion: string;
selectedAddress: string;

on(event: "close" | "accountsChanged" | "chainChanged" | "networkChanged", callback: (payload: unknown) => void): void;
once(event: "close" | "accountsChanged" | "chainChanged" | "networkChanged", callback: (payload: unknown) => void): void;
}

declare global {
interface Window {
ethereum: Ethereum;
ethereum: EthereumIsh;
}
}
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
"node": ">=20.10.0"
},
"scripts": {
"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",
"start": "run-s utils:hash start:sign start:ui",
"format": "run-s format:lint format:prettier format:cspell",
"build": "run-s utils:build",
"build": "run-s utils:hash 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",
"utils:hash": "git rev-parse --short HEAD > static/commit.txt",
"utils:get-invalidate-params": "forge script --via-ir scripts/solidity/GetInvalidateNonceParams.s.sol",
"format:lint": "eslint --fix .",
"format:prettier": "prettier --write .",
Expand Down Expand Up @@ -56,7 +55,6 @@
"@cspell/dict-node": "^4.0.3",
"@cspell/dict-software-terms": "^3.3.18",
"@cspell/dict-typescript": "^3.1.2",
"@types/ethereum-protocol": "^1.0.5",
"@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
Expand All @@ -70,7 +68,6 @@
"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",
"tsx": "^4.7.1",
Expand All @@ -80,8 +77,7 @@
"lint-staged": {
"*.ts": [
"yarn prettier --write",
"eslint --fix",
"bash .github/workflows/scripts/kebab-case.sh"
"eslint --fix"
],
"src/**.{ts,json}": [
"cspell"
Expand Down
Loading

0 comments on commit 6a6f90a

Please sign in to comment.