Skip to content

Commit 6cf69fc

Browse files
authoredJul 23, 2024··
chore: distributed session keys (#41)
* chore: distributed session keys
1 parent 5bcd41c commit 6cf69fc

38 files changed

+1165
-13975
lines changed
 

‎.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VITE_PAYMASTER_KEY=
2+
VITE_BUNDLER_URL=https://bundler.biconomy.io/api/v2/80002/cJPK7B3ru.dd7f7861-190d-45ic-af80-6877f74b8f44
3+
VITE_SILENCE_LABS_NPM_TOKEN=npm_XXX

‎.eslintrc.cjs

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ module.exports = {
22
root: true,
33
env: { browser: true, es2020: true },
44
extends: [
5-
'eslint:recommended',
6-
'plugin:@typescript-eslint/recommended',
7-
'plugin:react-hooks/recommended',
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:react-hooks/recommended"
88
],
9-
ignorePatterns: ['dist', '.eslintrc.cjs'],
10-
parser: '@typescript-eslint/parser',
11-
plugins: ['react-refresh'],
9+
ignorePatterns: ["dist", ".eslintrc.cjs"],
10+
parser: "@typescript-eslint/parser",
11+
plugins: ["react-refresh"],
1212
rules: {
13-
'react-refresh/only-export-components': [
14-
'warn',
15-
{ allowConstantExport: true },
16-
],
17-
},
13+
"react-refresh/only-export-components": [
14+
"warn",
15+
{ allowConstantExport: true }
16+
]
17+
}
1818
}

‎.github/workflows/dev.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
CI: false
3232
NODE_OPTIONS: --max_old_space_size=4096
3333
REACT_APP_PKEY: ${{ secrets.REACT_APP_PKEY }}
34+
SILENCE_LABS_NPM_TOKEN: ${{ secrets.SILENCE_LABS_NPM_TOKEN }}
3435

3536
- name: Configure AWS credentials
3637
uses: aws-actions/configure-aws-credentials@v1

‎.github/workflows/staging.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
CI: false
3232
NODE_OPTIONS: --max_old_space_size=4096
3333
REACT_APP_PKEY: ${{ secrets.REACT_APP_PKEY }}
34+
SILENCE_LABS_NPM_TOKEN: ${{ secrets.SILENCE_LABS_NPM_TOKEN }}
3435

3536
- name: Configure AWS credentials
3637
uses: aws-actions/configure-aws-credentials@v1

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ dist-ssr
2323
*.njsproj
2424
*.sln
2525
*.sw?
26+
27+
.env

‎biome.json

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
3+
"files": {
4+
"ignore": [
5+
"package.json",
6+
"node_modules",
7+
"**/node_modules",
8+
"cache",
9+
"coverage",
10+
"tsconfig.json",
11+
"tsconfig.*.json",
12+
"_cjs",
13+
"_esm",
14+
"_types",
15+
"bun.lockb",
16+
"docs",
17+
"dist",
18+
"build"
19+
]
20+
},
21+
"organizeImports": {
22+
"enabled": true
23+
},
24+
"linter": {
25+
"enabled": true,
26+
"rules": {
27+
"recommended": true,
28+
"suspicious": {
29+
"noExplicitAny": "off",
30+
"noArrayIndexKey": "off"
31+
},
32+
"style": {
33+
"noUnusedTemplateLiteral": "off",
34+
"noNonNullAssertion": "off",
35+
"noUselessElse": "off",
36+
"noParameterAssign": "off",
37+
"useTemplate": "off"
38+
},
39+
"a11y": {
40+
"noAccessKey": "off",
41+
"useKeyWithClickEvents": "off",
42+
"useKeyWithMouseEvents": "off",
43+
"useButtonType": "off"
44+
},
45+
"complexity": {
46+
"noExtraBooleanCast": "off"
47+
}
48+
}
49+
},
50+
"formatter": {
51+
"enabled": true,
52+
"formatWithErrors": true,
53+
"lineWidth": 80,
54+
"indentWidth": 2,
55+
"indentStyle": "space"
56+
},
57+
"javascript": {
58+
"formatter": {
59+
"semicolons": "asNeeded",
60+
"trailingComma": "none"
61+
}
62+
}
63+
}

‎bun.lockb

-9.19 KB
Binary file not shown.

‎bunfig.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[install.scopes]
2+
silencelaboratories = { token = "$VITE_SILENCE_LABS_NPM_TOKEN", url = "https://registry.npmjs.org" }

‎package.json

+15-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "bun i && bun link @biconomy/account && vite",
7+
"dev": "bun i && bun link @biconomy/account @biconomy/use-aa && vite",
88
"start": "vite",
99
"build": "tsc && vite build",
10-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"format": "biome format . --write",
11+
"lint": "biome check .",
12+
"lint:fix": "bun run lint --apply",
1113
"preview": "vite preview"
1214
},
1315
"dependencies": {
14-
"@biconomy/account": "^4.4.5",
15-
"@biconomy/use-aa": "1.0.11",
16+
"@biconomy/account": "^4.5.4",
17+
"@biconomy/use-aa": "^1.1.0",
1618
"@emotion/react": "^11.10.6",
1719
"@emotion/styled": "^11.10.6",
1820
"@ethersproject/providers": "^5.7.2",
@@ -21,16 +23,17 @@
2123
"@mui/styles": "^5.11.12",
2224
"@rainbow-me/rainbowkit": "^2.0.0",
2325
"@tanstack/react-query": "^5.22.2",
26+
"@types/react-toastify": "^4.1.0",
2427
"ethers": "^6.12.1",
2528
"react": "^18.2.0",
2629
"react-dom": "^18.2.0",
2730
"react-scripts": "5.0.1",
28-
"react-toastify": "^9.0.8",
31+
"react-toastify": "^10.0.5",
2932
"viem": "^2.13.7",
3033
"wagmi": "^2.9.9"
3134
},
3235
"devDependencies": {
33-
"@types/react": "^18.3.1",
36+
"@types/react": "^18.3.3",
3437
"@types/react-dom": "^18.3.0",
3538
"@typescript-eslint/eslint-plugin": "^7.2.0",
3639
"@typescript-eslint/parser": "^7.2.0",
@@ -39,6 +42,11 @@
3942
"eslint-plugin-react-hooks": "^4.6.0",
4043
"eslint-plugin-react-refresh": "^0.4.6",
4144
"typescript": "^5.2.2",
42-
"vite": "^5.2.0"
45+
"vite": "^5.2.0",
46+
"simple-git-hooks": "^2.9.0",
47+
"@biomejs/biome": "1.6.0"
48+
},
49+
"simple-git-hooks": {
50+
"pre-commit": "bun run format && bun run lint:fix"
4351
}
4452
}

‎src/App.tsx

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React from "react";
2-
import { makeStyles } from "@mui/styles";
3-
import { ToastContainer } from "react-toastify";
4-
import { useAccount } from "wagmi";
5-
import { ConnectButton } from "@rainbow-me/rainbowkit";
6-
import TabsBody from "./components/TabsBody";
1+
import { makeStyles } from "@mui/styles"
2+
import { ConnectButton } from "@rainbow-me/rainbowkit"
3+
import type React from "react"
4+
import { ToastContainer } from "react-toastify"
5+
import { useAccount } from "wagmi"
6+
import TabsBody from "./components/TabsBody"
77

88
const App: React.FC = () => {
9-
const classes = useStyles();
10-
const { address } = useAccount();
9+
const classes = useStyles()
10+
const { address } = useAccount()
1111

1212
if (!address) {
1313
return (
@@ -17,7 +17,7 @@ const App: React.FC = () => {
1717
<img
1818
width={35}
1919
style={{
20-
marginRight: 20,
20+
marginRight: 20
2121
}}
2222
src="/logo.svg"
2323
alt=""
@@ -31,16 +31,16 @@ const App: React.FC = () => {
3131
<ConnectButton />
3232
</div>
3333
</div>
34-
);
34+
)
3535
}
3636

3737
return (
3838
<div className={classes.bgCover}>
3939
<TabsBody loading={false} />
4040
<ToastContainer position="bottom-left" newestOnTop theme="dark" />
4141
</div>
42-
);
43-
};
42+
)
43+
}
4444

4545
const useStyles = makeStyles(() => ({
4646
bgCover: {
@@ -51,7 +51,7 @@ const useStyles = makeStyles(() => ({
5151
color: "#e6e6e6",
5252
justifyContent: "start",
5353
alignItems: "center",
54-
padding: "0px 20px",
54+
padding: "0px 20px"
5555
},
5656
container: {
5757
width: "60vw",
@@ -64,17 +64,17 @@ const useStyles = makeStyles(() => ({
6464
flexDirection: "column",
6565
alignItems: "start",
6666
justifyContent: "center",
67-
gap: 20,
67+
gap: 20
6868
},
6969
title: {
7070
margin: 0,
7171
fontSize: 50,
72-
color: "#ffb999",
72+
color: "#ffb999"
7373
},
7474
subTitle: {
7575
fontSize: 22,
76-
margin: 0,
77-
},
78-
}));
76+
margin: 0
77+
}
78+
}))
7979

80-
export default App;
80+
export default App

0 commit comments

Comments
 (0)