diff --git a/bot-pinner/package.json b/bot-pinner/package.json index b04e1b20c..0723f6e85 100644 --- a/bot-pinner/package.json +++ b/bot-pinner/package.json @@ -4,7 +4,6 @@ "description": "Pinning of the court data to decentralized storage.", "author": "Kleros", "license": "MIT", - "packageManager": "yarn@4.0.2+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186", "volta": { "node": "20.11.0" }, @@ -19,6 +18,6 @@ "node": ">=16.13.0" }, "devDependencies": { - "@dappnode/dappnodesdk": "^0.3.11" + "@dappnode/dappnodesdk": "^0.3.35" } } diff --git a/contracts/package.json b/contracts/package.json index 07ce9b2b7..913ccef8c 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -4,9 +4,9 @@ "description": "Smart contracts for Kleros version 2", "main": "typechain-types/index.ts", "repository": "git@github.com:kleros/kleros-v2.git", + "homepage": "https://github.com/kleros/kleros-v2/tree/master/contracts#readme", "author": "Kleros", "license": "MIT", - "packageManager": "yarn@4.0.2+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186", "engines": { "node": ">=16.0.0" }, @@ -60,7 +60,7 @@ "build:types": "tsc --project tsconfig.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap" }, "devDependencies": { - "@defi-wonderland/natspec-smells": "^1.0.3", + "@defi-wonderland/natspec-smells": "^1.1.5", "@kleros/kleros-v2-eslint-config": "workspace:^", "@kleros/kleros-v2-prettier-config": "workspace:^", "@kleros/kleros-v2-tsconfig": "workspace:^", @@ -71,18 +71,19 @@ "@openzeppelin/contracts": "^5.1.0", "@typechain/ethers-v6": "^0.5.1", "@typechain/hardhat": "^9.1.0", - "@types/chai": "^4.3.11", - "@types/mocha": "^10.0.6", - "@types/node": "^20.17.1", - "@wagmi/cli": "^2.1.16", + "@types/chai": "^4.3.20", + "@types/mocha": "^10.0.10", + "@types/node": "^20.17.6", + "@wagmi/cli": "^2.1.18", "abitype": "^0.10.3", - "chai": "^4.4.1", - "dotenv": "^16.3.1", + "chai": "^4.5.0", + "dotenv": "^16.4.5", + "eslint": "^9.15.0", "ethereumjs-util": "^7.1.5", "ethers": "^6.13.4", "graphql": "^16.9.0", - "graphql-request": "^6.1.0", - "hardhat": "2.22.15", + "graphql-request": "^7.1.2", + "hardhat": "2.22.16", "hardhat-contract-sizer": "^2.10.0", "hardhat-deploy": "^0.14.0", "hardhat-deploy-ethers": "^0.4.2", @@ -94,15 +95,17 @@ "node-fetch": "^3.3.2", "pino": "^8.21.0", "pino-pretty": "^10.3.1", + "prettier": "^3.3.3", + "prettier-plugin-solidity": "^1.4.1", "shelljs": "^0.8.5", "solhint-plugin-prettier": "^0.1.0", "solidity-coverage": "^0.8.13", "ts-node": "^10.9.2", "typechain": "^8.3.2", - "typescript": "^5.3.3" + "typescript": "^5.6.3" }, "dependencies": { "@kleros/vea-contracts": "^0.4.0", - "viem": "^2.21.35" + "viem": "^2.21.48" } } diff --git a/eslint-config/package.json b/eslint-config/package.json index cd5f47ed2..7ce7052e5 100644 --- a/eslint-config/package.json +++ b/eslint-config/package.json @@ -5,25 +5,26 @@ "main": ".eslintrc.js", "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "^8.8.1", - "@typescript-eslint/parser": "^8.8.1", - "@typescript-eslint/utils": "^8.8.1", + "@typescript-eslint/eslint-plugin": "^8.15.0", + "@typescript-eslint/parser": "^8.15.0", + "@typescript-eslint/utils": "^8.15.0", + "eslint": "^9.15.0", "eslint-config-prettier": "^9.1.0", - "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.31.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-promise": "^6.0.0", + "eslint-plugin-promise": "^6.6.0", "eslint-plugin-security": "^3.0.1", - "eslint-utils": "^3.0.0" + "eslint-utils": "^3.0.0", + "prettier": "^3.3.3" }, "devDependencies": { - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "^9.12.0", - "globals": "^15.11.0", - "typescript": "^5.3.3" + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.15.0", + "globals": "^15.12.0", + "typescript": "^5.6.3" }, "peerDependencies": { - "eslint": "8.x" + "eslint": "^8.0.0 || ^9.0.0" } } diff --git a/kleros-app/README.md b/kleros-app/README.md new file mode 100644 index 000000000..1db6aeafe --- /dev/null +++ b/kleros-app/README.md @@ -0,0 +1,112 @@ +# Kleros App + +Library for Kleros DApps with reusable abstractions and components. + +# Usage + +```node +yarn install @kleros/kleros-app +``` + +## 1. Atlas Interaction + +- This library exports utilities to interact with Atlas (Kleros' backend) with minimal code. + +- AtlasProvider : Provides functions to interact with Atlas. + +> AtlasProvider needs to be wrapped with [](https://wagmi.sh/react/api/WagmiProvider) and [](https://tanstack.com/query/latest/docs/framework/react/reference/QueryClientProvider#queryclientprovider) to work properly. + +#### Usage + +1. At the root of your app, setup AtlasProvider. + **uri** : Atlas backend uri + **product** : The product / Kleros DApp interacting with Atlas (CourtV2, Curate, etc.) + +```typescript +import { WagmiProvider } from 'wagmi' +import { config } from './config' +import { QueryClient, QueryClientProvider } from '@tanstack/react-query' +import { AtlasProvider, Products } from "@kleros/kleros-app"; + +const queryClient = new QueryClient() + +function App() { + return + + + + ... + + + +} +``` + +2. Once Provider is set up, use the functions provided. + +```typescript +import React, { useCallback } from "react"; + +import { useAccount } from "wagmi"; +import { useAtlasProvider } from "@kleros/kleros-app"; +import { Button } from "@kleros/ui-components-library"; + + +interface IEnsureAuth { + children: React.ReactElement; + className?: string; +} + +const EnsureAuth: React.FC = ({ children, className }) => { + const { address } = useAccount(); + const { isVerified, isSigningIn, authoriseUser } = useAtlasProvider(); + + const handleClick = useCallback(() => { + // authorise a user + authoriseUser() + .then((res) => { console.log(res)}) + .catch((err) => { + console.log(err); + }); + }, [authoriseUser]); + + return isVerified ? ( + children + ) : ( +