Skip to content

Commit bf9972a

Browse files
Merge branch 'dev' into feat/devtools
2 parents 4a1ae9e + 4c82235 commit bf9972a

35 files changed

+845
-104
lines changed

web/netlify/functions/authUser.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import middy from "@middy/core";
22
import jsonBodyParser from "@middy/http-json-body-parser";
33
import { createClient } from "@supabase/supabase-js";
4+
import { ethers } from "ethers";
45
import * as jwt from "jose";
56
import { SiweMessage } from "siwe";
67

7-
import { ETH_SIGNATURE_REGEX, DEFAULT_CHAIN } from "consts/processEnvConsts";
8+
import { ETH_SIGNATURE_REGEX, DEFAULT_CHAIN, isProductionDeployment } from "consts/processEnvConsts";
89

910
import { netlifyUri, netlifyDeployUri, netlifyDeployPrimeUri } from "src/generatedNetlifyInfo.json";
1011
import { Database } from "src/types/supabase-notification";
@@ -73,9 +74,14 @@ const authUser = async (event) => {
7374
}
7475

7576
try {
76-
await siweMessage.verify({ signature, nonce: nonceData.nonce, time: new Date().toISOString() });
77+
// If the main Alchemy API key is permissioned, it won't work in a Netlify Function so we use a dedicated API key
78+
const alchemyApiKey = process.env.ALCHEMY_FUNCTIONS_API_KEY ?? process.env.ALCHEMY_API_KEY;
79+
const alchemyChain = isProductionDeployment() ? "arb-mainnet" : "arb-sepolia";
80+
const alchemyRpcURL = `https://${alchemyChain}.g.alchemy.com/v2/${alchemyApiKey}`;
81+
const provider = new ethers.providers.JsonRpcProvider(alchemyRpcURL);
82+
await siweMessage.verify({ signature, nonce: nonceData.nonce, time: new Date().toISOString() }, { provider });
7783
} catch (err) {
78-
throw new Error("Invalid signer");
84+
throw new Error("Invalid signer: " + JSON.stringify(err));
7985
}
8086

8187
const { error } = await supabase.from("user-nonce").delete().match({ address: lowerCaseAddress });

web/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"@wagmi/cli": "^2.0.3",
6565
"eslint": "^8.56.0",
6666
"eslint-config-prettier": "^8.10.0",
67+
"eslint-import-resolver-typescript": "^3.6.1",
6768
"eslint-plugin-react": "^7.33.2",
6869
"eslint-plugin-react-hooks": "^4.6.0",
6970
"lru-cache": "^7.18.3",
@@ -77,7 +78,7 @@
7778
"@cyntler/react-doc-viewer": "^1.16.3",
7879
"@filebase/client": "^0.0.5",
7980
"@kleros/kleros-sdk": "workspace:^",
80-
"@kleros/ui-components-library": "^2.12.0",
81+
"@kleros/ui-components-library": "^2.14.0",
8182
"@lifi/widget": "^2.10.1",
8283
"@middy/core": "^5.3.2",
8384
"@middy/http-json-body-parser": "^5.3.2",

web/src/assets/svgs/mini-guides/dispute-resolver/parameters.svg

Lines changed: 42 additions & 0 deletions
Loading

web/src/assets/svgs/mini-guides/dispute-resolver/parties.svg

Lines changed: 29 additions & 0 deletions
Loading

web/src/assets/svgs/mini-guides/dispute-resolver/policy.svg

Lines changed: 37 additions & 0 deletions
Loading

web/src/assets/svgs/mini-guides/dispute-resolver/start-a-case.svg

Lines changed: 39 additions & 0 deletions
Loading

web/src/assets/svgs/mini-guides/dispute-resolver/voting-options.svg

Lines changed: 53 additions & 0 deletions
Loading

web/src/assets/svgs/mini-guides/dispute-resolver/well-done.svg

Lines changed: 78 additions & 0 deletions
Loading
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
4+
import ParametersSvg from "svgs/mini-guides/dispute-resolver/parameters.svg";
5+
6+
import { StyledImage } from "../PageContentsTemplate";
7+
8+
const StyledParametersSvg = styled(ParametersSvg)`
9+
[class$="rect-1"],
10+
[class$="rect-3"],
11+
[class$="rect-7"],
12+
[class$="path-3"] {
13+
fill: ${({ theme }) => theme.whiteBackground};
14+
}
15+
[class$="rect-2"],
16+
[class$="rect-6"],
17+
[class$="rect-8"] {
18+
stroke: ${({ theme }) => theme.stroke};
19+
}
20+
[class$="rect-4"] {
21+
stroke: ${({ theme }) => theme.primaryBlue};
22+
}
23+
[class$="rect-5"],
24+
[class$="path-2"] {
25+
fill: ${({ theme }) => theme.primaryBlue};
26+
}
27+
[class$="path-1"],
28+
[class$="path-4"],
29+
[class$="path-7"],
30+
[class$="path-8"] {
31+
fill: ${({ theme }) => theme.primaryText};
32+
}
33+
[class$="path-5"] {
34+
fill: ${({ theme }) => theme.stroke};
35+
}
36+
[class$="path-6"] {
37+
fill: ${({ theme }) => theme.secondaryPurple};
38+
}
39+
`;
40+
41+
const Parameters: React.FC = () => <StyledImage as={StyledParametersSvg} />;
42+
43+
export default Parameters;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
4+
import PartiesSvg from "svgs/mini-guides/dispute-resolver/parties.svg";
5+
6+
import { StyledImage } from "../PageContentsTemplate";
7+
8+
const StyledPartiesSvg = styled(PartiesSvg)`
9+
[class$="rect-1"] {
10+
fill: ${({ theme }) => theme.whiteBackground};
11+
}
12+
[class$="rect-2"],
13+
[class$="rect-3"],
14+
[class$="rect-4"],
15+
[class$="rect-5"],
16+
[class$="rect-6"] {
17+
stroke: ${({ theme }) => theme.stroke};
18+
fill: ${({ theme }) => theme.whiteBackground};
19+
}
20+
[class$="path-1"],
21+
[class$="path-3"],
22+
[class$="path-5"],
23+
[class$="path-7"] {
24+
fill: ${({ theme }) => theme.secondaryText};
25+
}
26+
[class$="path-2"],
27+
[class$="path-4"],
28+
[class$="path-6"],
29+
[class$="path-8"] {
30+
fill: ${({ theme }) => theme.primaryText};
31+
}
32+
`;
33+
34+
const Parties: React.FC = () => <StyledImage as={StyledPartiesSvg} />;
35+
36+
export default Parties;

0 commit comments

Comments
 (0)