Skip to content

Commit

Permalink
Merge branch 'dev' into feat(web)/migrate-wagmi-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
alcercu committed May 28, 2024
2 parents 1ad15d5 + a2ed358 commit 4fe797e
Show file tree
Hide file tree
Showing 43 changed files with 1,499 additions and 704 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"projectKey": "kleros_kleros-v2"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
2 changes: 1 addition & 1 deletion contracts/config/policies.v1.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{
"name": "Token Listing",
"description": "**Court Purpose:**\n\nThis court serves as the final validation for token listing for verified projects listing on the Ethfinex Exchange using Kleros’ Token Curated List Dapp.\nThis is a high level, high stake court requiring deep blockchain knowledge, legal experience and / or a knowledge of exchange listings in general. Jurors are required to stake a large amount of PNK and should only do so if they are confident in the above capabilities.",
"summary": "[Ethfinex Court Policy](https://ipfs.kleros.io/ipfs/QmVzwEBpGsbFY3UgyjA3SxgGXx3r5gFGynNpaoXkp6jenu/Ethfinex%20Court%20Policy.pdf)",
"summary": "[Ethfinex Court Policy](https://cdn.kleros.link/ipfs/QmVzwEBpGsbFY3UgyjA3SxgGXx3r5gFGynNpaoXkp6jenu/Ethfinex%20Court%20Policy.pdf)",
"court": 3,
"uri": "/ipfs/QmeyojE13mcQtWqQQddYypafDRChVND8z6dcHLbaarmbbx"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Token Listing",
"description": "This court serves as the final validation for token listing for verified projects listing on the Ethfinex Exchange using Kleros’ Token Curated List Dapp.\nThis is a high level, high stake court requiring deep blockchain knowledge, legal experience and / or a knowledge of exchange listings in general. Jurors are required to stake a large amount of PNK and should only do so if they are confident in the above capabilities.",
"summary": "[Ethfinex Court Policy](https://ipfs.kleros.io/ipfs/QmVzwEBpGsbFY3UgyjA3SxgGXx3r5gFGynNpaoXkp6jenu/Ethfinex%20Court%20Policy.pdf)"
"summary": "[Ethfinex Court Policy](https://cdn.kleros.link/ipfs/QmVzwEBpGsbFY3UgyjA3SxgGXx3r5gFGynNpaoXkp6jenu/Ethfinex%20Court%20Policy.pdf)"
}
2 changes: 1 addition & 1 deletion contracts/scripts/disputeCreatorBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default async function main() {
"000000000000000000000000000000000000000000000000000000000000000B" + // minJurors 11
"0000000000000000000000000000000000000000000000000000000000000002"; // disputeKitId 2
const templates = [
`{"title":"A reality.eth question","description":"A reality.eth question has been raised to arbitration.","question":"**Kleros Moderate:** Did the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?","answers":[{"id":"0x01","title":"Yes","reserved":false},{"id":"0x02","title":"No","reserved":false},{"id":"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","title":"Answered Too Soon","reserved":true}],"policyURI":"/ipfs/QmZ5XaV2RVgBADq5qMpbuEwgCuPZdRgCeu8rhGtJWLV6yz","frontendUrl":"https://reality.eth.limo/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39","arbitrableChainID":"100","arbitrableAddress":"0x2e39b8f43d0870ba896f516f78f57cde773cf805","arbitratorChainID":"421614","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Oracle","lang":"en_US","specification":"KIP99","version": "1.0"}`,
`{"title":"A reality.eth question","description":"A reality.eth question has been raised to arbitration.","question":"**Kleros Moderate:** Did the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://cdn.kleros.link/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://cdn.kleros.link/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?","answers":[{"id":"0x01","title":"Yes","reserved":false},{"id":"0x02","title":"No","reserved":false},{"id":"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","title":"Answered Too Soon","reserved":true}],"policyURI":"/ipfs/QmZ5XaV2RVgBADq5qMpbuEwgCuPZdRgCeu8rhGtJWLV6yz","frontendUrl":"https://reality.eth.limo/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39","arbitrableChainID":"100","arbitrableAddress":"0x2e39b8f43d0870ba896f516f78f57cde773cf805","arbitratorChainID":"421614","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Oracle","lang":"en_US","specification":"KIP99","version": "1.0"}`,
`{"title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmW3nQcMW2adyqe6TujRTYkyq26PiDqcmmTjdgKiz9ynPV","frontendUrl":"https://curate.kleros.io/tcr/100/0x957a53a994860be4750810131d9c876b2f52d6e1/0xc2c1aa705632f53051f22a9f65967c0944370020a7489aba608bd0d755ca1234","arbitratorChainID":"421614","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Curation","specification":"KIP0X","lang":"en_US","version": "1.0"}`,
`{"title":"Omen Question: News & Politics","description":"This reality dispute has been created by Omen, we advise you to read [the Omen Rules](https://cdn.kleros.link/ipfs/QmU1oZzsduGwtC7vCUQPw1QcBP6BDNDkg4t6zkowPucVcx) and consult the evidence provided in [the Market Comments](https://omen.eth.limo/#/0x95b2271039b020aba31b933039e042b60b063800).","question":"**Assuming that today is December 20th 2020, will Joe Biden win the 2020 United States presidential election?**","answers":[{"title":"Yes"},{"title":"No"}],"policyURI":"/ipfs/QmU1oZzsduGwtC7vCUQPw1QcBP6BDNDkg4t6zkowPucVcx","frontendUrl":"https://omen.eth.limo/#/0x95b2271039b020aba31b933039e042b60b063800","arbitratorChainID":"421614","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Oracle","specification":"KIP0X","lang":"en_US","version": "1.0"}`,
`{"title":"Proof of Humanity Registration Request","description":"A request to register the specified entry to a list of provable humans.","question":"Should the request to register be accepted?","answers":[{"title":"Yes","description":"Accept the request to register the entry."},{"title":"No","description":"Deny the request."}],"policyURI":"/ipfs/QmYPf2fdSyr9BiSy6pJFUmB1oTUPwg6dhEuFqL1n4ZosgH","frontendUrl":"https://app.proofofhumanity.id/profile/0x00de4b13153673bcae2616b67bf822500d325fc3?network=mainnet","arbitratorChainID":"421614","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Curated List","specification":"KIP0X","lang":"en_US","version": "1.0"}`,
Expand Down
2 changes: 1 addition & 1 deletion contracts/scripts/downloadPolicies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function download() #policies
{
for p in $(cat ${policies}.json | jq -r .[].uri)
do
wget -P $SCRIPT_DIR/../config/$policies https://ipfs.kleros.io${p}
wget -P $SCRIPT_DIR/../config/$policies https://cdn.kleros.link${p}
done
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/scripts/getPoliciesV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function main() {
const uri = await fetchPolicyUri(court);
if (!uri) break;

const policy = await fetchPolicy("https://ipfs.kleros.io" + uri);
const policy = await fetchPolicy("https://cdn.kleros.link" + uri);
policy.court = court;
policy.uri = uri;
policies.push(policy);
Expand Down
2 changes: 1 addition & 1 deletion kleros-sdk/config/v1-metaevidence/tokens1.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
]
},
"fileURI": "/ipfs/QmTL1SCKpRcr7NRbVpXW6z9QoQXRHJT5cQr6PEge5qoLwU/t2cr-primary-document.pdf",
"evidenceDisplayInterfaceURL": "https://ipfs.kleros.io/ipfs/QmYs17mAJTaQwYeXNTb6n4idoQXmRcAjREeUdjJShNSeKh/index.html"
"evidenceDisplayInterfaceURL": "https://cdn.kleros.link/ipfs/QmYs17mAJTaQwYeXNTb6n4idoQXmRcAjREeUdjJShNSeKh/index.html"
}
2 changes: 1 addition & 1 deletion kleros-sdk/config/v1-metaevidence/tokens2.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
]
},
"fileURI": "/ipfs/QmTL1SCKpRcr7NRbVpXW6z9QoQXRHJT5cQr6PEge5qoLwU/t2cr-primary-document.pdf",
"evidenceDisplayInterfaceURL": "https://ipfs.kleros.io/ipfs/QmYs17mAJTaQwYeXNTb6n4idoQXmRcAjREeUdjJShNSeKh/index.html"
"evidenceDisplayInterfaceURL": "https://cdn.kleros.link/ipfs/QmYs17mAJTaQwYeXNTb6n4idoQXmRcAjREeUdjJShNSeKh/index.html"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "./DisputeDetails.reality.schema.json",
"title": "A reality.eth question",
"description": "A reality.eth question has been raised to arbitration.",
"question": "**Kleros Moderate:** Did the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?",
"question": "**Kleros Moderate:** Did the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://cdn.kleros.link/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://cdn.kleros.link/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?",
"answers": [
{
"id": "0x01",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "./DisputeDetails.reality.schema.json",
"title": "A reality.eth question",
"description": "A reality.eth question has been raised to arbitration.",
"question": "# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?",
"question": "# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://cdn.kleros.link/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://cdn.kleros.link/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?",
"answers": [
{
"id": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?
# [Kleros Moderate](https://kleros.io/moderate)\n---\nDid the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://cdn.kleros.link/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://cdn.kleros.link/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?
single-select
,{"id":"0x00","title":"Invalid/Refuse to Arbitrate","reserved":true},{"id":"0x01","title":"Yes","reserved":false},{"id":"0x02","title":"No","reserved":false}
0xe78996a233895be74a66f451f1019ca9734205cc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"type": "json",
"source": {
"value": "**Kleros Moderate:** Did the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?",
"value": "**Kleros Moderate:** Did the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://cdn.kleros.link/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://cdn.kleros.link/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?",
"type": "single-select",
"answers": [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@
"alias": {
"process": "process/browser.js",
"buffer": "buffer",
"ethers": "./web/src/utils/ethersShim.ts"
"@lifi/sdk": "@tractors/lifi-sdk-parcel"
}
}
13 changes: 10 additions & 3 deletions web/.parcelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.svg": ["...", "@parcel/transformer-svg-react"],
"tsx:*.svg": ["@parcel/transformer-svg-react"],
"tsx:*": ["..."]
"web/src/**/*.svg": [
"...",
"@parcel/transformer-svg-react"
],
"tsx:*.svg": [
"@parcel/transformer-svg-react"
],
"tsx:*": [
"..."
]
}
}
29 changes: 17 additions & 12 deletions web/netlify/functions/authUser.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import middy from "@middy/core";
import jsonBodyParser from "@middy/http-json-body-parser";
import { ETH_SIGNATURE_REGEX } from "consts/index";
import { DEFAULT_CHAIN } from "consts/chains";
import { SiweMessage } from "siwe";
import * as jwt from "jose";
import { createClient } from "@supabase/supabase-js";
import { netlifyUri } from "src/generatedNetlifyInfo.json";
import * as jwt from "jose";
import { SiweMessage } from "siwe";

import { DEFAULT_CHAIN } from "consts/chains";
import { ETH_SIGNATURE_REGEX } from "consts/index";

import { netlifyUri, netlifyDeployUri, netlifyDeployPrimeUri } from "src/generatedNetlifyInfo.json";
import { Database } from "src/types/supabase-notification";

const authUser = async (event) => {
Expand Down Expand Up @@ -35,8 +37,16 @@ const authUser = async (event) => {

const siweMessage = new SiweMessage(message);

if (netlifyUri && netlifyUri !== siweMessage.uri) {
console.debug(`Invalid URI: expected ${netlifyUri} but got ${siweMessage.uri}`);
if (
!(
(netlifyUri && netlifyUri === siweMessage.uri) ||
(netlifyDeployUri && netlifyDeployUri === siweMessage.uri) ||
(netlifyDeployPrimeUri && netlifyDeployPrimeUri === siweMessage.uri)
)
) {
console.debug(
`Invalid URI: expected one of [${netlifyUri} ${netlifyDeployUri} ${netlifyDeployPrimeUri}] but got ${siweMessage.uri}`
);
throw new Error(`Invalid URI`);
}

Expand All @@ -45,11 +55,6 @@ const authUser = async (event) => {
throw new Error(`Invalid chain ID`);
}

if (!siweMessage.expirationTime || Date.parse(siweMessage.expirationTime) < Date.now()) {
console.debug(`Message expired: ${siweMessage.expirationTime} < ${new Date().toISOString()}`);
throw new Error("Message expired");
}

const lowerCaseAddress = siweMessage.address.toLowerCase();
if (lowerCaseAddress !== address.toLowerCase()) {
throw new Error("Address mismatch in provided address and message");
Expand Down
3 changes: 2 additions & 1 deletion web/netlify/functions/fetch-settings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import middy from "@middy/core";
import { createClient } from "@supabase/supabase-js";

import { Database } from "../../src/types/supabase-notification";
import middy from "@middy/core";
import { authMiddleware } from "../middleware/authMiddleware";

const fetchSettings = async (event) => {
Expand Down
6 changes: 4 additions & 2 deletions web/netlify/functions/getNonce.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { createClient } from "@supabase/supabase-js";
import { Database } from "../../src/types/supabase-notification";
import middy from "@middy/core";
import { createClient } from "@supabase/supabase-js";
import { generateNonce } from "siwe";

import { ETH_ADDRESS_REGEX } from "src/consts";

import { Database } from "../../src/types/supabase-notification";

const getNonce = async (event) => {
try {
const { queryStringParameters } = event;
Expand Down
7 changes: 4 additions & 3 deletions web/netlify/functions/update-settings.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { createClient } from "@supabase/supabase-js";
import { Database } from "../../src/types/supabase-notification";
import { EMAIL_REGEX, TELEGRAM_REGEX, ETH_ADDRESS_REGEX } from "../../src/consts/index";
import middy from "@middy/core";
import jsonBodyParser from "@middy/http-json-body-parser";
import { createClient } from "@supabase/supabase-js";

import { EMAIL_REGEX, TELEGRAM_REGEX, ETH_ADDRESS_REGEX } from "../../src/consts/index";
import { Database } from "../../src/types/supabase-notification";
import { authMiddleware } from "../middleware/authMiddleware";

type NotificationSettings = {
Expand Down
13 changes: 4 additions & 9 deletions web/netlify/functions/uploadToIPFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const parseMultipart = ({ headers, body, isBase64Encoded }) =>
bb.end();
});

const pinToFilebase = async (data: FormData, dapp: string, operation: string): Promise<Array<string>> => {
const pinToFilebase = async (data: FormData, operation: string): Promise<Array<string>> => {
const cids = new Array<string>();
for (const [_, dataElement] of Object.entries(data)) {
if (dataElement.isFile) {
Expand All @@ -68,19 +68,14 @@ const pinToFilebase = async (data: FormData, dapp: string, operation: string): P
export const handler: Handler = async (event) => {
const { queryStringParameters } = event;

if (
!queryStringParameters ||
!queryStringParameters.dapp ||
!queryStringParameters.key ||
!queryStringParameters.operation
) {
if (!queryStringParameters || !queryStringParameters.key || !queryStringParameters.operation) {
return {
statusCode: 400,
body: JSON.stringify({ message: "Invalid query parameters" }),
};
}

const { dapp, key, operation } = queryStringParameters;
const { key, operation } = queryStringParameters;

if (key !== FILEBASE_API_WRAPPER) {
return {
Expand All @@ -91,7 +86,7 @@ export const handler: Handler = async (event) => {

try {
const parsed = await parseMultipart(event);
const cids = await pinToFilebase(parsed, dapp, operation);
const cids = await pinToFilebase(parsed, operation);

return {
statusCode: 200,
Expand Down
6 changes: 4 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@
"dependencies": {
"@filebase/client": "^0.0.5",
"@kleros/kleros-sdk": "workspace:^",
"@kleros/ui-components-library": "^2.8.1",
"@kleros/ui-components-library": "^2.10.0",
"@lifi/widget": "^2.10.1",
"@middy/core": "^5.3.2",
"@middy/http-json-body-parser": "^5.3.2",
"@sentry/react": "^7.93.0",
"@sentry/tracing": "^7.93.0",
"@supabase/supabase-js": "^2.39.3",
"@tanstack/react-query": "^4.28.0",
"@tractors/lifi-sdk-parcel": "^2.5.3",
"@types/react-modal": "^3.16.3",
"@web3modal/wagmi": "^4.1.10",
"@yornaath/batshit": "^0.9.0",
Expand Down Expand Up @@ -110,7 +112,7 @@
"react-scripts": "^5.0.1",
"react-toastify": "^9.1.3",
"react-use": "^17.4.3",
"siwe": "^2.1.4",
"siwe": "^2.3.1",
"styled-components": "^5.3.11",
"vanilla-jsoneditor": "^0.21.4",
"viem": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion web/scripts/generateBuildInfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

jq -n --arg uri "$DEPLOY_PRIME_URL" '{ netlifyUri: $uri }' > src/generatedNetlifyInfo.json
jq -n --arg primeUri "$DEPLOY_PRIME_URL" --arg uri "$URL" --arg deployUri "$DEPLOY_URL" '{ netlifyDeployPrimeUri: $primeUri, netlifyUri: $uri, netlifyDeployUri: $deployUri }' > src/generatedNetlifyInfo.json
node $SCRIPT_DIR/gitInfo.js
Loading

0 comments on commit 4fe797e

Please sign in to comment.