From ae751eb4015c8f23540f4d22f84f39826c44a378 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 8 May 2024 12:20:36 +0200 Subject: [PATCH 01/75] move auth methods to taco-auth --- .changeset/config.json | 7 +- .eslintrc.js | 37 +- .github/PULL_REQUEST_TEMPLATE.md | 18 +- .github/dependabot.yml | 12 +- .github/workflows/lynx.yml | 17 +- .github/workflows/main.yml | 7 +- .github/workflows/mainnet.yml | 10 +- .github/workflows/npm.yml | 6 +- .github/workflows/release.yml | 4 +- .github/workflows/tapir.yml | 17 +- demos/taco-demo/src/App.tsx | 8 +- demos/taco-nft-demo/src/App.tsx | 3 +- .../taco-nft-demo/src/NFTConditionBuilder.tsx | 6 +- demos/taco-nft-demo/tsconfig.json | 8 +- demos/taco-nft-demo/webpack.config.js | 4 +- examples/pre/nextjs/src/app/page.tsx | 2 +- examples/pre/nextjs/tsconfig.json | 10 +- examples/pre/nodejs/tsconfig.json | 8 +- examples/pre/react/src/App.tsx | 2 +- examples/pre/react/tsconfig.json | 4 +- examples/pre/webpack-5/tsconfig.json | 8 +- examples/taco/nextjs/src/app/layout.tsx | 2 +- examples/taco/nextjs/src/app/page.tsx | 59 +- examples/taco/nextjs/tsconfig.build.json | 3 + examples/taco/nextjs/tsconfig.json | 10 +- examples/taco/nodejs/tsconfig.json | 8 +- examples/taco/react/src/App.tsx | 53 +- examples/taco/react/src/index.tsx | 2 +- examples/taco/react/tsconfig.json | 4 +- examples/taco/webpack-5/src/index.html | 3 +- examples/taco/webpack-5/tsconfig.json | 8 +- package.json | 3 +- packages/pre/.eslintrc.js | 4 +- packages/pre/tsconfig.cjs.json | 2 +- packages/pre/tsconfig.json | 8 +- packages/shared/package.json | 2 +- packages/shared/tsconfig.json | 4 +- packages/taco-auth/.eslintrc.js | 5 + packages/taco-auth/LICENSE | 675 ++++++++++++++++++ packages/taco-auth/README.md | 3 + packages/taco-auth/package.json | 52 ++ .../providers.ts => taco-auth/src/eip712.ts} | 26 +- packages/taco-auth/src/index.ts | 1 + packages/taco-auth/test/hello.test.ts | 7 + packages/taco-auth/tsconfig.cjs.json | 7 + packages/taco-auth/tsconfig.es.json | 10 + packages/taco-auth/tsconfig.json | 13 + packages/taco-auth/typedoc.json | 5 + packages/taco/package.json | 4 +- .../taco/src/conditions/context/context.ts | 6 +- packages/taco/src/web3.ts | 25 - packages/taco/tsconfig.json | 8 +- packages/test-utils/.eslintrc.js | 4 +- packages/test-utils/tsconfig.cjs.json | 2 +- packages/test-utils/tsconfig.json | 6 +- pnpm-lock.yaml | 26 +- pnpm-workspace.yaml | 6 +- tsconfig.json | 18 +- tsconfig.prod.json | 10 +- typedoc.base.json | 6 +- typedoc.json | 6 +- 61 files changed, 1058 insertions(+), 246 deletions(-) create mode 100644 packages/taco-auth/.eslintrc.js create mode 100644 packages/taco-auth/LICENSE create mode 100644 packages/taco-auth/README.md create mode 100644 packages/taco-auth/package.json rename packages/{taco/src/conditions/context/providers.ts => taco-auth/src/eip712.ts} (88%) create mode 100644 packages/taco-auth/src/index.ts create mode 100644 packages/taco-auth/test/hello.test.ts create mode 100644 packages/taco-auth/tsconfig.cjs.json create mode 100644 packages/taco-auth/tsconfig.es.json create mode 100644 packages/taco-auth/tsconfig.json create mode 100644 packages/taco-auth/typedoc.json delete mode 100644 packages/taco/src/web3.ts diff --git a/.changeset/config.json b/.changeset/config.json index 3e35728fe..f26533d60 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,12 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json", "changelog": "@changesets/cli/changelog", "commit": false, - "fixed": [ - [ - "@nucypher/shared", - "@nucypher/taco" - ] - ], + "fixed": [["@nucypher/shared", "@nucypher/taco"]], "linked": [], "access": "public", "baseBranch": "main", diff --git a/.eslintrc.js b/.eslintrc.js index 616ae2ece..e0c43f7a3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,54 +1,51 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { - 'root': true, - 'parser': '@typescript-eslint/parser', - 'env': { - 'es6': true, + root: true, + parser: '@typescript-eslint/parser', + env: { + es6: true, }, - 'ignorePatterns': [ + ignorePatterns: [ 'node_modules', 'build', 'coverage', 'src/contracts/ethers-typechain', ], - 'plugins': [ - 'import', - 'eslint-comments', - ], - 'extends': [ + plugins: ['import', 'eslint-comments'], + extends: [ 'eslint:recommended', 'plugin:eslint-comments/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:import/typescript', 'prettier', ], - 'globals': { - 'BigInt': true, - 'console': true, - 'WebAssembly': true, + globals: { + BigInt: true, + console: true, + WebAssembly: true, }, - 'rules': { + rules: { '@typescript-eslint/explicit-module-boundary-types': 'off', 'eslint-comments/disable-enable-pair': [ 'error', { - 'allowWholeFile': true, + allowWholeFile: true, }, ], 'import/order': [ 'error', { 'newlines-between': 'always', - 'alphabetize': { - 'order': 'asc', + alphabetize: { + order: 'asc', }, }, ], 'sort-imports': [ 'error', { - 'ignoreDeclarationSort': true, - 'ignoreCase': true, + ignoreDeclarationSort: true, + ignoreCase: true, }, ], }, diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c8838257a..e9f170d8d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,19 +9,23 @@ - [ ] 1 - [ ] 2 -- [X] 3 +- [x] 3 **What this does:** -> High-level idea of the changes introduced in this PR. -> List relevant API changes (if any), as well as related PRs and issues. + +> High-level idea of the changes introduced in this PR. List relevant API +> changes (if any), as well as related PRs and issues. **Issues fixed/closed:** + > - Fixes #... **Why it's needed:** -> Explain how this PR fits in the greater context of the NuCypher Network. -> E.g., if this PR address a `nucypher/productdev` issue, let reviewers know! + +> Explain how this PR fits in the greater context of the NuCypher Network. E.g., +> if this PR address a `nucypher/productdev` issue, let reviewers know! **Notes for reviewers:** -> What should reviewers focus on? -> Is there a particular commit/function/section of your PR that requires more attention from reviewers? + +> What should reviewers focus on? Is there a particular commit/function/section +> of your PR that requires more attention from reviewers? diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 279bdd8a8..1e6bc2d70 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,12 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: 'github-actions' + directory: '/' schedule: - interval: "monthly" + interval: 'monthly' open-pull-requests-limit: 5 - - package-ecosystem: "npm" - directory: "/" + - package-ecosystem: 'npm' + directory: '/' schedule: - interval: "monthly" + interval: 'monthly' open-pull-requests-limit: 5 diff --git a/.github/workflows/lynx.yml b/.github/workflows/lynx.yml index 375ad718f..d6de9fed5 100644 --- a/.github/workflows/lynx.yml +++ b/.github/workflows/lynx.yml @@ -2,26 +2,27 @@ name: '🔎 Lynx Testnet Example' on: schedule: - - cron: "0 * * * *" # Every hour + - cron: '0 * * * *' # Every hour pull_request: workflow_dispatch: # TODO: Use variables when GH supports it for forks. See https://github.com/orgs/community/discussions/44322 env: - RPC_PROVIDER_URL: "https://rpc-amoy.polygon.technology" - ENCRYPTOR_PRIVATE_KEY: "0x900edb9e8214b2353f82aa195e915128f419a92cfb8bbc0f4784f10ef4112b86" - CONSUMER_PRIVATE_KEY: "0xf307e165339cb5deb2b8ec59c31a5c0a957b8e8453ce7fe8a19d9a4c8acf36d4" - RITUAL_ID: "0" + RPC_PROVIDER_URL: 'https://rpc-amoy.polygon.technology' + ENCRYPTOR_PRIVATE_KEY: '0x900edb9e8214b2353f82aa195e915128f419a92cfb8bbc0f4784f10ef4112b86' + CONSUMER_PRIVATE_KEY: '0xf307e165339cb5deb2b8ec59c31a5c0a957b8e8453ce7fe8a19d9a4c8acf36d4' + RITUAL_ID: '0' jobs: networks: - name: '🔎 Lynx Testnet Example on Node ${{ matrix.node }} and ${{ matrix.os }}' + name: + '🔎 Lynx Testnet Example on Node ${{ matrix.node }} and ${{ matrix.os }}' runs-on: ${{ matrix.os }} strategy: matrix: - node: [ '18.x' ] - os: [ ubuntu-latest ] + node: ['18.x'] + os: [ubuntu-latest] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9495688d6..dfa70bb48 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,5 @@ name: CI -on: [ push, pull_request ] +on: [push, pull_request] concurrency: ${{ github.workflow }}-${{ github.ref }} @@ -9,8 +9,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node: [ '18.x', '20.x', '22.x' ] - os: [ ubuntu-latest ] + node: ['18.x', '20.x', '22.x'] + os: [ubuntu-latest] steps: - uses: actions/checkout@v4 @@ -41,7 +41,6 @@ jobs: with: # https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954/21 fail_ci_if_error: false - # TODO: Fix or replace bundlemon on CI # - name: Analyze bundle size # uses: lironer/bundlemon-action@v1 diff --git a/.github/workflows/mainnet.yml b/.github/workflows/mainnet.yml index 852fd57f1..eed5b3695 100644 --- a/.github/workflows/mainnet.yml +++ b/.github/workflows/mainnet.yml @@ -2,15 +2,15 @@ name: '🔎 Mainnet Example' on: schedule: - - cron: "0 * * * *" # Every hour + - cron: '0 * * * *' # Every hour workflow_dispatch: # TODO: Use variables when GH supports it for forks. See https://github.com/orgs/community/discussions/44322 env: - RPC_PROVIDER_URL: "https://rpc-mainnet.maticvigil.com" + RPC_PROVIDER_URL: 'https://rpc-mainnet.maticvigil.com' ENCRYPTOR_PRIVATE_KEY: ${{ secrets.MAINNET_ENCRYPTOR_PRIVATE_KEY }} CONSUMER_PRIVATE_KEY: ${{ secrets.MAINNET_CONSUMER_PRIVATE_KEY }} - RITUAL_ID: "9" + RITUAL_ID: '9' jobs: networks: @@ -19,8 +19,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node: [ '18.x' ] - os: [ ubuntu-latest ] + node: ['18.x'] + os: [ubuntu-latest] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 1fff3059f..6a5df4521 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -2,7 +2,7 @@ name: 'Test npmjs.com package' on: schedule: - - cron: "0 * * * *" # Every hour + - cron: '0 * * * *' # Every hour workflow_dispatch: jobs: @@ -10,8 +10,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [ '18.x' ] - version: [ 'latest', 'mainnet', 'devnet', 'testnet' ] + node: ['18.x'] + version: ['latest', 'mainnet', 'devnet', 'testnet'] steps: - uses: pnpm/action-setup@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5ef22b9a4..fa55a0060 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,14 +2,14 @@ name: Release on: push: branches: - - "main" + - 'main' concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: publish: name: Publish NPM package using changesets - runs-on: "ubuntu-latest" + runs-on: 'ubuntu-latest' steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 diff --git a/.github/workflows/tapir.yml b/.github/workflows/tapir.yml index 2b546a2bd..6813c8c6b 100644 --- a/.github/workflows/tapir.yml +++ b/.github/workflows/tapir.yml @@ -2,7 +2,7 @@ name: '🔎 Tapir Testnet Example' on: schedule: - - cron: "0 * * * *" # Every hour + - cron: '0 * * * *' # Every hour pull_request: branches: - main @@ -10,20 +10,21 @@ on: # TODO: Use variables when GH supports it for forks. See https://github.com/orgs/community/discussions/44322 env: - RPC_PROVIDER_URL: "https://rpc-amoy.polygon.technology" - ENCRYPTOR_PRIVATE_KEY: "0x900edb9e8214b2353f82aa195e915128f419a92cfb8bbc0f4784f10ef4112b86" - CONSUMER_PRIVATE_KEY: "0xf307e165339cb5deb2b8ec59c31a5c0a957b8e8453ce7fe8a19d9a4c8acf36d4" - RITUAL_ID: "0" + RPC_PROVIDER_URL: 'https://rpc-amoy.polygon.technology' + ENCRYPTOR_PRIVATE_KEY: '0x900edb9e8214b2353f82aa195e915128f419a92cfb8bbc0f4784f10ef4112b86' + CONSUMER_PRIVATE_KEY: '0xf307e165339cb5deb2b8ec59c31a5c0a957b8e8453ce7fe8a19d9a4c8acf36d4' + RITUAL_ID: '0' jobs: networks: - name: '🔎 Tapir Testnet Example on Node ${{ matrix.node }} and ${{ matrix.os }}' + name: + '🔎 Tapir Testnet Example on Node ${{ matrix.node }} and ${{ matrix.os }}' runs-on: ${{ matrix.os }} strategy: matrix: - node: [ '18.x' ] - os: [ ubuntu-latest ] + node: ['18.x'] + os: [ubuntu-latest] steps: - uses: actions/checkout@v4 diff --git a/demos/taco-demo/src/App.tsx b/demos/taco-demo/src/App.tsx index 05b2e4110..7fe6c9c39 100644 --- a/demos/taco-demo/src/App.tsx +++ b/demos/taco-demo/src/App.tsx @@ -13,11 +13,11 @@ import { ethers } from 'ethers'; import React, { useEffect, useState } from 'react'; import { ConditionBuilder } from './ConditionBuilder'; +import { DEFAULT_DOMAIN, DEFAULT_RITUAL_ID } from './config'; import { Decrypt } from './Decrypt'; import { Encrypt } from './Encrypt'; -import { Spinner } from './Spinner'; -import { DEFAULT_DOMAIN, DEFAULT_RITUAL_ID } from './config'; import { downloadData, getWebIrys, uploadData } from './irys'; +import { Spinner } from './Spinner'; const chainIdForDomain = { [domains.DEVNET]: 80002, @@ -78,7 +78,9 @@ export default function App() { setDecryptedMessage(''); setDecryptionErrors([]); - const encryptedMessageHex = await downloadData(encryptedMessageId) as string; + const encryptedMessageHex = (await downloadData( + encryptedMessageId, + )) as string; const encryptedMessage = ThresholdMessageKit.fromBytes( Buffer.from(encryptedMessageHex, 'hex'), ); diff --git a/demos/taco-nft-demo/src/App.tsx b/demos/taco-nft-demo/src/App.tsx index 1dd2be201..48f934dc0 100644 --- a/demos/taco-nft-demo/src/App.tsx +++ b/demos/taco-nft-demo/src/App.tsx @@ -11,11 +11,11 @@ import { useEthers } from '@usedapp/core'; import { ethers } from 'ethers'; import React, { useEffect, useState } from 'react'; +import { DEFAULT_DOMAIN, DEFAULT_RITUAL_ID } from './config'; import { Decrypt } from './Decrypt'; import { Encrypt } from './Encrypt'; import { NFTConditionBuilder } from './NFTConditionBuilder'; import { Spinner } from './Spinner'; -import { DEFAULT_DOMAIN, DEFAULT_RITUAL_ID } from './config'; const chainIdForDomain = { [domains.DEVNET]: 80002, @@ -43,7 +43,6 @@ export default function App() { switchNetwork(chainId); }, [chainId]); - const encryptMessage = async (message: string) => { if (!condition) { return; diff --git a/demos/taco-nft-demo/src/NFTConditionBuilder.tsx b/demos/taco-nft-demo/src/NFTConditionBuilder.tsx index 9f74b7de3..a4ba8c788 100644 --- a/demos/taco-nft-demo/src/NFTConditionBuilder.tsx +++ b/demos/taco-nft-demo/src/NFTConditionBuilder.tsx @@ -1,5 +1,5 @@ import { conditions } from '@nucypher/taco'; -import { Sepolia, useEthers} from '@usedapp/core'; +import { Sepolia, useEthers } from '@usedapp/core'; import React, { useState } from 'react'; interface Props { @@ -97,8 +97,8 @@ export const NFTConditionBuilder = ({

You can mint an NFT{' '} - here or use your own - contract. + here or use + your own contract.

diff --git a/demos/taco-nft-demo/tsconfig.json b/demos/taco-nft-demo/tsconfig.json index 6b7fb0d09..53ac5617c 100644 --- a/demos/taco-nft-demo/tsconfig.json +++ b/demos/taco-nft-demo/tsconfig.json @@ -6,11 +6,11 @@ "noEmit": true, "resolveJsonModule": true, "esModuleInterop": true, - "skipLibCheck": true + "skipLibCheck": true, }, "references": [ { - "path": "../../packages/taco/tsconfig.es.json" - } - ] + "path": "../../packages/taco/tsconfig.es.json", + }, + ], } diff --git a/demos/taco-nft-demo/webpack.config.js b/demos/taco-nft-demo/webpack.config.js index 11c98381e..9bbd7185b 100644 --- a/demos/taco-nft-demo/webpack.config.js +++ b/demos/taco-nft-demo/webpack.config.js @@ -33,8 +33,8 @@ module.exports = { DEFAULT_RITUAL_ID: JSON.stringify(process.env.DEFAULT_RITUAL_ID), DEFAULT_DOMAIN: JSON.stringify(process.env.DEFAULT_DOMAIN), }, - } - }) + }, + }), ].filter(Boolean), module: { rules: [ diff --git a/examples/pre/nextjs/src/app/page.tsx b/examples/pre/nextjs/src/app/page.tsx index 431db626e..6ca463030 100644 --- a/examples/pre/nextjs/src/app/page.tsx +++ b/examples/pre/nextjs/src/app/page.tsx @@ -10,7 +10,7 @@ import { toHexString, } from '@nucypher/pre'; import { ethers } from 'ethers'; -import { hexlify } from "ethers/lib/utils"; +import { hexlify } from 'ethers/lib/utils'; import { useEffect, useState } from 'react'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/examples/pre/nextjs/tsconfig.json b/examples/pre/nextjs/tsconfig.json index e59724b28..4b8fa2e46 100644 --- a/examples/pre/nextjs/tsconfig.json +++ b/examples/pre/nextjs/tsconfig.json @@ -15,13 +15,13 @@ "incremental": true, "plugins": [ { - "name": "next" - } + "name": "next", + }, ], "paths": { - "@/*": ["./src/*"] - } + "@/*": ["./src/*"], + }, }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "exclude": ["node_modules"], } diff --git a/examples/pre/nodejs/tsconfig.json b/examples/pre/nodejs/tsconfig.json index 08684819c..d956c8f11 100644 --- a/examples/pre/nodejs/tsconfig.json +++ b/examples/pre/nodejs/tsconfig.json @@ -4,11 +4,11 @@ "compilerOptions": { "outDir": "dist", "rootDir": "src", - "noEmit": true + "noEmit": true, }, "references": [ { - "path": "../../../packages/pre/tsconfig.cjs.json" - } - ] + "path": "../../../packages/pre/tsconfig.cjs.json", + }, + ], } diff --git a/examples/pre/react/src/App.tsx b/examples/pre/react/src/App.tsx index dbc9faeb6..0afa5e7fe 100644 --- a/examples/pre/react/src/App.tsx +++ b/examples/pre/react/src/App.tsx @@ -9,7 +9,7 @@ import { toHexString, } from '@nucypher/pre'; import { ethers } from 'ethers'; -import { hexlify } from "ethers/lib/utils"; +import { hexlify } from 'ethers/lib/utils'; import { useEffect, useState } from 'react'; function App() { diff --git a/examples/pre/react/tsconfig.json b/examples/pre/react/tsconfig.json index 9d379a3c4..aca306ec8 100644 --- a/examples/pre/react/tsconfig.json +++ b/examples/pre/react/tsconfig.json @@ -14,7 +14,7 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react-jsx" + "jsx": "react-jsx", }, - "include": ["src"] + "include": ["src"], } diff --git a/examples/pre/webpack-5/tsconfig.json b/examples/pre/webpack-5/tsconfig.json index e0e8b8a09..e6944705f 100644 --- a/examples/pre/webpack-5/tsconfig.json +++ b/examples/pre/webpack-5/tsconfig.json @@ -4,11 +4,11 @@ "compilerOptions": { "esModuleInterop": true, "skipLibCheck": true, - "noEmit": true + "noEmit": true, }, "references": [ { - "path": "../../../packages/pre/tsconfig.es.json" - } - ] + "path": "../../../packages/pre/tsconfig.es.json", + }, + ], } diff --git a/examples/taco/nextjs/src/app/layout.tsx b/examples/taco/nextjs/src/app/layout.tsx index a048075ad..f00aeecb5 100644 --- a/examples/taco/nextjs/src/app/layout.tsx +++ b/examples/taco/nextjs/src/app/layout.tsx @@ -1,6 +1,6 @@ import type { Metadata } from 'next'; import { Inter } from 'next/font/google'; -import '../../styles/global.css' +import '../../styles/global.css'; const inter = Inter({ subsets: ['latin'] }); diff --git a/examples/taco/nextjs/src/app/page.tsx b/examples/taco/nextjs/src/app/page.tsx index 2fe2a84bf..fd5771efe 100644 --- a/examples/taco/nextjs/src/app/page.tsx +++ b/examples/taco/nextjs/src/app/page.tsx @@ -1,14 +1,12 @@ 'use client'; -import {fromHexString} from "@nucypher/shared"; -import {conditions, domains, fromBytes, toHexString} from '@nucypher/taco'; -import {ethers} from 'ethers'; -import {hexlify} from 'ethers/lib/utils'; -import {useEffect, useState} from 'react'; +import { fromHexString } from '@nucypher/shared'; +import { conditions, domains, fromBytes, toHexString } from '@nucypher/taco'; +import { ethers } from 'ethers'; +import { hexlify } from 'ethers/lib/utils'; +import { useEffect, useState } from 'react'; import useTaco from '../hooks/useTaco'; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any declare const window: any; @@ -19,12 +17,10 @@ function App() { const [provider, setProvider] = useState< ethers.providers.Web3Provider | undefined >(); - const [message, setMessage] = useState('this is a secret') - const [encrypting, setEncrypting] = useState(false) - const [encryptedText, setEncryptedText] = useState( - '', - ); - const [decrypting, setDecrypting] = useState(false) + const [message, setMessage] = useState('this is a secret'); + const [encrypting, setEncrypting] = useState(false); + const [encryptedText, setEncryptedText] = useState(''); + const [decrypting, setDecrypting] = useState(false); const [decryptedMessage, setDecryptedMessage] = useState( '', ); @@ -87,18 +83,18 @@ function App() { signer, ); if (encryptedBytes) { - setEncryptedText(toHexString(encryptedBytes)) + setEncryptedText(toHexString(encryptedBytes)); } } catch (e) { - console.log(e) + console.log(e); } - setEncrypting(false) - } + setEncrypting(false); + }; const decryptMessage = async () => { - if(!encryptedText || !provider) return + if (!encryptedText || !provider) return; try { - setDecrypting(true) + setDecrypting(true); const signer = provider.getSigner(); console.log('Decrypting message...'); @@ -110,15 +106,32 @@ function App() { setDecryptedMessage(fromBytes(decryptedMessage)); } } catch (e) { - console.log(e) + console.log(e); } - setDecrypting(false) + setDecrypting(false); }; return (
-

Secret message: setMessage(e.target.value)} onClick={encryptMessage}/> {encrypting && 'Encrypting...'}

-

Encrypted message: setEncryptedText(e.target.value)} /> {decrypting && 'Decrypting...'}

+

+ Secret message:{' '} + setMessage(e.target.value)} + onClick={encryptMessage} + />{' '} + {' '} + {encrypting && 'Encrypting...'} +

+

+ Encrypted message:{' '} + setEncryptedText(e.target.value)} + />{' '} + {' '} + {decrypting && 'Decrypting...'} +

{decryptedMessage &&

Decrypted message: {decryptedMessage}

}
); diff --git a/examples/taco/nextjs/tsconfig.build.json b/examples/taco/nextjs/tsconfig.build.json index 22ff2bd0b..beb822b78 100644 --- a/examples/taco/nextjs/tsconfig.build.json +++ b/examples/taco/nextjs/tsconfig.build.json @@ -9,6 +9,9 @@ "references": [ { "path": "../../../packages/taco/tsconfig.es.json" + }, + { + "path": "../../../packages/taco-auth/tsconfig.es.json" } ] } diff --git a/examples/taco/nextjs/tsconfig.json b/examples/taco/nextjs/tsconfig.json index e59724b28..4b8fa2e46 100644 --- a/examples/taco/nextjs/tsconfig.json +++ b/examples/taco/nextjs/tsconfig.json @@ -15,13 +15,13 @@ "incremental": true, "plugins": [ { - "name": "next" - } + "name": "next", + }, ], "paths": { - "@/*": ["./src/*"] - } + "@/*": ["./src/*"], + }, }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "exclude": ["node_modules"], } diff --git a/examples/taco/nodejs/tsconfig.json b/examples/taco/nodejs/tsconfig.json index aeb9f0525..50ed3c7ac 100644 --- a/examples/taco/nodejs/tsconfig.json +++ b/examples/taco/nodejs/tsconfig.json @@ -4,11 +4,11 @@ "compilerOptions": { "outDir": "dist", "rootDir": "src", - "noEmit": true + "noEmit": true, }, "references": [ { - "path": "../../../packages/taco/tsconfig.cjs.json" - } - ] + "path": "../../../packages/taco/tsconfig.cjs.json", + }, + ], } diff --git a/examples/taco/react/src/App.tsx b/examples/taco/react/src/App.tsx index 6050685b5..481b856fd 100644 --- a/examples/taco/react/src/App.tsx +++ b/examples/taco/react/src/App.tsx @@ -1,8 +1,8 @@ -import {fromHexString} from "@nucypher/shared"; -import {conditions, domains, fromBytes, toHexString} from '@nucypher/taco'; -import {ethers} from 'ethers'; -import {hexlify} from 'ethers/lib/utils'; -import {useEffect, useState} from 'react'; +import { fromHexString } from '@nucypher/shared'; +import { conditions, domains, fromBytes, toHexString } from '@nucypher/taco'; +import { ethers } from 'ethers'; +import { hexlify } from 'ethers/lib/utils'; +import { useEffect, useState } from 'react'; import useTaco from './hooks/useTaco'; @@ -16,12 +16,10 @@ function App() { const [provider, setProvider] = useState< ethers.providers.Web3Provider | undefined >(); - const [message, setMessage] = useState('this is a secret') - const [encrypting, setEncrypting] = useState(false) - const [encryptedText, setEncryptedText] = useState( - '', - ); - const [decrypting, setDecrypting] = useState(false) + const [message, setMessage] = useState('this is a secret'); + const [encrypting, setEncrypting] = useState(false); + const [encryptedText, setEncryptedText] = useState(''); + const [decrypting, setDecrypting] = useState(false); const [decryptedMessage, setDecryptedMessage] = useState( '', ); @@ -84,13 +82,13 @@ function App() { signer, ); if (encryptedBytes) { - setEncryptedText(toHexString(encryptedBytes)) + setEncryptedText(toHexString(encryptedBytes)); } } catch (e) { - console.log(e) + console.log(e); } - setEncrypting(false) - } + setEncrypting(false); + }; const decryptMessage = async () => { if (!encryptedText || !provider) { @@ -109,15 +107,32 @@ function App() { setDecryptedMessage(fromBytes(decryptedMessage)); } } catch (e) { - console.log(e) + console.log(e); } - setDecrypting(false) + setDecrypting(false); }; return (
-

Secret message: setMessage(e.target.value)} onClick={encryptMessage}/> {encrypting && 'Encrypting...'}

-

Encrypted message: setEncryptedText(e.target.value)} /> {decrypting && 'Decrypting...'}

+

+ Secret message:{' '} + setMessage(e.target.value)} + onClick={encryptMessage} + />{' '} + {' '} + {encrypting && 'Encrypting...'} +

+

+ Encrypted message:{' '} + setEncryptedText(e.target.value)} + />{' '} + {' '} + {decrypting && 'Decrypting...'} +

{decryptedMessage &&

Decrypted message: {decryptedMessage}

}
); diff --git a/examples/taco/react/src/index.tsx b/examples/taco/react/src/index.tsx index 253d3f9b3..3f83eeaea 100644 --- a/examples/taco/react/src/index.tsx +++ b/examples/taco/react/src/index.tsx @@ -1,8 +1,8 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; -import './index.css' import App from './App'; +import './index.css'; const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement, diff --git a/examples/taco/react/tsconfig.json b/examples/taco/react/tsconfig.json index 9d379a3c4..aca306ec8 100644 --- a/examples/taco/react/tsconfig.json +++ b/examples/taco/react/tsconfig.json @@ -14,7 +14,7 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react-jsx" + "jsx": "react-jsx", }, - "include": ["src"] + "include": ["src"], } diff --git a/examples/taco/webpack-5/src/index.html b/examples/taco/webpack-5/src/index.html index ad1f3fd35..6aaef3537 100644 --- a/examples/taco/webpack-5/src/index.html +++ b/examples/taco/webpack-5/src/index.html @@ -8,7 +8,8 @@ + javascript in your browser.

Check console for results

diff --git a/examples/taco/webpack-5/tsconfig.json b/examples/taco/webpack-5/tsconfig.json index f651a6051..8ee7f0a76 100644 --- a/examples/taco/webpack-5/tsconfig.json +++ b/examples/taco/webpack-5/tsconfig.json @@ -4,11 +4,11 @@ "compilerOptions": { "esModuleInterop": true, "skipLibCheck": true, - "noEmit": true + "noEmit": true, }, "references": [ { - "path": "../../../packages/taco/tsconfig.es.json" - } - ] + "path": "../../../packages/taco/tsconfig.es.json", + }, + ], } diff --git a/package.json b/package.json index 2b554a767..ab989994d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ }, "dependencies": { "@changesets/cli": "^2.26.2", - "@nucypher/nucypher-core": "*" + "@nucypher/nucypher-core": "*", + "ethers": "^5.7.2" }, "devDependencies": { "@skypack/package-check": "^0.2.2", diff --git a/packages/pre/.eslintrc.js b/packages/pre/.eslintrc.js index 831288f9c..5ae4943e5 100644 --- a/packages/pre/.eslintrc.js +++ b/packages/pre/.eslintrc.js @@ -1,5 +1,5 @@ -const baseConfig = require('../../.eslintrc.js') +const baseConfig = require('../../.eslintrc.js'); module.exports = { ...baseConfig, -} +}; diff --git a/packages/pre/tsconfig.cjs.json b/packages/pre/tsconfig.cjs.json index 035a2ab62..32dded0e5 100644 --- a/packages/pre/tsconfig.cjs.json +++ b/packages/pre/tsconfig.cjs.json @@ -2,6 +2,6 @@ "extends": "./tsconfig.es.json", "compilerOptions": { "outDir": "dist/cjs", - "module": "CommonJS", + "module": "CommonJS" } } diff --git a/packages/pre/tsconfig.json b/packages/pre/tsconfig.json index 935974c35..3b6264c31 100644 --- a/packages/pre/tsconfig.json +++ b/packages/pre/tsconfig.json @@ -3,11 +3,11 @@ "include": ["src", "test"], "compilerOptions": { "esModuleInterop": true, - "skipLibCheck": true + "skipLibCheck": true, }, "references": [ { - "path": "../test-utils/tsconfig.es.json" - } - ] + "path": "../test-utils/tsconfig.es.json", + }, + ], } diff --git a/packages/shared/package.json b/packages/shared/package.json index 621f97aa2..950bc6d30 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -46,7 +46,7 @@ "@nucypher/nucypher-core": "*", "axios": "^1.6.8", "deep-equal": "^2.2.3", - "ethers": "^5.7.2", + "ethers": "*", "qs": "^6.12.1" }, "devDependencies": { diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index 8336571c0..0c3f3ec10 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json @@ -4,6 +4,6 @@ "compilerOptions": { "esModuleInterop": true, "skipLibCheck": true, - "resolveJsonModule": true - } + "resolveJsonModule": true, + }, } diff --git a/packages/taco-auth/.eslintrc.js b/packages/taco-auth/.eslintrc.js new file mode 100644 index 000000000..5ae4943e5 --- /dev/null +++ b/packages/taco-auth/.eslintrc.js @@ -0,0 +1,5 @@ +const baseConfig = require('../../.eslintrc.js'); + +module.exports = { + ...baseConfig, +}; diff --git a/packages/taco-auth/LICENSE b/packages/taco-auth/LICENSE new file mode 100644 index 000000000..2fb2e74d8 --- /dev/null +++ b/packages/taco-auth/LICENSE @@ -0,0 +1,675 @@ +### GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +### Preamble + +The GNU General Public License is a free, copyleft license for +software and other kinds of works. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom +to share and change all versions of a program--to make sure it remains +free software for all its users. We, the Free Software Foundation, use +the GNU General Public License for most of our software; it applies +also to any other work released this way by its authors. You can apply +it to your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you +have certain responsibilities if you distribute copies of the +software, or if you modify it: responsibilities to respect the freedom +of others. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the +manufacturer can do so. This is fundamentally incompatible with the +aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for +individuals to use, which is precisely where it is most unacceptable. +Therefore, we have designed this version of the GPL to prohibit the +practice for those products. If such problems arise substantially in +other domains, we stand ready to extend this provision to those +domains in future versions of the GPL, as needed to protect the +freedom of users. + +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish +to avoid the special danger that patents applied to a free program +could make it effectively proprietary. To prevent this, the GPL +assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and +modification follow. + +### TERMS AND CONDITIONS + +#### 0. Definitions. + +"This License" refers to version 3 of the GNU General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a "modified version" of +the earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based +on the Program. + +To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays "Appropriate Legal Notices" to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +#### 1. Source Code. + +The "source code" for a work means the preferred form of the work for +making modifications to it. "Object code" means any non-source form of +a work. + +A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +#### 2. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 makes +it unnecessary. + +#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +#### 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +#### 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + +- a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. +- b) The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in section 4 + to "keep intact all notices". +- c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +- d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +#### 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + +- a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +- b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the Corresponding + Source from a network server at no charge. +- c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +- d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +- e) Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the general + public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +"normally used" refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +#### 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + +- a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +- b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +- c) Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +- d) Limiting the use for publicity purposes of names of licensors + or authors of the material; or +- e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +- f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions + of it) with contractual assumptions of liability to the recipient, + for any liability that these contractual assumptions directly + impose on those licensors and authors. + +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +#### 8. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +#### 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +#### 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +#### 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is "discriminatory" if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +#### 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree to +terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +#### 13. Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + +#### 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU General Public +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that numbered version or +of any later version published by the Free Software Foundation. If the +Program does not specify a version number of the GNU General Public +License, you may choose any version ever published by the Free +Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU General Public License can be used, that proxy's public +statement of acceptance of a version permanently authorizes you to +choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +#### 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +#### 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +#### 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +### How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively state +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper +mail. + +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands \`show w' and \`show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + +You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + +The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . diff --git a/packages/taco-auth/README.md b/packages/taco-auth/README.md new file mode 100644 index 000000000..e01eed427 --- /dev/null +++ b/packages/taco-auth/README.md @@ -0,0 +1,3 @@ +# `@nucypher/taco-auth` + +## [`nucypher/taco-web`](../../README.md) diff --git a/packages/taco-auth/package.json b/packages/taco-auth/package.json new file mode 100644 index 000000000..9b431a258 --- /dev/null +++ b/packages/taco-auth/package.json @@ -0,0 +1,52 @@ +{ + "name": "@nucypher/taco-auth", + "version": "0.0.0", + "keywords": [ + "pre", + "threshold", + "access control", + "authentication" + ], + "repository": { + "type": "git", + "url": "https://github.com/nucypher/taco-web" + }, + "license": "GPL-3.0-only", + "author": "Piotr Roslaniec ", + "exports": { + ".": { + "import": "./dist/es/index.js", + "require": "./dist/cjs/index.js" + } + }, + "main": "./dist/cjs/index.js", + "module": "./dist/es/index.js", + "types": "./dist/cjs/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "prebuild": "pnpm clean", + "build": "pnpm build:module && pnpm build:cjs", + "build:cjs": "tsc --build ./tsconfig.cjs.json --verbose", + "build:module": "tsc --build ./tsconfig.es.json --verbose", + "clean": "rm -rf dist", + "exports:lint": "ts-unused-exports tsconfig.json --ignoreFiles src/index.ts", + "lint": "eslint --ext .ts src test", + "lint:fix": "pnpm lint --fix", + "package-check": "package-check", + "test": "vitest run", + "typedoc": "typedoc" + }, + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@nucypher/shared": "workspace:*" + }, + "devDependencies": { + "@nucypher/test-utils": "workspace:*" + }, + "engines": { + "node": ">=18", + "pnpm": ">=8.0.0" + } +} diff --git a/packages/taco/src/conditions/context/providers.ts b/packages/taco-auth/src/eip712.ts similarity index 88% rename from packages/taco/src/conditions/context/providers.ts rename to packages/taco-auth/src/eip712.ts index 4b6c8f43a..1b7b2264a 100644 --- a/packages/taco/src/conditions/context/providers.ts +++ b/packages/taco-auth/src/eip712.ts @@ -2,7 +2,31 @@ import type { TypedDataSigner } from '@ethersproject/abstract-signer'; import { ethers } from 'ethers'; import { utils as ethersUtils } from 'ethers/lib/ethers'; -import { Eip712TypedData, FormattedTypedData } from '../../web3'; +export interface Eip712TypedData { + types: { + Wallet: { name: string; type: string }[]; + }; + domain: { + salt: string; + chainId: number; + name: string; + version: string; + }; + message: { + blockHash: string; + address: string; + blockNumber: number; + signatureText: string; + }; +} + +export interface FormattedTypedData extends Eip712TypedData { + primaryType: 'Wallet'; + types: { + EIP712Domain: { name: string; type: string }[]; + Wallet: { name: string; type: string }[]; + }; +} export interface TypedSignature { signature: string; diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts new file mode 100644 index 000000000..fec9f529c --- /dev/null +++ b/packages/taco-auth/src/index.ts @@ -0,0 +1 @@ +export * from './eip712'; diff --git a/packages/taco-auth/test/hello.test.ts b/packages/taco-auth/test/hello.test.ts new file mode 100644 index 000000000..40c6b8b9a --- /dev/null +++ b/packages/taco-auth/test/hello.test.ts @@ -0,0 +1,7 @@ +import { describe, expect, it } from 'vitest'; + +describe('hello', () => { + it('hello-world', async () => { + expect('hello').toBe('hello'); + }); +}); diff --git a/packages/taco-auth/tsconfig.cjs.json b/packages/taco-auth/tsconfig.cjs.json new file mode 100644 index 000000000..32dded0e5 --- /dev/null +++ b/packages/taco-auth/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.es.json", + "compilerOptions": { + "outDir": "dist/cjs", + "module": "CommonJS" + } +} diff --git a/packages/taco-auth/tsconfig.es.json b/packages/taco-auth/tsconfig.es.json new file mode 100644 index 000000000..2ffa9192c --- /dev/null +++ b/packages/taco-auth/tsconfig.es.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "include": ["src"], + "compilerOptions": { + "outDir": "dist/es", + "rootDir": "src", + "module": "ES2022", + "target": "ES2022" + } +} diff --git a/packages/taco-auth/tsconfig.json b/packages/taco-auth/tsconfig.json new file mode 100644 index 000000000..3b6264c31 --- /dev/null +++ b/packages/taco-auth/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src", "test"], + "compilerOptions": { + "esModuleInterop": true, + "skipLibCheck": true, + }, + "references": [ + { + "path": "../test-utils/tsconfig.es.json", + }, + ], +} diff --git a/packages/taco-auth/typedoc.json b/packages/taco-auth/typedoc.json new file mode 100644 index 000000000..e0346b370 --- /dev/null +++ b/packages/taco-auth/typedoc.json @@ -0,0 +1,5 @@ +{ + "extends": ["../../typedoc.base.json"], + "entryPoints": ["src/index.ts"], + "name": "@nucypher/taco-auth" +} diff --git a/packages/taco/package.json b/packages/taco/package.json index 97c332da3..db3e4e442 100644 --- a/packages/taco/package.json +++ b/packages/taco/package.json @@ -39,10 +39,10 @@ "typedoc": "typedoc" }, "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", "@nucypher/nucypher-core": "*", "@nucypher/shared": "workspace:*", - "ethers": "^5.7.2", + "@nucypher/taco-auth": "workspace:*", + "ethers": "*", "semver": "^7.5.2", "zod": "^3.22.4" }, diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index bbd86872f..f0564b6e5 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,5 +1,9 @@ import { Context, Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { fromJSON, toJSON } from '@nucypher/shared'; +import { + TypedSignature, + WalletAuthenticationProvider, +} from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { CompoundConditionType } from '../compound-condition'; @@ -12,8 +16,6 @@ import { USER_ADDRESS_PARAM, } from '../const'; -import { TypedSignature, WalletAuthenticationProvider } from './providers'; - export type CustomContextParam = string | number | boolean; export type ContextParam = CustomContextParam | TypedSignature; diff --git a/packages/taco/src/web3.ts b/packages/taco/src/web3.ts deleted file mode 100644 index f8923626b..000000000 --- a/packages/taco/src/web3.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface Eip712TypedData { - types: { - Wallet: { name: string; type: string }[]; - }; - domain: { - salt: string; - chainId: number; - name: string; - version: string; - }; - message: { - blockHash: string; - address: string; - blockNumber: number; - signatureText: string; - }; -} - -export interface FormattedTypedData extends Eip712TypedData { - primaryType: 'Wallet'; - types: { - EIP712Domain: { name: string; type: string }[]; - Wallet: { name: string; type: string }[]; - }; -} diff --git a/packages/taco/tsconfig.json b/packages/taco/tsconfig.json index 14f758389..b21614e23 100644 --- a/packages/taco/tsconfig.json +++ b/packages/taco/tsconfig.json @@ -3,11 +3,11 @@ "include": ["src", "test", "examples"], "compilerOptions": { "esModuleInterop": true, - "skipLibCheck": true + "skipLibCheck": true, }, "references": [ { - "path": "../shared/tsconfig.es.json" - } - ] + "path": "../shared/tsconfig.es.json", + }, + ], } diff --git a/packages/test-utils/.eslintrc.js b/packages/test-utils/.eslintrc.js index 831288f9c..5ae4943e5 100644 --- a/packages/test-utils/.eslintrc.js +++ b/packages/test-utils/.eslintrc.js @@ -1,5 +1,5 @@ -const baseConfig = require('../../.eslintrc.js') +const baseConfig = require('../../.eslintrc.js'); module.exports = { ...baseConfig, -} +}; diff --git a/packages/test-utils/tsconfig.cjs.json b/packages/test-utils/tsconfig.cjs.json index 035a2ab62..32dded0e5 100644 --- a/packages/test-utils/tsconfig.cjs.json +++ b/packages/test-utils/tsconfig.cjs.json @@ -2,6 +2,6 @@ "extends": "./tsconfig.es.json", "compilerOptions": { "outDir": "dist/cjs", - "module": "CommonJS", + "module": "CommonJS" } } diff --git a/packages/test-utils/tsconfig.json b/packages/test-utils/tsconfig.json index 0d2507890..47bb9e178 100644 --- a/packages/test-utils/tsconfig.json +++ b/packages/test-utils/tsconfig.json @@ -7,7 +7,7 @@ }, "references": [ { - "path": "../shared/tsconfig.es.json" - } - ] + "path": "../shared/tsconfig.es.json", + }, + ], } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 63133b4e2..2645fd7d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,9 @@ importers: '@nucypher/nucypher-core': specifier: ^0.14.5 version: 0.14.5 + ethers: + specifier: ^5.7.2 + version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) devDependencies: '@skypack/package-check': specifier: ^0.2.2 @@ -504,7 +507,7 @@ importers: specifier: ^2.2.3 version: 2.2.3 ethers: - specifier: ^5.7.2 + specifier: '*' version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) qs: specifier: ^6.12.1 @@ -534,17 +537,17 @@ importers: packages/taco: dependencies: - '@ethersproject/abstract-signer': - specifier: ^5.7.0 - version: 5.7.0 '@nucypher/nucypher-core': specifier: ^0.14.5 version: 0.14.5 '@nucypher/shared': specifier: workspace:* version: link:../shared + '@nucypher/taco-auth': + specifier: workspace:* + version: link:../taco-auth ethers: - specifier: ^5.7.2 + specifier: '*' version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) semver: specifier: ^7.5.2 @@ -560,6 +563,19 @@ importers: specifier: ^7.5.6 version: 7.5.8 + packages/taco-auth: + dependencies: + '@ethersproject/abstract-signer': + specifier: ^5.7.0 + version: 5.7.0 + '@nucypher/shared': + specifier: workspace:* + version: link:../shared + devDependencies: + '@nucypher/test-utils': + specifier: workspace:* + version: link:../test-utils + packages/test-utils: dependencies: '@nucypher/nucypher-core': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f4b55b628..99e0a94ab 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,5 @@ prefer-workspace-packages: true packages: - - "demos/**/*" - - "examples/**/*" - - "packages/**/*" + - 'demos/**/*' + - 'examples/**/*' + - 'packages/**/*' diff --git a/tsconfig.json b/tsconfig.json index bf242524e..0b875ba67 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "declaration": true, - "lib": [ - "ES2018", - "dom" - ], + "lib": ["ES2018", "dom"], "module": "CommonJS", "moduleResolution": "node", "strict": true, @@ -13,15 +10,8 @@ "composite": true, "incremental": true, "exactOptionalPropertyTypes": true, - "noImplicitOverride": true + "noImplicitOverride": true, }, - "include": [ - "**/*.ts", - "**/*.js", - "**/.*.js", - "scripts/.common.ts" - ], - "exclude": [ - "**/node_modules" - ] + "include": ["**/*.ts", "**/*.js", "**/.*.js", "scripts/.common.ts"], + "exclude": ["**/node_modules"], } diff --git a/tsconfig.prod.json b/tsconfig.prod.json index ee8a4270a..4d2c35c60 100644 --- a/tsconfig.prod.json +++ b/tsconfig.prod.json @@ -1,9 +1,7 @@ { "compilerOptions": { "declaration": true, - "lib": [ - "ES2018" - ], + "lib": ["ES2018"], "module": "CommonJS", "moduleResolution": "node", "strict": true, @@ -28,6 +26,12 @@ { "path": "./packages/pre/tsconfig.cjs.json" }, + { + "path": "./packages/taco-auth/tsconfig.es.json" + }, + { + "path": "./packages/taco-auth/tsconfig.cjs.json" + }, { "path": "./packages/taco/tsconfig.es.json" }, diff --git a/typedoc.base.json b/typedoc.base.json index efd393cf9..e31d04e1a 100644 --- a/typedoc.base.json +++ b/typedoc.base.json @@ -6,9 +6,5 @@ "typedoc-plugin-missing-exports", "typedoc-plugin-coverage" ], - "exclude": [ - "**/node_modules/**/*", - "**/test/**/*", - "**/dist/**/*" - ] + "exclude": ["**/node_modules/**/*", "**/test/**/*", "**/dist/**/*"] } diff --git a/typedoc.json b/typedoc.json index c6a210594..14547f69c 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,10 +1,6 @@ { "extends": ["./typedoc.base.json"], - "entryPoints": [ - "packages/pre", - "packages/shared", - "packages/taco" - ], + "entryPoints": ["packages/pre", "packages/shared", "packages/taco"], "entryPointStrategy": "packages", "name": "@nucypher/taco-web" } From ec5ce9ac779d3670f652e35d93171507cd011655 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 8 May 2024 14:08:41 +0200 Subject: [PATCH 02/75] rewrite eip712 auth --- packages/taco-auth/src/eip712.ts | 86 ++++++++----------- packages/taco-auth/src/storage.ts | 44 ++++++++++ .../taco/src/conditions/context/context.ts | 13 ++- 3 files changed, 85 insertions(+), 58 deletions(-) create mode 100644 packages/taco-auth/src/storage.ts diff --git a/packages/taco-auth/src/eip712.ts b/packages/taco-auth/src/eip712.ts index 1b7b2264a..de4a64b1c 100644 --- a/packages/taco-auth/src/eip712.ts +++ b/packages/taco-auth/src/eip712.ts @@ -2,7 +2,9 @@ import type { TypedDataSigner } from '@ethersproject/abstract-signer'; import { ethers } from 'ethers'; import { utils as ethersUtils } from 'ethers/lib/ethers'; -export interface Eip712TypedData { +import { LocalStorage } from './storage'; + +interface Eip712 { types: { Wallet: { name: string; type: string }[]; }; @@ -20,7 +22,7 @@ export interface Eip712TypedData { }; } -export interface FormattedTypedData extends Eip712TypedData { +interface FormattedEip712 extends Eip712 { primaryType: 'Wallet'; types: { EIP712Domain: { name: string; type: string }[]; @@ -28,9 +30,9 @@ export interface FormattedTypedData extends Eip712TypedData { }; } -export interface TypedSignature { +interface TypedSignature { signature: string; - typedData: Eip712TypedData; + typedData: Eip712; address: string; } @@ -40,47 +42,48 @@ interface ChainData { blockNumber: number; } -export class WalletAuthenticationProvider { - private walletSignature?: Record; +const EIP712Domain = [ + { + name: 'name', + type: 'string', + }, + { + name: 'version', + type: 'string', + }, + { + name: 'chainId', + type: 'uint256', + }, + { + name: 'salt', + type: 'bytes32', + }, +]; + +export class EIP712SignatureProvider { + private readonly storage: LocalStorage; constructor( private readonly provider: ethers.providers.Provider, private readonly signer: ethers.Signer, - ) {} + ) { + this.storage = new LocalStorage(); + } public async getOrCreateWalletSignature(): Promise { const address = await this.signer.getAddress(); - const storageKey = `wallet-signature-${address}`; + const storageKey = `eip712-signature-${address}`; // If we have a signature in localStorage, return it - const isLocalStorage = typeof localStorage !== 'undefined'; - if (isLocalStorage) { - const maybeSignature = localStorage.getItem(storageKey); - if (maybeSignature) { - return JSON.parse(maybeSignature); - } - } - - // If not, try returning from memory - const maybeSignature = this.walletSignature?.[address]; + const maybeSignature = this.storage.getItem(storageKey); if (maybeSignature) { - if (isLocalStorage) { - localStorage.setItem(storageKey, maybeSignature); - } return JSON.parse(maybeSignature); } // If at this point we didn't return, we need to create a new signature const typedSignature = await this.createWalletSignature(); - - // Persist where you can - if (isLocalStorage) { - localStorage.setItem(storageKey, JSON.stringify(typedSignature)); - } - if (!this.walletSignature) { - this.walletSignature = {}; - } - this.walletSignature[address] = JSON.stringify(typedSignature); + this.storage.setItem(storageKey, JSON.stringify(typedSignature)); return typedSignature; } @@ -91,7 +94,7 @@ export class WalletAuthenticationProvider { const signatureText = `I'm the owner of address ${address} as of block number ${blockNumber}`; const salt = ethersUtils.hexlify(ethersUtils.randomBytes(32)); - const typedData: Eip712TypedData = { + const typedData: Eip712 = { types: { Wallet: [ { name: 'address', type: 'address' }, @@ -118,29 +121,12 @@ export class WalletAuthenticationProvider { this.signer as unknown as TypedDataSigner )._signTypedData(typedData.domain, typedData.types, typedData.message); - const formattedTypedData: FormattedTypedData = { + const formattedTypedData: FormattedEip712 = { ...typedData, primaryType: 'Wallet', types: { ...typedData.types, - EIP712Domain: [ - { - name: 'name', - type: 'string', - }, - { - name: 'version', - type: 'string', - }, - { - name: 'chainId', - type: 'uint256', - }, - { - name: 'salt', - type: 'bytes32', - }, - ], + EIP712Domain, }, }; return { signature, typedData: formattedTypedData, address }; diff --git a/packages/taco-auth/src/storage.ts b/packages/taco-auth/src/storage.ts new file mode 100644 index 000000000..764fb0584 --- /dev/null +++ b/packages/taco-auth/src/storage.ts @@ -0,0 +1,44 @@ +interface IStorage { + getItem(key: string): string | null; + + setItem(key: string, value: string): void; +} + +class BrowserStorage implements IStorage { + getItem(key: string): string | null { + return localStorage.getItem(key); + } + + setItem(key: string, value: string): void { + localStorage.setItem(key, value); + } +} + + +class NodeStorage implements IStorage { + private storage: Record = {}; + + getItem(key: string): string | null { + return this.storage[key] || null; + } + + setItem(key: string, value: string): void { + this.storage[key] = value; + } +} + +export class LocalStorage { + private storage: IStorage; + + constructor() { + this.storage = typeof localStorage === 'undefined' ? new NodeStorage() : new BrowserStorage(); + } + + getItem(key: string): string | null { + return this.storage.getItem(key); + } + + setItem(key: string, value: string): void { + this.storage.setItem(key, value); + } +} diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index f0564b6e5..949bf7f08 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,9 +1,6 @@ import { Context, Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { fromJSON, toJSON } from '@nucypher/shared'; -import { - TypedSignature, - WalletAuthenticationProvider, -} from '@nucypher/taco-auth'; +import { EIP712SignatureProvider, TypedSignature } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { CompoundConditionType } from '../compound-condition'; @@ -30,7 +27,7 @@ const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => `Unknown custom context parameter(s): ${params.join(', ')}`; export class ConditionContext { - private readonly walletAuthProvider?: WalletAuthenticationProvider; + private readonly eip712SignatureProvider?: EIP712SignatureProvider; constructor( private readonly provider: ethers.providers.Provider, @@ -39,7 +36,7 @@ export class ConditionContext { private readonly signer?: ethers.Signer, ) { if (this.signer) { - this.walletAuthProvider = new WalletAuthenticationProvider( + this.eip712SignatureProvider = new EIP712SignatureProvider( this.provider, this.signer, ); @@ -99,11 +96,11 @@ export class ConditionContext { // Fill in predefined context parameters if (requestedParameters.has(USER_ADDRESS_PARAM)) { - if (!this.walletAuthProvider) { + if (!this.eip712SignatureProvider) { throw new Error(ERR_SIGNER_REQUIRED); } parameters[USER_ADDRESS_PARAM] = - await this.walletAuthProvider.getOrCreateWalletSignature(); + await this.eip712SignatureProvider.getOrCreateWalletSignature(); // Remove from requested parameters requestedParameters.delete(USER_ADDRESS_PARAM); } From b57e3b956e3cc22f424532efcc0bbd19f426ea3d Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 4 Jun 2024 13:54:26 +0200 Subject: [PATCH 03/75] chore: fix build errors --- packages/taco-auth/src/eip712.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taco-auth/src/eip712.ts b/packages/taco-auth/src/eip712.ts index de4a64b1c..a1b397d9c 100644 --- a/packages/taco-auth/src/eip712.ts +++ b/packages/taco-auth/src/eip712.ts @@ -30,7 +30,7 @@ interface FormattedEip712 extends Eip712 { }; } -interface TypedSignature { +export interface TypedSignature { signature: string; typedData: Eip712; address: string; From e6de3e3948dc9877129f60717507a2ed7a1c3c39 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 15 May 2024 12:06:32 +0200 Subject: [PATCH 04/75] add a sketch of siwe provider --- packages/taco-auth/package.json | 1 + packages/taco-auth/src/eip4361.ts | 60 + packages/taco-auth/src/storage.ts | 6 +- packages/taco-auth/test/did.test.ts | 33 + packages/taco-auth/test/hello.test.ts | 7 - packages/taco-auth/tsconfig.json | 8 +- pnpm-lock.yaml | 2916 +++++++++++++------------ 7 files changed, 1585 insertions(+), 1446 deletions(-) create mode 100644 packages/taco-auth/src/eip4361.ts create mode 100644 packages/taco-auth/test/did.test.ts delete mode 100644 packages/taco-auth/test/hello.test.ts diff --git a/packages/taco-auth/package.json b/packages/taco-auth/package.json index 9b431a258..aaa56ea6d 100644 --- a/packages/taco-auth/package.json +++ b/packages/taco-auth/package.json @@ -39,6 +39,7 @@ "typedoc": "typedoc" }, "dependencies": { + "@didtools/cacao": "^3.0.1", "@ethersproject/abstract-signer": "^5.7.0", "@nucypher/shared": "workspace:*" }, diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts new file mode 100644 index 000000000..9e1e0d828 --- /dev/null +++ b/packages/taco-auth/src/eip4361.ts @@ -0,0 +1,60 @@ +import { SiweMessage } from '@didtools/cacao'; +import { ethers } from 'ethers'; + +import { LocalStorage } from './storage'; + +export class EIP4361SignatureProvider { + private readonly storage: LocalStorage; + + constructor( + private readonly provider: ethers.providers.Provider, + private readonly signer: ethers.Signer, + ) { + this.storage = new LocalStorage(); + } + + public async getOrCreateSignInMessage(): Promise { + const address = await this.signer.getAddress(); + const storageKey = `eth-signin-message-${address}`; + + // If we have a message in localStorage, return it + const maybeMessage = this.storage.getItem(storageKey); + if (maybeMessage) { + return maybeMessage; + } + + // If at this point we didn't return, we need to create a new message + const message = await this.crateSiweMessage(); + this.storage.setItem(storageKey, message); + return message; + } + + private async crateSiweMessage(): Promise { + const { blockNumber, chainId } = await this.getChainData(); + const address = await this.signer.getAddress(); + // TODO: Expose these as parameters + const domain = 'yourdomain.com'; // replace with your domain + const version = '1'; + const nonce = '0'; // replace with your nonce + const uri = 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8'; // replace with your uri + + const siweMessage = new SiweMessage({ + domain, + address, + // TODO: Is this statement application-specific? + statement: `I'm signing in to ${domain} as of block number ${blockNumber}`, + uri, + version, + nonce, + chainId: chainId.toString(), + }); + + return siweMessage.toMessage(); + } + + private async getChainData(): Promise<{ blockNumber: number, chainId: number }> { + const blockNumber = await this.provider.getBlockNumber(); + const chainId = (await this.provider.getNetwork()).chainId; + return { blockNumber, chainId }; + } +} diff --git a/packages/taco-auth/src/storage.ts b/packages/taco-auth/src/storage.ts index 764fb0584..c692fb0c8 100644 --- a/packages/taco-auth/src/storage.ts +++ b/packages/taco-auth/src/storage.ts @@ -14,7 +14,6 @@ class BrowserStorage implements IStorage { } } - class NodeStorage implements IStorage { private storage: Record = {}; @@ -31,7 +30,10 @@ export class LocalStorage { private storage: IStorage; constructor() { - this.storage = typeof localStorage === 'undefined' ? new NodeStorage() : new BrowserStorage(); + this.storage = + typeof localStorage === 'undefined' + ? new NodeStorage() + : new BrowserStorage(); } getItem(key: string): string | null { diff --git a/packages/taco-auth/test/did.test.ts b/packages/taco-auth/test/did.test.ts new file mode 100644 index 000000000..c25b21de8 --- /dev/null +++ b/packages/taco-auth/test/did.test.ts @@ -0,0 +1,33 @@ +import { Cacao, SiweMessage } from '@didtools/cacao'; +import { Wallet } from 'ethers'; +import { describe, it } from 'vitest'; + +describe('hello', () => { + it('hello-world', async () => { + const wallet = Wallet.createRandom(); + const address = wallet.address; + + const siweMessage = new SiweMessage({ + domain: 'service.org', + address: address, + statement: + 'I accept the ServiceOrg Terms of Service: https://service.org/tos', + uri: 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8', + version: '1', + nonce: '32891757', + issuedAt: '2021-09-30T16:25:24.000Z', + chainId: '1', + resources: [ + 'ipfs://Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu', + 'https://example.com/my-web2-claim.json', + 'ceramic://k2t6wyfsu4pg040dpjpbla1ybxof65baldb7fvmeam4m3n71q0w1nslz609u2d', + ], + }); + + const cacao = Cacao.fromSiweMessage(siweMessage); + const siweMessage2 = SiweMessage.fromCacao(cacao); + + const signature = await wallet.signMessage(siweMessage.toMessage()); + siweMessage2.signature = signature; + }); +}); diff --git a/packages/taco-auth/test/hello.test.ts b/packages/taco-auth/test/hello.test.ts deleted file mode 100644 index 40c6b8b9a..000000000 --- a/packages/taco-auth/test/hello.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { describe, expect, it } from 'vitest'; - -describe('hello', () => { - it('hello-world', async () => { - expect('hello').toBe('hello'); - }); -}); diff --git a/packages/taco-auth/tsconfig.json b/packages/taco-auth/tsconfig.json index 3b6264c31..935974c35 100644 --- a/packages/taco-auth/tsconfig.json +++ b/packages/taco-auth/tsconfig.json @@ -3,11 +3,11 @@ "include": ["src", "test"], "compilerOptions": { "esModuleInterop": true, - "skipLibCheck": true, + "skipLibCheck": true }, "references": [ { - "path": "../test-utils/tsconfig.es.json", - }, - ], + "path": "../test-utils/tsconfig.es.json" + } + ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2645fd7d4..d99d17a24 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,11 +5,11 @@ settings: excludeLinksFromLockfile: false overrides: + '@nucypher/nucypher-core': ^0.14.5 + glob-parent@<5.1.2: '>=5.1.2' node-forge@<1.0.0: '>=1.0.0' node-forge@<1.3.0: '>=1.3.0' - glob-parent@<5.1.2: '>=5.1.2' nth-check@<2.0.1: '>=2.0.1' - '@nucypher/nucypher-core': ^0.14.5 importers: @@ -17,7 +17,7 @@ importers: dependencies: '@changesets/cli': specifier: ^2.26.2 - version: 2.27.5 + version: 2.27.3 '@nucypher/nucypher-core': specifier: ^0.14.5 version: 0.14.5 @@ -39,7 +39,7 @@ importers: version: 6.21.0(eslint@8.56.0)(typescript@5.2.2) '@vitest/coverage-v8': specifier: ^1.3.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.1)) + version: 1.6.0(vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0)) bundlemon: specifier: ^2.0.2 version: 2.1.0 @@ -75,10 +75,10 @@ importers: version: 4.1.5 prettier: specifier: ^3.2.4 - version: 3.3.2 + version: 3.2.5 prettier-plugin-organize-imports: specifier: ^3.2.4 - version: 3.2.4(prettier@3.3.2)(typescript@5.2.2) + version: 3.2.4(prettier@3.2.5)(typescript@5.2.2) sort-package-json: specifier: ^2.6.0 version: 2.10.0 @@ -105,7 +105,7 @@ importers: version: 5.2.2 vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.1) + version: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0) demos/taco-demo: dependencies: @@ -117,7 +117,7 @@ importers: version: 0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@usedapp/core': specifier: ^1.2.13 - version: 1.2.16(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0) + version: 1.2.15(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0) buffer: specifier: ^6.0.3 version: 6.0.3 @@ -126,7 +126,7 @@ importers: version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) file-loader: specifier: ^6.2.0 - version: 6.2.0(webpack@5.92.0(webpack-cli@5.1.4)) + version: 6.2.0(webpack@5.91.0(webpack-cli@5.1.4)) react: specifier: ^18.2.0 version: 18.2.0 @@ -142,7 +142,7 @@ importers: devDependencies: '@pmmmwh/react-refresh-webpack-plugin': specifier: ^0.5.7 - version: 0.5.15(react-refresh@0.14.2)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4)) + version: 0.5.13(react-refresh@0.14.2)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4)) '@types/react': specifier: ^18.2.48 version: 18.2.48 @@ -154,16 +154,16 @@ importers: version: 18.2.18 copy-webpack-plugin: specifier: ^12.0.2 - version: 12.0.2(webpack@5.92.0(webpack-cli@5.1.4)) + version: 12.0.2(webpack@5.91.0(webpack-cli@5.1.4)) crypto-browserify: specifier: ^3.12.0 version: 3.12.0 esbuild-loader: specifier: ^2.20.0 - version: 2.21.0(webpack@5.92.0(webpack-cli@5.1.4)) + version: 2.21.0(webpack@5.91.0(webpack-cli@5.1.4)) html-webpack-plugin: specifier: ^5.5.0 - version: 5.6.0(webpack@5.92.0(webpack-cli@5.1.4)) + version: 5.6.0(webpack@5.91.0(webpack-cli@5.1.4)) process: specifier: ^0.11.10 version: 0.11.10 @@ -184,13 +184,13 @@ importers: version: 1.1.2 webpack: specifier: ^5.90.3 - version: 5.92.0(webpack-cli@5.1.4) + version: 5.91.0(webpack-cli@5.1.4) webpack-cli: specifier: ^5.1.4 - version: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + version: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) webpack-dev-server: specifier: ^4.11.1 - version: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0) + version: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0) demos/taco-nft-demo: dependencies: @@ -199,7 +199,7 @@ importers: version: 0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@usedapp/core': specifier: ^1.2.13 - version: 1.2.16(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0) + version: 1.2.15(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0) buffer: specifier: ^6.0.3 version: 6.0.3 @@ -208,7 +208,7 @@ importers: version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) file-loader: specifier: ^6.2.0 - version: 6.2.0(webpack@5.92.0(webpack-cli@5.1.4)) + version: 6.2.0(webpack@5.91.0(webpack-cli@5.1.4)) react: specifier: ^18.2.0 version: 18.2.0 @@ -224,7 +224,7 @@ importers: devDependencies: '@pmmmwh/react-refresh-webpack-plugin': specifier: ^0.5.7 - version: 0.5.15(react-refresh@0.14.2)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4)) + version: 0.5.13(react-refresh@0.14.2)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4)) '@types/react': specifier: ^18.2.48 version: 18.2.48 @@ -236,13 +236,13 @@ importers: version: 18.2.18 copy-webpack-plugin: specifier: ^12.0.2 - version: 12.0.2(webpack@5.92.0(webpack-cli@5.1.4)) + version: 12.0.2(webpack@5.91.0(webpack-cli@5.1.4)) esbuild-loader: specifier: ^2.20.0 - version: 2.21.0(webpack@5.92.0(webpack-cli@5.1.4)) + version: 2.21.0(webpack@5.91.0(webpack-cli@5.1.4)) html-webpack-plugin: specifier: ^5.5.0 - version: 5.6.0(webpack@5.92.0(webpack-cli@5.1.4)) + version: 5.6.0(webpack@5.91.0(webpack-cli@5.1.4)) react-refresh: specifier: ^0.14.0 version: 0.14.2 @@ -257,13 +257,13 @@ importers: version: 4.9.5 webpack: specifier: ^5.90.3 - version: 5.92.0(webpack-cli@5.1.4) + version: 5.91.0(webpack-cli@5.1.4) webpack-cli: specifier: ^5.1.4 - version: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + version: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) webpack-dev-server: specifier: ^4.11.1 - version: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0) + version: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0) examples/pre/nextjs: dependencies: @@ -336,7 +336,7 @@ importers: version: 18.2.18 react-scripts: specifier: ^5.0.1 - version: 5.0.1(@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.7))(@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.24.7))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10) + version: 5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10) examples/pre/webpack-5: dependencies: @@ -346,22 +346,22 @@ importers: devDependencies: copy-webpack-plugin: specifier: ^12.0.2 - version: 12.0.2(webpack@5.92.0(webpack-cli@5.1.4)) + version: 12.0.2(webpack@5.91.0(webpack-cli@5.1.4)) esbuild-loader: specifier: ^2.11.0 - version: 2.21.0(webpack@5.92.0(webpack-cli@5.1.4)) + version: 2.21.0(webpack@5.91.0(webpack-cli@5.1.4)) ethers: specifier: ^5.7.2 version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) webpack: specifier: ^5.90.3 - version: 5.92.0(webpack-cli@5.1.4) + version: 5.91.0(webpack-cli@5.1.4) webpack-cli: specifier: ^5.1.4 - version: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + version: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) webpack-dev-server: specifier: ^4.7.4 - version: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0) + version: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0) examples/taco/nextjs: dependencies: @@ -443,7 +443,7 @@ importers: version: 18.2.18 react-scripts: specifier: ^5.0.1 - version: 5.0.1(@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.7))(@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.24.7))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10) + version: 5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10) examples/taco/webpack-5: dependencies: @@ -456,19 +456,19 @@ importers: devDependencies: copy-webpack-plugin: specifier: ^12.0.2 - version: 12.0.2(webpack@5.92.0(webpack-cli@5.1.4)) + version: 12.0.2(webpack@5.91.0(webpack-cli@5.1.4)) esbuild-loader: specifier: ^2.11.0 - version: 2.21.0(webpack@5.92.0(webpack-cli@5.1.4)) + version: 2.21.0(webpack@5.91.0(webpack-cli@5.1.4)) webpack: specifier: ^5.90.3 - version: 5.92.0(webpack-cli@5.1.4) + version: 5.91.0(webpack-cli@5.1.4) webpack-cli: specifier: ^5.1.4 - version: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + version: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) webpack-dev-server: specifier: ^4.7.4 - version: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0) + version: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0) packages/pre: dependencies: @@ -565,6 +565,9 @@ importers: packages/taco-auth: dependencies: + '@didtools/cacao': + specifier: ^3.0.1 + version: 3.0.1(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8) '@ethersproject/abstract-signer': specifier: ^5.7.0 version: 5.7.0 @@ -592,10 +595,13 @@ importers: version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) vitest: specifier: ^1.3.1 - version: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.1) + version: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0) packages: + '@adraffy/ens-normalize@1.10.0': + resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -618,53 +624,53 @@ packages: resolution: {integrity: sha512-q3s6pPq8H2buGp+tPuIRInWsYOuhSEwuNJPwd2YnsiID3YSLihn2ug39ktDJAcSOprUcp7Nid8WK7hKqnUmSdA==} engines: {node: '>=15.10.0'} - '@aptos-labs/ts-sdk@1.19.0': - resolution: {integrity: sha512-ReTQNh1heap8VpK9Js4FVUVflRs/zSol+jtMDFwHk6IY7eNkdtVck9rqp17/vghBGkQw7b0YZERFOz0UdcE5zA==} + '@aptos-labs/ts-sdk@1.16.0': + resolution: {integrity: sha512-NqJDx39sHN0o7BpxpQzishoZjGBzvXqSVxO+bRm6OPP/Oe+Kb51R5x8dWvW9i3amO3QNdocg/p4jFRCwzqy2Gg==} engines: {node: '>=11.0.0'} - '@babel/code-frame@7.24.7': - resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} + '@babel/code-frame@7.24.6': + resolution: {integrity: sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.24.7': - resolution: {integrity: sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==} + '@babel/compat-data@7.24.6': + resolution: {integrity: sha512-aC2DGhBq5eEdyXWqrDInSqQjO0k8xtPRf5YylULqx8MCd6jBtzqfta/3ETMRpuKIc5hyswfO80ObyA1MvkCcUQ==} engines: {node: '>=6.9.0'} - '@babel/core@7.24.7': - resolution: {integrity: sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==} + '@babel/core@7.24.6': + resolution: {integrity: sha512-qAHSfAdVyFmIvl0VHELib8xar7ONuSHrE2hLnsaWkYNTI68dmi1x8GYDhJjMI/e7XWal9QBlZkwbOnkcw7Z8gQ==} engines: {node: '>=6.9.0'} - '@babel/eslint-parser@7.24.7': - resolution: {integrity: sha512-SO5E3bVxDuxyNxM5agFv480YA2HO6ohZbGxbazZdIk3KQOPOGVNw6q78I9/lbviIf95eq6tPozeYnJLbjnC8IA==} + '@babel/eslint-parser@7.24.6': + resolution: {integrity: sha512-Q1BfQX42zXHx732PLW0w4+Y3wJjoZKEMaatFUEAmQ7Z+jCXxinzeqX9bvv2Q8xNPes/H6F0I23oGkcgjaItmLw==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/core': ^7.11.0 eslint: ^7.5.0 || ^8.0.0 || ^9.0.0 - '@babel/generator@7.24.7': - resolution: {integrity: sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==} + '@babel/generator@7.24.6': + resolution: {integrity: sha512-S7m4eNa6YAPJRHmKsLHIDJhNAGNKoWNiWefz1MBbpnt8g9lvMDl1hir4P9bo/57bQEmuwEhnRU/AMWsD0G/Fbg==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.24.7': - resolution: {integrity: sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==} + '@babel/helper-annotate-as-pure@7.24.6': + resolution: {integrity: sha512-DitEzDfOMnd13kZnDqns1ccmftwJTS9DMkyn9pYTxulS7bZxUxpMly3Nf23QQ6NwA4UB8lAqjbqWtyvElEMAkg==} engines: {node: '>=6.9.0'} - '@babel/helper-builder-binary-assignment-operator-visitor@7.24.7': - resolution: {integrity: sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==} + '@babel/helper-builder-binary-assignment-operator-visitor@7.24.6': + resolution: {integrity: sha512-+wnfqc5uHiMYtvRX7qu80Toef8BXeh4HHR1SPeonGb1SKPniNEd4a/nlaJJMv/OIEYvIVavvo0yR7u10Gqz0Iw==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.24.7': - resolution: {integrity: sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==} + '@babel/helper-compilation-targets@7.24.6': + resolution: {integrity: sha512-VZQ57UsDGlX/5fFA7GkVPplZhHsVc+vuErWgdOiysI9Ksnw0Pbbd6pnPiR/mmJyKHgyIW0c7KT32gmhiF+cirg==} engines: {node: '>=6.9.0'} - '@babel/helper-create-class-features-plugin@7.24.7': - resolution: {integrity: sha512-kTkaDl7c9vO80zeX1rJxnuRpEsD5tA81yh11X1gQo+PhSti3JS+7qeZo9U4RHobKRiFPKaGK3svUAeb8D0Q7eg==} + '@babel/helper-create-class-features-plugin@7.24.6': + resolution: {integrity: sha512-djsosdPJVZE6Vsw3kk7IPRWethP94WHGOhQTc67SNXE0ZzMhHgALw8iGmYS0TD1bbMM0VDROy43od7/hN6WYcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-create-regexp-features-plugin@7.24.7': - resolution: {integrity: sha512-03TCmXy2FtXJEZfbXDTSqq1fRJArk7lX9DOFC/47VthYcxyIOx+eXQmdo6DOQvrbpIix+KfXwvuXdFDZHxt+rA==} + '@babel/helper-create-regexp-features-plugin@7.24.6': + resolution: {integrity: sha512-C875lFBIWWwyv6MHZUG9HmRrlTDgOsLWZfYR0nW69gaKJNe0/Mpxx5r0EID2ZdHQkdUmQo2t0uNckTL08/1BgA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -674,113 +680,113 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - '@babel/helper-environment-visitor@7.24.7': - resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} + '@babel/helper-environment-visitor@7.24.6': + resolution: {integrity: sha512-Y50Cg3k0LKLMjxdPjIl40SdJgMB85iXn27Vk/qbHZCFx/o5XO3PSnpi675h1KEmmDb6OFArfd5SCQEQ5Q4H88g==} engines: {node: '>=6.9.0'} - '@babel/helper-function-name@7.24.7': - resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==} + '@babel/helper-function-name@7.24.6': + resolution: {integrity: sha512-xpeLqeeRkbxhnYimfr2PC+iA0Q7ljX/d1eZ9/inYbmfG2jpl8Lu3DyXvpOAnrS5kxkfOWJjioIMQsaMBXFI05w==} engines: {node: '>=6.9.0'} - '@babel/helper-hoist-variables@7.24.7': - resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} + '@babel/helper-hoist-variables@7.24.6': + resolution: {integrity: sha512-SF/EMrC3OD7dSta1bLJIlrsVxwtd0UpjRJqLno6125epQMJ/kyFmpTT4pbvPbdQHzCHg+biQ7Syo8lnDtbR+uA==} engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.24.7': - resolution: {integrity: sha512-LGeMaf5JN4hAT471eJdBs/GK1DoYIJ5GCtZN/EsL6KUiiDZOvO/eKE11AMZJa2zP4zk4qe9V2O/hxAmkRc8p6w==} + '@babel/helper-member-expression-to-functions@7.24.6': + resolution: {integrity: sha512-OTsCufZTxDUsv2/eDXanw/mUZHWOxSbEmC3pP8cgjcy5rgeVPWWMStnv274DV60JtHxTk0adT0QrCzC4M9NWGg==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.24.7': - resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} + '@babel/helper-module-imports@7.24.6': + resolution: {integrity: sha512-a26dmxFJBF62rRO9mmpgrfTLsAuyHk4e1hKTUkD/fcMfynt8gvEKwQPQDVxWhca8dHoDck+55DFt42zV0QMw5g==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.24.7': - resolution: {integrity: sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==} + '@babel/helper-module-transforms@7.24.6': + resolution: {integrity: sha512-Y/YMPm83mV2HJTbX1Qh2sjgjqcacvOlhbzdCCsSlblOKjSYmQqEbO6rUniWQyRo9ncyfjT8hnUjlG06RXDEmcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-optimise-call-expression@7.24.7': - resolution: {integrity: sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==} + '@babel/helper-optimise-call-expression@7.24.6': + resolution: {integrity: sha512-3SFDJRbx7KuPRl8XDUr8O7GAEB8iGyWPjLKJh/ywP/Iy9WOmEfMrsWbaZpvBu2HSYn4KQygIsz0O7m8y10ncMA==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.24.7': - resolution: {integrity: sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==} + '@babel/helper-plugin-utils@7.24.6': + resolution: {integrity: sha512-MZG/JcWfxybKwsA9N9PmtF2lOSFSEMVCpIRrbxccZFLJPrJciJdG/UhSh5W96GEteJI2ARqm5UAHxISwRDLSNg==} engines: {node: '>=6.9.0'} - '@babel/helper-remap-async-to-generator@7.24.7': - resolution: {integrity: sha512-9pKLcTlZ92hNZMQfGCHImUpDOlAgkkpqalWEeftW5FBya75k8Li2ilerxkM/uBEj01iBZXcCIB/bwvDYgWyibA==} + '@babel/helper-remap-async-to-generator@7.24.6': + resolution: {integrity: sha512-1Qursq9ArRZPAMOZf/nuzVW8HgJLkTB9y9LfP4lW2MVp4e9WkLJDovfKBxoDcCk6VuzIxyqWHyBoaCtSRP10yg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-replace-supers@7.24.7': - resolution: {integrity: sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg==} + '@babel/helper-replace-supers@7.24.6': + resolution: {integrity: sha512-mRhfPwDqDpba8o1F8ESxsEkJMQkUF8ZIWrAc0FtWhxnjfextxMWxr22RtFizxxSYLjVHDeMgVsRq8BBZR2ikJQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-simple-access@7.24.7': - resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} + '@babel/helper-simple-access@7.24.6': + resolution: {integrity: sha512-nZzcMMD4ZhmB35MOOzQuiGO5RzL6tJbsT37Zx8M5L/i9KSrukGXWTjLe1knIbb/RmxoJE9GON9soq0c0VEMM5g==} engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.24.7': - resolution: {integrity: sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==} + '@babel/helper-skip-transparent-expression-wrappers@7.24.6': + resolution: {integrity: sha512-jhbbkK3IUKc4T43WadP96a27oYti9gEf1LdyGSP2rHGH77kwLwfhO7TgwnWvxxQVmke0ImmCSS47vcuxEMGD3Q==} engines: {node: '>=6.9.0'} - '@babel/helper-split-export-declaration@7.24.7': - resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} + '@babel/helper-split-export-declaration@7.24.6': + resolution: {integrity: sha512-CvLSkwXGWnYlF9+J3iZUvwgAxKiYzK3BWuo+mLzD/MDGOZDj7Gq8+hqaOkMxmJwmlv0iu86uH5fdADd9Hxkymw==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.24.7': - resolution: {integrity: sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==} + '@babel/helper-string-parser@7.24.6': + resolution: {integrity: sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.24.7': - resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} + '@babel/helper-validator-identifier@7.24.6': + resolution: {integrity: sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.24.7': - resolution: {integrity: sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==} + '@babel/helper-validator-option@7.24.6': + resolution: {integrity: sha512-Jktc8KkF3zIkePb48QO+IapbXlSapOW9S+ogZZkcO6bABgYAxtZcjZ/O005111YLf+j4M84uEgwYoidDkXbCkQ==} engines: {node: '>=6.9.0'} - '@babel/helper-wrap-function@7.24.7': - resolution: {integrity: sha512-N9JIYk3TD+1vq/wn77YnJOqMtfWhNewNE+DJV4puD2X7Ew9J4JvrzrFDfTfyv5EgEXVy9/Wt8QiOErzEmv5Ifw==} + '@babel/helper-wrap-function@7.24.6': + resolution: {integrity: sha512-f1JLrlw/jbiNfxvdrfBgio/gRBk3yTAEJWirpAkiJG2Hb22E7cEYKHWo0dFPTv/niPovzIdPdEDetrv6tC6gPQ==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.24.7': - resolution: {integrity: sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==} + '@babel/helpers@7.24.6': + resolution: {integrity: sha512-V2PI+NqnyFu1i0GyTd/O/cTpxzQCYioSkUIRmgo7gFEHKKCg5w46+r/A6WeUR1+P3TeQ49dspGPNd/E3n9AnnA==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.24.7': - resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} + '@babel/highlight@7.24.6': + resolution: {integrity: sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==} engines: {node: '>=6.9.0'} - '@babel/parser@7.24.7': - resolution: {integrity: sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==} + '@babel/parser@7.24.6': + resolution: {integrity: sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.7': - resolution: {integrity: sha512-TiT1ss81W80eQsN+722OaeQMY/G4yTb4G9JrqeiDADs3N8lbPMGldWi9x8tyqCW5NLx1Jh2AvkE6r6QvEltMMQ==} + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.6': + resolution: {integrity: sha512-bYndrJ6Ph6Ar+GaB5VAc0JPoP80bQCm4qon6JEzXfRl5QZyQ8Ur1K6k7htxWmPA5z+k7JQvaMUrtXlqclWYzKw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.24.7': - resolution: {integrity: sha512-unaQgZ/iRu/By6tsjMZzpeBZjChYfLYry6HrEXPoz3KmfF0sVBQ1l8zKMQ4xRGLWVsjuvB8nQfjNP/DcfEOCsg==} + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.24.6': + resolution: {integrity: sha512-iVuhb6poq5ikqRq2XWU6OQ+R5o9wF+r/or9CeUyovgptz0UlnK4/seOQ1Istu/XybYjAhQv1FRSSfHHufIku5Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.24.7': - resolution: {integrity: sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==} + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.24.6': + resolution: {integrity: sha512-c8TER5xMDYzzFcGqOEp9l4hvB7dcbhcGjcLVwxWfe4P5DOafdwjsBJZKsmv+o3aXh7NhopvayQIovHrh2zSRUQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.13.0 - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.24.7': - resolution: {integrity: sha512-utA4HuR6F4Vvcr+o4DnjL8fCOlgRFGbeeBEGNg3ZTrLFw6VWG5XmUrvcQ0FjIYMU2ST4XcR2Wsp7t9qOAPnxMg==} + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.24.6': + resolution: {integrity: sha512-z8zEjYmwBUHN/pCF3NuWBhHQjJCrd33qAi8MgANfMrAvn72k2cImT8VjK9LJFu4ysOLJqhfkYYb3MvwANRUNZQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -792,8 +798,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-decorators@7.24.7': - resolution: {integrity: sha512-RL9GR0pUG5Kc8BUWLNDm2T5OpYwSX15r98I0IkgmRQTXuELq/OynH8xtMTMvTJFjXbMWFVTKtYkTaYQsuAwQlQ==} + '@babel/plugin-proposal-decorators@7.24.6': + resolution: {integrity: sha512-8DjR0/DzlBhz2SVi9a19/N2U5+C3y3rseXuyoKL9SP8vnbewscj1eHZtL6kpEn4UCuUmqEo0mvqyDYRFoN2gpA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -860,8 +866,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-decorators@7.24.7': - resolution: {integrity: sha512-Ui4uLJJrRV1lb38zg1yYTmRKmiZLiftDEvZN2iq3kd9kUFU+PttmzTbAFC2ucRk/XJmtek6G23gPsuZbhrT8fQ==} + '@babel/plugin-syntax-decorators@7.24.6': + resolution: {integrity: sha512-gInH8LEqBp+wkwTVihCd/qf+4s28g81FZyvlIbAurHk9eSiItEKG7E0uNK2UdpgsD79aJVAW3R3c85h0YJ0jsw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -876,20 +882,20 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-flow@7.24.7': - resolution: {integrity: sha512-9G8GYT/dxn/D1IIKOUBmGX0mnmj46mGH9NnZyJLwtCpgh5f7D2VbuKodb+2s9m1Yavh1s7ASQN8lf0eqrb1LTw==} + '@babel/plugin-syntax-flow@7.24.6': + resolution: {integrity: sha512-gNkksSdV8RbsCoHF9sjVYrHfYACMl/8U32UfUhJ9+84/ASXw8dlx+eHyyF0m6ncQJ9IBSxfuCkB36GJqYdXTOA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-import-assertions@7.24.7': - resolution: {integrity: sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==} + '@babel/plugin-syntax-import-assertions@7.24.6': + resolution: {integrity: sha512-BE6o2BogJKJImTmGpkmOic4V0hlRRxVtzqxiSPa8TIFxyhi4EFjHm08nq1M4STK4RytuLMgnSz0/wfflvGFNOg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-import-attributes@7.24.7': - resolution: {integrity: sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==} + '@babel/plugin-syntax-import-attributes@7.24.6': + resolution: {integrity: sha512-D+CfsVZousPXIdudSII7RGy52+dYRtbyKAZcvtQKq/NpsivyMVduepzcLqG5pMBugtMdedxdC8Ramdpcne9ZWQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -904,8 +910,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.24.7': - resolution: {integrity: sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==} + '@babel/plugin-syntax-jsx@7.24.6': + resolution: {integrity: sha512-lWfvAIFNWMlCsU0DRUun2GpFwZdGTukLaHJqRh1JRb80NdAP5Sb1HDHB5X9P9OtgZHQl089UzQkpYlBq2VTPRw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -952,8 +958,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.24.7': - resolution: {integrity: sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==} + '@babel/plugin-syntax-typescript@7.24.6': + resolution: {integrity: sha512-TzCtxGgVTEJWWwcYwQhCIQ6WaKlo80/B+Onsk4RRCcYqpYGFcG9etPW94VToGte5AAcxRrhjPUFvUS3Y2qKi4A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -964,344 +970,344 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-arrow-functions@7.24.7': - resolution: {integrity: sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==} + '@babel/plugin-transform-arrow-functions@7.24.6': + resolution: {integrity: sha512-jSSSDt4ZidNMggcLx8SaKsbGNEfIl0PHx/4mFEulorE7bpYLbN0d3pDW3eJ7Y5Z3yPhy3L3NaPCYyTUY7TuugQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-async-generator-functions@7.24.7': - resolution: {integrity: sha512-o+iF77e3u7ZS4AoAuJvapz9Fm001PuD2V3Lp6OSE4FYQke+cSewYtnek+THqGRWyQloRCyvWL1OkyfNEl9vr/g==} + '@babel/plugin-transform-async-generator-functions@7.24.6': + resolution: {integrity: sha512-VEP2o4iR2DqQU6KPgizTW2mnMx6BG5b5O9iQdrW9HesLkv8GIA8x2daXBQxw1MrsIkFQGA/iJ204CKoQ8UcnAA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-async-to-generator@7.24.7': - resolution: {integrity: sha512-SQY01PcJfmQ+4Ash7NE+rpbLFbmqA2GPIgqzxfFTL4t1FKRq4zTms/7htKpoCUI9OcFYgzqfmCdH53s6/jn5fA==} + '@babel/plugin-transform-async-to-generator@7.24.6': + resolution: {integrity: sha512-NTBA2SioI3OsHeIn6sQmhvXleSl9T70YY/hostQLveWs0ic+qvbA3fa0kwAwQ0OA/XGaAerNZRQGJyRfhbJK4g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-block-scoped-functions@7.24.7': - resolution: {integrity: sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==} + '@babel/plugin-transform-block-scoped-functions@7.24.6': + resolution: {integrity: sha512-XNW7jolYHW9CwORrZgA/97tL/k05qe/HL0z/qqJq1mdWhwwCM6D4BJBV7wAz9HgFziN5dTOG31znkVIzwxv+vw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-block-scoping@7.24.7': - resolution: {integrity: sha512-Nd5CvgMbWc+oWzBsuaMcbwjJWAcp5qzrbg69SZdHSP7AMY0AbWFqFO0WTFCA1jxhMCwodRwvRec8k0QUbZk7RQ==} + '@babel/plugin-transform-block-scoping@7.24.6': + resolution: {integrity: sha512-S/t1Xh4ehW7sGA7c1j/hiOBLnEYCp/c2sEG4ZkL8kI1xX9tW2pqJTCHKtdhe/jHKt8nG0pFCrDHUXd4DvjHS9w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.24.7': - resolution: {integrity: sha512-vKbfawVYayKcSeSR5YYzzyXvsDFWU2mD8U5TFeXtbCPLFUqe7GyCgvO6XDHzje862ODrOwy6WCPmKeWHbCFJ4w==} + '@babel/plugin-transform-class-properties@7.24.6': + resolution: {integrity: sha512-j6dZ0Z2Z2slWLR3kt9aOmSIrBvnntWjMDN/TVcMPxhXMLmJVqX605CBRlcGI4b32GMbfifTEsdEjGjiE+j/c3A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-static-block@7.24.7': - resolution: {integrity: sha512-HMXK3WbBPpZQufbMG4B46A90PkuuhN9vBCb5T8+VAHqvAqvcLi+2cKoukcpmUYkszLhScU3l1iudhrks3DggRQ==} + '@babel/plugin-transform-class-static-block@7.24.6': + resolution: {integrity: sha512-1QSRfoPI9RoLRa8Mnakc6v3e0gJxiZQTYrMfLn+mD0sz5+ndSzwymp2hDcYJTyT0MOn0yuWzj8phlIvO72gTHA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.12.0 - '@babel/plugin-transform-classes@7.24.7': - resolution: {integrity: sha512-CFbbBigp8ln4FU6Bpy6g7sE8B/WmCmzvivzUC6xDAdWVsjYTXijpuuGJmYkAaoWAzcItGKT3IOAbxRItZ5HTjw==} + '@babel/plugin-transform-classes@7.24.6': + resolution: {integrity: sha512-+fN+NO2gh8JtRmDSOB6gaCVo36ha8kfCW1nMq2Gc0DABln0VcHN4PrALDvF5/diLzIRKptC7z/d7Lp64zk92Fg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-computed-properties@7.24.7': - resolution: {integrity: sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==} + '@babel/plugin-transform-computed-properties@7.24.6': + resolution: {integrity: sha512-cRzPobcfRP0ZtuIEkA8QzghoUpSB3X3qSH5W2+FzG+VjWbJXExtx0nbRqwumdBN1x/ot2SlTNQLfBCnPdzp6kg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-destructuring@7.24.7': - resolution: {integrity: sha512-19eJO/8kdCQ9zISOf+SEUJM/bAUIsvY3YDnXZTupUCQ8LgrWnsG/gFB9dvXqdXnRXMAM8fvt7b0CBKQHNGy1mw==} + '@babel/plugin-transform-destructuring@7.24.6': + resolution: {integrity: sha512-YLW6AE5LQpk5npNXL7i/O+U9CE4XsBCuRPgyjl1EICZYKmcitV+ayuuUGMJm2lC1WWjXYszeTnIxF/dq/GhIZQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-dotall-regex@7.24.7': - resolution: {integrity: sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==} + '@babel/plugin-transform-dotall-regex@7.24.6': + resolution: {integrity: sha512-rCXPnSEKvkm/EjzOtLoGvKseK+dS4kZwx1HexO3BtRtgL0fQ34awHn34aeSHuXtZY2F8a1X8xqBBPRtOxDVmcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-duplicate-keys@7.24.7': - resolution: {integrity: sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==} + '@babel/plugin-transform-duplicate-keys@7.24.6': + resolution: {integrity: sha512-/8Odwp/aVkZwPFJMllSbawhDAO3UJi65foB00HYnK/uXvvCPm0TAXSByjz1mpRmp0q6oX2SIxpkUOpPFHk7FLA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-dynamic-import@7.24.7': - resolution: {integrity: sha512-sc3X26PhZQDb3JhORmakcbvkeInvxz+A8oda99lj7J60QRuPZvNAk9wQlTBS1ZynelDrDmTU4pw1tyc5d5ZMUg==} + '@babel/plugin-transform-dynamic-import@7.24.6': + resolution: {integrity: sha512-vpq8SSLRTBLOHUZHSnBqVo0AKX3PBaoPs2vVzYVWslXDTDIpwAcCDtfhUcHSQQoYoUvcFPTdC8TZYXu9ZnLT/w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-exponentiation-operator@7.24.7': - resolution: {integrity: sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==} + '@babel/plugin-transform-exponentiation-operator@7.24.6': + resolution: {integrity: sha512-EemYpHtmz0lHE7hxxxYEuTYOOBZ43WkDgZ4arQ4r+VX9QHuNZC+WH3wUWmRNvR8ECpTRne29aZV6XO22qpOtdA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-export-namespace-from@7.24.7': - resolution: {integrity: sha512-v0K9uNYsPL3oXZ/7F9NNIbAj2jv1whUEtyA6aujhekLs56R++JDQuzRcP2/z4WX5Vg/c5lE9uWZA0/iUoFhLTA==} + '@babel/plugin-transform-export-namespace-from@7.24.6': + resolution: {integrity: sha512-inXaTM1SVrIxCkIJ5gqWiozHfFMStuGbGJAxZFBoHcRRdDP0ySLb3jH6JOwmfiinPwyMZqMBX+7NBDCO4z0NSA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-flow-strip-types@7.24.7': - resolution: {integrity: sha512-cjRKJ7FobOH2eakx7Ja+KpJRj8+y+/SiB3ooYm/n2UJfxu0oEaOoxOinitkJcPqv9KxS0kxTGPUaR7L2XcXDXA==} + '@babel/plugin-transform-flow-strip-types@7.24.6': + resolution: {integrity: sha512-1l8b24NoCpaQ13Vi6FtLG1nv6kNoi8PWvQb1AYO7GHZDpFfBYc3lbXArx1lP2KRt8b4pej1eWc/zrRmsQTfOdQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-for-of@7.24.7': - resolution: {integrity: sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==} + '@babel/plugin-transform-for-of@7.24.6': + resolution: {integrity: sha512-n3Sf72TnqK4nw/jziSqEl1qaWPbCRw2CziHH+jdRYvw4J6yeCzsj4jdw8hIntOEeDGTmHVe2w4MVL44PN0GMzg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-function-name@7.24.7': - resolution: {integrity: sha512-U9FcnA821YoILngSmYkW6FjyQe2TyZD5pHt4EVIhmcTkrJw/3KqcrRSxuOo5tFZJi7TE19iDyI1u+weTI7bn2w==} + '@babel/plugin-transform-function-name@7.24.6': + resolution: {integrity: sha512-sOajCu6V0P1KPljWHKiDq6ymgqB+vfo3isUS4McqW1DZtvSVU2v/wuMhmRmkg3sFoq6GMaUUf8W4WtoSLkOV/Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-json-strings@7.24.7': - resolution: {integrity: sha512-2yFnBGDvRuxAaE/f0vfBKvtnvvqU8tGpMHqMNpTN2oWMKIR3NqFkjaAgGwawhqK/pIN2T3XdjGPdaG0vDhOBGw==} + '@babel/plugin-transform-json-strings@7.24.6': + resolution: {integrity: sha512-Uvgd9p2gUnzYJxVdBLcU0KurF8aVhkmVyMKW4MIY1/BByvs3EBpv45q01o7pRTVmTvtQq5zDlytP3dcUgm7v9w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-literals@7.24.7': - resolution: {integrity: sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ==} + '@babel/plugin-transform-literals@7.24.6': + resolution: {integrity: sha512-f2wHfR2HF6yMj+y+/y07+SLqnOSwRp8KYLpQKOzS58XLVlULhXbiYcygfXQxJlMbhII9+yXDwOUFLf60/TL5tw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-logical-assignment-operators@7.24.7': - resolution: {integrity: sha512-4D2tpwlQ1odXmTEIFWy9ELJcZHqrStlzK/dAOWYyxX3zT0iXQB6banjgeOJQXzEc4S0E0a5A+hahxPaEFYftsw==} + '@babel/plugin-transform-logical-assignment-operators@7.24.6': + resolution: {integrity: sha512-EKaWvnezBCMkRIHxMJSIIylzhqK09YpiJtDbr2wsXTwnO0TxyjMUkaw4RlFIZMIS0iDj0KyIg7H7XCguHu/YDA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-member-expression-literals@7.24.7': - resolution: {integrity: sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==} + '@babel/plugin-transform-member-expression-literals@7.24.6': + resolution: {integrity: sha512-9g8iV146szUo5GWgXpRbq/GALTnY+WnNuRTuRHWWFfWGbP9ukRL0aO/jpu9dmOPikclkxnNsjY8/gsWl6bmZJQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-amd@7.24.7': - resolution: {integrity: sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==} + '@babel/plugin-transform-modules-amd@7.24.6': + resolution: {integrity: sha512-eAGogjZgcwqAxhyFgqghvoHRr+EYRQPFjUXrTYKBRb5qPnAVxOOglaxc4/byHqjvq/bqO2F3/CGwTHsgKJYHhQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.24.7': - resolution: {integrity: sha512-iFI8GDxtevHJ/Z22J5xQpVqFLlMNstcLXh994xifFwxxGslr2ZXXLWgtBeLctOD63UFDArdvN6Tg8RFw+aEmjQ==} + '@babel/plugin-transform-modules-commonjs@7.24.6': + resolution: {integrity: sha512-JEV8l3MHdmmdb7S7Cmx6rbNEjRCgTQMZxllveHO0mx6uiclB0NflCawlQQ6+o5ZrwjUBYPzHm2XoK4wqGVUFuw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-systemjs@7.24.7': - resolution: {integrity: sha512-GYQE0tW7YoaN13qFh3O1NCY4MPkUiAH3fiF7UcV/I3ajmDKEdG3l+UOcbAm4zUE3gnvUU+Eni7XrVKo9eO9auw==} + '@babel/plugin-transform-modules-systemjs@7.24.6': + resolution: {integrity: sha512-xg1Z0J5JVYxtpX954XqaaAT6NpAY6LtZXvYFCJmGFJWwtlz2EmJoR8LycFRGNE8dBKizGWkGQZGegtkV8y8s+w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-umd@7.24.7': - resolution: {integrity: sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==} + '@babel/plugin-transform-modules-umd@7.24.6': + resolution: {integrity: sha512-esRCC/KsSEUvrSjv5rFYnjZI6qv4R1e/iHQrqwbZIoRJqk7xCvEUiN7L1XrmW5QSmQe3n1XD88wbgDTWLbVSyg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-named-capturing-groups-regex@7.24.7': - resolution: {integrity: sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==} + '@babel/plugin-transform-named-capturing-groups-regex@7.24.6': + resolution: {integrity: sha512-6DneiCiu91wm3YiNIGDWZsl6GfTTbspuj/toTEqLh9d4cx50UIzSdg+T96p8DuT7aJOBRhFyaE9ZvTHkXrXr6Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/plugin-transform-new-target@7.24.7': - resolution: {integrity: sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==} + '@babel/plugin-transform-new-target@7.24.6': + resolution: {integrity: sha512-f8liz9JG2Va8A4J5ZBuaSdwfPqN6axfWRK+y66fjKYbwf9VBLuq4WxtinhJhvp1w6lamKUwLG0slK2RxqFgvHA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-nullish-coalescing-operator@7.24.7': - resolution: {integrity: sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==} + '@babel/plugin-transform-nullish-coalescing-operator@7.24.6': + resolution: {integrity: sha512-+QlAiZBMsBK5NqrBWFXCYeXyiU1y7BQ/OYaiPAcQJMomn5Tyg+r5WuVtyEuvTbpV7L25ZSLfE+2E9ywj4FD48A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-numeric-separator@7.24.7': - resolution: {integrity: sha512-e6q1TiVUzvH9KRvicuxdBTUj4AdKSRwzIyFFnfnezpCfP2/7Qmbb8qbU2j7GODbl4JMkblitCQjKYUaX/qkkwA==} + '@babel/plugin-transform-numeric-separator@7.24.6': + resolution: {integrity: sha512-6voawq8T25Jvvnc4/rXcWZQKKxUNZcKMS8ZNrjxQqoRFernJJKjE3s18Qo6VFaatG5aiX5JV1oPD7DbJhn0a4Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-object-rest-spread@7.24.7': - resolution: {integrity: sha512-4QrHAr0aXQCEFni2q4DqKLD31n2DL+RxcwnNjDFkSG0eNQ/xCavnRkfCUjsyqGC2OviNJvZOF/mQqZBw7i2C5Q==} + '@babel/plugin-transform-object-rest-spread@7.24.6': + resolution: {integrity: sha512-OKmi5wiMoRW5Smttne7BwHM8s/fb5JFs+bVGNSeHWzwZkWXWValR1M30jyXo1s/RaqgwwhEC62u4rFH/FBcBPg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-object-super@7.24.7': - resolution: {integrity: sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==} + '@babel/plugin-transform-object-super@7.24.6': + resolution: {integrity: sha512-N/C76ihFKlZgKfdkEYKtaRUtXZAgK7sOY4h2qrbVbVTXPrKGIi8aww5WGe/+Wmg8onn8sr2ut6FXlsbu/j6JHg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-catch-binding@7.24.7': - resolution: {integrity: sha512-uLEndKqP5BfBbC/5jTwPxLh9kqPWWgzN/f8w6UwAIirAEqiIVJWWY312X72Eub09g5KF9+Zn7+hT7sDxmhRuKA==} + '@babel/plugin-transform-optional-catch-binding@7.24.6': + resolution: {integrity: sha512-L5pZ+b3O1mSzJ71HmxSCmTVd03VOT2GXOigug6vDYJzE5awLI7P1g0wFcdmGuwSDSrQ0L2rDOe/hHws8J1rv3w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.24.7': - resolution: {integrity: sha512-tK+0N9yd4j+x/4hxF3F0e0fu/VdcxU18y5SevtyM/PCFlQvXbR0Zmlo2eBrKtVipGNFzpq56o8WsIIKcJFUCRQ==} + '@babel/plugin-transform-optional-chaining@7.24.6': + resolution: {integrity: sha512-cHbqF6l1QP11OkYTYQ+hhVx1E017O5ZcSPXk9oODpqhcAD1htsWG2NpHrrhthEO2qZomLK0FXS+u7NfrkF5aOQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-parameters@7.24.7': - resolution: {integrity: sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==} + '@babel/plugin-transform-parameters@7.24.6': + resolution: {integrity: sha512-ST7guE8vLV+vI70wmAxuZpIKzVjvFX9Qs8bl5w6tN/6gOypPWUmMQL2p7LJz5E63vEGrDhAiYetniJFyBH1RkA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-methods@7.24.7': - resolution: {integrity: sha512-COTCOkG2hn4JKGEKBADkA8WNb35TGkkRbI5iT845dB+NyqgO8Hn+ajPbSnIQznneJTa3d30scb6iz/DhH8GsJQ==} + '@babel/plugin-transform-private-methods@7.24.6': + resolution: {integrity: sha512-T9LtDI0BgwXOzyXrvgLTT8DFjCC/XgWLjflczTLXyvxbnSR/gpv0hbmzlHE/kmh9nOvlygbamLKRo6Op4yB6aw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-property-in-object@7.24.7': - resolution: {integrity: sha512-9z76mxwnwFxMyxZWEgdgECQglF2Q7cFLm0kMf8pGwt+GSJsY0cONKj/UuO4bOH0w/uAel3ekS4ra5CEAyJRmDA==} + '@babel/plugin-transform-private-property-in-object@7.24.6': + resolution: {integrity: sha512-Qu/ypFxCY5NkAnEhCF86Mvg3NSabKsh/TPpBVswEdkGl7+FbsYHy1ziRqJpwGH4thBdQHh8zx+z7vMYmcJ7iaQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-property-literals@7.24.7': - resolution: {integrity: sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==} + '@babel/plugin-transform-property-literals@7.24.6': + resolution: {integrity: sha512-oARaglxhRsN18OYsnPTpb8TcKQWDYNsPNmTnx5++WOAsUJ0cSC/FZVlIJCKvPbU4yn/UXsS0551CFKJhN0CaMw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-constant-elements@7.24.7': - resolution: {integrity: sha512-7LidzZfUXyfZ8/buRW6qIIHBY8wAZ1OrY9c/wTr8YhZ6vMPo+Uc/CVFLYY1spZrEQlD4w5u8wjqk5NQ3OVqQKA==} + '@babel/plugin-transform-react-constant-elements@7.24.6': + resolution: {integrity: sha512-vQfyXRtG/kNIcTYRd/49uJnwvMig9X3R4XsTVXRml2RFupZFY+2RDuK+/ymb+MfX2WuIHAgUZc2xEvQrnI7QCg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-display-name@7.24.7': - resolution: {integrity: sha512-H/Snz9PFxKsS1JLI4dJLtnJgCJRoo0AUm3chP6NYr+9En1JMKloheEiLIhlp5MDVznWo+H3AAC1Mc8lmUEpsgg==} + '@babel/plugin-transform-react-display-name@7.24.6': + resolution: {integrity: sha512-/3iiEEHDsJuj9QU09gbyWGSUxDboFcD7Nj6dnHIlboWSodxXAoaY/zlNMHeYAC0WsERMqgO9a7UaM77CsYgWcg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx-development@7.24.7': - resolution: {integrity: sha512-QG9EnzoGn+Qar7rxuW+ZOsbWOt56FvvI93xInqsZDC5fsekx1AlIO4KIJ5M+D0p0SqSH156EpmZyXq630B8OlQ==} + '@babel/plugin-transform-react-jsx-development@7.24.6': + resolution: {integrity: sha512-F7EsNp5StNDouSSdYyDSxh4J+xvj/JqG+Cb6s2fA+jCyHOzigG5vTwgH8tU2U8Voyiu5zCG9bAK49wTr/wPH0w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx@7.24.7': - resolution: {integrity: sha512-+Dj06GDZEFRYvclU6k4bme55GKBEWUmByM/eoKuqg4zTNQHiApWRhQph5fxQB2wAEFvRzL1tOEj1RJ19wJrhoA==} + '@babel/plugin-transform-react-jsx@7.24.6': + resolution: {integrity: sha512-pCtPHhpRZHfwdA5G1Gpk5mIzMA99hv0R8S/Ket50Rw+S+8hkt3wBWqdqHaPw0CuUYxdshUgsPiLQ5fAs4ASMhw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-pure-annotations@7.24.7': - resolution: {integrity: sha512-PLgBVk3fzbmEjBJ/u8kFzOqS9tUeDjiaWud/rRym/yjCo/M9cASPlnrd2ZmmZpQT40fOOrvR8jh+n8jikrOhNA==} + '@babel/plugin-transform-react-pure-annotations@7.24.6': + resolution: {integrity: sha512-0HoDQlFJJkXRyV2N+xOpUETbKHcouSwijRQbKWVtxsPoq5bbB30qZag9/pSc5xcWVYjTHlLsBsY+hZDnzQTPNw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-regenerator@7.24.7': - resolution: {integrity: sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==} + '@babel/plugin-transform-regenerator@7.24.6': + resolution: {integrity: sha512-SMDxO95I8WXRtXhTAc8t/NFQUT7VYbIWwJCJgEli9ml4MhqUMh4S6hxgH6SmAC3eAQNWCDJFxcFeEt9w2sDdXg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-reserved-words@7.24.7': - resolution: {integrity: sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==} + '@babel/plugin-transform-reserved-words@7.24.6': + resolution: {integrity: sha512-DcrgFXRRlK64dGE0ZFBPD5egM2uM8mgfrvTMOSB2yKzOtjpGegVYkzh3s1zZg1bBck3nkXiaOamJUqK3Syk+4A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-runtime@7.24.7': - resolution: {integrity: sha512-YqXjrk4C+a1kZjewqt+Mmu2UuV1s07y8kqcUf4qYLnoqemhR4gRQikhdAhSVJioMjVTu6Mo6pAbaypEA3jY6fw==} + '@babel/plugin-transform-runtime@7.24.6': + resolution: {integrity: sha512-W3gQydMb0SY99y/2lV0Okx2xg/8KzmZLQsLaiCmwNRl1kKomz14VurEm+2TossUb+sRvBCnGe+wx8KtIgDtBbQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-shorthand-properties@7.24.7': - resolution: {integrity: sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==} + '@babel/plugin-transform-shorthand-properties@7.24.6': + resolution: {integrity: sha512-xnEUvHSMr9eOWS5Al2YPfc32ten7CXdH7Zwyyk7IqITg4nX61oHj+GxpNvl+y5JHjfN3KXE2IV55wAWowBYMVw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-spread@7.24.7': - resolution: {integrity: sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==} + '@babel/plugin-transform-spread@7.24.6': + resolution: {integrity: sha512-h/2j7oIUDjS+ULsIrNZ6/TKG97FgmEk1PXryk/HQq6op4XUUUwif2f69fJrzK0wza2zjCS1xhXmouACaWV5uPA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-sticky-regex@7.24.7': - resolution: {integrity: sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==} + '@babel/plugin-transform-sticky-regex@7.24.6': + resolution: {integrity: sha512-fN8OcTLfGmYv7FnDrsjodYBo1DhPL3Pze/9mIIE2MGCT1KgADYIOD7rEglpLHZj8PZlC/JFX5WcD+85FLAQusw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-template-literals@7.24.7': - resolution: {integrity: sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==} + '@babel/plugin-transform-template-literals@7.24.6': + resolution: {integrity: sha512-BJbEqJIcKwrqUP+KfUIkxz3q8VzXe2R8Wv8TaNgO1cx+nNavxn/2+H8kp9tgFSOL6wYPPEgFvU6IKS4qoGqhmg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typeof-symbol@7.24.7': - resolution: {integrity: sha512-VtR8hDy7YLB7+Pet9IarXjg/zgCMSF+1mNS/EQEiEaUPoFXCVsHG64SIxcaaI2zJgRiv+YmgaQESUfWAdbjzgg==} + '@babel/plugin-transform-typeof-symbol@7.24.6': + resolution: {integrity: sha512-IshCXQ+G9JIFJI7bUpxTE/oA2lgVLAIK8q1KdJNoPXOpvRaNjMySGuvLfBw/Xi2/1lLo953uE8hyYSDW3TSYig==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.24.7': - resolution: {integrity: sha512-iLD3UNkgx2n/HrjBesVbYX6j0yqn/sJktvbtKKgcaLIQ4bTTQ8obAypc1VpyHPD2y4Phh9zHOaAt8e/L14wCpw==} + '@babel/plugin-transform-typescript@7.24.6': + resolution: {integrity: sha512-H0i+hDLmaYYSt6KU9cZE0gb3Cbssa/oxWis7PX4ofQzbvsfix9Lbh8SRk7LCPDlLWJHUiFeHU0qRRpF/4Zv7mQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-escapes@7.24.7': - resolution: {integrity: sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==} + '@babel/plugin-transform-unicode-escapes@7.24.6': + resolution: {integrity: sha512-bKl3xxcPbkQQo5eX9LjjDpU2xYHeEeNQbOhj0iPvetSzA+Tu9q/o5lujF4Sek60CM6MgYvOS/DJuwGbiEYAnLw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-property-regex@7.24.7': - resolution: {integrity: sha512-uH2O4OV5M9FZYQrwc7NdVmMxQJOCCzFeYudlZSzUAHRFeOujQefa92E74TQDVskNHCzOXoigEuoyzHDhaEaK5w==} + '@babel/plugin-transform-unicode-property-regex@7.24.6': + resolution: {integrity: sha512-8EIgImzVUxy15cZiPii9GvLZwsy7Vxc+8meSlR3cXFmBIl5W5Tn9LGBf7CDKkHj4uVfNXCJB8RsVfnmY61iedA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-regex@7.24.7': - resolution: {integrity: sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==} + '@babel/plugin-transform-unicode-regex@7.24.6': + resolution: {integrity: sha512-pssN6ExsvxaKU638qcWb81RrvvgZom3jDgU/r5xFZ7TONkZGFf4MhI2ltMb8OcQWhHyxgIavEU+hgqtbKOmsPA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-unicode-sets-regex@7.24.7': - resolution: {integrity: sha512-2G8aAvF4wy1w/AGZkemprdGMRg5o6zPNhbHVImRz3lss55TYCBd6xStN19rt8XJHq20sqV0JbyWjOWwQRwV/wg==} + '@babel/plugin-transform-unicode-sets-regex@7.24.6': + resolution: {integrity: sha512-quiMsb28oXWIDK0gXLALOJRXLgICLiulqdZGOaPPd0vRT7fQp74NtdADAVu+D8s00C+0Xs0MxVP0VKF/sZEUgw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/preset-env@7.24.7': - resolution: {integrity: sha512-1YZNsc+y6cTvWlDHidMBsQZrZfEFjRIo/BZCT906PMdzOyXtSLTgqGdrpcuTDCXyd11Am5uQULtDIcCfnTc8fQ==} + '@babel/preset-env@7.24.6': + resolution: {integrity: sha512-CrxEAvN7VxfjOG8JNF2Y/eMqMJbZPZ185amwGUBp8D9USK90xQmv7dLdFSa+VbD7fdIqcy/Mfv7WtzG8+/qxKg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1311,14 +1317,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 - '@babel/preset-react@7.24.7': - resolution: {integrity: sha512-AAH4lEkpmzFWrGVlHaxJB7RLH21uPQ9+He+eFLWHmF9IuFQVugz8eAsamaW0DXRrTfco5zj1wWtpdcXJUOfsag==} + '@babel/preset-react@7.24.6': + resolution: {integrity: sha512-8mpzh1bWvmINmwM3xpz6ahu57mNaWavMm+wBNjQ4AFu1nghKBiIRET7l/Wmj4drXany/BBGjJZngICcD98F1iw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/preset-typescript@7.24.7': - resolution: {integrity: sha512-SyXRe3OdWwIwalxDg5UtJnJQO+YPcTfwiIY2B0Xlddh9o7jpWLvv8X1RthIeDOxQ+O1ML5BLPCONToObyVQVuQ==} + '@babel/preset-typescript@7.24.6': + resolution: {integrity: sha512-U10aHPDnokCFRXgyT/MaIRTivUu2K/mu0vJlwRS9LxJmJet+PFQNKpggPyFCUtC6zWSBPjvxjnpNkAn3Uw2m5w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1326,49 +1332,49 @@ packages: '@babel/regjsgen@0.8.0': resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} - '@babel/runtime@7.24.7': - resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} + '@babel/runtime@7.24.6': + resolution: {integrity: sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==} engines: {node: '>=6.9.0'} - '@babel/template@7.24.7': - resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} + '@babel/template@7.24.6': + resolution: {integrity: sha512-3vgazJlLwNXi9jhrR1ef8qiB65L1RK90+lEQwv4OxveHnqC3BfmnHdgySwRLzf6akhlOYenT+b7AfWq+a//AHw==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.24.7': - resolution: {integrity: sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==} + '@babel/traverse@7.24.6': + resolution: {integrity: sha512-OsNjaJwT9Zn8ozxcfoBc+RaHdj3gFmCmYoQLUII1o6ZrUwku0BMg80FoOTPx+Gi6XhcQxAYE4xyjPTo4SxEQqw==} engines: {node: '>=6.9.0'} - '@babel/types@7.24.7': - resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} + '@babel/types@7.24.6': + resolution: {integrity: sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==} engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@changesets/apply-release-plan@7.0.3': - resolution: {integrity: sha512-klL6LCdmfbEe9oyfLxnidIf/stFXmrbFO/3gT5LU5pcyoZytzJe4gWpTBx3BPmyNPl16dZ1xrkcW7b98e3tYkA==} + '@changesets/apply-release-plan@7.0.1': + resolution: {integrity: sha512-aPdSq/R++HOyfEeBGjEe6LNG8gs0KMSyRETD/J2092OkNq8mOioAxyKjMbvVUdzgr/HTawzMOz7lfw339KnsCA==} - '@changesets/assemble-release-plan@6.0.2': - resolution: {integrity: sha512-n9/Tdq+ze+iUtjmq0mZO3pEhJTKkku9hUxtUadW30jlN7kONqJG3O6ALeXrmc6gsi/nvoCuKjqEJ68Hk8RbMTQ==} + '@changesets/assemble-release-plan@6.0.0': + resolution: {integrity: sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==} '@changesets/changelog-git@0.2.0': resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} - '@changesets/cli@2.27.5': - resolution: {integrity: sha512-UVppOvzCjjylBenFcwcZNG5IaZ8jsIaEVraV/pbXgukYNb0Oqa0d8UWb0LkYzA1Bf1HmUrOfccFcRLheRuA7pA==} + '@changesets/cli@2.27.3': + resolution: {integrity: sha512-ve/VpWApILlSs8cr0okNx5C2LKRawI9XZgvfmf58S8sar2nhx5DPJREFXYZBahs0FeTfvH0rdVl+nGe8QF45Ig==} hasBin: true - '@changesets/config@3.0.1': - resolution: {integrity: sha512-nCr8pOemUjvGJ8aUu8TYVjqnUL+++bFOQHBVmtNbLvKzIDkN/uiP/Z4RKmr7NNaiujIURHySDEGFPftR4GbTUA==} + '@changesets/config@3.0.0': + resolution: {integrity: sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==} '@changesets/errors@0.2.0': resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} - '@changesets/get-dependents-graph@2.1.0': - resolution: {integrity: sha512-QOt6pQq9RVXKGHPVvyKimJDYJumx7p4DO5MO9AhRJYgAPgv0emhNqAqqysSVKHBm4sxKlGN4S1zXOIb5yCFuhQ==} + '@changesets/get-dependents-graph@2.0.0': + resolution: {integrity: sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==} - '@changesets/get-release-plan@4.0.2': - resolution: {integrity: sha512-rOalz7nMuMV2vyeP7KBeAhqEB7FM2GFPO5RQSoOoUKKH9L6wW3QyPA2K+/rG9kBrWl2HckPVES73/AuwPvbH3w==} + '@changesets/get-release-plan@4.0.0': + resolution: {integrity: sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} @@ -1388,9 +1394,6 @@ packages: '@changesets/read@0.6.0': resolution: {integrity: sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==} - '@changesets/should-skip-package@0.1.0': - resolution: {integrity: sha512-FxG6Mhjw7yFStlSM7Z0Gmg3RiyQ98d/9VpQAZ3Fzr59dCOM9G6ZdYbjiSAt0XtFr9JR5U2tBaJWPjrkGGc618g==} - '@changesets/types@4.1.0': resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} @@ -1517,6 +1520,18 @@ packages: peerDependencies: postcss-selector-parser: ^6.0.10 + '@didtools/cacao@3.0.1': + resolution: {integrity: sha512-vV1JirxqVsBf2dqdvoS/msNN8fabvMfseZB0kf1FG8TbosrHd81+hgDOlQMZit7zJbTk5g3CGkZg3b7iYKkynw==} + engines: {node: '>=14.14'} + + '@didtools/codecs@3.0.0': + resolution: {integrity: sha512-TemoVySZrs1XflMtOkwVTATtZEs42Mh2yk9SoYvBXES6Mz30PBJCm8v7U/2y1N5lrjb2cAPWs48Ryc7paetSxQ==} + engines: {node: '>=14.14'} + + '@didtools/siwx@2.0.0': + resolution: {integrity: sha512-eqBtI5dZrptXTCyadnhvU0di/KvumoByT7F8KB/8BLU7M1lltfEmvf/c5AnsyrWO9338ygCs2u5mKz1p1Zdj5A==} + engines: {node: '>=14.14'} + '@discoveryjs/json-ext@0.5.7': resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} engines: {node: '>=10.0.0'} @@ -1797,8 +1812,8 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.10.1': - resolution: {integrity: sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==} + '@eslint-community/regexpp@4.10.0': + resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/eslintrc@2.1.4': @@ -1902,7 +1917,6 @@ packages: '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -1910,12 +1924,15 @@ packages: '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - deprecated: Use @eslint/object-schema instead '@hutson/parse-repository-url@3.0.2': resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} engines: {node: '>=6.9.0'} + '@ipld/dag-cbor@9.2.0': + resolution: {integrity: sha512-N14oMy0q4gM6OuZkIpisKe0JBSjf1Jb39VI+7jMLiWX9124u1Z3Fdj/Tag1NA0cVxxqWDh0CqsjcVfOKtelPDA==} + engines: {node: '>=16.0.0', npm: '>=7.0.0'} + '@irys/arweave@0.0.2': resolution: {integrity: sha512-ddE5h4qXbl0xfGlxrtBIwzflaxZUDlDs43TuT0u1OMfyobHul4AA1VEX72Rpzw2bOh4vzoytSqA1jCM7x9YtHg==} @@ -2156,12 +2173,19 @@ packages: '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} + '@noble/curves@1.2.0': + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/curves@1.4.0': resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} '@noble/ed25519@1.7.3': resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==} + '@noble/hashes@1.3.2': + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + '@noble/hashes@1.4.0': resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} engines: {node: '>= 16'} @@ -2196,8 +2220,8 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@pmmmwh/react-refresh-webpack-plugin@0.5.15': - resolution: {integrity: sha512-LFWllMA55pzB9D34w/wXUCf8+c+IYKuJDgxiZ3qMhl64KRMBHYM1I3VdGaD2BV5FNPV2/S2596bppxHbv2ZydQ==} + '@pmmmwh/react-refresh-webpack-plugin@0.5.13': + resolution: {integrity: sha512-odZVYXly+JwzYri9rKqqUAk0cY6zLpv4dxoKinhoJNShV36Gpxf+CyDIILJ4tYsJ1ZxIWs233Y39iVnynvDA/g==} engines: {node: '>= 10.13'} peerDependencies: '@types/webpack': 4.x || 5.x @@ -2342,9 +2366,15 @@ packages: '@scure/base@1.1.6': resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} + '@scure/bip32@1.3.2': + resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==} + '@scure/bip32@1.4.0': resolution: {integrity: sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==} + '@scure/bip39@1.2.1': + resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} + '@scure/bip39@1.3.0': resolution: {integrity: sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==} @@ -2376,8 +2406,8 @@ packages: resolution: {integrity: sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==} engines: {node: '>=5.10'} - '@solana/web3.js@1.92.3': - resolution: {integrity: sha512-NVBWvb9zdJIAx6X+caXaIICCEQfQaQ8ygykCjJW4u2z/sIKcvPj3ZIIllnx0MWMc3IxGq15ozGYDOQIMbwUcHw==} + '@solana/web3.js@1.91.8': + resolution: {integrity: sha512-USa6OS1jbh8zOapRJ/CBZImZ8Xb7AJjROZl5adql9TpOoBN9BUzyyouS5oPuZHft7S7eB8uJPuXWYjMi6BHgOw==} '@supercharge/promise-pool@3.2.0': resolution: {integrity: sha512-pj0cAALblTZBPtMltWOlZTQSLT07jIaFNeM8TWoJD1cQMgDB9mcMlVMoetiB35OzNJpqQ2b+QEtwiR9f20mADg==} @@ -2523,8 +2553,8 @@ packages: '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - '@types/express-serve-static-core@4.19.3': - resolution: {integrity: sha512-KOzM7MhcBFlmnlr/fzISFF5vGWVSvN6fTd4T+ExOt08bA/dA5kpSzY52nMsI1KDFmUREpJelPYyuslLRSjjgCg==} + '@types/express-serve-static-core@4.19.1': + resolution: {integrity: sha512-ej0phymbFLoCB26dbbq5PGScsf2JAJ4IJHjG10LalgUV36XKTmA4GdA+PVllKvRk0sEKt64X8975qFnkSi0hqA==} '@types/express@4.17.21': resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} @@ -2562,8 +2592,8 @@ packages: '@types/keyv@3.1.4': resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} - '@types/lodash@4.17.5': - resolution: {integrity: sha512-MBIOHVZqVqgfro1euRDWX7OO0fBVUUMrN6Pwm8LQsz8cWhEpihlvR70ENj3f40j58TNxZaWv2ndSkInykNBBJw==} + '@types/lodash@4.17.4': + resolution: {integrity: sha512-wYCP26ZLxaT3R39kiN2+HcJ4kTd3U1waI/cY7ivWYqFP6pW3ZNpvi6Wd6PHZx7T/t8z0vlkXMg3QYLa7DZ/IJQ==} '@types/mime@1.3.5': resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} @@ -2793,8 +2823,8 @@ packages: resolution: {integrity: sha512-Hc3TfrFaupg0M84e/Zv7BoF+fmMWDV15mZ5s8ZQt2qZxUcNw2GQW+L6L/2k74who31G+p1m3GRYbJpAo7d1pqA==} engines: {node: '>=10'} - '@usedapp/core@1.2.16': - resolution: {integrity: sha512-IgJzxItngsSDoVemXChFqiqqvV9gjp7OvEaM2ajZ3GZPA3JMBKw+tPBwhjjjKvnHgcIpE4kEBaWaosYqMzQG0Q==} + '@usedapp/core@1.2.15': + resolution: {integrity: sha512-ztXGW+9UFsWUvTheE1ZYBKhhzTM0UwryvetHnZM6jgjsHNRXSsaODRDh/T23UcD790kPcfFa0i6evU/KzOeTsQ==} hasBin: true peerDependencies: ethers: ^5 @@ -2904,6 +2934,17 @@ packages: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} deprecated: Use your platform's native atob() and btoa() methods instead + abitype@0.9.8: + resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -2911,8 +2952,8 @@ packages: acorn-globals@6.0.0: resolution: {integrity: sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==} - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} + acorn-import-assertions@1.9.0: + resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} peerDependencies: acorn: ^8 @@ -2982,8 +3023,8 @@ packages: ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - ajv@8.16.0: - resolution: {integrity: sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==} + ajv@8.14.0: + resolution: {integrity: sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==} algo-msgpack-with-bigint@2.1.1: resolution: {integrity: sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ==} @@ -3006,11 +3047,6 @@ packages: engines: {'0': node >= 0.8.0} hasBin: true - ansi-html@0.0.9: - resolution: {integrity: sha512-ozbS3LuenHVxNRh/wdnN16QapUHzauqSomAl1jwwJRRsGwFwtj644lIhxfWu0Fy0acCij2+AEgHvjscq3dlVXg==} - engines: {'0': node >= 0.8.0} - hasBin: true - ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -3123,9 +3159,8 @@ packages: array.prototype.toreversed@1.1.2: resolution: {integrity: sha512-wwDCoT4Ck4Cz7sLtgUmzR5UV3YF5mFHUlbChCzZBQZ+0m2cl/DH3tKgvphv1nKgFsJ48oCSg6p91q2Vm0I/ZMA==} - array.prototype.tosorted@1.1.4: - resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==} - engines: {node: '>= 0.4'} + array.prototype.tosorted@1.1.3: + resolution: {integrity: sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==} arraybuffer.prototype.slice@1.0.3: resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} @@ -3378,8 +3413,8 @@ packages: resolution: {integrity: sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==} engines: {node: '>= 0.12'} - browserslist@4.23.1: - resolution: {integrity: sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==} + browserslist@4.23.0: + resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -3449,6 +3484,9 @@ packages: resolution: {integrity: sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==} engines: {node: '>=6'} + caip@1.1.1: + resolution: {integrity: sha512-a3v5lteUUOoyRI0U6qe5ayCCGkF2mCmJ5zQMDnOD2vRjgRg6sm9p8TsRC2h4D4beyqRN9RYniphAPnj/+jQC6g==} + call-bind@1.0.7: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} @@ -3479,13 +3517,17 @@ packages: caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} - caniuse-lite@1.0.30001632: - resolution: {integrity: sha512-udx3o7yHJfUxMLkGohMlVHCvFvWmirKh9JAH/d7WOLPetlH+LTL5cocMZ0t7oZx/mdlOWXti97xLZWc8uURRHg==} + caniuse-lite@1.0.30001623: + resolution: {integrity: sha512-X/XhAVKlpIxWPpgRTnlgZssJrF0m6YtRA0QDWgsBNT12uZM6LPRydR7ip405Y3t1LamD8cP2TZFEDZFBf5ApcA==} case-sensitive-paths-webpack-plugin@2.4.0: resolution: {integrity: sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==} engines: {node: '>=4'} + cborg@4.2.0: + resolution: {integrity: sha512-q6cFW5m3KxfP/9xGI3yGLaC1l5DP6DWM9IvjiJojnIwohL5CQDl02EXViPV852mOfQo+7PJGPN01MI87vFGzyA==} + hasBin: true + chai@4.4.1: resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} engines: {node: '>=4'} @@ -3523,8 +3565,8 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} - chrome-trace-event@1.0.4: - resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} + chrome-trace-event@1.0.3: + resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} engines: {node: '>=6.0'} ci-info@3.9.0: @@ -3585,6 +3627,9 @@ packages: resolution: {integrity: sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==} engines: {node: '>= 4.0'} + codeco@1.2.3: + resolution: {integrity: sha512-nbj0SrL3Cr5nWRwStBDYkA/lEJ9xm9TOjKk7Fo4rEspEC/fb9k3N9MvoK/ygTInBh5dqjsFGC9Bd6AE3GnAyxg==} + collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} @@ -4044,8 +4089,8 @@ packages: supports-color: optional: true - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} + debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -4071,8 +4116,8 @@ packages: dedent@0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} - deep-eql@4.1.4: - resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} + deep-eql@4.1.3: + resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} engines: {node: '>=6'} deep-equal@2.2.3: @@ -4274,8 +4319,8 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.4.799: - resolution: {integrity: sha512-3D3DwWkRTzrdEpntY0hMLYwj7SeBk1138CkPE8sBDSj3WzrzOiG2rHm3luw8jucpf+WiyLBCZyU9lMHyQI9M9Q==} + electron-to-chromium@1.4.783: + resolution: {integrity: sha512-bT0jEz/Xz1fahQpbZ1D7LgmPYZ3iHVY39NcWWro1+hA2IvjiPeaXtfSqrQ+nXjApMvQRE2ASt1itSLRrebHMRQ==} elliptic@6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} @@ -4311,8 +4356,8 @@ packages: end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} - enhanced-resolve@5.17.0: - resolution: {integrity: sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==} + enhanced-resolve@5.16.1: + resolution: {integrity: sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw==} engines: {node: '>=10.13.0'} enquirer@2.4.1: @@ -4542,8 +4587,8 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - eslint-plugin-react@7.34.2: - resolution: {integrity: sha512-2HCmrU+/JNigDN6tg55cRDKCQWicYAPB38JGSFDQt95jDm8rrvSUo7YPkOIm5l6ts1j1zCvysNcasvfTMQzUOw==} + eslint-plugin-react@7.34.1: + resolution: {integrity: sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 @@ -4844,8 +4889,8 @@ packages: for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - foreground-child@3.2.0: - resolution: {integrity: sha512-CrWQNaEl1/6WeZoarcM9LHupTo3RpZO2Pdk1vktwzPiQTsJnAKJmm3TACKeG5UZbWDfaH2AbvYxzP96y0MT7fA==} + foreground-child@3.1.1: + resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} engines: {node: '>=14'} fork-ts-checker-webpack-plugin@6.5.3: @@ -5580,6 +5625,11 @@ packages: peerDependencies: ws: '*' + isows@1.0.3: + resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} + peerDependencies: + ws: '*' + istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} @@ -5607,8 +5657,8 @@ packages: iterator.prototype@1.1.2: resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==} - jackspeak@3.4.0: - resolution: {integrity: sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==} + jackspeak@3.1.2: + resolution: {integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==} engines: {node: '>=14'} jake@10.9.1: @@ -5789,17 +5839,14 @@ packages: node-notifier: optional: true - jiti@1.21.6: - resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} + jiti@1.21.0: + resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} - js-base64@3.7.7: - resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==} - js-sha256@0.9.0: resolution: {integrity: sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==} @@ -5901,10 +5948,6 @@ packages: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} - jwt-decode@4.0.0: - resolution: {integrity: sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==} - engines: {node: '>=18'} - keccak@3.0.4: resolution: {integrity: sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==} engines: {node: '>=10.0.0'} @@ -5954,8 +5997,8 @@ packages: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} - lilconfig@3.1.2: - resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} + lilconfig@3.1.1: + resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} engines: {node: '>=14'} lines-and-columns@1.2.4: @@ -5977,8 +6020,8 @@ packages: resolution: {integrity: sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==} engines: {node: '>=8.9.0'} - loader-utils@3.3.1: - resolution: {integrity: sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==} + loader-utils@3.2.1: + resolution: {integrity: sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==} engines: {node: '>= 12.13.0'} local-pkg@0.5.0: @@ -6262,8 +6305,8 @@ packages: engines: {node: '>=10'} hasBin: true - mlly@1.7.1: - resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} + mlly@1.7.0: + resolution: {integrity: sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==} modify-values@1.0.1: resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==} @@ -6282,6 +6325,9 @@ packages: resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} hasBin: true + multiformats@13.1.1: + resolution: {integrity: sha512-JiptvwMmlxlzIlLLwhCi/srf/nk409UL0eUBr0kioRJq15hqqKyg68iftrBvhCRjR6Rw4fkNnSc4ZJXJDuta/Q==} + multistream@4.1.0: resolution: {integrity: sha512-J1XDiAmmNpRCBfIWJv+n0ymC4ABcf/Pl+5YvC5B/D2f/2+8PtHvCNxMPKiQcZyi922Hq69J2YOpb1pTywfifyw==} @@ -6708,9 +6754,6 @@ packages: resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} engines: {node: '>=8'} - poseidon-lite@0.2.0: - resolution: {integrity: sha512-vivDZnGmz8W4G/GzVA72PXkfYStjilu83rjjUfpL4PueKcC8nfX6hCPh2XhoC5FBgC6y0TA3YuUeUo5YCcNoig==} - possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} @@ -7175,8 +7218,8 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - prettier@3.3.2: - resolution: {integrity: sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==} + prettier@3.2.5: + resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} engines: {node: '>=14'} hasBin: true @@ -7245,10 +7288,6 @@ packages: q@1.5.1: resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==} engines: {node: '>=0.6.0', teleport: '>=0.2.0'} - deprecated: |- - You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. - - (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) qs@6.11.0: resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} @@ -7556,8 +7595,8 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rpc-websockets@8.0.1: - resolution: {integrity: sha512-PptrPRK40uQvifq5sCcObmqInVcZXhy+RRrirzdE5KUPvDI47y1wPvfckD2QzqngOU9xaPW/dT+G+b+wj6M1MQ==} + rpc-websockets@7.11.0: + resolution: {integrity: sha512-IkLYjayPv6Io8C/TdCL5gwgzd1hFz2vmBZrjMw/SPEXo51ETOhnzgS4Qy5GWi2JQN7HKHa66J3+2mv0fgNh/7w==} run-async@2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} @@ -8008,9 +8047,8 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true - superstruct@1.0.4: - resolution: {integrity: sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==} - engines: {node: '>=14.0.0'} + superstruct@0.14.2: + resolution: {integrity: sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==} supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} @@ -8053,8 +8091,8 @@ packages: resolution: {integrity: sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==} engines: {node: '>=8.0.0'} - tailwindcss@3.4.4: - resolution: {integrity: sha512-ZoyXOdJjISB7/BcLTR6SEsLgKtDStYyYZVLsUtWChO4Ps20CBad7lfJKVDiejocV4ME1hLmyY0WJE3hSDcmQ2A==} + tailwindcss@3.4.3: + resolution: {integrity: sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==} engines: {node: '>=14.0.0'} hasBin: true @@ -8098,8 +8136,8 @@ packages: uglify-js: optional: true - terser@5.31.1: - resolution: {integrity: sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==} + terser@5.31.0: + resolution: {integrity: sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg==} engines: {node: '>=10'} hasBin: true @@ -8251,8 +8289,8 @@ packages: tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} tsutils@3.21.0: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -8384,11 +8422,14 @@ packages: ufo@1.5.3: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} - uglify-js@3.18.0: - resolution: {integrity: sha512-SyVVbcNBCk0dzr9XL/R/ySrmYf0s372K6/hFklzgcp2lBFyXtw4I7BOdDjlLhE1aVqaI/SHWXWmYdlZxuyF38A==} + uglify-js@3.17.4: + resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} hasBin: true + uint8arrays@5.1.0: + resolution: {integrity: sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==} + unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -8492,13 +8533,21 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} + viem@1.21.4: + resolution: {integrity: sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + vite-node@1.6.0: resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite@5.2.13: - resolution: {integrity: sha512-SSq1noJfY9pR3I1TUENL3rQYDQCFqgD+lM6fTRAM8Nv6Lsg5hDLaXkjETVeBt+7vZBCMoibD+6IWnT2mJ+Zb/A==} + vite@5.2.11: + resolution: {integrity: sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -8654,8 +8703,8 @@ packages: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} - webpack@5.92.0: - resolution: {integrity: sha512-Bsw2X39MYIgxouNATyVpCNVWBCuUwDgWtN78g6lSdPJRLaQ/PUVm/oXcaRAyY/sMFoKFQrsPeqvTizWtq7QPCA==} + webpack@5.91.0: + resolution: {integrity: sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -8766,6 +8815,7 @@ packages: workbox-google-analytics@6.6.0: resolution: {integrity: sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==} + deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained workbox-navigation-preload@6.6.0: resolution: {integrity: sha512-utNEWG+uOfXdaZmvhshrh7KzhDu/1iMHyQOV6Aqup8Mm78D286ugu5k9MFD9SzBT5TcwgwSORVvInaXWbvKz9Q==} @@ -8842,6 +8892,18 @@ packages: utf-8-validate: optional: true + ws@8.13.0: + resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@8.17.0: resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==} engines: {node: '>=10.0.0'} @@ -8884,8 +8946,8 @@ packages: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} - yaml@2.4.5: - resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} + yaml@2.4.2: + resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} engines: {node: '>= 14'} hasBin: true @@ -8934,6 +8996,8 @@ packages: snapshots: + '@adraffy/ens-normalize@1.10.0': {} + '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.3.0': @@ -8941,9 +9005,9 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@apideck/better-ajv-errors@0.3.6(ajv@8.16.0)': + '@apideck/better-ajv-errors@0.3.6(ajv@8.14.0)': dependencies: - ajv: 8.16.0 + ajv: 8.14.0 json-schema: 0.4.0 jsonpointer: 5.0.1 leven: 3.1.0 @@ -8957,7 +9021,7 @@ snapshots: transitivePeerDependencies: - debug - '@aptos-labs/ts-sdk@1.19.0': + '@aptos-labs/ts-sdk@1.16.0': dependencies: '@aptos-labs/aptos-cli': 0.1.8 '@aptos-labs/aptos-client': 0.1.0 @@ -8967,963 +9031,877 @@ snapshots: '@scure/bip39': 1.3.0 eventemitter3: 5.0.1 form-data: 4.0.0 - js-base64: 3.7.7 - jwt-decode: 4.0.0 - poseidon-lite: 0.2.0 transitivePeerDependencies: - debug - '@babel/code-frame@7.24.7': + '@babel/code-frame@7.24.6': dependencies: - '@babel/highlight': 7.24.7 + '@babel/highlight': 7.24.6 picocolors: 1.0.1 - '@babel/compat-data@7.24.7': {} + '@babel/compat-data@7.24.6': {} - '@babel/core@7.24.7': + '@babel/core@7.24.6': dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.24.7 - '@babel/helper-compilation-targets': 7.24.7 - '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.7) - '@babel/helpers': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/template': 7.24.7 - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 + '@babel/code-frame': 7.24.6 + '@babel/generator': 7.24.6 + '@babel/helper-compilation-targets': 7.24.6 + '@babel/helper-module-transforms': 7.24.6(@babel/core@7.24.6) + '@babel/helpers': 7.24.6 + '@babel/parser': 7.24.6 + '@babel/template': 7.24.6 + '@babel/traverse': 7.24.6 + '@babel/types': 7.24.6 convert-source-map: 2.0.0 - debug: 4.3.5 + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/eslint-parser@7.24.7(@babel/core@7.24.7)(eslint@8.56.0)': + '@babel/eslint-parser@7.24.6(@babel/core@7.24.6)(eslint@8.56.0)': dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.6 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 eslint: 8.56.0 eslint-visitor-keys: 2.1.0 semver: 6.3.1 - '@babel/generator@7.24.7': + '@babel/generator@7.24.6': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 - '@babel/helper-annotate-as-pure@7.24.7': + '@babel/helper-annotate-as-pure@7.24.6': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 - '@babel/helper-builder-binary-assignment-operator-visitor@7.24.7': + '@babel/helper-builder-binary-assignment-operator-visitor@7.24.6': dependencies: - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.24.6 - '@babel/helper-compilation-targets@7.24.7': + '@babel/helper-compilation-targets@7.24.6': dependencies: - '@babel/compat-data': 7.24.7 - '@babel/helper-validator-option': 7.24.7 - browserslist: 4.23.1 + '@babel/compat-data': 7.24.6 + '@babel/helper-validator-option': 7.24.6 + browserslist: 4.23.0 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-function-name': 7.24.7 - '@babel/helper-member-expression-to-functions': 7.24.7 - '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/helper-replace-supers': 7.24.7(@babel/core@7.24.7) - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 + '@babel/helper-create-class-features-plugin@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-function-name': 7.24.6 + '@babel/helper-member-expression-to-functions': 7.24.6 + '@babel/helper-optimise-call-expression': 7.24.6 + '@babel/helper-replace-supers': 7.24.6(@babel/core@7.24.6) + '@babel/helper-skip-transparent-expression-wrappers': 7.24.6 + '@babel/helper-split-export-declaration': 7.24.6 semver: 6.3.1 - transitivePeerDependencies: - - supports-color - '@babel/helper-create-regexp-features-plugin@7.24.7(@babel/core@7.24.7)': + '@babel/helper-create-regexp-features-plugin@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 regexpu-core: 5.3.2 semver: 6.3.1 - '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.24.7)': + '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-compilation-targets': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - debug: 4.3.5 + '@babel/core': 7.24.6 + '@babel/helper-compilation-targets': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + debug: 4.3.4 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: - supports-color - '@babel/helper-environment-visitor@7.24.7': - dependencies: - '@babel/types': 7.24.7 + '@babel/helper-environment-visitor@7.24.6': {} - '@babel/helper-function-name@7.24.7': + '@babel/helper-function-name@7.24.6': dependencies: - '@babel/template': 7.24.7 - '@babel/types': 7.24.7 + '@babel/template': 7.24.6 + '@babel/types': 7.24.6 - '@babel/helper-hoist-variables@7.24.7': + '@babel/helper-hoist-variables@7.24.6': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 - '@babel/helper-member-expression-to-functions@7.24.7': + '@babel/helper-member-expression-to-functions@7.24.6': dependencies: - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.24.6 - '@babel/helper-module-imports@7.24.7': + '@babel/helper-module-imports@7.24.6': dependencies: - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.24.6 - '@babel/helper-module-transforms@7.24.7(@babel/core@7.24.7)': + '@babel/helper-module-transforms@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-module-imports': 7.24.6 + '@babel/helper-simple-access': 7.24.6 + '@babel/helper-split-export-declaration': 7.24.6 + '@babel/helper-validator-identifier': 7.24.6 - '@babel/helper-optimise-call-expression@7.24.7': + '@babel/helper-optimise-call-expression@7.24.6': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 - '@babel/helper-plugin-utils@7.24.7': {} + '@babel/helper-plugin-utils@7.24.6': {} - '@babel/helper-remap-async-to-generator@7.24.7(@babel/core@7.24.7)': + '@babel/helper-remap-async-to-generator@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-wrap-function': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-wrap-function': 7.24.6 - '@babel/helper-replace-supers@7.24.7(@babel/core@7.24.7)': + '@babel/helper-replace-supers@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-member-expression-to-functions': 7.24.7 - '@babel/helper-optimise-call-expression': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-member-expression-to-functions': 7.24.6 + '@babel/helper-optimise-call-expression': 7.24.6 - '@babel/helper-simple-access@7.24.7': + '@babel/helper-simple-access@7.24.6': dependencies: - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.24.6 - '@babel/helper-skip-transparent-expression-wrappers@7.24.7': + '@babel/helper-skip-transparent-expression-wrappers@7.24.6': dependencies: - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/types': 7.24.6 - '@babel/helper-split-export-declaration@7.24.7': + '@babel/helper-split-export-declaration@7.24.6': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 - '@babel/helper-string-parser@7.24.7': {} + '@babel/helper-string-parser@7.24.6': {} - '@babel/helper-validator-identifier@7.24.7': {} + '@babel/helper-validator-identifier@7.24.6': {} - '@babel/helper-validator-option@7.24.7': {} + '@babel/helper-validator-option@7.24.6': {} - '@babel/helper-wrap-function@7.24.7': + '@babel/helper-wrap-function@7.24.6': dependencies: - '@babel/helper-function-name': 7.24.7 - '@babel/template': 7.24.7 - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/helper-function-name': 7.24.6 + '@babel/template': 7.24.6 + '@babel/types': 7.24.6 - '@babel/helpers@7.24.7': + '@babel/helpers@7.24.6': dependencies: - '@babel/template': 7.24.7 - '@babel/types': 7.24.7 + '@babel/template': 7.24.6 + '@babel/types': 7.24.6 - '@babel/highlight@7.24.7': + '@babel/highlight@7.24.6': dependencies: - '@babel/helper-validator-identifier': 7.24.7 + '@babel/helper-validator-identifier': 7.24.6 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.0.1 - '@babel/parser@7.24.7': + '@babel/parser@7.24.6': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-transform-optional-chaining': 7.24.7(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-skip-transparent-expression-wrappers': 7.24.6 + '@babel/plugin-transform-optional-chaining': 7.24.6(@babel/core@7.24.6) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.24.7)': + '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-proposal-decorators@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-proposal-decorators@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-decorators': 7.24.7(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-decorators': 7.24.6(@babel/core@7.24.6) - '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.24.7)': + '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.6) - '@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.24.7)': + '@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.6) - '@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.24.7)': + '@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-skip-transparent-expression-wrappers': 7.24.6 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.6) - '@babel/plugin-proposal-private-methods@7.18.6(@babel/core@7.24.7)': + '@babel/plugin-proposal-private-methods@7.18.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.24.7)': + '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.6 - '@babel/plugin-proposal-private-property-in-object@7.21.11(@babel/core@7.24.7)': + '@babel/plugin-proposal-private-property-in-object@7.21.11(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.6) - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.7)': + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.7)': + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.7)': + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.24.7)': + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-decorators@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-syntax-decorators@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.24.7)': + '@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.24.7)': + '@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-import-assertions@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-syntax-import-assertions@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-import-attributes@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-syntax-import-attributes@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.7)': + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.7)': + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-syntax-jsx@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.7)': + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.7)': + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.7)': + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.7)': + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.7)': + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.7)': + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.24.7)': + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.7)': + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-syntax-typescript@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.24.7)': + '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-create-regexp-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-arrow-functions@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-arrow-functions@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-async-generator-functions@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-async-generator-functions@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-remap-async-to-generator': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-remap-async-to-generator': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.6) - '@babel/plugin-transform-async-to-generator@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-async-to-generator@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-remap-async-to-generator': 7.24.7(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-module-imports': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-remap-async-to-generator': 7.24.6(@babel/core@7.24.6) - '@babel/plugin-transform-block-scoped-functions@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-block-scoped-functions@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-block-scoping@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-block-scoping@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-class-properties@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-class-properties@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-class-static-block@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-class-static-block@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.24.6) - '@babel/plugin-transform-classes@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-classes@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-compilation-targets': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-function-name': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-replace-supers': 7.24.7(@babel/core@7.24.7) - '@babel/helper-split-export-declaration': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-compilation-targets': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-function-name': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-replace-supers': 7.24.6(@babel/core@7.24.6) + '@babel/helper-split-export-declaration': 7.24.6 globals: 11.12.0 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-computed-properties@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-computed-properties@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/template': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/template': 7.24.6 - '@babel/plugin-transform-destructuring@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-destructuring@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-dotall-regex@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-dotall-regex@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-create-regexp-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-duplicate-keys@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-duplicate-keys@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-dynamic-import@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-dynamic-import@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.24.6) - '@babel/plugin-transform-exponentiation-operator@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-exponentiation-operator@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-builder-binary-assignment-operator-visitor': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-export-namespace-from@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-export-namespace-from@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.24.6) - '@babel/plugin-transform-flow-strip-types@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-flow-strip-types@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-flow': 7.24.6(@babel/core@7.24.6) - '@babel/plugin-transform-for-of@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-for-of@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-skip-transparent-expression-wrappers': 7.24.6 - '@babel/plugin-transform-function-name@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-function-name@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-compilation-targets': 7.24.7 - '@babel/helper-function-name': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-compilation-targets': 7.24.6 + '@babel/helper-function-name': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-json-strings@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-json-strings@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.6) - '@babel/plugin-transform-literals@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-literals@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-logical-assignment-operators@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-logical-assignment-operators@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.6) - '@babel/plugin-transform-member-expression-literals@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-member-expression-literals@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-modules-amd@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-modules-amd@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-module-transforms': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-modules-commonjs@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-modules-commonjs@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-module-transforms': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-simple-access': 7.24.6 - '@babel/plugin-transform-modules-systemjs@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-modules-systemjs@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-hoist-variables': 7.24.7 - '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-hoist-variables': 7.24.6 + '@babel/helper-module-transforms': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-validator-identifier': 7.24.6 - '@babel/plugin-transform-modules-umd@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-modules-umd@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-module-transforms': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-named-capturing-groups-regex@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-named-capturing-groups-regex@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-create-regexp-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-new-target@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-new-target@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-nullish-coalescing-operator@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-nullish-coalescing-operator@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.6) - '@babel/plugin-transform-numeric-separator@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-numeric-separator@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.6) - '@babel/plugin-transform-object-rest-spread@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-object-rest-spread@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-compilation-targets': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-compilation-targets': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-transform-parameters': 7.24.6(@babel/core@7.24.6) - '@babel/plugin-transform-object-super@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-object-super@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-replace-supers': 7.24.7(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-replace-supers': 7.24.6(@babel/core@7.24.6) - '@babel/plugin-transform-optional-catch-binding@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-optional-catch-binding@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.6) - '@babel/plugin-transform-optional-chaining@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-optional-chaining@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-skip-transparent-expression-wrappers': 7.24.6 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.6) - '@babel/plugin-transform-parameters@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-parameters@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-private-methods@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-private-methods@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-private-property-in-object@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-private-property-in-object@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.6) - '@babel/plugin-transform-property-literals@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-property-literals@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-react-constant-elements@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-react-constant-elements@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-react-display-name@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-react-display-name@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-react-jsx-development@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-react-jsx-development@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/plugin-transform-react-jsx': 7.24.7(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/plugin-transform-react-jsx': 7.24.6(@babel/core@7.24.6) - '@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.24.7) - '@babel/types': 7.24.7 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-module-imports': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-jsx': 7.24.6(@babel/core@7.24.6) + '@babel/types': 7.24.6 - '@babel/plugin-transform-react-pure-annotations@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-react-pure-annotations@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-regenerator@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-regenerator@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 regenerator-transform: 0.15.2 - '@babel/plugin-transform-reserved-words@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-reserved-words@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-runtime@7.24.7(@babel/core@7.24.7)': + '@babel/plugin-transform-runtime@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.24.7) - babel-plugin-polyfill-corejs3: 0.10.4(@babel/core@7.24.7) - babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-module-imports': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.24.6) + babel-plugin-polyfill-corejs3: 0.10.4(@babel/core@7.24.6) + babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.24.6) semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/plugin-transform-shorthand-properties@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-transform-spread@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-sticky-regex@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-transform-template-literals@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-transform-typeof-symbol@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-transform-typescript@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-unicode-escapes@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-transform-unicode-property-regex@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-transform-unicode-regex@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-transform-unicode-sets-regex@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-create-regexp-features-plugin': 7.24.7(@babel/core@7.24.7) - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/preset-env@7.24.7(@babel/core@7.24.7)': - dependencies: - '@babel/compat-data': 7.24.7 - '@babel/core': 7.24.7 - '@babel/helper-compilation-targets': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-validator-option': 7.24.7 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.24.7) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.7) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.7) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.24.7) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-import-assertions': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-syntax-import-attributes': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.7) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.7) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.7) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.7) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.7) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.24.7) - '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-async-generator-functions': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-async-to-generator': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-block-scoped-functions': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-block-scoping': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-class-properties': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-class-static-block': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-classes': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-destructuring': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-dotall-regex': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-duplicate-keys': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-dynamic-import': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-exponentiation-operator': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-export-namespace-from': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-for-of': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-function-name': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-json-strings': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-literals': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-logical-assignment-operators': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-member-expression-literals': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-modules-amd': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-modules-commonjs': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-modules-systemjs': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-modules-umd': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-named-capturing-groups-regex': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-new-target': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-nullish-coalescing-operator': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-numeric-separator': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-object-rest-spread': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-object-super': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-optional-catch-binding': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-optional-chaining': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-private-methods': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-private-property-in-object': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-property-literals': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-regenerator': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-reserved-words': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-sticky-regex': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-typeof-symbol': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-unicode-escapes': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-unicode-property-regex': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-unicode-regex': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-unicode-sets-regex': 7.24.7(@babel/core@7.24.7) - '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.24.7) - babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.24.7) - babel-plugin-polyfill-corejs3: 0.10.4(@babel/core@7.24.7) - babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.24.7) + '@babel/plugin-transform-shorthand-properties@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + + '@babel/plugin-transform-spread@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-skip-transparent-expression-wrappers': 7.24.6 + + '@babel/plugin-transform-sticky-regex@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + + '@babel/plugin-transform-template-literals@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + + '@babel/plugin-transform-typeof-symbol@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + + '@babel/plugin-transform-typescript@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-typescript': 7.24.6(@babel/core@7.24.6) + + '@babel/plugin-transform-unicode-escapes@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + + '@babel/plugin-transform-unicode-property-regex@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-create-regexp-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + + '@babel/plugin-transform-unicode-regex@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-create-regexp-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + + '@babel/plugin-transform-unicode-sets-regex@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/core': 7.24.6 + '@babel/helper-create-regexp-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + + '@babel/preset-env@7.24.6(@babel/core@7.24.6)': + dependencies: + '@babel/compat-data': 7.24.6 + '@babel/core': 7.24.6 + '@babel/helper-compilation-targets': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-validator-option': 7.24.6 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.24.6) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.6) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.6) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.24.6) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-import-assertions': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-syntax-import-attributes': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.6) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.6) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.24.6) + '@babel/plugin-transform-arrow-functions': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-async-generator-functions': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-async-to-generator': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-block-scoped-functions': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-block-scoping': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-class-properties': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-class-static-block': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-classes': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-computed-properties': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-destructuring': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-dotall-regex': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-duplicate-keys': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-dynamic-import': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-exponentiation-operator': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-export-namespace-from': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-for-of': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-function-name': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-json-strings': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-literals': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-logical-assignment-operators': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-member-expression-literals': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-modules-amd': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-modules-commonjs': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-modules-systemjs': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-modules-umd': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-named-capturing-groups-regex': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-new-target': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-nullish-coalescing-operator': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-numeric-separator': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-object-rest-spread': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-object-super': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-optional-catch-binding': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-optional-chaining': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-parameters': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-private-methods': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-private-property-in-object': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-property-literals': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-regenerator': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-reserved-words': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-shorthand-properties': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-spread': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-sticky-regex': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-template-literals': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-typeof-symbol': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-unicode-escapes': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-unicode-property-regex': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-unicode-regex': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-unicode-sets-regex': 7.24.6(@babel/core@7.24.6) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.24.6) + babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.24.6) + babel-plugin-polyfill-corejs3: 0.10.4(@babel/core@7.24.6) + babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.24.6) core-js-compat: 3.37.1 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.24.7)': + '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/types': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/types': 7.24.6 esutils: 2.0.3 - '@babel/preset-react@7.24.7(@babel/core@7.24.7)': + '@babel/preset-react@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-validator-option': 7.24.7 - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-react-jsx': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-react-jsx-development': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-react-pure-annotations': 7.24.7(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-validator-option': 7.24.6 + '@babel/plugin-transform-react-display-name': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-react-jsx': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-react-jsx-development': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-react-pure-annotations': 7.24.6(@babel/core@7.24.6) - '@babel/preset-typescript@7.24.7(@babel/core@7.24.7)': + '@babel/preset-typescript@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/helper-validator-option': 7.24.7 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-modules-commonjs': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-typescript': 7.24.7(@babel/core@7.24.7) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/helper-validator-option': 7.24.6 + '@babel/plugin-syntax-jsx': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-modules-commonjs': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-typescript': 7.24.6(@babel/core@7.24.6) '@babel/regjsgen@0.8.0': {} - '@babel/runtime@7.24.7': + '@babel/runtime@7.24.6': dependencies: regenerator-runtime: 0.14.1 - '@babel/template@7.24.7': + '@babel/template@7.24.6': dependencies: - '@babel/code-frame': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 + '@babel/code-frame': 7.24.6 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 - '@babel/traverse@7.24.7': + '@babel/traverse@7.24.6': dependencies: - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-function-name': 7.24.7 - '@babel/helper-hoist-variables': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 - debug: 4.3.5 + '@babel/code-frame': 7.24.6 + '@babel/generator': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-function-name': 7.24.6 + '@babel/helper-hoist-variables': 7.24.6 + '@babel/helper-split-export-declaration': 7.24.6 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.24.7': + '@babel/types@7.24.6': dependencies: - '@babel/helper-string-parser': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 + '@babel/helper-string-parser': 7.24.6 + '@babel/helper-validator-identifier': 7.24.6 to-fast-properties: 2.0.0 '@bcoe/v8-coverage@0.2.3': {} - '@changesets/apply-release-plan@7.0.3': + '@changesets/apply-release-plan@7.0.1': dependencies: - '@babel/runtime': 7.24.7 - '@changesets/config': 3.0.1 + '@babel/runtime': 7.24.6 + '@changesets/config': 3.0.0 '@changesets/get-version-range-type': 0.4.0 '@changesets/git': 3.0.0 - '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 @@ -9934,12 +9912,11 @@ snapshots: resolve-from: 5.0.0 semver: 7.6.2 - '@changesets/assemble-release-plan@6.0.2': + '@changesets/assemble-release-plan@6.0.0': dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.0 - '@changesets/should-skip-package': 0.1.0 + '@changesets/get-dependents-graph': 2.0.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 semver: 7.6.2 @@ -9948,21 +9925,20 @@ snapshots: dependencies: '@changesets/types': 6.0.0 - '@changesets/cli@2.27.5': + '@changesets/cli@2.27.3': dependencies: - '@babel/runtime': 7.24.7 - '@changesets/apply-release-plan': 7.0.3 - '@changesets/assemble-release-plan': 6.0.2 + '@babel/runtime': 7.24.6 + '@changesets/apply-release-plan': 7.0.1 + '@changesets/assemble-release-plan': 6.0.0 '@changesets/changelog-git': 0.2.0 - '@changesets/config': 3.0.1 + '@changesets/config': 3.0.0 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.0 - '@changesets/get-release-plan': 4.0.2 + '@changesets/get-dependents-graph': 2.0.0 + '@changesets/get-release-plan': 4.0.0 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/pre': 2.0.0 '@changesets/read': 0.6.0 - '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@changesets/write': 0.3.1 '@manypkg/get-packages': 1.1.3 @@ -9984,10 +9960,10 @@ snapshots: term-size: 2.2.1 tty-table: 4.2.3 - '@changesets/config@3.0.1': + '@changesets/config@3.0.0': dependencies: '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.0 + '@changesets/get-dependents-graph': 2.0.0 '@changesets/logger': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -9998,7 +9974,7 @@ snapshots: dependencies: extendable-error: 0.1.7 - '@changesets/get-dependents-graph@2.1.0': + '@changesets/get-dependents-graph@2.0.0': dependencies: '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -10006,11 +9982,11 @@ snapshots: fs-extra: 7.0.1 semver: 7.6.2 - '@changesets/get-release-plan@4.0.2': + '@changesets/get-release-plan@4.0.0': dependencies: - '@babel/runtime': 7.24.7 - '@changesets/assemble-release-plan': 6.0.2 - '@changesets/config': 3.0.1 + '@babel/runtime': 7.24.6 + '@changesets/assemble-release-plan': 6.0.0 + '@changesets/config': 3.0.0 '@changesets/pre': 2.0.0 '@changesets/read': 0.6.0 '@changesets/types': 6.0.0 @@ -10020,7 +9996,7 @@ snapshots: '@changesets/git@3.0.0': dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -10039,7 +10015,7 @@ snapshots: '@changesets/pre@2.0.0': dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -10047,7 +10023,7 @@ snapshots: '@changesets/read@0.6.0': dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/parse': 0.4.0 @@ -10056,19 +10032,13 @@ snapshots: fs-extra: 7.0.1 p-filter: 2.1.0 - '@changesets/should-skip-package@0.1.0': - dependencies: - '@babel/runtime': 7.24.7 - '@changesets/types': 6.0.0 - '@manypkg/get-packages': 1.1.3 - '@changesets/types@4.1.0': {} '@changesets/types@6.0.0': {} '@changesets/write@0.3.1': dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 '@changesets/types': 6.0.0 fs-extra: 7.0.1 human-id: 1.0.2 @@ -10077,7 +10047,7 @@ snapshots: '@commitlint/config-validator@19.0.3': dependencies: '@commitlint/types': 19.0.3 - ajv: 8.16.0 + ajv: 8.14.0 optional: true '@commitlint/execute-rule@19.0.0': @@ -10200,6 +10170,31 @@ snapshots: dependencies: postcss-selector-parser: 6.1.0 + '@didtools/cacao@3.0.1(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8)': + dependencies: + '@didtools/codecs': 3.0.0 + '@didtools/siwx': 2.0.0 + '@ipld/dag-cbor': 9.2.0 + caip: 1.1.1 + multiformats: 13.1.1 + uint8arrays: 5.1.0 + viem: 1.21.4(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8) + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + + '@didtools/codecs@3.0.0': + dependencies: + codeco: 1.2.3 + multiformats: 13.1.1 + uint8arrays: 5.1.0 + + '@didtools/siwx@2.0.0': + dependencies: + codeco: 1.2.3 + '@discoveryjs/json-ext@0.5.7': {} '@esbuild/aix-ppc64@0.20.2': @@ -10342,12 +10337,12 @@ snapshots: eslint: 8.56.0 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.10.1': {} + '@eslint-community/regexpp@4.10.0': {} '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.5 + debug: 4.3.4 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -10618,7 +10613,7 @@ snapshots: '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.5 + debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -10629,6 +10624,11 @@ snapshots: '@hutson/parse-repository-url@3.0.2': {} + '@ipld/dag-cbor@9.2.0': + dependencies: + cborg: 4.2.0 + multiformats: 13.1.1 + '@irys/arweave@0.0.2': dependencies: asn1.js: 5.4.1 @@ -10648,7 +10648,7 @@ snapshots: '@irys/sdk@0.1.24(arweave@1.15.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: - '@aptos-labs/ts-sdk': 1.19.0 + '@aptos-labs/ts-sdk': 1.16.0 '@ethersproject/bignumber': 5.7.0 '@ethersproject/contracts': 5.7.0 '@ethersproject/providers': 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -10658,7 +10658,7 @@ snapshots: '@near-js/keystores-browser': 0.0.3 '@near-js/providers': 0.0.4 '@near-js/transactions': 0.1.1 - '@solana/web3.js': 1.92.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.91.8(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@supercharge/promise-pool': 3.2.0 algosdk: 1.24.1 arbundles: 0.10.1(arweave@1.15.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -10673,7 +10673,7 @@ snapshots: js-sha256: 0.9.0 mime-types: 2.1.35 near-seed-phrase: 0.2.0 - tslib: 2.6.3 + tslib: 2.6.2 transitivePeerDependencies: - arweave - bufferutil @@ -10846,7 +10846,7 @@ snapshots: '@jest/transform@27.5.1': dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.6 '@jest/types': 27.5.1 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 @@ -10912,14 +10912,14 @@ snapshots: '@manypkg/find-root@1.1.0': dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 '@manypkg/get-packages@1.1.3': dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -11061,12 +11061,18 @@ snapshots: dependencies: eslint-scope: 5.1.1 + '@noble/curves@1.2.0': + dependencies: + '@noble/hashes': 1.3.2 + '@noble/curves@1.4.0': dependencies: '@noble/hashes': 1.4.0 '@noble/ed25519@1.7.3': {} + '@noble/hashes@1.3.2': {} + '@noble/hashes@1.4.0': {} '@nodelib/fs.scandir@2.1.5': @@ -11116,35 +11122,35 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@pmmmwh/react-refresh-webpack-plugin@0.5.15(react-refresh@0.11.0)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.92.0))(webpack@5.92.0)': + '@pmmmwh/react-refresh-webpack-plugin@0.5.13(react-refresh@0.11.0)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0))(webpack@5.91.0)': dependencies: - ansi-html: 0.0.9 + ansi-html-community: 0.0.8 core-js-pure: 3.37.1 error-stack-parser: 2.1.4 html-entities: 2.5.2 loader-utils: 2.0.4 react-refresh: 0.11.0 - schema-utils: 4.2.0 + schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.92.0 + webpack: 5.91.0 optionalDependencies: type-fest: 0.21.3 - webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.92.0) + webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0) - '@pmmmwh/react-refresh-webpack-plugin@0.5.15(react-refresh@0.14.2)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4))': + '@pmmmwh/react-refresh-webpack-plugin@0.5.13(react-refresh@0.14.2)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4))': dependencies: - ansi-html: 0.0.9 + ansi-html-community: 0.0.8 core-js-pure: 3.37.1 error-stack-parser: 2.1.4 html-entities: 2.5.2 loader-utils: 2.0.4 react-refresh: 0.14.2 - schema-utils: 4.2.0 + schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.92.0(webpack-cli@5.1.4) + webpack: 5.91.0(webpack-cli@5.1.4) optionalDependencies: type-fest: 0.21.3 - webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0) + webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0) '@randlabs/communication-bridge@1.0.1': optional: true @@ -11154,16 +11160,14 @@ snapshots: '@randlabs/communication-bridge': 1.0.1 optional: true - '@rollup/plugin-babel@5.3.1(@babel/core@7.24.7)(@types/babel__core@7.20.5)(rollup@2.79.1)': + '@rollup/plugin-babel@5.3.1(@babel/core@7.24.6)(@types/babel__core@7.20.5)(rollup@2.79.1)': dependencies: - '@babel/core': 7.24.7 - '@babel/helper-module-imports': 7.24.7 + '@babel/core': 7.24.6 + '@babel/helper-module-imports': 7.24.6 '@rollup/pluginutils': 3.1.0(rollup@2.79.1) rollup: 2.79.1 optionalDependencies: '@types/babel__core': 7.20.5 - transitivePeerDependencies: - - supports-color '@rollup/plugin-node-resolve@11.2.1(rollup@2.79.1)': dependencies: @@ -11240,12 +11244,23 @@ snapshots: '@scure/base@1.1.6': {} + '@scure/bip32@1.3.2': + dependencies: + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/base': 1.1.6 + '@scure/bip32@1.4.0': dependencies: '@noble/curves': 1.4.0 '@noble/hashes': 1.4.0 '@scure/base': 1.1.6 + '@scure/bip39@1.2.1': + dependencies: + '@noble/hashes': 1.3.2 + '@scure/base': 1.1.6 + '@scure/bip39@1.3.0': dependencies: '@noble/hashes': 1.4.0 @@ -11276,9 +11291,9 @@ snapshots: dependencies: buffer: 6.0.3 - '@solana/web3.js@1.92.3(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + '@solana/web3.js@1.91.8(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 '@noble/curves': 1.4.0 '@noble/hashes': 1.4.0 '@solana/buffer-layout': 4.0.1 @@ -11291,8 +11306,8 @@ snapshots: fast-stable-stringify: 1.0.0 jayson: 4.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) node-fetch: 2.7.0 - rpc-websockets: 8.0.1 - superstruct: 1.0.4 + rpc-websockets: 7.11.0 + superstruct: 0.14.2 transitivePeerDependencies: - bufferutil - encoding @@ -11344,11 +11359,11 @@ snapshots: '@svgr/hast-util-to-babel-ast@5.5.0': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 '@svgr/plugin-jsx@5.5.0': dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.6 '@svgr/babel-preset': 5.5.0 '@svgr/hast-util-to-babel-ast': 5.5.0 svg-parser: 2.0.4 @@ -11363,10 +11378,10 @@ snapshots: '@svgr/webpack@5.5.0': dependencies: - '@babel/core': 7.24.7 - '@babel/plugin-transform-react-constant-elements': 7.24.7(@babel/core@7.24.7) - '@babel/preset-env': 7.24.7(@babel/core@7.24.7) - '@babel/preset-react': 7.24.7(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/plugin-transform-react-constant-elements': 7.24.6(@babel/core@7.24.6) + '@babel/preset-env': 7.24.6(@babel/core@7.24.6) + '@babel/preset-react': 7.24.6(@babel/core@7.24.6) '@svgr/core': 5.5.0 '@svgr/plugin-jsx': 5.5.0 '@svgr/plugin-svgo': 5.5.0 @@ -11376,7 +11391,7 @@ snapshots: '@swc/helpers@0.5.2': dependencies: - tslib: 2.6.3 + tslib: 2.6.2 '@szmarczak/http-timer@4.0.6': dependencies: @@ -11406,24 +11421,24 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.6 '@types/babel__generator@7.6.8': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 '@types/babel__traverse@7.20.6': dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.6 '@types/body-parser@1.19.5': dependencies: @@ -11443,7 +11458,7 @@ snapshots: '@types/connect-history-api-fallback@1.5.4': dependencies: - '@types/express-serve-static-core': 4.19.3 + '@types/express-serve-static-core': 4.19.1 '@types/node': 20.11.30 '@types/connect@3.4.38': @@ -11471,7 +11486,7 @@ snapshots: '@types/estree@1.0.5': {} - '@types/express-serve-static-core@4.19.3': + '@types/express-serve-static-core@4.19.1': dependencies: '@types/node': 20.11.30 '@types/qs': 6.9.15 @@ -11481,7 +11496,7 @@ snapshots: '@types/express@4.17.21': dependencies: '@types/body-parser': 1.19.5 - '@types/express-serve-static-core': 4.19.3 + '@types/express-serve-static-core': 4.19.1 '@types/qs': 6.9.15 '@types/serve-static': 1.15.7 @@ -11517,7 +11532,7 @@ snapshots: dependencies: '@types/node': 20.11.30 - '@types/lodash@4.17.5': {} + '@types/lodash@4.17.4': {} '@types/mime@1.3.5': {} @@ -11622,12 +11637,12 @@ snapshots: '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2)': dependencies: - '@eslint-community/regexpp': 4.10.1 + '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) - debug: 4.3.5 + debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -11641,13 +11656,13 @@ snapshots: '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2)': dependencies: - '@eslint-community/regexpp': 4.10.1 + '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/type-utils': 6.21.0(eslint@8.56.0)(typescript@5.2.2) '@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.5 + debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -11672,7 +11687,7 @@ snapshots: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) - debug: 4.3.5 + debug: 4.3.4 eslint: 8.56.0 optionalDependencies: typescript: 5.2.2 @@ -11685,7 +11700,7 @@ snapshots: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.5 + debug: 4.3.4 eslint: 8.56.0 optionalDependencies: typescript: 5.2.2 @@ -11706,7 +11721,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) - debug: 4.3.5 + debug: 4.3.4 eslint: 8.56.0 tsutils: 3.21.0(typescript@5.2.2) optionalDependencies: @@ -11718,7 +11733,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2) '@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.2.2) - debug: 4.3.5 + debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.3.0(typescript@5.2.2) optionalDependencies: @@ -11734,7 +11749,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.5 + debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 @@ -11748,7 +11763,7 @@ snapshots: dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.5 + debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -11802,7 +11817,7 @@ snapshots: '@uniswap/token-lists@1.0.0-beta.34': {} - '@usedapp/core@1.2.16(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0)': + '@usedapp/core@1.2.15(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0)': dependencies: '@metamask/detect-provider': 2.0.0 '@uniswap/token-lists': 1.0.0-beta.34 @@ -11816,11 +11831,11 @@ snapshots: - node-fetch - supports-color - '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.1))': + '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 - debug: 4.3.5 + debug: 4.3.4 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 5.0.4 @@ -11831,7 +11846,7 @@ snapshots: std-env: 3.7.0 strip-literal: 2.1.0 test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.1) + vitest: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0) transitivePeerDependencies: - supports-color @@ -11940,22 +11955,22 @@ snapshots: '@webassemblyjs/ast': 1.12.1 '@xtuc/long': 4.2.2 - '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4))': + '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4))': dependencies: - webpack: 5.92.0(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + webpack: 5.91.0(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) - '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4))': + '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4))': dependencies: - webpack: 5.92.0(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + webpack: 5.91.0(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) - '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0))(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4))': + '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0))(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4))': dependencies: - webpack: 5.92.0(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + webpack: 5.91.0(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) optionalDependencies: - webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0) + webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0) '@xtuc/ieee754@1.2.0': {} @@ -11968,6 +11983,11 @@ snapshots: abab@2.0.6: {} + abitype@0.9.8(typescript@5.2.2)(zod@3.23.8): + optionalDependencies: + typescript: 5.2.2 + zod: 3.23.8 + accepts@1.3.8: dependencies: mime-types: 2.1.35 @@ -11978,7 +11998,7 @@ snapshots: acorn: 7.4.1 acorn-walk: 7.2.0 - acorn-import-attributes@1.9.5(acorn@8.11.3): + acorn-import-assertions@1.9.0(acorn@8.11.3): dependencies: acorn: 8.11.3 @@ -12007,7 +12027,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.5 + debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -12015,17 +12035,17 @@ snapshots: dependencies: humanize-ms: 1.2.1 - ajv-formats@2.1.1(ajv@8.16.0): + ajv-formats@2.1.1(ajv@8.14.0): optionalDependencies: - ajv: 8.16.0 + ajv: 8.14.0 ajv-keywords@3.5.2(ajv@6.12.6): dependencies: ajv: 6.12.6 - ajv-keywords@5.1.0(ajv@8.16.0): + ajv-keywords@5.1.0(ajv@8.14.0): dependencies: - ajv: 8.16.0 + ajv: 8.14.0 fast-deep-equal: 3.1.3 ajv@6.12.6: @@ -12035,7 +12055,7 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 - ajv@8.16.0: + ajv@8.14.0: dependencies: fast-deep-equal: 3.1.3 json-schema-traverse: 1.0.0 @@ -12067,8 +12087,6 @@ snapshots: ansi-html-community@0.0.8: {} - ansi-html@0.0.9: {} - ansi-regex@5.0.1: {} ansi-regex@6.0.1: {} @@ -12219,7 +12237,7 @@ snapshots: es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 - array.prototype.tosorted@1.1.4: + array.prototype.tosorted@1.1.3: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 @@ -12285,8 +12303,8 @@ snapshots: autoprefixer@10.4.19(postcss@8.4.38): dependencies: - browserslist: 4.23.1 - caniuse-lite: 1.0.30001632 + browserslist: 4.23.0 + caniuse-lite: 1.0.30001623 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.1 @@ -12301,7 +12319,7 @@ snapshots: axios-retry@3.9.1: dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 is-retry-allowed: 2.2.0 axios@1.6.2: @@ -12324,32 +12342,32 @@ snapshots: dependencies: dequal: 2.0.3 - babel-jest@27.5.1(@babel/core@7.24.7): + babel-jest@27.5.1(@babel/core@7.24.6): dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.6 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 '@types/babel__core': 7.20.5 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 27.5.1(@babel/core@7.24.7) + babel-preset-jest: 27.5.1(@babel/core@7.24.6) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 transitivePeerDependencies: - supports-color - babel-loader@8.3.0(@babel/core@7.24.7)(webpack@5.92.0): + babel-loader@8.3.0(@babel/core@7.24.6)(webpack@5.91.0): dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.6 find-cache-dir: 3.3.2 loader-utils: 2.0.4 make-dir: 3.1.0 schema-utils: 2.7.1 - webpack: 5.92.0 + webpack: 5.91.0 babel-plugin-istanbul@6.1.1: dependencies: - '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-plugin-utils': 7.24.6 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -12359,86 +12377,86 @@ snapshots: babel-plugin-jest-hoist@27.5.1: dependencies: - '@babel/template': 7.24.7 - '@babel/types': 7.24.7 + '@babel/template': 7.24.6 + '@babel/types': 7.24.6 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.20.6 babel-plugin-macros@3.1.0: dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 cosmiconfig: 7.1.0 resolve: 1.22.8 - babel-plugin-named-asset-import@0.3.8(@babel/core@7.24.7): + babel-plugin-named-asset-import@0.3.8(@babel/core@7.24.6): dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.6 - babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.24.7): + babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.24.6): dependencies: - '@babel/compat-data': 7.24.7 - '@babel/core': 7.24.7 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.24.7) + '@babel/compat-data': 7.24.6 + '@babel/core': 7.24.6 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.24.6) semver: 6.3.1 transitivePeerDependencies: - supports-color - babel-plugin-polyfill-corejs3@0.10.4(@babel/core@7.24.7): + babel-plugin-polyfill-corejs3@0.10.4(@babel/core@7.24.6): dependencies: - '@babel/core': 7.24.7 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.24.6) core-js-compat: 3.37.1 transitivePeerDependencies: - supports-color - babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.24.7): + babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.24.6): dependencies: - '@babel/core': 7.24.7 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.24.7) + '@babel/core': 7.24.6 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.24.6) transitivePeerDependencies: - supports-color babel-plugin-transform-react-remove-prop-types@0.4.24: {} - babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.7): - dependencies: - '@babel/core': 7.24.7 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.7) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.7) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.7) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.7) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.7) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.7) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.7) - - babel-preset-jest@27.5.1(@babel/core@7.24.7): - dependencies: - '@babel/core': 7.24.7 + babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.6): + dependencies: + '@babel/core': 7.24.6 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.6) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.6) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.6) + + babel-preset-jest@27.5.1(@babel/core@7.24.6): + dependencies: + '@babel/core': 7.24.6 babel-plugin-jest-hoist: 27.5.1 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.7) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.6) babel-preset-react-app@10.0.1: dependencies: - '@babel/core': 7.24.7 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.24.7) - '@babel/plugin-proposal-decorators': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.24.7) - '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.24.7) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.24.7) - '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.24.7) - '@babel/plugin-proposal-private-property-in-object': 7.21.11(@babel/core@7.24.7) - '@babel/plugin-transform-flow-strip-types': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-react-display-name': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-runtime': 7.24.7(@babel/core@7.24.7) - '@babel/preset-env': 7.24.7(@babel/core@7.24.7) - '@babel/preset-react': 7.24.7(@babel/core@7.24.7) - '@babel/preset-typescript': 7.24.7(@babel/core@7.24.7) - '@babel/runtime': 7.24.7 + '@babel/core': 7.24.6 + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.24.6) + '@babel/plugin-proposal-decorators': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.24.6) + '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.24.6) + '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.24.6) + '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.24.6) + '@babel/plugin-proposal-private-property-in-object': 7.21.11(@babel/core@7.24.6) + '@babel/plugin-transform-flow-strip-types': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-react-display-name': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-runtime': 7.24.6(@babel/core@7.24.6) + '@babel/preset-env': 7.24.6(@babel/core@7.24.6) + '@babel/preset-react': 7.24.6(@babel/core@7.24.6) + '@babel/preset-typescript': 7.24.6(@babel/core@7.24.6) + '@babel/runtime': 7.24.6 babel-plugin-macros: 3.1.0 babel-plugin-transform-react-remove-prop-types: 0.4.24 transitivePeerDependencies: @@ -12605,12 +12623,12 @@ snapshots: readable-stream: 2.3.8 safe-buffer: 5.2.1 - browserslist@4.23.1: + browserslist@4.23.0: dependencies: - caniuse-lite: 1.0.30001632 - electron-to-chromium: 1.4.799 + caniuse-lite: 1.0.30001623 + electron-to-chromium: 1.4.783 node-releases: 2.0.14 - update-browserslist-db: 1.0.16(browserslist@4.23.1) + update-browserslist-db: 1.0.16(browserslist@4.23.0) bs58@4.0.1: dependencies: @@ -12689,6 +12707,8 @@ snapshots: cachedir@2.3.0: {} + caip@1.1.1: {} + call-bind@1.0.7: dependencies: es-define-property: 1.0.0 @@ -12702,7 +12722,7 @@ snapshots: camel-case@4.1.2: dependencies: pascal-case: 3.1.2 - tslib: 2.6.3 + tslib: 2.6.2 camelcase-css@2.0.1: {} @@ -12718,20 +12738,22 @@ snapshots: caniuse-api@3.0.0: dependencies: - browserslist: 4.23.1 - caniuse-lite: 1.0.30001632 + browserslist: 4.23.0 + caniuse-lite: 1.0.30001623 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 - caniuse-lite@1.0.30001632: {} + caniuse-lite@1.0.30001623: {} case-sensitive-paths-webpack-plugin@2.4.0: {} + cborg@4.2.0: {} + chai@4.4.1: dependencies: assertion-error: 1.1.0 check-error: 1.0.3 - deep-eql: 4.1.4 + deep-eql: 4.1.3 get-func-name: 2.0.2 loupe: 2.3.7 pathval: 1.1.1 @@ -12775,7 +12797,7 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - chrome-trace-event@1.0.4: {} + chrome-trace-event@1.0.3: {} ci-info@3.9.0: {} @@ -12838,6 +12860,8 @@ snapshots: chalk: 2.4.2 q: 1.5.1 + codeco@1.2.3: {} + collect-v8-coverage@1.0.2: {} color-convert@1.9.3: @@ -13080,7 +13104,7 @@ snapshots: dependencies: toggle-selection: 1.0.6 - copy-webpack-plugin@12.0.2(webpack@5.92.0(webpack-cli@5.1.4)): + copy-webpack-plugin@12.0.2(webpack@5.91.0(webpack-cli@5.1.4)): dependencies: fast-glob: 3.3.2 glob-parent: 6.0.2 @@ -13088,11 +13112,11 @@ snapshots: normalize-path: 3.0.0 schema-utils: 4.2.0 serialize-javascript: 6.0.2 - webpack: 5.92.0(webpack-cli@5.1.4) + webpack: 5.91.0(webpack-cli@5.1.4) core-js-compat@3.37.1: dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 core-js-pure@3.37.1: {} @@ -13104,7 +13128,7 @@ snapshots: dependencies: '@types/node': 20.11.30 cosmiconfig: 9.0.0(typescript@5.2.2) - jiti: 1.21.6 + jiti: 1.21.0 typescript: 5.2.2 optional: true @@ -13214,7 +13238,7 @@ snapshots: postcss: 8.4.38 postcss-selector-parser: 6.1.0 - css-loader@6.11.0(webpack@5.92.0): + css-loader@6.11.0(webpack@5.91.0): dependencies: icss-utils: 5.1.0(postcss@8.4.38) postcss: 8.4.38 @@ -13225,9 +13249,9 @@ snapshots: postcss-value-parser: 4.2.0 semver: 7.6.2 optionalDependencies: - webpack: 5.92.0 + webpack: 5.91.0 - css-minimizer-webpack-plugin@3.4.1(webpack@5.92.0): + css-minimizer-webpack-plugin@3.4.1(webpack@5.91.0): dependencies: cssnano: 5.1.15(postcss@8.4.38) jest-worker: 27.5.1 @@ -13235,7 +13259,7 @@ snapshots: schema-utils: 4.2.0 serialize-javascript: 6.0.2 source-map: 0.6.1 - webpack: 5.92.0 + webpack: 5.91.0 css-prefers-color-scheme@6.0.3(postcss@8.4.38): dependencies: @@ -13399,7 +13423,7 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.5: + debug@4.3.4: dependencies: ms: 2.1.2 @@ -13418,7 +13442,7 @@ snapshots: dedent@0.7.0: {} - deep-eql@4.1.4: + deep-eql@4.1.3: dependencies: type-detect: 4.0.8 @@ -13582,7 +13606,7 @@ snapshots: dot-case@3.0.4: dependencies: no-case: 3.0.4 - tslib: 2.6.3 + tslib: 2.6.2 dot-prop@5.3.0: dependencies: @@ -13611,7 +13635,7 @@ snapshots: dependencies: jake: 10.9.1 - electron-to-chromium@1.4.799: {} + electron-to-chromium@1.4.783: {} elliptic@6.5.4: dependencies: @@ -13651,7 +13675,7 @@ snapshots: dependencies: once: 1.4.0 - enhanced-resolve@5.17.0: + enhanced-resolve@5.16.1: dependencies: graceful-fs: 4.2.11 tapable: 2.2.1 @@ -13790,14 +13814,14 @@ snapshots: dependencies: es6-promise: 4.2.8 - esbuild-loader@2.21.0(webpack@5.92.0(webpack-cli@5.1.4)): + esbuild-loader@2.21.0(webpack@5.91.0(webpack-cli@5.1.4)): dependencies: esbuild: 0.16.17 joycon: 3.1.1 json5: 2.2.3 loader-utils: 2.0.4 tapable: 2.2.1 - webpack: 5.92.0(webpack-cli@5.1.4) + webpack: 5.91.0(webpack-cli@5.1.4) webpack-sources: 1.4.3 esbuild@0.16.17: @@ -13888,7 +13912,7 @@ snapshots: eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.56.0) - eslint-plugin-react: 7.34.2(eslint@8.56.0) + eslint-plugin-react: 7.34.1(eslint@8.56.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.56.0) optionalDependencies: typescript: 5.2.2 @@ -13900,21 +13924,21 @@ snapshots: dependencies: eslint: 8.56.0 - eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.7))(@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.24.7))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2): + eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2): dependencies: - '@babel/core': 7.24.7 - '@babel/eslint-parser': 7.24.7(@babel/core@7.24.7)(eslint@8.56.0) + '@babel/core': 7.24.6 + '@babel/eslint-parser': 7.24.6(@babel/core@7.24.6)(eslint@8.56.0) '@rushstack/eslint-patch': 1.10.3 '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2) '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.2.2) babel-preset-react-app: 10.0.1 confusing-browser-globals: 1.0.11 eslint: 8.56.0 - eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.7))(@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.24.7))(eslint@8.56.0) + eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.56.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0) eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.56.0) - eslint-plugin-react: 7.34.2(eslint@8.56.0) + eslint-plugin-react: 7.34.1(eslint@8.56.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.56.0) eslint-plugin-testing-library: 5.11.1(eslint@8.56.0)(typescript@5.2.2) optionalDependencies: @@ -13942,8 +13966,8 @@ snapshots: eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0): dependencies: - debug: 4.3.5 - enhanced-resolve: 5.17.0 + debug: 4.3.4 + enhanced-resolve: 5.16.1 eslint: 8.56.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) @@ -13984,10 +14008,10 @@ snapshots: eslint: 8.56.0 ignore: 5.3.1 - eslint-plugin-flowtype@8.0.3(@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.7))(@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.24.7))(eslint@8.56.0): + eslint-plugin-flowtype@8.0.3(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.56.0): dependencies: - '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.24.7) - '@babel/plugin-transform-react-jsx': 7.24.7(@babel/core@7.24.7) + '@babel/plugin-syntax-flow': 7.24.6(@babel/core@7.24.6) + '@babel/plugin-transform-react-jsx': 7.24.6(@babel/core@7.24.6) eslint: 8.56.0 lodash: 4.17.21 string-natural-compare: 3.0.1 @@ -14059,7 +14083,7 @@ snapshots: eslint-plugin-jsx-a11y@6.8.0(eslint@8.56.0): dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 aria-query: 5.3.0 array-includes: 3.1.8 array.prototype.flatmap: 1.3.2 @@ -14083,13 +14107,13 @@ snapshots: dependencies: eslint: 8.56.0 - eslint-plugin-react@7.34.2(eslint@8.56.0): + eslint-plugin-react@7.34.1(eslint@8.56.0): dependencies: array-includes: 3.1.8 array.prototype.findlast: 1.2.5 array.prototype.flatmap: 1.3.2 array.prototype.toreversed: 1.1.2 - array.prototype.tosorted: 1.1.4 + array.prototype.tosorted: 1.1.3 doctrine: 2.1.0 es-iterator-helpers: 1.0.19 eslint: 8.56.0 @@ -14144,7 +14168,7 @@ snapshots: eslint-visitor-keys@3.4.3: {} - eslint-webpack-plugin@3.2.0(eslint@8.56.0)(webpack@5.92.0): + eslint-webpack-plugin@3.2.0(eslint@8.56.0)(webpack@5.91.0): dependencies: '@types/eslint': 8.56.10 eslint: 8.56.0 @@ -14152,12 +14176,12 @@ snapshots: micromatch: 4.0.7 normalize-path: 3.0.0 schema-utils: 4.2.0 - webpack: 5.92.0 + webpack: 5.91.0 eslint@8.56.0: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) - '@eslint-community/regexpp': 4.10.1 + '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.56.0 '@humanwhocodes/config-array': 0.11.14 @@ -14167,7 +14191,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.5 + debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -14394,10 +14418,10 @@ snapshots: fetch-mock@9.11.0(node-fetch@2.7.0): dependencies: - '@babel/core': 7.24.7 - '@babel/runtime': 7.24.7 + '@babel/core': 7.24.6 + '@babel/runtime': 7.24.6 core-js: 3.37.1 - debug: 4.3.5 + debug: 4.3.4 glob-to-regexp: 0.4.1 is-subset: 0.1.1 lodash.isequal: 4.5.0 @@ -14417,17 +14441,17 @@ snapshots: dependencies: flat-cache: 3.2.0 - file-loader@6.2.0(webpack@5.92.0(webpack-cli@5.1.4)): + file-loader@6.2.0(webpack@5.91.0(webpack-cli@5.1.4)): dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.92.0(webpack-cli@5.1.4) + webpack: 5.91.0(webpack-cli@5.1.4) - file-loader@6.2.0(webpack@5.92.0): + file-loader@6.2.0(webpack@5.91.0): dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.92.0 + webpack: 5.91.0 file-uri-to-path@1.0.0: {} @@ -14524,14 +14548,14 @@ snapshots: dependencies: is-callable: 1.2.7 - foreground-child@3.2.0: + foreground-child@3.1.1: dependencies: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@6.5.3(eslint@8.56.0)(typescript@5.2.2)(webpack@5.92.0): + fork-ts-checker-webpack-plugin@6.5.3(eslint@8.56.0)(typescript@5.2.2)(webpack@5.91.0): dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.24.6 '@types/json-schema': 7.0.15 chalk: 4.1.2 chokidar: 3.6.0 @@ -14545,7 +14569,7 @@ snapshots: semver: 7.6.2 tapable: 1.1.3 typescript: 5.2.2 - webpack: 5.92.0 + webpack: 5.91.0 optionalDependencies: eslint: 8.56.0 @@ -14707,8 +14731,8 @@ snapshots: glob@10.4.1: dependencies: - foreground-child: 3.2.0 - jackspeak: 3.4.0 + foreground-child: 3.1.1 + jackspeak: 3.1.2 minimatch: 9.0.4 minipass: 7.1.2 path-scurry: 1.11.1 @@ -14842,7 +14866,7 @@ snapshots: source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.18.0 + uglify-js: 3.17.4 hard-rejection@2.1.0: {} @@ -14931,9 +14955,9 @@ snapshots: he: 1.2.0 param-case: 3.0.4 relateurl: 0.2.7 - terser: 5.31.1 + terser: 5.31.0 - html-webpack-plugin@5.6.0(webpack@5.92.0(webpack-cli@5.1.4)): + html-webpack-plugin@5.6.0(webpack@5.91.0(webpack-cli@5.1.4)): dependencies: '@types/html-minifier-terser': 6.1.0 html-minifier-terser: 6.1.0 @@ -14941,9 +14965,9 @@ snapshots: pretty-error: 4.0.0 tapable: 2.2.1 optionalDependencies: - webpack: 5.92.0(webpack-cli@5.1.4) + webpack: 5.91.0(webpack-cli@5.1.4) - html-webpack-plugin@5.6.0(webpack@5.92.0): + html-webpack-plugin@5.6.0(webpack@5.91.0): dependencies: '@types/html-minifier-terser': 6.1.0 html-minifier-terser: 6.1.0 @@ -14951,7 +14975,7 @@ snapshots: pretty-error: 4.0.0 tapable: 2.2.1 optionalDependencies: - webpack: 5.92.0 + webpack: 5.91.0 htmlparser2@6.1.0: dependencies: @@ -14993,7 +15017,7 @@ snapshots: dependencies: '@tootallnate/once': 1.1.2 agent-base: 6.0.2 - debug: 4.3.5 + debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -15025,7 +15049,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.5 + debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -15315,12 +15339,16 @@ snapshots: dependencies: ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + isows@1.0.3(ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)): + dependencies: + ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + istanbul-lib-coverage@3.2.2: {} istanbul-lib-instrument@5.2.1: dependencies: - '@babel/core': 7.24.7 - '@babel/parser': 7.24.7 + '@babel/core': 7.24.6 + '@babel/parser': 7.24.6 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -15335,7 +15363,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.5 + debug: 4.3.4 istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -15344,7 +15372,7 @@ snapshots: istanbul-lib-source-maps@5.0.4: dependencies: '@jridgewell/trace-mapping': 0.3.25 - debug: 4.3.5 + debug: 4.3.4 istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -15362,7 +15390,7 @@ snapshots: reflect.getprototypeof: 1.0.6 set-function-name: 2.0.2 - jackspeak@3.4.0: + jackspeak@3.1.2: dependencies: '@isaacs/cliui': 8.0.2 optionalDependencies: @@ -15446,10 +15474,10 @@ snapshots: jest-config@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10): dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.6 '@jest/test-sequencer': 27.5.1 '@jest/types': 27.5.1 - babel-jest: 27.5.1(@babel/core@7.24.7) + babel-jest: 27.5.1(@babel/core@7.24.6) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.3.1 @@ -15576,7 +15604,7 @@ snapshots: jest-message-util@27.5.1: dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.24.6 '@jest/types': 27.5.1 '@types/stack-utils': 2.0.3 chalk: 4.1.2 @@ -15588,7 +15616,7 @@ snapshots: jest-message-util@28.1.3: dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.24.6 '@jest/types': 28.1.3 '@types/stack-utils': 2.0.3 chalk: 4.1.2 @@ -15695,16 +15723,16 @@ snapshots: jest-snapshot@27.5.1: dependencies: - '@babel/core': 7.24.7 - '@babel/generator': 7.24.7 - '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.24.7) - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 + '@babel/core': 7.24.6 + '@babel/generator': 7.24.6 + '@babel/plugin-syntax-typescript': 7.24.6(@babel/core@7.24.6) + '@babel/traverse': 7.24.6 + '@babel/types': 7.24.6 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 '@types/babel__traverse': 7.20.6 '@types/prettier': 2.7.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.7) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.6) chalk: 4.1.2 expect: 27.5.1 graceful-fs: 4.2.11 @@ -15809,12 +15837,10 @@ snapshots: - ts-node - utf-8-validate - jiti@1.21.6: {} + jiti@1.21.0: {} joycon@3.1.1: {} - js-base64@3.7.7: {} - js-sha256@0.9.0: {} js-sha3@0.8.0: {} @@ -15927,8 +15953,6 @@ snapshots: object.assign: 4.1.5 object.values: 1.2.0 - jwt-decode@4.0.0: {} - keccak@3.0.4: dependencies: node-addon-api: 2.0.2 @@ -15972,7 +15996,7 @@ snapshots: lilconfig@2.1.0: {} - lilconfig@3.1.2: {} + lilconfig@3.1.1: {} lines-and-columns@1.2.4: {} @@ -15998,11 +16022,11 @@ snapshots: emojis-list: 3.0.0 json5: 2.2.3 - loader-utils@3.3.1: {} + loader-utils@3.2.1: {} local-pkg@0.5.0: dependencies: - mlly: 1.7.1 + mlly: 1.7.0 pkg-types: 1.1.1 locate-path@2.0.0: @@ -16072,7 +16096,7 @@ snapshots: lower-case@2.0.2: dependencies: - tslib: 2.6.3 + tslib: 2.6.2 lowercase-keys@2.0.0: {} @@ -16103,8 +16127,8 @@ snapshots: magicast@0.3.4: dependencies: - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 source-map-js: 1.2.0 make-dir@3.1.0: @@ -16211,11 +16235,11 @@ snapshots: min-indent@1.0.1: {} - mini-css-extract-plugin@2.9.0(webpack@5.92.0): + mini-css-extract-plugin@2.9.0(webpack@5.91.0): dependencies: schema-utils: 4.2.0 tapable: 2.2.1 - webpack: 5.92.0 + webpack: 5.91.0 minimalistic-assert@1.0.1: {} @@ -16257,7 +16281,7 @@ snapshots: mkdirp@1.0.4: {} - mlly@1.7.1: + mlly@1.7.0: dependencies: acorn: 8.11.3 pathe: 1.1.2 @@ -16277,6 +16301,8 @@ snapshots: dns-packet: 5.6.1 thunky: 1.1.0 + multiformats@13.1.1: {} + multistream@4.1.0: dependencies: once: 1.4.0 @@ -16325,7 +16351,7 @@ snapshots: '@next/env': 14.1.1 '@swc/helpers': 0.5.2 busboy: 1.6.0 - caniuse-lite: 1.0.30001632 + caniuse-lite: 1.0.30001623 graceful-fs: 4.2.11 postcss: 8.4.31 react: 18.2.0 @@ -16350,7 +16376,7 @@ snapshots: no-case@3.0.4: dependencies: lower-case: 2.0.2 - tslib: 2.6.3 + tslib: 2.6.2 node-addon-api@2.0.2: {} @@ -16587,7 +16613,7 @@ snapshots: param-case@3.0.4: dependencies: dot-case: 3.0.4 - tslib: 2.6.3 + tslib: 2.6.2 parent-module@1.0.1: dependencies: @@ -16609,7 +16635,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.24.6 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -16623,7 +16649,7 @@ snapshots: pascal-case@3.1.2: dependencies: no-case: 3.0.4 - tslib: 2.6.3 + tslib: 2.6.2 path-exists@3.0.0: {} @@ -16699,15 +16725,13 @@ snapshots: pkg-types@1.1.1: dependencies: confbox: 0.1.7 - mlly: 1.7.1 + mlly: 1.7.0 pathe: 1.1.2 pkg-up@3.1.0: dependencies: find-up: 3.0.0 - poseidon-lite@0.2.0: {} - possible-typed-array-names@1.0.0: {} postcss-attribute-case-insensitive@5.0.2(postcss@8.4.38): @@ -16715,9 +16739,9 @@ snapshots: postcss: 8.4.38 postcss-selector-parser: 6.1.0 - postcss-browser-comments@4.0.0(browserslist@4.23.1)(postcss@8.4.38): + postcss-browser-comments@4.0.0(browserslist@4.23.0)(postcss@8.4.38): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 postcss: 8.4.38 postcss-calc@8.2.4(postcss@8.4.38): @@ -16748,7 +16772,7 @@ snapshots: postcss-colormin@5.3.1(postcss@8.4.38): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 caniuse-api: 3.0.0 colord: 2.9.3 postcss: 8.4.38 @@ -16756,7 +16780,7 @@ snapshots: postcss-convert-values@5.1.3(postcss@8.4.38): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 postcss: 8.4.38 postcss-value-parser: 4.2.0 @@ -16858,19 +16882,19 @@ snapshots: postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)): dependencies: - lilconfig: 3.1.2 - yaml: 2.4.5 + lilconfig: 3.1.1 + yaml: 2.4.2 optionalDependencies: postcss: 8.4.38 ts-node: 10.9.2(@types/node@20.11.30)(typescript@5.2.2) - postcss-loader@6.2.1(postcss@8.4.38)(webpack@5.92.0): + postcss-loader@6.2.1(postcss@8.4.38)(webpack@5.91.0): dependencies: cosmiconfig: 7.1.0 klona: 2.0.6 postcss: 8.4.38 semver: 7.6.2 - webpack: 5.92.0 + webpack: 5.91.0 postcss-logical@5.0.4(postcss@8.4.38): dependencies: @@ -16888,7 +16912,7 @@ snapshots: postcss-merge-rules@5.1.4(postcss@8.4.38): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 caniuse-api: 3.0.0 cssnano-utils: 3.1.0(postcss@8.4.38) postcss: 8.4.38 @@ -16908,7 +16932,7 @@ snapshots: postcss-minify-params@5.1.4(postcss@8.4.38): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 cssnano-utils: 3.1.0(postcss@8.4.38) postcss: 8.4.38 postcss-value-parser: 4.2.0 @@ -16981,7 +17005,7 @@ snapshots: postcss-normalize-unicode@5.1.1(postcss@8.4.38): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 postcss: 8.4.38 postcss-value-parser: 4.2.0 @@ -16996,12 +17020,12 @@ snapshots: postcss: 8.4.38 postcss-value-parser: 4.2.0 - postcss-normalize@10.0.1(browserslist@4.23.1)(postcss@8.4.38): + postcss-normalize@10.0.1(browserslist@4.23.0)(postcss@8.4.38): dependencies: '@csstools/normalize.css': 12.1.1 - browserslist: 4.23.1 + browserslist: 4.23.0 postcss: 8.4.38 - postcss-browser-comments: 4.0.0(browserslist@4.23.1)(postcss@8.4.38) + postcss-browser-comments: 4.0.0(browserslist@4.23.0)(postcss@8.4.38) sanitize.css: 13.0.0 postcss-opacity-percentage@1.1.3(postcss@8.4.38): @@ -17045,7 +17069,7 @@ snapshots: '@csstools/postcss-trigonometric-functions': 1.0.2(postcss@8.4.38) '@csstools/postcss-unset-value': 1.0.2(postcss@8.4.38) autoprefixer: 10.4.19(postcss@8.4.38) - browserslist: 4.23.1 + browserslist: 4.23.0 css-blank-pseudo: 3.0.3(postcss@8.4.38) css-has-pseudo: 3.0.4(postcss@8.4.38) css-prefers-color-scheme: 6.0.3(postcss@8.4.38) @@ -17088,7 +17112,7 @@ snapshots: postcss-reduce-initial@5.1.2(postcss@8.4.38): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 caniuse-api: 3.0.0 postcss: 8.4.38 @@ -17152,14 +17176,14 @@ snapshots: prelude-ls@1.2.1: {} - prettier-plugin-organize-imports@3.2.4(prettier@3.3.2)(typescript@5.2.2): + prettier-plugin-organize-imports@3.2.4(prettier@3.2.5)(typescript@5.2.2): dependencies: - prettier: 3.3.2 + prettier: 3.2.5 typescript: 5.2.2 prettier@2.8.8: {} - prettier@3.3.2: {} + prettier@3.2.5: {} pretty-bytes@5.6.0: {} @@ -17292,24 +17316,24 @@ snapshots: prop-types: 15.8.1 react: 18.2.0 - react-dev-utils@12.0.1(eslint@8.56.0)(typescript@5.2.2)(webpack@5.92.0): + react-dev-utils@12.0.1(eslint@8.56.0)(typescript@5.2.2)(webpack@5.91.0): dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.24.6 address: 1.2.2 - browserslist: 4.23.1 + browserslist: 4.23.0 chalk: 4.1.2 cross-spawn: 7.0.3 detect-port-alt: 1.1.6 escape-string-regexp: 4.0.0 filesize: 8.0.7 find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.56.0)(typescript@5.2.2)(webpack@5.92.0) + fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.56.0)(typescript@5.2.2)(webpack@5.91.0) global-modules: 2.0.0 globby: 11.1.0 gzip-size: 6.0.0 immer: 9.0.21 is-root: 2.1.0 - loader-utils: 3.3.1 + loader-utils: 3.2.1 open: 8.4.2 pkg-up: 3.1.0 prompts: 2.4.2 @@ -17318,7 +17342,7 @@ snapshots: shell-quote: 1.8.1 strip-ansi: 6.0.1 text-table: 0.2.0 - webpack: 5.92.0 + webpack: 5.91.0 optionalDependencies: typescript: 5.2.2 transitivePeerDependencies: @@ -17344,56 +17368,56 @@ snapshots: react-refresh@0.14.2: {} - react-scripts@5.0.1(@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.7))(@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.24.7))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10): + react-scripts@5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10): dependencies: - '@babel/core': 7.24.7 - '@pmmmwh/react-refresh-webpack-plugin': 0.5.15(react-refresh@0.11.0)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.92.0))(webpack@5.92.0) + '@babel/core': 7.24.6 + '@pmmmwh/react-refresh-webpack-plugin': 0.5.13(react-refresh@0.11.0)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0))(webpack@5.91.0) '@svgr/webpack': 5.5.0 - babel-jest: 27.5.1(@babel/core@7.24.7) - babel-loader: 8.3.0(@babel/core@7.24.7)(webpack@5.92.0) - babel-plugin-named-asset-import: 0.3.8(@babel/core@7.24.7) + babel-jest: 27.5.1(@babel/core@7.24.6) + babel-loader: 8.3.0(@babel/core@7.24.6)(webpack@5.91.0) + babel-plugin-named-asset-import: 0.3.8(@babel/core@7.24.6) babel-preset-react-app: 10.0.1 bfj: 7.1.0 - browserslist: 4.23.1 + browserslist: 4.23.0 camelcase: 6.3.0 case-sensitive-paths-webpack-plugin: 2.4.0 - css-loader: 6.11.0(webpack@5.92.0) - css-minimizer-webpack-plugin: 3.4.1(webpack@5.92.0) + css-loader: 6.11.0(webpack@5.91.0) + css-minimizer-webpack-plugin: 3.4.1(webpack@5.91.0) dotenv: 10.0.0 dotenv-expand: 5.1.0 eslint: 8.56.0 - eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.7))(@babel/plugin-transform-react-jsx@7.24.7(@babel/core@7.24.7))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2) - eslint-webpack-plugin: 3.2.0(eslint@8.56.0)(webpack@5.92.0) - file-loader: 6.2.0(webpack@5.92.0) + eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2) + eslint-webpack-plugin: 3.2.0(eslint@8.56.0)(webpack@5.91.0) + file-loader: 6.2.0(webpack@5.91.0) fs-extra: 10.1.0 - html-webpack-plugin: 5.6.0(webpack@5.92.0) + html-webpack-plugin: 5.6.0(webpack@5.91.0) identity-obj-proxy: 3.0.0 jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) jest-resolve: 27.5.1 jest-watch-typeahead: 1.1.0(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10)) - mini-css-extract-plugin: 2.9.0(webpack@5.92.0) + mini-css-extract-plugin: 2.9.0(webpack@5.91.0) postcss: 8.4.38 postcss-flexbugs-fixes: 5.0.2(postcss@8.4.38) - postcss-loader: 6.2.1(postcss@8.4.38)(webpack@5.92.0) - postcss-normalize: 10.0.1(browserslist@4.23.1)(postcss@8.4.38) + postcss-loader: 6.2.1(postcss@8.4.38)(webpack@5.91.0) + postcss-normalize: 10.0.1(browserslist@4.23.0)(postcss@8.4.38) postcss-preset-env: 7.8.3(postcss@8.4.38) prompts: 2.4.2 react: 18.2.0 react-app-polyfill: 3.0.0 - react-dev-utils: 12.0.1(eslint@8.56.0)(typescript@5.2.2)(webpack@5.92.0) + react-dev-utils: 12.0.1(eslint@8.56.0)(typescript@5.2.2)(webpack@5.91.0) react-refresh: 0.11.0 resolve: 1.22.8 resolve-url-loader: 4.0.0 - sass-loader: 12.6.0(webpack@5.92.0) + sass-loader: 12.6.0(webpack@5.91.0) semver: 7.6.2 - source-map-loader: 3.0.2(webpack@5.92.0) - style-loader: 3.3.4(webpack@5.92.0) - tailwindcss: 3.4.4(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)) - terser-webpack-plugin: 5.3.10(webpack@5.92.0) - webpack: 5.92.0 - webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.92.0) - webpack-manifest-plugin: 4.1.1(webpack@5.92.0) - workbox-webpack-plugin: 6.6.0(@types/babel__core@7.20.5)(webpack@5.92.0) + source-map-loader: 3.0.2(webpack@5.91.0) + style-loader: 3.3.4(webpack@5.91.0) + tailwindcss: 3.4.3(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)) + terser-webpack-plugin: 5.3.10(webpack@5.91.0) + webpack: 5.91.0 + webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0) + webpack-manifest-plugin: 4.1.1(webpack@5.91.0) + workbox-webpack-plugin: 6.6.0(@types/babel__core@7.20.5)(webpack@5.91.0) optionalDependencies: fsevents: 2.3.3 typescript: 5.2.2 @@ -17532,7 +17556,7 @@ snapshots: regenerator-transform@0.15.2: dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.24.6 regex-parser@2.3.0: {} @@ -17641,11 +17665,11 @@ snapshots: rollup-plugin-terser@7.0.2(rollup@2.79.1): dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.24.6 jest-worker: 26.6.2 rollup: 2.79.1 serialize-javascript: 4.0.0 - terser: 5.31.1 + terser: 5.31.0 rollup@2.79.1: optionalDependencies: @@ -17673,7 +17697,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.18.0 fsevents: 2.3.3 - rpc-websockets@8.0.1: + rpc-websockets@7.11.0: dependencies: eventemitter3: 4.0.7 uuid: 8.3.2 @@ -17690,7 +17714,7 @@ snapshots: rxjs@7.8.1: dependencies: - tslib: 2.6.3 + tslib: 2.6.2 safe-array-concat@1.1.2: dependencies: @@ -17713,11 +17737,11 @@ snapshots: sanitize.css@13.0.0: {} - sass-loader@12.6.0(webpack@5.92.0): + sass-loader@12.6.0(webpack@5.91.0): dependencies: klona: 2.0.6 neo-async: 2.6.2 - webpack: 5.92.0 + webpack: 5.91.0 sax@1.2.4: {} @@ -17750,9 +17774,9 @@ snapshots: schema-utils@4.2.0: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.16.0 - ajv-formats: 2.1.1(ajv@8.16.0) - ajv-keywords: 5.1.0(ajv@8.16.0) + ajv: 8.14.0 + ajv-formats: 2.1.1(ajv@8.14.0) + ajv-keywords: 5.1.0(ajv@8.14.0) scrypt-js@3.0.1: {} @@ -17927,12 +17951,12 @@ snapshots: source-map-js@1.2.0: {} - source-map-loader@3.0.2(webpack@5.92.0): + source-map-loader@3.0.2(webpack@5.91.0): dependencies: abab: 2.0.6 iconv-lite: 0.6.3 source-map-js: 1.2.0 - webpack: 5.92.0 + webpack: 5.91.0 source-map-support@0.5.21: dependencies: @@ -17970,7 +17994,7 @@ snapshots: spdy-transport@3.0.0: dependencies: - debug: 4.3.5 + debug: 4.3.4 detect-node: 2.1.0 hpack.js: 2.1.6 obuf: 1.1.2 @@ -17981,7 +18005,7 @@ snapshots: spdy@4.0.2: dependencies: - debug: 4.3.5 + debug: 4.3.4 handle-thing: 2.0.1 http-deceiver: 1.2.7 select-hose: 2.0.0 @@ -18166,9 +18190,9 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 - style-loader@3.3.4(webpack@5.92.0): + style-loader@3.3.4(webpack@5.91.0): dependencies: - webpack: 5.92.0 + webpack: 5.91.0 styled-jsx@5.1.1(react@18.2.0): dependencies: @@ -18177,7 +18201,7 @@ snapshots: stylehacks@5.1.1(postcss@8.4.38): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 postcss: 8.4.38 postcss-selector-parser: 6.1.0 @@ -18191,7 +18215,7 @@ snapshots: pirates: 4.0.6 ts-interface-checker: 0.1.13 - superstruct@1.0.4: {} + superstruct@0.14.2: {} supports-color@5.5.0: dependencies: @@ -18249,7 +18273,7 @@ snapshots: typical: 5.2.0 wordwrapjs: 4.0.1 - tailwindcss@3.4.4(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)): + tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -18259,7 +18283,7 @@ snapshots: fast-glob: 3.3.2 glob-parent: 6.0.2 is-glob: 4.0.3 - jiti: 1.21.6 + jiti: 1.21.0 lilconfig: 2.1.0 micromatch: 4.0.7 normalize-path: 3.0.0 @@ -18296,25 +18320,25 @@ snapshots: ansi-escapes: 4.3.2 supports-hyperlinks: 2.3.0 - terser-webpack-plugin@5.3.10(webpack@5.92.0(webpack-cli@5.1.4)): + terser-webpack-plugin@5.3.10(webpack@5.91.0(webpack-cli@5.1.4)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 - terser: 5.31.1 - webpack: 5.92.0(webpack-cli@5.1.4) + terser: 5.31.0 + webpack: 5.91.0(webpack-cli@5.1.4) - terser-webpack-plugin@5.3.10(webpack@5.92.0): + terser-webpack-plugin@5.3.10(webpack@5.91.0): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 - terser: 5.31.1 - webpack: 5.92.0 + terser: 5.31.0 + webpack: 5.91.0 - terser@5.31.1: + terser@5.31.0: dependencies: '@jridgewell/source-map': 0.3.6 acorn: 8.11.3 @@ -18463,7 +18487,7 @@ snapshots: tslib@1.14.1: {} - tslib@2.6.3: {} + tslib@2.6.2: {} tsutils@3.21.0(typescript@5.2.2): dependencies: @@ -18514,7 +18538,7 @@ snapshots: typechain@8.3.2(typescript@5.2.2): dependencies: '@types/prettier': 2.7.3 - debug: 4.3.5 + debug: 4.3.4 fs-extra: 7.0.1 glob: 7.1.7 js-sha3: 0.8.0 @@ -18595,9 +18619,13 @@ snapshots: ufo@1.5.3: {} - uglify-js@3.18.0: + uglify-js@3.17.4: optional: true + uint8arrays@5.1.0: + dependencies: + multiformats: 13.1.1 + unbox-primitive@1.0.2: dependencies: call-bind: 1.0.7 @@ -18638,9 +18666,9 @@ snapshots: upath@1.2.0: {} - update-browserslist-db@1.0.16(browserslist@4.23.1): + update-browserslist-db@1.0.16(browserslist@4.23.0): dependencies: - browserslist: 4.23.1 + browserslist: 4.23.0 escalade: 3.1.2 picocolors: 1.0.1 @@ -18688,13 +18716,30 @@ snapshots: vary@1.1.2: {} - vite-node@1.6.0(@types/node@20.11.30)(terser@5.31.1): + viem@1.21.4(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8): + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + abitype: 0.9.8(typescript@5.2.2)(zod@3.23.8) + isows: 1.0.3(ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + optionalDependencies: + typescript: 5.2.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + + vite-node@1.6.0(@types/node@20.11.30)(terser@5.31.0): dependencies: cac: 6.7.14 - debug: 4.3.5 + debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.2.13(@types/node@20.11.30)(terser@5.31.1) + vite: 5.2.11(@types/node@20.11.30)(terser@5.31.0) transitivePeerDependencies: - '@types/node' - less @@ -18705,7 +18750,7 @@ snapshots: - supports-color - terser - vite@5.2.13(@types/node@20.11.30)(terser@5.31.1): + vite@5.2.11(@types/node@20.11.30)(terser@5.31.0): dependencies: esbuild: 0.20.2 postcss: 8.4.38 @@ -18713,9 +18758,9 @@ snapshots: optionalDependencies: '@types/node': 20.11.30 fsevents: 2.3.3 - terser: 5.31.1 + terser: 5.31.0 - vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.1): + vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -18724,7 +18769,7 @@ snapshots: '@vitest/utils': 1.6.0 acorn-walk: 8.3.2 chai: 4.4.1 - debug: 4.3.5 + debug: 4.3.4 execa: 8.0.1 local-pkg: 0.5.0 magic-string: 0.30.10 @@ -18734,8 +18779,8 @@ snapshots: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.2.13(@types/node@20.11.30)(terser@5.31.1) - vite-node: 1.6.0(@types/node@20.11.30)(terser@5.31.1) + vite: 5.2.11(@types/node@20.11.30)(terser@5.31.0) + vite-node: 1.6.0(@types/node@20.11.30)(terser@5.31.0) why-is-node-running: 2.2.2 optionalDependencies: '@types/node': 20.11.30 @@ -18790,12 +18835,12 @@ snapshots: webidl-conversions@6.1.0: {} - webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0): + webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0): dependencies: '@discoveryjs/json-ext': 0.5.7 - '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4)) - '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4)) - '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0))(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0))(webpack@5.92.0(webpack-cli@5.1.4)) + '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4)) + '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4)) + '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0))(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0))(webpack@5.91.0(webpack-cli@5.1.4)) colorette: 2.0.20 commander: 10.0.1 cross-spawn: 7.0.3 @@ -18804,30 +18849,30 @@ snapshots: import-local: 3.1.0 interpret: 3.1.1 rechoir: 0.8.0 - webpack: 5.92.0(webpack-cli@5.1.4) + webpack: 5.91.0(webpack-cli@5.1.4) webpack-merge: 5.10.0 optionalDependencies: - webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0) + webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0) - webpack-dev-middleware@5.3.4(webpack@5.92.0(webpack-cli@5.1.4)): + webpack-dev-middleware@5.3.4(webpack@5.91.0(webpack-cli@5.1.4)): dependencies: colorette: 2.0.20 memfs: 3.5.3 mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.2.0 - webpack: 5.92.0(webpack-cli@5.1.4) + webpack: 5.91.0(webpack-cli@5.1.4) - webpack-dev-middleware@5.3.4(webpack@5.92.0): + webpack-dev-middleware@5.3.4(webpack@5.91.0): dependencies: colorette: 2.0.20 memfs: 3.5.3 mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.2.0 - webpack: 5.92.0 + webpack: 5.91.0 - webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.92.0): + webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.91.0): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -18857,18 +18902,18 @@ snapshots: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack-dev-middleware: 5.3.4(webpack@5.92.0(webpack-cli@5.1.4)) + webpack-dev-middleware: 5.3.4(webpack@5.91.0(webpack-cli@5.1.4)) ws: 8.17.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) optionalDependencies: - webpack: 5.92.0(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + webpack: 5.91.0(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) transitivePeerDependencies: - bufferutil - debug - supports-color - utf-8-validate - webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.92.0): + webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -18898,20 +18943,20 @@ snapshots: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack-dev-middleware: 5.3.4(webpack@5.92.0) + webpack-dev-middleware: 5.3.4(webpack@5.91.0) ws: 8.17.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) optionalDependencies: - webpack: 5.92.0 + webpack: 5.91.0 transitivePeerDependencies: - bufferutil - debug - supports-color - utf-8-validate - webpack-manifest-plugin@4.1.1(webpack@5.92.0): + webpack-manifest-plugin@4.1.1(webpack@5.91.0): dependencies: tapable: 2.2.1 - webpack: 5.92.0 + webpack: 5.91.0 webpack-sources: 2.3.1 webpack-merge@5.10.0: @@ -18932,7 +18977,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.92.0: + webpack@5.91.0: dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -18940,10 +18985,10 @@ snapshots: '@webassemblyjs/wasm-edit': 1.12.1 '@webassemblyjs/wasm-parser': 1.12.1 acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - browserslist: 4.23.1 - chrome-trace-event: 1.0.4 - enhanced-resolve: 5.17.0 + acorn-import-assertions: 1.9.0(acorn@8.11.3) + browserslist: 4.23.0 + chrome-trace-event: 1.0.3 + enhanced-resolve: 5.16.1 es-module-lexer: 1.5.3 eslint-scope: 5.1.1 events: 3.3.0 @@ -18955,7 +19000,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(webpack@5.92.0) + terser-webpack-plugin: 5.3.10(webpack@5.91.0) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -18963,7 +19008,7 @@ snapshots: - esbuild - uglify-js - webpack@5.92.0(webpack-cli@5.1.4): + webpack@5.91.0(webpack-cli@5.1.4): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -18971,10 +19016,10 @@ snapshots: '@webassemblyjs/wasm-edit': 1.12.1 '@webassemblyjs/wasm-parser': 1.12.1 acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - browserslist: 4.23.1 - chrome-trace-event: 1.0.4 - enhanced-resolve: 5.17.0 + acorn-import-assertions: 1.9.0(acorn@8.11.3) + browserslist: 4.23.0 + chrome-trace-event: 1.0.3 + enhanced-resolve: 5.16.1 es-module-lexer: 1.5.3 eslint-scope: 5.1.1 events: 3.3.0 @@ -18986,11 +19031,11 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(webpack@5.92.0(webpack-cli@5.1.4)) + terser-webpack-plugin: 5.3.10(webpack@5.91.0(webpack-cli@5.1.4)) watchpack: 2.4.1 webpack-sources: 3.2.3 optionalDependencies: - webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.92.0) + webpack-cli: 5.1.4(webpack-dev-server@4.15.2)(webpack@5.91.0) transitivePeerDependencies: - '@swc/core' - esbuild @@ -19115,15 +19160,15 @@ snapshots: workbox-build@6.6.0(@types/babel__core@7.20.5): dependencies: - '@apideck/better-ajv-errors': 0.3.6(ajv@8.16.0) - '@babel/core': 7.24.7 - '@babel/preset-env': 7.24.7(@babel/core@7.24.7) - '@babel/runtime': 7.24.7 - '@rollup/plugin-babel': 5.3.1(@babel/core@7.24.7)(@types/babel__core@7.20.5)(rollup@2.79.1) + '@apideck/better-ajv-errors': 0.3.6(ajv@8.14.0) + '@babel/core': 7.24.6 + '@babel/preset-env': 7.24.6(@babel/core@7.24.6) + '@babel/runtime': 7.24.6 + '@rollup/plugin-babel': 5.3.1(@babel/core@7.24.6)(@types/babel__core@7.20.5)(rollup@2.79.1) '@rollup/plugin-node-resolve': 11.2.1(rollup@2.79.1) '@rollup/plugin-replace': 2.4.2(rollup@2.79.1) '@surma/rollup-plugin-off-main-thread': 2.2.3 - ajv: 8.16.0 + ajv: 8.14.0 common-tags: 1.8.2 fast-json-stable-stringify: 2.1.0 fs-extra: 9.1.0 @@ -19212,12 +19257,12 @@ snapshots: workbox-sw@6.6.0: {} - workbox-webpack-plugin@6.6.0(@types/babel__core@7.20.5)(webpack@5.92.0): + workbox-webpack-plugin@6.6.0(@types/babel__core@7.20.5)(webpack@5.91.0): dependencies: fast-json-stable-stringify: 2.1.0 pretty-bytes: 5.6.0 upath: 1.2.0 - webpack: 5.92.0 + webpack: 5.91.0 webpack-sources: 1.4.3 workbox-build: 6.6.0(@types/babel__core@7.20.5) transitivePeerDependencies: @@ -19266,6 +19311,11 @@ snapshots: bufferutil: 4.0.8 utf-8-validate: 5.0.10 + ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 5.0.10 + ws@8.17.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8 @@ -19289,7 +19339,7 @@ snapshots: yaml@1.10.2: {} - yaml@2.4.5: {} + yaml@2.4.2: {} yargs-parser@18.1.3: dependencies: @@ -19342,8 +19392,8 @@ snapshots: yup@0.32.11: dependencies: - '@babel/runtime': 7.24.7 - '@types/lodash': 4.17.5 + '@babel/runtime': 7.24.6 + '@types/lodash': 4.17.4 lodash: 4.17.21 lodash-es: 4.17.21 nanoclone: 0.2.1 From b7de428e7a0900990d550b26a206783ea9fc7e9e Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Thu, 23 May 2024 13:29:47 +0200 Subject: [PATCH 05/75] Change function name --- packages/taco-auth/src/eip4361.ts | 6 +++--- packages/taco-auth/src/index.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 9e1e0d828..2da5b3b04 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -13,7 +13,7 @@ export class EIP4361SignatureProvider { this.storage = new LocalStorage(); } - public async getOrCreateSignInMessage(): Promise { + public async getOrCreateSiweMessage(): Promise { const address = await this.signer.getAddress(); const storageKey = `eth-signin-message-${address}`; @@ -24,12 +24,12 @@ export class EIP4361SignatureProvider { } // If at this point we didn't return, we need to create a new message - const message = await this.crateSiweMessage(); + const message = await this.createSiweMessage(); this.storage.setItem(storageKey, message); return message; } - private async crateSiweMessage(): Promise { + private async createSiweMessage(): Promise { const { blockNumber, chainId } = await this.getChainData(); const address = await this.signer.getAddress(); // TODO: Expose these as parameters diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts index fec9f529c..6b5476af1 100644 --- a/packages/taco-auth/src/index.ts +++ b/packages/taco-auth/src/index.ts @@ -1 +1,2 @@ export * from './eip712'; +export * from './eip4361'; From 919b31f120e531b3cff28a5c0659f1e9adf8b58d Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Fri, 24 May 2024 15:44:20 +0200 Subject: [PATCH 06/75] Expose createSIWEMessage parameters --- packages/taco-auth/src/eip4361.ts | 32 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 2da5b3b04..acb66cc91 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -13,7 +13,12 @@ export class EIP4361SignatureProvider { this.storage = new LocalStorage(); } - public async getOrCreateSiweMessage(): Promise { + public async getOrCreateSiweMessage( + domain: string, + version: string, + nonce: string, + uri: string, + ): Promise { const address = await this.signer.getAddress(); const storageKey = `eth-signin-message-${address}`; @@ -24,25 +29,24 @@ export class EIP4361SignatureProvider { } // If at this point we didn't return, we need to create a new message - const message = await this.createSiweMessage(); + const message = await this.createSiweMessage(domain, version, nonce, uri); this.storage.setItem(storageKey, message); return message; } - private async createSiweMessage(): Promise { - const { blockNumber, chainId } = await this.getChainData(); + private async createSiweMessage( + domain: string, + version: string, + nonce: string, + uri: string, + ): Promise { + const chainId = (await this.provider.getNetwork()).chainId; const address = await this.signer.getAddress(); - // TODO: Expose these as parameters - const domain = 'yourdomain.com'; // replace with your domain - const version = '1'; - const nonce = '0'; // replace with your nonce - const uri = 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8'; // replace with your uri const siweMessage = new SiweMessage({ domain, address, - // TODO: Is this statement application-specific? - statement: `I'm signing in to ${domain} as of block number ${blockNumber}`, + statement: `${domain} wants you to sign in with your Ethereum account: ${address}`, uri, version, nonce, @@ -51,10 +55,4 @@ export class EIP4361SignatureProvider { return siweMessage.toMessage(); } - - private async getChainData(): Promise<{ blockNumber: number, chainId: number }> { - const blockNumber = await this.provider.getBlockNumber(); - const chainId = (await this.provider.getNetwork()).chainId; - return { blockNumber, chainId }; - } } From d67cd1347d6d20beb4c761e5776bd3a8859e7aa4 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Fri, 24 May 2024 16:43:28 +0200 Subject: [PATCH 07/75] Use EIP-4361 as Signature Provider --- packages/taco/src/conditions/context/context.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 949bf7f08..adac19dd6 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,6 +1,6 @@ import { Context, Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { fromJSON, toJSON } from '@nucypher/shared'; -import { EIP712SignatureProvider, TypedSignature } from '@nucypher/taco-auth'; +import { EIP4361SignatureProvider, TypedSignature } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { CompoundConditionType } from '../compound-condition'; @@ -12,6 +12,7 @@ import { RESERVED_CONTEXT_PARAMS, USER_ADDRESS_PARAM, } from '../const'; +import { version } from 'os'; export type CustomContextParam = string | number | boolean; export type ContextParam = CustomContextParam | TypedSignature; @@ -27,7 +28,7 @@ const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => `Unknown custom context parameter(s): ${params.join(', ')}`; export class ConditionContext { - private readonly eip712SignatureProvider?: EIP712SignatureProvider; + private readonly eip4361SignatureProvider?: EIP4361SignatureProvider; constructor( private readonly provider: ethers.providers.Provider, @@ -36,7 +37,7 @@ export class ConditionContext { private readonly signer?: ethers.Signer, ) { if (this.signer) { - this.eip712SignatureProvider = new EIP712SignatureProvider( + this.eip4361SignatureProvider = new EIP4361SignatureProvider( this.provider, this.signer, ); @@ -91,16 +92,21 @@ export class ConditionContext { private async fillContextParameters( requestedParameters: Set, ): Promise> { + const domain = ""; + const version = ""; + const nonce = ""; + const uri = ""; + // Now, we can safely add all the parameters const parameters: Record = {}; // Fill in predefined context parameters if (requestedParameters.has(USER_ADDRESS_PARAM)) { - if (!this.eip712SignatureProvider) { + if (!this.eip4361SignatureProvider) { throw new Error(ERR_SIGNER_REQUIRED); } parameters[USER_ADDRESS_PARAM] = - await this.eip712SignatureProvider.getOrCreateWalletSignature(); + await this.eip4361SignatureProvider.getOrCreateSiweMessage(domain, version, nonce, uri); // Remove from requested parameters requestedParameters.delete(USER_ADDRESS_PARAM); } From b602083e7cdf2f55f684a2dfcd6cb7d551623924 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Mon, 27 May 2024 11:21:45 +0200 Subject: [PATCH 08/75] Update pnpm-lock file after rebase --- pnpm-lock.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d99d17a24..302ee7e3e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,7 +114,7 @@ importers: version: 0.1.24(arweave@1.15.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@nucypher/taco': specifier: ^0.2.4 - version: 0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10) + version: 0.2.7(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@usedapp/core': specifier: ^1.2.13 version: 1.2.15(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0) @@ -196,7 +196,7 @@ importers: dependencies: '@nucypher/taco': specifier: ^0.2.4 - version: 0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10) + version: 0.2.7(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@usedapp/core': specifier: ^1.2.13 version: 1.2.15(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0) @@ -2208,12 +2208,12 @@ packages: '@nucypher/nucypher-core@0.14.5': resolution: {integrity: sha512-Q3kBuJL0qtTtnxrM5DEQauQUvDlXmwubm9u1h7gbyLhs+aZNC9WDyjEUbE43+uahlHu4k1hKEMxD1gjV165ChA==} - '@nucypher/shared@0.2.2': - resolution: {integrity: sha512-T8nIo1cn7WOFpmx67SZQTuxzOTNe1A6XgcfCa2vX+WiLWZagqHFhByoVqCAbKM2PX6F78qziZmxKNBLSszEjUw==} + '@nucypher/shared@0.2.3': + resolution: {integrity: sha512-byKAtM3isz3RIztc3tEETivS7fFnlLqu9wWiqJaK6EtyCs9BGhb5c4+2ASrJilpJ5E2zQGjxkBdpTa2yWuCZgQ==} engines: {node: '>=18', pnpm: '>=8.0.0'} - '@nucypher/taco@0.2.6': - resolution: {integrity: sha512-BSEByDVSxUvlHWcoDxpM+ogNMzDdC38sHH5uYCCAnrs5TJokA4htwQH+CrrOCbaWuHp6thXYVUVX7UhulXscTw==} + '@nucypher/taco@0.2.7': + resolution: {integrity: sha512-6K+Vstq0rVO+waMiLhSK3deLD9tKqTZgoTgXRTofKqT4HEqNomnIIE0HpwrsVwBUWNTLaeQFT51srfG2ymy9QQ==} engines: {node: '>=18', pnpm: '>=8.0.0'} '@pkgjs/parseargs@0.11.0': @@ -6325,8 +6325,8 @@ packages: resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} hasBin: true - multiformats@13.1.1: - resolution: {integrity: sha512-JiptvwMmlxlzIlLLwhCi/srf/nk409UL0eUBr0kioRJq15hqqKyg68iftrBvhCRjR6Rw4fkNnSc4ZJXJDuta/Q==} + multiformats@13.1.0: + resolution: {integrity: sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==} multistream@4.1.0: resolution: {integrity: sha512-J1XDiAmmNpRCBfIWJv+n0ymC4ABcf/Pl+5YvC5B/D2f/2+8PtHvCNxMPKiQcZyi922Hq69J2YOpb1pTywfifyw==} @@ -10176,7 +10176,7 @@ snapshots: '@didtools/siwx': 2.0.0 '@ipld/dag-cbor': 9.2.0 caip: 1.1.1 - multiformats: 13.1.1 + multiformats: 13.1.0 uint8arrays: 5.1.0 viem: 1.21.4(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8) transitivePeerDependencies: @@ -10188,7 +10188,7 @@ snapshots: '@didtools/codecs@3.0.0': dependencies: codeco: 1.2.3 - multiformats: 13.1.1 + multiformats: 13.1.0 uint8arrays: 5.1.0 '@didtools/siwx@2.0.0': @@ -10627,7 +10627,7 @@ snapshots: '@ipld/dag-cbor@9.2.0': dependencies: cborg: 4.2.0 - multiformats: 13.1.1 + multiformats: 13.1.0 '@irys/arweave@0.0.2': dependencies: @@ -11091,7 +11091,7 @@ snapshots: '@nucypher/nucypher-core@0.14.5': {} - '@nucypher/shared@0.2.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + '@nucypher/shared@0.2.3(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/providers': 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -11106,11 +11106,11 @@ snapshots: - debug - utf-8-validate - '@nucypher/taco@0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + '@nucypher/taco@0.2.7(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abstract-signer': 5.7.0 '@nucypher/nucypher-core': 0.14.5 - '@nucypher/shared': 0.2.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@nucypher/shared': 0.2.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) semver: 7.6.2 zod: 3.23.8 @@ -16301,7 +16301,7 @@ snapshots: dns-packet: 5.6.1 thunky: 1.1.0 - multiformats@13.1.1: {} + multiformats@13.1.0: {} multistream@4.1.0: dependencies: @@ -18624,7 +18624,7 @@ snapshots: uint8arrays@5.1.0: dependencies: - multiformats: 13.1.1 + multiformats: 13.1.0 unbox-primitive@1.0.2: dependencies: From 8eca4c496a1eb383a592ac5f51b8c3c723b4fdb0 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Mon, 27 May 2024 14:00:06 +0200 Subject: [PATCH 09/75] Add EIP-712 test --- packages/taco-auth/test/did.test.ts | 33 ----------- packages/taco-auth/test/taco-auth.test.ts | 67 +++++++++++++++++++++++ 2 files changed, 67 insertions(+), 33 deletions(-) delete mode 100644 packages/taco-auth/test/did.test.ts create mode 100644 packages/taco-auth/test/taco-auth.test.ts diff --git a/packages/taco-auth/test/did.test.ts b/packages/taco-auth/test/did.test.ts deleted file mode 100644 index c25b21de8..000000000 --- a/packages/taco-auth/test/did.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Cacao, SiweMessage } from '@didtools/cacao'; -import { Wallet } from 'ethers'; -import { describe, it } from 'vitest'; - -describe('hello', () => { - it('hello-world', async () => { - const wallet = Wallet.createRandom(); - const address = wallet.address; - - const siweMessage = new SiweMessage({ - domain: 'service.org', - address: address, - statement: - 'I accept the ServiceOrg Terms of Service: https://service.org/tos', - uri: 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8', - version: '1', - nonce: '32891757', - issuedAt: '2021-09-30T16:25:24.000Z', - chainId: '1', - resources: [ - 'ipfs://Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu', - 'https://example.com/my-web2-claim.json', - 'ceramic://k2t6wyfsu4pg040dpjpbla1ybxof65baldb7fvmeam4m3n71q0w1nslz609u2d', - ], - }); - - const cacao = Cacao.fromSiweMessage(siweMessage); - const siweMessage2 = SiweMessage.fromCacao(cacao); - - const signature = await wallet.signMessage(siweMessage.toMessage()); - siweMessage2.signature = signature; - }); -}); diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts new file mode 100644 index 000000000..1aa9fe8d8 --- /dev/null +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -0,0 +1,67 @@ +import { Cacao, SiweMessage } from '@didtools/cacao'; +import { bobSecretKeyBytes, fakeProvider, fakeSigner } from '@nucypher/test-utils'; +import { Wallet } from 'ethers'; +import { describe, expect, it } from 'vitest'; +import { EIP712SignatureProvider } from '../src/eip712'; + +describe('taco authorization', () => { + it('creates a new EIP-712 message', async () => { + const provider = fakeProvider(bobSecretKeyBytes); + const signer = fakeSigner(bobSecretKeyBytes); + const eip712Provider = new EIP712SignatureProvider(provider, signer); + + const eip712Message = await eip712Provider.getOrCreateWalletSignature(); + + // Expected format: + // { + // ":userAddress": + // { + // "signature": "", + // "address": "
", + // "scheme": "EIP712" | "SIWE" | ... + // "typeData": ... + // } + // } + + expect(eip712Message.signature).toBeDefined(); + expect(eip712Message.address).toEqual(await signer.getAddress()); + // expect(eip712Mjessage.scheme).toEqual('EIP712'); + expect(eip712Message.typedData).toBeDefined(); + expect(eip712Message.typedData.types.Wallet).toBeDefined(); + expect(eip712Message.typedData.domain.name).toEqual('taco'); + expect(eip712Message.typedData.domain.version).toEqual('1'); + expect(eip712Message.typedData.domain.chainId).toEqual((await provider.getNetwork()).chainId); + expect(eip712Message.typedData.domain.salt).toBeDefined(); + expect(eip712Message.typedData.message.address).toEqual(await signer.getAddress()); + expect(eip712Message.typedData.message.blockNumber).toEqual(await provider.getBlockNumber()); + expect(eip712Message.typedData.message).toHaveProperty('blockHash'); + }); + + it('hello-world', async () => { + const wallet = Wallet.createRandom(); + const address = wallet.address; + + const siweMessage = new SiweMessage({ + domain: 'service.org', + address: address, + statement: + 'I accept the ServiceOrg Terms of Service: https://service.org/tos', + uri: 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8', + version: '1', + nonce: '32891757', + issuedAt: '2021-09-30T16:25:24.000Z', + chainId: '1', + resources: [ + 'ipfs://Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu', + 'https://example.com/my-web2-claim.json', + 'ceramic://k2t6wyfsu4pg040dpjpbla1ybxof65baldb7fvmeam4m3n71q0w1nslz609u2d', + ], + }); + + const cacao = Cacao.fromSiweMessage(siweMessage); + const siweMessage2 = SiweMessage.fromCacao(cacao); + + const signature = await wallet.signMessage(siweMessage.toMessage()); + siweMessage2.signature = signature; + }); +}); From d365bba80a24da1db59bb9416ee316b0406a0a0b Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Mon, 27 May 2024 14:06:23 +0200 Subject: [PATCH 10/75] Add scheme field to EIP712 message --- packages/taco-auth/src/eip712.ts | 7 +++++-- packages/taco-auth/test/taco-auth.test.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/taco-auth/src/eip712.ts b/packages/taco-auth/src/eip712.ts index a1b397d9c..cb0e24304 100644 --- a/packages/taco-auth/src/eip712.ts +++ b/packages/taco-auth/src/eip712.ts @@ -32,8 +32,9 @@ interface FormattedEip712 extends Eip712 { export interface TypedSignature { signature: string; - typedData: Eip712; address: string; + scheme: 'EIP712' | 'SIWE'; + typedData: Eip712; } interface ChainData { @@ -94,6 +95,8 @@ export class EIP712SignatureProvider { const signatureText = `I'm the owner of address ${address} as of block number ${blockNumber}`; const salt = ethersUtils.hexlify(ethersUtils.randomBytes(32)); + const scheme = 'EIP712'; + const typedData: Eip712 = { types: { Wallet: [ @@ -129,7 +132,7 @@ export class EIP712SignatureProvider { EIP712Domain, }, }; - return { signature, typedData: formattedTypedData, address }; + return { signature, address, scheme, typedData: formattedTypedData }; } private async getChainData(): Promise { diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 1aa9fe8d8..326671729 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -25,7 +25,7 @@ describe('taco authorization', () => { expect(eip712Message.signature).toBeDefined(); expect(eip712Message.address).toEqual(await signer.getAddress()); - // expect(eip712Mjessage.scheme).toEqual('EIP712'); + expect(eip712Message.scheme).toEqual('EIP712'); expect(eip712Message.typedData).toBeDefined(); expect(eip712Message.typedData.types.Wallet).toBeDefined(); expect(eip712Message.typedData.domain.name).toEqual('taco'); From 704a08afd0c0cbb46138779ba5c345c74a4aa2b0 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Mon, 27 May 2024 19:29:35 +0200 Subject: [PATCH 11/75] Generalize TypedSignature interface --- packages/taco-auth/src/eip712.ts | 10 ++------- packages/taco-auth/src/typedSignature.ts | 10 +++++++++ packages/taco-auth/test/taco-auth.test.ts | 25 ++++++++++++----------- 3 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 packages/taco-auth/src/typedSignature.ts diff --git a/packages/taco-auth/src/eip712.ts b/packages/taco-auth/src/eip712.ts index cb0e24304..7f8b3da01 100644 --- a/packages/taco-auth/src/eip712.ts +++ b/packages/taco-auth/src/eip712.ts @@ -3,6 +3,7 @@ import { ethers } from 'ethers'; import { utils as ethersUtils } from 'ethers/lib/ethers'; import { LocalStorage } from './storage'; +import type { TypedSignature } from './typedSignature'; interface Eip712 { types: { @@ -22,7 +23,7 @@ interface Eip712 { }; } -interface FormattedEip712 extends Eip712 { +export interface FormattedEip712 extends Eip712 { primaryType: 'Wallet'; types: { EIP712Domain: { name: string; type: string }[]; @@ -30,13 +31,6 @@ interface FormattedEip712 extends Eip712 { }; } -export interface TypedSignature { - signature: string; - address: string; - scheme: 'EIP712' | 'SIWE'; - typedData: Eip712; -} - interface ChainData { blockHash: string; chainId: number; diff --git a/packages/taco-auth/src/typedSignature.ts b/packages/taco-auth/src/typedSignature.ts new file mode 100644 index 000000000..376add2d0 --- /dev/null +++ b/packages/taco-auth/src/typedSignature.ts @@ -0,0 +1,10 @@ +import type { SiweMessage } from '@didtools/cacao'; + +import { FormattedEip712 } from './eip712'; + +export interface TypedSignature { + signature: string; + address: string; + scheme: 'EIP712' | 'SIWE'; + typedData: FormattedEip712 | SiweMessage; + } diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 326671729..24b368afa 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -1,8 +1,7 @@ -import { Cacao, SiweMessage } from '@didtools/cacao'; import { bobSecretKeyBytes, fakeProvider, fakeSigner } from '@nucypher/test-utils'; -import { Wallet } from 'ethers'; import { describe, expect, it } from 'vitest'; -import { EIP712SignatureProvider } from '../src/eip712'; + +import { EIP4361SignatureProvider, EIP712SignatureProvider, FormattedEip712 } from '../src'; describe('taco authorization', () => { it('creates a new EIP-712 message', async () => { @@ -26,15 +25,17 @@ describe('taco authorization', () => { expect(eip712Message.signature).toBeDefined(); expect(eip712Message.address).toEqual(await signer.getAddress()); expect(eip712Message.scheme).toEqual('EIP712'); - expect(eip712Message.typedData).toBeDefined(); - expect(eip712Message.typedData.types.Wallet).toBeDefined(); - expect(eip712Message.typedData.domain.name).toEqual('taco'); - expect(eip712Message.typedData.domain.version).toEqual('1'); - expect(eip712Message.typedData.domain.chainId).toEqual((await provider.getNetwork()).chainId); - expect(eip712Message.typedData.domain.salt).toBeDefined(); - expect(eip712Message.typedData.message.address).toEqual(await signer.getAddress()); - expect(eip712Message.typedData.message.blockNumber).toEqual(await provider.getBlockNumber()); - expect(eip712Message.typedData.message).toHaveProperty('blockHash'); + + const typedData = eip712Message.typedData as FormattedEip712; + expect(typedData).toBeDefined(); + expect(typedData.types.Wallet).toBeDefined(); + expect(typedData.domain.name).toEqual('taco'); + expect(typedData.domain.version).toEqual('1'); + expect(typedData.domain.chainId).toEqual((await provider.getNetwork()).chainId); + expect(typedData.domain.salt).toBeDefined(); + expect(typedData.message.address).toEqual(await signer.getAddress()); + expect(typedData.message.blockNumber).toEqual(await provider.getBlockNumber()); + expect(typedData.message).toHaveProperty('blockHash'); }); it('hello-world', async () => { From 14c128ed9cf2c4989a7b9dd1e661cb7a24188831 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Mon, 27 May 2024 19:37:42 +0200 Subject: [PATCH 12/75] Use TypedSignature format as return of SiweMessage --- packages/taco-auth/src/eip4361.ts | 35 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index acb66cc91..471f9322a 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -2,6 +2,7 @@ import { SiweMessage } from '@didtools/cacao'; import { ethers } from 'ethers'; import { LocalStorage } from './storage'; +import { TypedSignature } from './typedSignature'; export class EIP4361SignatureProvider { private readonly storage: LocalStorage; @@ -13,36 +14,29 @@ export class EIP4361SignatureProvider { this.storage = new LocalStorage(); } - public async getOrCreateSiweMessage( - domain: string, - version: string, - nonce: string, - uri: string, - ): Promise { + public async getOrCreateSiweMessage(): Promise { const address = await this.signer.getAddress(); const storageKey = `eth-signin-message-${address}`; // If we have a message in localStorage, return it const maybeMessage = this.storage.getItem(storageKey); if (maybeMessage) { - return maybeMessage; + return JSON.parse(maybeMessage); } // If at this point we didn't return, we need to create a new message - const message = await this.createSiweMessage(domain, version, nonce, uri); - this.storage.setItem(storageKey, message); - return message; + const typedSignature = await this.createSiweMessage(); + this.storage.setItem(storageKey, JSON.stringify(typedSignature)); + return typedSignature; } - private async createSiweMessage( - domain: string, - version: string, - nonce: string, - uri: string, - ): Promise { - const chainId = (await this.provider.getNetwork()).chainId; + private async createSiweMessage(): Promise { const address = await this.signer.getAddress(); - + const domain = 'https://login.xyz'; + const version = '1'; + const nonce = '0'; + const uri = 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8'; + const chainId = (await this.provider.getNetwork()).chainId; const siweMessage = new SiweMessage({ domain, address, @@ -53,6 +47,9 @@ export class EIP4361SignatureProvider { chainId: chainId.toString(), }); - return siweMessage.toMessage(); + const scheme = 'SIWE'; + const signature = await this.signer.signMessage(siweMessage.toMessage()); + + return { signature, address, scheme, typedData: siweMessage }; } } From 4e226db3f9933567db1b3d5054cb218d2a60c8f1 Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Mon, 27 May 2024 19:54:24 +0200 Subject: [PATCH 13/75] Add tests for SIWE message creation --- packages/taco-auth/test/taco-auth.test.ts | 77 +++++++++++++++-------- 1 file changed, 50 insertions(+), 27 deletions(-) diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 24b368afa..29ff67531 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -1,7 +1,16 @@ -import { bobSecretKeyBytes, fakeProvider, fakeSigner } from '@nucypher/test-utils'; +import { SiweMessage } from '@didtools/cacao'; +import { + bobSecretKeyBytes, + fakeProvider, + fakeSigner, +} from '@nucypher/test-utils'; import { describe, expect, it } from 'vitest'; -import { EIP4361SignatureProvider, EIP712SignatureProvider, FormattedEip712 } from '../src'; +import { + EIP4361SignatureProvider, + EIP712SignatureProvider, + FormattedEip712, +} from '../src'; describe('taco authorization', () => { it('creates a new EIP-712 message', async () => { @@ -31,38 +40,52 @@ describe('taco authorization', () => { expect(typedData.types.Wallet).toBeDefined(); expect(typedData.domain.name).toEqual('taco'); expect(typedData.domain.version).toEqual('1'); - expect(typedData.domain.chainId).toEqual((await provider.getNetwork()).chainId); + expect(typedData.domain.chainId).toEqual( + (await provider.getNetwork()).chainId, + ); expect(typedData.domain.salt).toBeDefined(); expect(typedData.message.address).toEqual(await signer.getAddress()); - expect(typedData.message.blockNumber).toEqual(await provider.getBlockNumber()); + expect(typedData.message.blockNumber).toEqual( + await provider.getBlockNumber(), + ); expect(typedData.message).toHaveProperty('blockHash'); }); - it('hello-world', async () => { - const wallet = Wallet.createRandom(); - const address = wallet.address; + it('creates a new SIWE message', async () => { + const provider = fakeProvider(bobSecretKeyBytes); + const signer = fakeSigner(bobSecretKeyBytes); - const siweMessage = new SiweMessage({ - domain: 'service.org', - address: address, - statement: - 'I accept the ServiceOrg Terms of Service: https://service.org/tos', - uri: 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8', - version: '1', - nonce: '32891757', - issuedAt: '2021-09-30T16:25:24.000Z', - chainId: '1', - resources: [ - 'ipfs://Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu', - 'https://example.com/my-web2-claim.json', - 'ceramic://k2t6wyfsu4pg040dpjpbla1ybxof65baldb7fvmeam4m3n71q0w1nslz609u2d', - ], - }); + const eip4361Provider = new EIP4361SignatureProvider(provider, signer); + const siweMessage = await eip4361Provider.getOrCreateSiweMessage(); + + // Expected format: + // { + // ":userAddress": + // { + // "signature": "", + // "address": "
", + // "scheme": "EIP712" | "SIWE" | ... + // "typeData": ... + // } + // } - const cacao = Cacao.fromSiweMessage(siweMessage); - const siweMessage2 = SiweMessage.fromCacao(cacao); + expect(siweMessage.signature).toBeDefined(); + expect(siweMessage.address).toEqual(await signer.getAddress()); + expect(siweMessage.scheme).toEqual('SIWE'); - const signature = await wallet.signMessage(siweMessage.toMessage()); - siweMessage2.signature = signature; + const typedData = siweMessage.typedData as SiweMessage; + expect(typedData).toBeDefined(); + expect(typedData.domain).toEqual('https://login.xyz'); + expect(typedData.version).toEqual('1'); + expect(typedData.nonce).toEqual('0'); + expect(typedData.uri).toEqual( + 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8', + ); + expect(typedData.chainId).toEqual( + (await provider.getNetwork()).chainId.toString(), + ); + expect(typedData.statement).toEqual( + `${typedData.domain} wants you to sign in with your Ethereum account: ${await signer.getAddress()}`, + ); }); }); From e986f268ce7908cf088530d0e6fb5e10ea89f15d Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Tue, 28 May 2024 14:12:04 +0200 Subject: [PATCH 14/75] Add EIP761 and SIWE as context options and tests Co-authored-by: Piotr Roslaniec --- packages/taco-auth/src/eip4361.ts | 2 +- packages/taco-auth/src/eip712.ts | 2 +- packages/taco-auth/src/index.ts | 1 + .../src/{typedSignature.ts => types.ts} | 0 packages/taco/src/conditions/condition.ts | 15 +- packages/taco/src/conditions/const.ts | 16 +- .../taco/src/conditions/context/context.ts | 86 ++++++++-- .../taco/src/conditions/predefined/erc20.ts | 4 +- .../taco/src/conditions/predefined/erc721.ts | 6 +- packages/taco/src/conditions/shared.ts | 4 +- .../test/conditions/base/contract.test.ts | 6 +- .../test/conditions/condition-expr.test.ts | 4 +- packages/taco/test/conditions/context.test.ts | 155 +++++++++++++++--- .../test/conditions/predefined/erc721.test.ts | 4 +- 14 files changed, 249 insertions(+), 56 deletions(-) rename packages/taco-auth/src/{typedSignature.ts => types.ts} (100%) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 471f9322a..544d958fc 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -2,7 +2,7 @@ import { SiweMessage } from '@didtools/cacao'; import { ethers } from 'ethers'; import { LocalStorage } from './storage'; -import { TypedSignature } from './typedSignature'; +import { TypedSignature } from './types'; export class EIP4361SignatureProvider { private readonly storage: LocalStorage; diff --git a/packages/taco-auth/src/eip712.ts b/packages/taco-auth/src/eip712.ts index 7f8b3da01..e60f5b8d2 100644 --- a/packages/taco-auth/src/eip712.ts +++ b/packages/taco-auth/src/eip712.ts @@ -3,7 +3,7 @@ import { ethers } from 'ethers'; import { utils as ethersUtils } from 'ethers/lib/ethers'; import { LocalStorage } from './storage'; -import type { TypedSignature } from './typedSignature'; +import type { TypedSignature } from './types'; interface Eip712 { types: { diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts index 6b5476af1..ece38575d 100644 --- a/packages/taco-auth/src/index.ts +++ b/packages/taco-auth/src/index.ts @@ -1,2 +1,3 @@ export * from './eip712'; export * from './eip4361'; +export * from './types'; diff --git a/packages/taco-auth/src/typedSignature.ts b/packages/taco-auth/src/types.ts similarity index 100% rename from packages/taco-auth/src/typedSignature.ts rename to packages/taco-auth/src/types.ts diff --git a/packages/taco/src/conditions/condition.ts b/packages/taco/src/conditions/condition.ts index 88d19b9cb..c447ffa14 100644 --- a/packages/taco/src/conditions/condition.ts +++ b/packages/taco/src/conditions/condition.ts @@ -1,7 +1,7 @@ import { objectEquals } from '@nucypher/shared'; import { z } from 'zod'; -import { USER_ADDRESS_PARAM } from './const'; +import { USER_ADDRESS_PARAMS, USER_ADDRESS_PARAM_DEFAULT } from './const'; type ConditionSchema = z.ZodSchema; export type ConditionProps = z.infer; @@ -35,8 +35,19 @@ export class Condition { return { error: result.error }; } + // TODO: Fix this method and add a test for it + public findParamWithSigner(): string | null { + const serialized = JSON.stringify(this.value); + USER_ADDRESS_PARAMS.forEach(param => { + if (serialized.includes(param)) { + return param; + } + }) + return null; + } + public requiresSigner(): boolean { - return JSON.stringify(this.value).includes(USER_ADDRESS_PARAM); + return Boolean(this.findParamWithSigner) } public toObj() { diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 45e0124f1..16b648b29 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -1,6 +1,8 @@ import { ChainId } from '@nucypher/shared'; -export const USER_ADDRESS_PARAM = ':userAddress'; +export const USER_ADDRESS_PARAM_DEFAULT = ':userAddress'; +export const USER_ADDRESS_PARAM_EIP712 = ':userAddressEIP712'; +export const USER_ADDRESS_PARAM_EIP4361 = ':userAddressEIP4361'; export const ETH_ADDRESS_REGEXP = new RegExp('^0x[a-fA-F0-9]{40}$'); @@ -16,4 +18,14 @@ export const SUPPORTED_CHAIN_IDS = [ ChainId.ETHEREUM_MAINNET, ]; -export const RESERVED_CONTEXT_PARAMS = [USER_ADDRESS_PARAM]; +export const USER_ADDRESS_PARAMS = [ + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EIP712, + USER_ADDRESS_PARAM_EIP4361, +]; + +export const RESERVED_CONTEXT_PARAMS = [ + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EIP712, + USER_ADDRESS_PARAM_EIP4361, +]; diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index adac19dd6..f46ada960 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,6 +1,6 @@ import { Context, Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { fromJSON, toJSON } from '@nucypher/shared'; -import { EIP4361SignatureProvider, TypedSignature } from '@nucypher/taco-auth'; +import { EIP712SignatureProvider, EIP4361SignatureProvider, TypedSignature } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { CompoundConditionType } from '../compound-condition'; @@ -10,7 +10,10 @@ import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS, - USER_ADDRESS_PARAM, + USER_ADDRESS_PARAMS, + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EIP4361, + USER_ADDRESS_PARAM_EIP712, } from '../const'; import { version } from 'os'; @@ -21,13 +24,14 @@ const ERR_RESERVED_PARAM = (key: string) => `Cannot use reserved parameter name ${key} as custom parameter`; const ERR_INVALID_CUSTOM_PARAM = (key: string) => `Custom parameter ${key} must start with ${CONTEXT_PARAM_PREFIX}`; -const ERR_SIGNER_REQUIRED = `Signer required to satisfy ${USER_ADDRESS_PARAM} context variable in condition`; +const ERR_SIGNER_REQUIRED = (key: string) => `Signer required to satisfy ${key} context variable in condition`; const ERR_MISSING_CONTEXT_PARAMS = (params: string[]) => `Missing custom context parameter(s): ${params.join(', ')}`; const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => `Unknown custom context parameter(s): ${params.join(', ')}`; export class ConditionContext { + private readonly eip712SignatureProvider?: EIP712SignatureProvider; private readonly eip4361SignatureProvider?: EIP4361SignatureProvider; constructor( @@ -37,6 +41,11 @@ export class ConditionContext { private readonly signer?: ethers.Signer, ) { if (this.signer) { + this.eip712SignatureProvider = new EIP712SignatureProvider( + this.provider, + this.signer, + ); + this.eip4361SignatureProvider = new EIP4361SignatureProvider( this.provider, this.signer, @@ -55,8 +64,15 @@ export class ConditionContext { } }); + // TODO: Use this `requiredParam` to throw an error + // Currently doesn't find anything (returns "null") + // But when it does return something, use it on the line 72 + const requiredParam = this.condition.findParamWithSigner(); + console.log({requiredParam}); + // if (requiredParam && !this.signer) { if (this.condition.requiresSigner() && !this.signer) { - throw new Error(ERR_SIGNER_REQUIRED); + // throw new Error(requiredParam); + throw new Error("placeholder"); } } @@ -89,26 +105,68 @@ export class ConditionContext { return parameters; }; + // today + // :user_address -> (:user_address, eip712) + + // in future + // :user_address -> (:user_address, schema: eip712) + // :user_address_eip712 -> (:user_address, schema: eip712) + // :user_address_eip4361 -> (:user_address, schema: eip4361) + + // HasNFTBalance({ + // balanceOf(":user_address") > 10 + // }) + + // HasNFTBalance({ + // balanceOf(":user_address_eip712") > 10 + // }) + + // HasNFTBalance({ + // balanceOf(":user_address_eip4361") > 10 + // }) + private async fillContextParameters( requestedParameters: Set, ): Promise> { - const domain = ""; - const version = ""; - const nonce = ""; - const uri = ""; - // Now, we can safely add all the parameters const parameters: Record = {}; // Fill in predefined context parameters - if (requestedParameters.has(USER_ADDRESS_PARAM)) { + + // TODO: Figure out if we can simplify/deduplicate this logic for every + // authentication method we use + + // Handle legacy EIP712 signature denoted by ":userAddress" + if (requestedParameters.has(USER_ADDRESS_PARAM_DEFAULT)) { + if (!this.eip712SignatureProvider) { + throw new Error(ERR_SIGNER_REQUIRED(USER_ADDRESS_PARAM_EIP712)); + } + parameters[USER_ADDRESS_PARAM_DEFAULT] = + await this.eip712SignatureProvider.getOrCreateWalletSignature(); + // Remove from requested parameters + requestedParameters.delete(USER_ADDRESS_PARAM_DEFAULT); + } + + // Handle a new alias for EIP712, ":userAddressEIP712" + if (requestedParameters.has(USER_ADDRESS_PARAM_EIP712)) { + if (!this.eip712SignatureProvider) { + throw new Error(ERR_SIGNER_REQUIRED(USER_ADDRESS_PARAM_EIP712)); + } + parameters[USER_ADDRESS_PARAM_EIP712] = + await this.eip712SignatureProvider.getOrCreateWalletSignature(); + // Remove from requested parameters + requestedParameters.delete(USER_ADDRESS_PARAM_EIP712); + } + + // Handle a new method, EIP4361, with a ":userAddressEIP4361" alias + if (requestedParameters.has(USER_ADDRESS_PARAM_EIP4361)) { if (!this.eip4361SignatureProvider) { - throw new Error(ERR_SIGNER_REQUIRED); + throw new Error(ERR_SIGNER_REQUIRED(USER_ADDRESS_PARAM_EIP4361)); } - parameters[USER_ADDRESS_PARAM] = - await this.eip4361SignatureProvider.getOrCreateSiweMessage(domain, version, nonce, uri); + parameters[USER_ADDRESS_PARAM_EIP4361] = + await this.eip4361SignatureProvider.getOrCreateSiweMessage(); // Remove from requested parameters - requestedParameters.delete(USER_ADDRESS_PARAM); + requestedParameters.delete(USER_ADDRESS_PARAM_EIP4361); } // Fill in custom parameters diff --git a/packages/taco/src/conditions/predefined/erc20.ts b/packages/taco/src/conditions/predefined/erc20.ts index 5f341cb15..265d40a30 100644 --- a/packages/taco/src/conditions/predefined/erc20.ts +++ b/packages/taco/src/conditions/predefined/erc20.ts @@ -3,14 +3,14 @@ import { ContractConditionProps, ContractConditionType, } from '../base/contract'; -import { USER_ADDRESS_PARAM } from '../const'; +import { USER_ADDRESS_PARAM_DEFAULT } from '../const'; type ERC20BalanceFields = 'contractAddress' | 'chain' | 'returnValueTest'; const ERC20BalanceDefaults: Omit = { conditionType: ContractConditionType, method: 'balanceOf', - parameters: [USER_ADDRESS_PARAM], + parameters: [USER_ADDRESS_PARAM_DEFAULT], standardContractType: 'ERC20', }; diff --git a/packages/taco/src/conditions/predefined/erc721.ts b/packages/taco/src/conditions/predefined/erc721.ts index 5e0e7f434..407d9e8a7 100644 --- a/packages/taco/src/conditions/predefined/erc721.ts +++ b/packages/taco/src/conditions/predefined/erc721.ts @@ -3,7 +3,7 @@ import { ContractConditionProps, ContractConditionType, } from '../base/contract'; -import { USER_ADDRESS_PARAM } from '../const'; +import { USER_ADDRESS_PARAM_DEFAULT } from '../const'; type ERC721OwnershipFields = 'contractAddress' | 'chain' | 'parameters'; @@ -16,7 +16,7 @@ const ERC721OwnershipDefaults: Omit< standardContractType: 'ERC721', returnValueTest: { comparator: '==', - value: USER_ADDRESS_PARAM, + value: USER_ADDRESS_PARAM_DEFAULT, }, }; @@ -32,7 +32,7 @@ const ERC721BalanceDefaults: Omit = { conditionType: ContractConditionType, method: 'balanceOf', - parameters: [USER_ADDRESS_PARAM], + parameters: [USER_ADDRESS_PARAM_DEFAULT], standardContractType: 'ERC721', }; diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index da452cd1e..9016a63f0 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -4,7 +4,7 @@ import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, ETH_ADDRESS_REGEXP, - USER_ADDRESS_PARAM, + USER_ADDRESS_PARAM_DEFAULT, } from './const'; export const contextParamSchema = z.string().regex(CONTEXT_PARAM_REGEXP); @@ -36,7 +36,7 @@ export const returnValueTestSchema = z.object({ export type ReturnValueTestProps = z.infer; const EthAddressSchema = z.string().regex(ETH_ADDRESS_REGEXP); -const UserAddressSchema = z.literal(USER_ADDRESS_PARAM); +const UserAddressSchema = z.literal(USER_ADDRESS_PARAM_DEFAULT); export const EthAddressOrUserAddressSchema = z.union([ EthAddressSchema, UserAddressSchema, diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index daedd95b1..8a1024f3a 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -10,7 +10,7 @@ import { FunctionAbiProps, } from '../../../src/conditions/base/contract'; import { ConditionExpression } from '../../../src/conditions/condition-expr'; -import { USER_ADDRESS_PARAM } from '../../../src/conditions/const'; +import { USER_ADDRESS_PARAM_DEFAULT } from '../../../src/conditions/const'; import { CustomContextParam } from '../../../src/conditions/context'; import { testContractConditionObj, testFunctionAbi } from '../../test-utils'; @@ -156,7 +156,7 @@ describe('supports custom function abi', () => { standardContractType: undefined, functionAbi: testFunctionAbi, method: 'myFunction', - parameters: [USER_ADDRESS_PARAM, ':customParam'], + parameters: [USER_ADDRESS_PARAM_DEFAULT, ':customParam'], returnValueTest: { comparator: '==', value: 100, @@ -179,7 +179,7 @@ describe('supports custom function abi', () => { .toJson(); expect(asJson).toBeDefined(); - expect(asJson).toContain(USER_ADDRESS_PARAM); + expect(asJson).toContain(USER_ADDRESS_PARAM_DEFAULT); expect(asJson).toContain(myCustomParam); }); diff --git a/packages/taco/test/conditions/condition-expr.test.ts b/packages/taco/test/conditions/condition-expr.test.ts index c68385cde..90452cb15 100644 --- a/packages/taco/test/conditions/condition-expr.test.ts +++ b/packages/taco/test/conditions/condition-expr.test.ts @@ -15,7 +15,7 @@ import { } from '../../src/conditions/base/time'; import { CompoundCondition } from '../../src/conditions/compound-condition'; import { ConditionExpression } from '../../src/conditions/condition-expr'; -import { USER_ADDRESS_PARAM } from '../../src/conditions/const'; +import { USER_ADDRESS_PARAM_DEFAULT } from '../../src/conditions/const'; import { ERC721Balance } from '../../src/conditions/predefined/erc721'; import { testContractConditionObj, @@ -45,7 +45,7 @@ describe('condition set', () => { standardContractType: undefined, functionAbi: testFunctionAbi, method: testFunctionAbi.name, - parameters: [USER_ADDRESS_PARAM, customParamKey], + parameters: [USER_ADDRESS_PARAM_DEFAULT, customParamKey], returnValueTest: { ...testReturnValueTest, }, diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 9a4b28229..3a488e98c 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -1,8 +1,9 @@ import { initialize } from '@nucypher/nucypher-core'; import { fakeProvider, fakeSigner } from '@nucypher/test-utils'; import { ethers } from 'ethers'; -import { beforeAll, describe, expect, it } from 'vitest'; +import { beforeAll, describe, expect, it, vi } from 'vitest'; +import { EIP4361SignatureProvider, EIP712SignatureProvider } from '@nucypher/taco-auth'; import { toBytes, toHexString } from '../../src'; import { ContractCondition, @@ -12,12 +13,14 @@ import { RpcCondition } from '../../src/conditions/base/rpc'; import { ConditionExpression } from '../../src/conditions/condition-expr'; import { RESERVED_CONTEXT_PARAMS, - USER_ADDRESS_PARAM, + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EIP4361, + USER_ADDRESS_PARAM_EIP712, } from '../../src/conditions/const'; import { CustomContextParam } from '../../src/conditions/context'; import { - paramOrContextParamSchema, ReturnValueTestProps, + paramOrContextParamSchema, } from '../../src/conditions/shared'; import { testContractConditionObj, @@ -40,10 +43,10 @@ describe('context', () => { it('serializes to json', async () => { const rpcCondition = new RpcCondition({ ...testRpcConditionObj, - parameters: [USER_ADDRESS_PARAM], + parameters: [USER_ADDRESS_PARAM_DEFAULT], returnValueTest: { comparator: '==', - value: USER_ADDRESS_PARAM, + value: USER_ADDRESS_PARAM_DEFAULT, }, }); const conditionContext = new ConditionExpression( @@ -52,7 +55,7 @@ describe('context', () => { const asJson = await conditionContext.toJson(); expect(asJson).toBeDefined(); - expect(asJson).toContain(USER_ADDRESS_PARAM); + expect(asJson).toContain(USER_ADDRESS_PARAM_DEFAULT); }); }); @@ -104,8 +107,8 @@ describe('context', () => { }); it('rejects on using reserved context parameter', () => { - const badCustomParams: Record = {}; RESERVED_CONTEXT_PARAMS.forEach((reservedParam) => { + const badCustomParams: Record = {}; badCustomParams[reservedParam] = 'this-will-throw'; expect(() => context.withCustomParams(badCustomParams)).toThrow( `Cannot use reserved parameter name ${reservedParam} as custom parameter`, @@ -128,7 +131,7 @@ describe('context', () => { it('detects when signer is required by parameters', () => { const conditionObj = { ...testContractConditionObj, - parameters: [USER_ADDRESS_PARAM], + parameters: [USER_ADDRESS_PARAM_DEFAULT], returnValueTest: { comparator: '==', value: 100, @@ -139,7 +142,7 @@ describe('context', () => { expect(conditionExpr.contextRequiresSigner()).toBe(true); expect(conditionExpr.buildContext(provider, {}, signer)).toBeDefined(); expect(() => conditionExpr.buildContext(provider, {})).toThrow( - `Signer required to satisfy ${USER_ADDRESS_PARAM} context variable in condition`, + `Signer required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -151,7 +154,7 @@ describe('context', () => { parameters: [3591], returnValueTest: { comparator: '==', - value: USER_ADDRESS_PARAM, + value: USER_ADDRESS_PARAM_DEFAULT, }, } as ContractConditionProps; const condition = new ContractCondition(conditionObj); @@ -159,7 +162,7 @@ describe('context', () => { expect(conditionExpr.contextRequiresSigner()).toBe(true); expect(conditionExpr.buildContext(provider, {}, signer)).toBeDefined(); expect(() => conditionExpr.buildContext(provider, {})).toThrow( - `Signer required to satisfy ${USER_ADDRESS_PARAM} context variable in condition`, + `Signer required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -167,7 +170,7 @@ describe('context', () => { const condition = new RpcCondition(testRpcConditionObj); const conditionExpr = new ConditionExpression(condition); expect( - JSON.stringify(condition.toObj()).includes(USER_ADDRESS_PARAM), + JSON.stringify(condition.toObj()).includes(USER_ADDRESS_PARAM_DEFAULT), ).toBe(false); expect(conditionExpr.contextRequiresSigner()).toBe(false); expect(conditionExpr.buildContext(provider, {}, signer)).toBeDefined(); @@ -179,14 +182,14 @@ describe('context', () => { ...testContractConditionObj, returnValueTest: { ...testReturnValueTest, - value: USER_ADDRESS_PARAM, + value: USER_ADDRESS_PARAM_DEFAULT, }, }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( - `Signer required to satisfy ${USER_ADDRESS_PARAM} context variable in condition`, + `Signer required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -195,14 +198,14 @@ describe('context', () => { ...testContractConditionObj, returnValueTest: { ...testReturnValueTest, - value: USER_ADDRESS_PARAM, + value: USER_ADDRESS_PARAM_DEFAULT, }, }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( - `Signer required to satisfy ${USER_ADDRESS_PARAM} context variable in condition`, + `Signer required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -212,7 +215,7 @@ describe('context', () => { standardContractType: undefined, // We're going to use a custom function ABI functionAbi: testFunctionAbi, method: testFunctionAbi.name, - parameters: [USER_ADDRESS_PARAM, customParamKey], // We're going to use a custom parameter + parameters: [USER_ADDRESS_PARAM_DEFAULT, customParamKey], // We're going to use a custom parameter returnValueTest: { ...testReturnValueTest, }, @@ -221,7 +224,7 @@ describe('context', () => { it('rejects on a missing parameter ', async () => { const customContractCondition = new ContractCondition({ ...contractConditionObj, - parameters: [USER_ADDRESS_PARAM, customParamKey], + parameters: [USER_ADDRESS_PARAM_DEFAULT, customParamKey], }); const conditionContext = new ConditionExpression( customContractCondition, @@ -235,7 +238,7 @@ describe('context', () => { it('accepts on a hard-coded parameter', async () => { const customContractCondition = new ContractCondition({ ...contractConditionObj, - parameters: [USER_ADDRESS_PARAM, 100], + parameters: [USER_ADDRESS_PARAM_DEFAULT, 100], }); const conditionContext = new ConditionExpression( customContractCondition, @@ -243,7 +246,7 @@ describe('context', () => { const asObj = await conditionContext.toObj(); expect(asObj).toBeDefined(); - expect(asObj[USER_ADDRESS_PARAM]).toBeDefined(); + expect(asObj[USER_ADDRESS_PARAM_DEFAULT]).toBeDefined(); }); it.each([0, ''])( @@ -252,7 +255,7 @@ describe('context', () => { const customParamKey = ':customParam'; const customContractCondition = new ContractCondition({ ...contractConditionObj, - parameters: [USER_ADDRESS_PARAM, customParamKey], + parameters: [USER_ADDRESS_PARAM_DEFAULT, customParamKey], }); const customParameters: Record = {}; customParameters[customParamKey] = falsyParam; @@ -262,7 +265,7 @@ describe('context', () => { const asObj = await conditionContext.toObj(); expect(asObj).toBeDefined(); - expect(asObj[USER_ADDRESS_PARAM]).toBeDefined(); + expect(asObj[USER_ADDRESS_PARAM_DEFAULT]).toBeDefined(); expect(asObj[customParamKey]).toBeDefined(); expect(asObj[customParamKey]).toEqual(falsyParam); }, @@ -271,6 +274,114 @@ describe('context', () => { }); }); +describe('authentication provider', () => { + let provider: ethers.providers.Provider; + let signer: ethers.Signer; + + beforeAll(async () => { + await initialize(); + provider = fakeProvider(); + signer = fakeSigner(); + }); + + it('throws an error if there is no signer', () => { + RESERVED_CONTEXT_PARAMS.forEach((userAddressParam) => { + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: userAddressParam, + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionExpr = new ConditionExpression(condition); + expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( + `Signer required to satisfy ${userAddressParam} context variable in condition`, + ); + }) + }); + + it('it supports just one provider at a time', () => { + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: USER_ADDRESS_PARAM_DEFAULT, + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionExpr = new ConditionExpression(condition); + expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(() => conditionExpr.buildContext(provider, {}, signer)).not.toThrow(); + }); + + it('supports multiple providers when needed', () => { + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + // TODO: Is it supposed to work? Multiple providers at the same time? + value: [USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361], + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionExpr = new ConditionExpression(condition); + expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(() => conditionExpr.buildContext(provider, {}, signer)).not.toThrow(); + }); + + // TODO: Consider rewriting those tests to be a bit more comprehensive and deduplicate them + + it('supports default auth method (eip712)', () => { + const eip712Spy = vi.spyOn(EIP712SignatureProvider.prototype, "getOrCreateWalletSignature"); + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: USER_ADDRESS_PARAM_DEFAULT, + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionExpr = new ConditionExpression(condition); + expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(() => conditionExpr.buildContext(provider, {}, signer).toObj()).not.toThrow(); + expect(eip712Spy).toHaveBeenCalledOnce(); + }); + + it('supports eip712', () => { + const eip712Spy = vi.spyOn(EIP712SignatureProvider.prototype, "getOrCreateWalletSignature"); + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: USER_ADDRESS_PARAM_EIP712, + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionExpr = new ConditionExpression(condition); + expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(() => conditionExpr.buildContext(provider, {}, signer).toObj()).not.toThrow(); + expect(eip712Spy).toHaveBeenCalledOnce(); + }); + + it('supports eip4361', () => { + const eip4361Spy = vi.spyOn(EIP4361SignatureProvider.prototype, "getOrCreateSiweMessage"); + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: USER_ADDRESS_PARAM_EIP4361, + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionExpr = new ConditionExpression(condition); + expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(() => conditionExpr.buildContext(provider, {}, signer).toObj()).not.toThrow(); + expect(eip4361Spy).toHaveBeenCalledOnce(); + }); +}) + describe('param or context param schema', () => { it('accepts a plain string', () => { expect(paramOrContextParamSchema.safeParse('hello').success).toBe(true); diff --git a/packages/taco/test/conditions/predefined/erc721.test.ts b/packages/taco/test/conditions/predefined/erc721.test.ts index b2a9ed40c..8285a87d3 100644 --- a/packages/taco/test/conditions/predefined/erc721.test.ts +++ b/packages/taco/test/conditions/predefined/erc721.test.ts @@ -2,7 +2,7 @@ import { TEST_CHAIN_ID, TEST_CONTRACT_ADDR } from '@nucypher/test-utils'; import { describe, expect, it } from 'vitest'; import { ContractConditionProps } from '../../../src/conditions/base/contract'; -import { USER_ADDRESS_PARAM } from '../../../src/conditions/const'; +import { USER_ADDRESS_PARAM_DEFAULT } from '../../../src/conditions/const'; import { ERC721Balance, ERC721Ownership, @@ -16,7 +16,7 @@ describe('ERC721Ownership', () => { > = { contractAddress: TEST_CONTRACT_ADDR, chain: TEST_CHAIN_ID, - parameters: [USER_ADDRESS_PARAM], + parameters: [USER_ADDRESS_PARAM_DEFAULT], }; const instance = new ERC721Ownership(props); From 39765fed1d0dbd855e1b48fa8ea56aad00762f3d Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 30 May 2024 11:43:06 -0400 Subject: [PATCH 15/75] Replace didtools dependency with a depdency on siwe. Modify some default values used for creating SIWE message, including use a random nonce. --- packages/taco-auth/package.json | 4 +- packages/taco-auth/src/eip4361.ts | 10 +- packages/taco-auth/src/eip712.ts | 2 +- packages/taco-auth/test/taco-auth.test.ts | 12 +- pnpm-lock.yaml | 311 ++++++---------------- 5 files changed, 99 insertions(+), 240 deletions(-) diff --git a/packages/taco-auth/package.json b/packages/taco-auth/package.json index aaa56ea6d..0e821b87c 100644 --- a/packages/taco-auth/package.json +++ b/packages/taco-auth/package.json @@ -39,9 +39,9 @@ "typedoc": "typedoc" }, "dependencies": { - "@didtools/cacao": "^3.0.1", "@ethersproject/abstract-signer": "^5.7.0", - "@nucypher/shared": "workspace:*" + "@nucypher/shared": "workspace:*", + "siwe": "^2.3.2" }, "devDependencies": { "@nucypher/test-utils": "workspace:*" diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 544d958fc..8e2d3000f 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -1,5 +1,5 @@ -import { SiweMessage } from '@didtools/cacao'; import { ethers } from 'ethers'; +import { generateNonce, SiweMessage } from 'siwe'; import { LocalStorage } from './storage'; import { TypedSignature } from './types'; @@ -32,10 +32,10 @@ export class EIP4361SignatureProvider { private async createSiweMessage(): Promise { const address = await this.signer.getAddress(); - const domain = 'https://login.xyz'; + const domain = 'TACo'; const version = '1'; - const nonce = '0'; - const uri = 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8'; + const nonce = generateNonce(); + const uri = 'taco://'; const chainId = (await this.provider.getNetwork()).chainId; const siweMessage = new SiweMessage({ domain, @@ -44,7 +44,7 @@ export class EIP4361SignatureProvider { uri, version, nonce, - chainId: chainId.toString(), + chainId, }); const scheme = 'SIWE'; diff --git a/packages/taco-auth/src/eip712.ts b/packages/taco-auth/src/eip712.ts index e60f5b8d2..35e1117f0 100644 --- a/packages/taco-auth/src/eip712.ts +++ b/packages/taco-auth/src/eip712.ts @@ -101,7 +101,7 @@ export class EIP712SignatureProvider { ], }, domain: { - name: 'taco', + name: 'TACo', version: '1', chainId, salt, diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 29ff67531..8511592e0 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -38,7 +38,7 @@ describe('taco authorization', () => { const typedData = eip712Message.typedData as FormattedEip712; expect(typedData).toBeDefined(); expect(typedData.types.Wallet).toBeDefined(); - expect(typedData.domain.name).toEqual('taco'); + expect(typedData.domain.name).toEqual('TACo'); expect(typedData.domain.version).toEqual('1'); expect(typedData.domain.chainId).toEqual( (await provider.getNetwork()).chainId, @@ -75,14 +75,12 @@ describe('taco authorization', () => { const typedData = siweMessage.typedData as SiweMessage; expect(typedData).toBeDefined(); - expect(typedData.domain).toEqual('https://login.xyz'); + expect(typedData.domain).toEqual('TACo'); expect(typedData.version).toEqual('1'); - expect(typedData.nonce).toEqual('0'); - expect(typedData.uri).toEqual( - 'did:key:z6MkrBdNdwUPnXDVD1DCxedzVVBpaGi8aSmoXFAeKNgtAer8', - ); + expect(typedData.nonce).toBeDefined(); // random + expect(typedData.uri).toEqual('taco://'); expect(typedData.chainId).toEqual( - (await provider.getNetwork()).chainId.toString(), + (await provider.getNetwork()).chainId, ); expect(typedData.statement).toEqual( `${typedData.domain} wants you to sign in with your Ethereum account: ${await signer.getAddress()}`, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 302ee7e3e..6a9f3b618 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - '@nucypher/nucypher-core': ^0.14.5 + '@nucypher/nucypher-core': ^0.14.1 glob-parent@<5.1.2: '>=5.1.2' node-forge@<1.0.0: '>=1.0.0' node-forge@<1.3.0: '>=1.3.0' @@ -19,8 +19,8 @@ importers: specifier: ^2.26.2 version: 2.27.3 '@nucypher/nucypher-core': - specifier: ^0.14.5 - version: 0.14.5 + specifier: ^0.14.1 + version: 0.14.4 ethers: specifier: ^5.7.2 version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -114,7 +114,7 @@ importers: version: 0.1.24(arweave@1.15.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@nucypher/taco': specifier: ^0.2.4 - version: 0.2.7(bufferutil@4.0.8)(utf-8-validate@5.0.10) + version: 0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@usedapp/core': specifier: ^1.2.13 version: 1.2.15(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0) @@ -196,7 +196,7 @@ importers: dependencies: '@nucypher/taco': specifier: ^0.2.4 - version: 0.2.7(bufferutil@4.0.8)(utf-8-validate@5.0.10) + version: 0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@usedapp/core': specifier: ^1.2.13 version: 1.2.15(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(node-fetch@2.7.0)(react@18.2.0) @@ -473,8 +473,8 @@ importers: packages/pre: dependencies: '@nucypher/nucypher-core': - specifier: ^0.14.5 - version: 0.14.5 + specifier: ^0.14.1 + version: 0.14.4 '@nucypher/shared': specifier: workspace:* version: link:../shared @@ -498,8 +498,8 @@ importers: specifier: ^0.22.0 version: 0.22.0 '@nucypher/nucypher-core': - specifier: ^0.14.5 - version: 0.14.5 + specifier: ^0.14.1 + version: 0.14.4 axios: specifier: ^1.6.8 version: 1.7.2 @@ -538,8 +538,8 @@ importers: packages/taco: dependencies: '@nucypher/nucypher-core': - specifier: ^0.14.5 - version: 0.14.5 + specifier: ^0.14.1 + version: 0.14.4 '@nucypher/shared': specifier: workspace:* version: link:../shared @@ -565,15 +565,15 @@ importers: packages/taco-auth: dependencies: - '@didtools/cacao': - specifier: ^3.0.1 - version: 3.0.1(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8) '@ethersproject/abstract-signer': specifier: ^5.7.0 version: 5.7.0 '@nucypher/shared': specifier: workspace:* version: link:../shared + siwe: + specifier: ^2.3.2 + version: 2.3.2(ethers@5.7.2) devDependencies: '@nucypher/test-utils': specifier: workspace:* @@ -582,8 +582,8 @@ importers: packages/test-utils: dependencies: '@nucypher/nucypher-core': - specifier: ^0.14.5 - version: 0.14.5 + specifier: ^0.14.1 + version: 0.14.4 '@nucypher/shared': specifier: workspace:* version: link:../shared @@ -599,9 +599,6 @@ importers: packages: - '@adraffy/ens-normalize@1.10.0': - resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} - '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -794,7 +791,6 @@ packages: '@babel/plugin-proposal-class-properties@7.18.6': resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -807,28 +803,24 @@ packages: '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6': resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-numeric-separator@7.18.6': resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-optional-chaining@7.21.0': resolution: {integrity: sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-private-methods@7.18.6': resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -841,7 +833,6 @@ packages: '@babel/plugin-proposal-private-property-in-object@7.21.11': resolution: {integrity: sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -1520,18 +1511,6 @@ packages: peerDependencies: postcss-selector-parser: ^6.0.10 - '@didtools/cacao@3.0.1': - resolution: {integrity: sha512-vV1JirxqVsBf2dqdvoS/msNN8fabvMfseZB0kf1FG8TbosrHd81+hgDOlQMZit7zJbTk5g3CGkZg3b7iYKkynw==} - engines: {node: '>=14.14'} - - '@didtools/codecs@3.0.0': - resolution: {integrity: sha512-TemoVySZrs1XflMtOkwVTATtZEs42Mh2yk9SoYvBXES6Mz30PBJCm8v7U/2y1N5lrjb2cAPWs48Ryc7paetSxQ==} - engines: {node: '>=14.14'} - - '@didtools/siwx@2.0.0': - resolution: {integrity: sha512-eqBtI5dZrptXTCyadnhvU0di/KvumoByT7F8KB/8BLU7M1lltfEmvf/c5AnsyrWO9338ygCs2u5mKz1p1Zdj5A==} - engines: {node: '>=14.14'} - '@discoveryjs/json-ext@0.5.7': resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} engines: {node: '>=10.0.0'} @@ -1929,10 +1908,6 @@ packages: resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} engines: {node: '>=6.9.0'} - '@ipld/dag-cbor@9.2.0': - resolution: {integrity: sha512-N14oMy0q4gM6OuZkIpisKe0JBSjf1Jb39VI+7jMLiWX9124u1Z3Fdj/Tag1NA0cVxxqWDh0CqsjcVfOKtelPDA==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - '@irys/arweave@0.0.2': resolution: {integrity: sha512-ddE5h4qXbl0xfGlxrtBIwzflaxZUDlDs43TuT0u1OMfyobHul4AA1VEX72Rpzw2bOh4vzoytSqA1jCM7x9YtHg==} @@ -2173,19 +2148,12 @@ packages: '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} - '@noble/curves@1.2.0': - resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} - '@noble/curves@1.4.0': resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} '@noble/ed25519@1.7.3': resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==} - '@noble/hashes@1.3.2': - resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} - engines: {node: '>= 16'} - '@noble/hashes@1.4.0': resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} engines: {node: '>= 16'} @@ -2205,15 +2173,15 @@ packages: '@nucypher/nucypher-contracts@0.22.0': resolution: {integrity: sha512-poWxFBi2qL5KnPZYsqr4AWn/O26Z2Q6X9EoARjQZIZdcEqYvE6iMHHgiw/RKL036u1jh1/rzo44eZRCt6ErMpA==} - '@nucypher/nucypher-core@0.14.5': - resolution: {integrity: sha512-Q3kBuJL0qtTtnxrM5DEQauQUvDlXmwubm9u1h7gbyLhs+aZNC9WDyjEUbE43+uahlHu4k1hKEMxD1gjV165ChA==} + '@nucypher/nucypher-core@0.14.4': + resolution: {integrity: sha512-LIQbT0wKhoBwDx2E7SlxRg0P4HLaTr/S3TRIed1TqejYqqYvFckyKJmkovVSH9qE7fVuSYpZ1OiAqLFaAtx82A==} - '@nucypher/shared@0.2.3': - resolution: {integrity: sha512-byKAtM3isz3RIztc3tEETivS7fFnlLqu9wWiqJaK6EtyCs9BGhb5c4+2ASrJilpJ5E2zQGjxkBdpTa2yWuCZgQ==} + '@nucypher/shared@0.2.2': + resolution: {integrity: sha512-T8nIo1cn7WOFpmx67SZQTuxzOTNe1A6XgcfCa2vX+WiLWZagqHFhByoVqCAbKM2PX6F78qziZmxKNBLSszEjUw==} engines: {node: '>=18', pnpm: '>=8.0.0'} - '@nucypher/taco@0.2.7': - resolution: {integrity: sha512-6K+Vstq0rVO+waMiLhSK3deLD9tKqTZgoTgXRTofKqT4HEqNomnIIE0HpwrsVwBUWNTLaeQFT51srfG2ymy9QQ==} + '@nucypher/taco@0.2.6': + resolution: {integrity: sha512-BSEByDVSxUvlHWcoDxpM+ogNMzDdC38sHH5uYCCAnrs5TJokA4htwQH+CrrOCbaWuHp6thXYVUVX7UhulXscTw==} engines: {node: '>=18', pnpm: '>=8.0.0'} '@pkgjs/parseargs@0.11.0': @@ -2366,15 +2334,9 @@ packages: '@scure/base@1.1.6': resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} - '@scure/bip32@1.3.2': - resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==} - '@scure/bip32@1.4.0': resolution: {integrity: sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==} - '@scure/bip39@1.2.1': - resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} - '@scure/bip39@1.3.0': resolution: {integrity: sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==} @@ -2409,6 +2371,21 @@ packages: '@solana/web3.js@1.91.8': resolution: {integrity: sha512-USa6OS1jbh8zOapRJ/CBZImZ8Xb7AJjROZl5adql9TpOoBN9BUzyyouS5oPuZHft7S7eB8uJPuXWYjMi6BHgOw==} + '@spruceid/siwe-parser@2.1.2': + resolution: {integrity: sha512-d/r3S1LwJyMaRAKQ0awmo9whfXeE88Qt00vRj91q5uv5ATtWIQEGJ67Yr5eSZw5zp1/fZCXZYuEckt8lSkereQ==} + + '@stablelib/binary@1.0.1': + resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==} + + '@stablelib/int@1.0.1': + resolution: {integrity: sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==} + + '@stablelib/random@1.0.2': + resolution: {integrity: sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==} + + '@stablelib/wipe@1.0.1': + resolution: {integrity: sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==} + '@supercharge/promise-pool@3.2.0': resolution: {integrity: sha512-pj0cAALblTZBPtMltWOlZTQSLT07jIaFNeM8TWoJD1cQMgDB9mcMlVMoetiB35OzNJpqQ2b+QEtwiR9f20mADg==} engines: {node: '>=8'} @@ -2932,18 +2909,6 @@ packages: abab@2.0.6: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} - deprecated: Use your platform's native atob() and btoa() methods instead - - abitype@0.9.8: - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.19.1 - peerDependenciesMeta: - typescript: - optional: true - zod: - optional: true accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} @@ -3081,6 +3046,9 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + apg-js@4.4.0: + resolution: {integrity: sha512-fefmXFknJmtgtNEXfPwZKYkMFX4Fyeyz+fNF6JWp87biGOPslJbCBVU158zvKRZfHBKnJDy8CMM40oLFGkXT8Q==} + arbundles@0.10.1: resolution: {integrity: sha512-QYFepxessLCirvRkQK9iQmjxjHz+s50lMNGRwZwpyPWLohuf6ISyj1gkFXJHlMT+rNSrsHxb532glHnKbjwu3A==} @@ -3484,9 +3452,6 @@ packages: resolution: {integrity: sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==} engines: {node: '>=6'} - caip@1.1.1: - resolution: {integrity: sha512-a3v5lteUUOoyRI0U6qe5ayCCGkF2mCmJ5zQMDnOD2vRjgRg6sm9p8TsRC2h4D4beyqRN9RYniphAPnj/+jQC6g==} - call-bind@1.0.7: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} @@ -3524,10 +3489,6 @@ packages: resolution: {integrity: sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==} engines: {node: '>=4'} - cborg@4.2.0: - resolution: {integrity: sha512-q6cFW5m3KxfP/9xGI3yGLaC1l5DP6DWM9IvjiJojnIwohL5CQDl02EXViPV852mOfQo+7PJGPN01MI87vFGzyA==} - hasBin: true - chai@4.4.1: resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} engines: {node: '>=4'} @@ -3627,9 +3588,6 @@ packages: resolution: {integrity: sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==} engines: {node: '>= 4.0'} - codeco@1.2.3: - resolution: {integrity: sha512-nbj0SrL3Cr5nWRwStBDYkA/lEJ9xm9TOjKk7Fo4rEspEC/fb9k3N9MvoK/ygTInBh5dqjsFGC9Bd6AE3GnAyxg==} - collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} @@ -4268,7 +4226,6 @@ packages: domexception@2.0.1: resolution: {integrity: sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==} engines: {node: '>=8'} - deprecated: Use your platform's native DOMException instead domhandler@4.3.1: resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} @@ -5060,11 +5017,9 @@ packages: glob@7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} - deprecated: Glob versions prior to v9 are no longer supported glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported global-directory@4.0.1: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} @@ -5361,7 +5316,6 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.3: resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} @@ -5625,11 +5579,6 @@ packages: peerDependencies: ws: '*' - isows@1.0.3: - resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} - peerDependencies: - ws: '*' - istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} @@ -6325,9 +6274,6 @@ packages: resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} hasBin: true - multiformats@13.1.0: - resolution: {integrity: sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==} - multistream@4.1.0: resolution: {integrity: sha512-J1XDiAmmNpRCBfIWJv+n0ymC4ABcf/Pl+5YvC5B/D2f/2+8PtHvCNxMPKiQcZyi922Hq69J2YOpb1pTywfifyw==} @@ -7300,7 +7246,6 @@ packages: querystring@0.2.1: resolution: {integrity: sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==} engines: {node: '>=0.4.x'} - deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} @@ -7568,7 +7513,6 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rimraf@5.0.7: @@ -7581,7 +7525,6 @@ packages: rollup-plugin-terser@7.0.2: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} - deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser peerDependencies: rollup: ^2.0.0 @@ -7782,6 +7725,11 @@ packages: sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + siwe@2.3.2: + resolution: {integrity: sha512-aSf+6+Latyttbj5nMu6GF3doMfv2UYj83hhwZgUF20ky6fTS83uVhkQABdIVnEuS8y1bBdk7p6ltb9SmlhTTlA==} + peerDependencies: + ethers: ^5.6.8 || ^6.0.8 + slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -7839,7 +7787,6 @@ packages: sourcemap-codec@1.4.8: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} @@ -7874,7 +7821,6 @@ packages: stable@0.1.8: resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} - deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} @@ -7972,7 +7918,6 @@ packages: stringify-package@1.0.1: resolution: {integrity: sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==} - deprecated: This module is not used anymore, and has been replaced by @npmcli/package-json strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} @@ -8076,7 +8021,6 @@ packages: svgo@1.3.2: resolution: {integrity: sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==} engines: {node: '>=4.0.0'} - deprecated: This SVGO version is no longer supported. Upgrade to v2.x.x. hasBin: true svgo@2.8.0: @@ -8427,9 +8371,6 @@ packages: engines: {node: '>=0.8.0'} hasBin: true - uint8arrays@5.1.0: - resolution: {integrity: sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==} - unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -8526,6 +8467,9 @@ packages: resolution: {integrity: sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==} engines: {node: '>=10.12.0'} + valid-url@1.0.9: + resolution: {integrity: sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==} + validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} @@ -8533,14 +8477,6 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - viem@1.21.4: - resolution: {integrity: sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==} - peerDependencies: - typescript: '>=5.0.4' - peerDependenciesMeta: - typescript: - optional: true - vite-node@1.6.0: resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} engines: {node: ^18.0.0 || >=20.0.0} @@ -8613,7 +8549,6 @@ packages: w3c-hr-time@1.0.2: resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} - deprecated: Use your platform's native performance.now() and performance.timeOrigin. w3c-xmlserializer@2.0.0: resolution: {integrity: sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==} @@ -8805,7 +8740,6 @@ packages: workbox-cacheable-response@6.6.0: resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} - deprecated: workbox-background-sync@6.6.0 workbox-core@6.6.0: resolution: {integrity: sha512-GDtFRF7Yg3DD859PMbPAYPeJyg5gJYXuBQAC+wyrWuuXgpfoOrIQIvFRZnQ7+czTIQjIr1DhLEGFzZanAT/3bQ==} @@ -8815,7 +8749,6 @@ packages: workbox-google-analytics@6.6.0: resolution: {integrity: sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==} - deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained workbox-navigation-preload@6.6.0: resolution: {integrity: sha512-utNEWG+uOfXdaZmvhshrh7KzhDu/1iMHyQOV6Aqup8Mm78D286ugu5k9MFD9SzBT5TcwgwSORVvInaXWbvKz9Q==} @@ -8892,18 +8825,6 @@ packages: utf-8-validate: optional: true - ws@8.13.0: - resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@8.17.0: resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==} engines: {node: '>=10.0.0'} @@ -8996,8 +8917,6 @@ packages: snapshots: - '@adraffy/ens-normalize@1.10.0': {} - '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.3.0': @@ -10170,31 +10089,6 @@ snapshots: dependencies: postcss-selector-parser: 6.1.0 - '@didtools/cacao@3.0.1(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8)': - dependencies: - '@didtools/codecs': 3.0.0 - '@didtools/siwx': 2.0.0 - '@ipld/dag-cbor': 9.2.0 - caip: 1.1.1 - multiformats: 13.1.0 - uint8arrays: 5.1.0 - viem: 1.21.4(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8) - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - - zod - - '@didtools/codecs@3.0.0': - dependencies: - codeco: 1.2.3 - multiformats: 13.1.0 - uint8arrays: 5.1.0 - - '@didtools/siwx@2.0.0': - dependencies: - codeco: 1.2.3 - '@discoveryjs/json-ext@0.5.7': {} '@esbuild/aix-ppc64@0.20.2': @@ -10624,11 +10518,6 @@ snapshots: '@hutson/parse-repository-url@3.0.2': {} - '@ipld/dag-cbor@9.2.0': - dependencies: - cborg: 4.2.0 - multiformats: 13.1.0 - '@irys/arweave@0.0.2': dependencies: asn1.js: 5.4.1 @@ -11061,18 +10950,12 @@ snapshots: dependencies: eslint-scope: 5.1.1 - '@noble/curves@1.2.0': - dependencies: - '@noble/hashes': 1.3.2 - '@noble/curves@1.4.0': dependencies: '@noble/hashes': 1.4.0 '@noble/ed25519@1.7.3': {} - '@noble/hashes@1.3.2': {} - '@noble/hashes@1.4.0': {} '@nodelib/fs.scandir@2.1.5': @@ -11089,14 +10972,14 @@ snapshots: '@nucypher/nucypher-contracts@0.22.0': {} - '@nucypher/nucypher-core@0.14.5': {} + '@nucypher/nucypher-core@0.14.4': {} - '@nucypher/shared@0.2.3(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + '@nucypher/shared@0.2.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/providers': 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@nucypher/nucypher-contracts': 0.22.0 - '@nucypher/nucypher-core': 0.14.5 + '@nucypher/nucypher-core': 0.14.4 axios: 1.7.2 deep-equal: 2.2.3 ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -11106,11 +10989,11 @@ snapshots: - debug - utf-8-validate - '@nucypher/taco@0.2.7(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + '@nucypher/taco@0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abstract-signer': 5.7.0 - '@nucypher/nucypher-core': 0.14.5 - '@nucypher/shared': 0.2.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@nucypher/nucypher-core': 0.14.4 + '@nucypher/shared': 0.2.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) semver: 7.6.2 zod: 3.23.8 @@ -11244,23 +11127,12 @@ snapshots: '@scure/base@1.1.6': {} - '@scure/bip32@1.3.2': - dependencies: - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@scure/base': 1.1.6 - '@scure/bip32@1.4.0': dependencies: '@noble/curves': 1.4.0 '@noble/hashes': 1.4.0 '@scure/base': 1.1.6 - '@scure/bip39@1.2.1': - dependencies: - '@noble/hashes': 1.3.2 - '@scure/base': 1.1.6 - '@scure/bip39@1.3.0': dependencies: '@noble/hashes': 1.4.0 @@ -11313,6 +11185,26 @@ snapshots: - encoding - utf-8-validate + '@spruceid/siwe-parser@2.1.2': + dependencies: + '@noble/hashes': 1.4.0 + apg-js: 4.4.0 + uri-js: 4.4.1 + valid-url: 1.0.9 + + '@stablelib/binary@1.0.1': + dependencies: + '@stablelib/int': 1.0.1 + + '@stablelib/int@1.0.1': {} + + '@stablelib/random@1.0.2': + dependencies: + '@stablelib/binary': 1.0.1 + '@stablelib/wipe': 1.0.1 + + '@stablelib/wipe@1.0.1': {} + '@supercharge/promise-pool@3.2.0': {} '@surma/rollup-plugin-off-main-thread@2.2.3': @@ -11983,11 +11875,6 @@ snapshots: abab@2.0.6: {} - abitype@0.9.8(typescript@5.2.2)(zod@3.23.8): - optionalDependencies: - typescript: 5.2.2 - zod: 3.23.8 - accepts@1.3.8: dependencies: mime-types: 2.1.35 @@ -12112,6 +11999,8 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 + apg-js@4.4.0: {} + arbundles@0.10.1(arweave@1.15.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: '@ethersproject/bytes': 5.7.0 @@ -12707,8 +12596,6 @@ snapshots: cachedir@2.3.0: {} - caip@1.1.1: {} - call-bind@1.0.7: dependencies: es-define-property: 1.0.0 @@ -12747,8 +12634,6 @@ snapshots: case-sensitive-paths-webpack-plugin@2.4.0: {} - cborg@4.2.0: {} - chai@4.4.1: dependencies: assertion-error: 1.1.0 @@ -12860,8 +12745,6 @@ snapshots: chalk: 2.4.2 q: 1.5.1 - codeco@1.2.3: {} - collect-v8-coverage@1.0.2: {} color-convert@1.9.3: @@ -15339,10 +15222,6 @@ snapshots: dependencies: ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) - isows@1.0.3(ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)): - dependencies: - ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - istanbul-lib-coverage@3.2.2: {} istanbul-lib-instrument@5.2.1: @@ -16301,8 +16180,6 @@ snapshots: dns-packet: 5.6.1 thunky: 1.1.0 - multiformats@13.1.0: {} - multistream@4.1.0: dependencies: once: 1.4.0 @@ -17913,6 +17790,14 @@ snapshots: sisteransi@1.0.5: {} + siwe@2.3.2(ethers@5.7.2): + dependencies: + '@spruceid/siwe-parser': 2.1.2 + '@stablelib/random': 1.0.2 + ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + uri-js: 4.4.1 + valid-url: 1.0.9 + slash@3.0.0: {} slash@4.0.0: {} @@ -18622,10 +18507,6 @@ snapshots: uglify-js@3.17.4: optional: true - uint8arrays@5.1.0: - dependencies: - multiformats: 13.1.0 - unbox-primitive@1.0.2: dependencies: call-bind: 1.0.7 @@ -18709,6 +18590,8 @@ snapshots: convert-source-map: 1.9.0 source-map: 0.7.4 + valid-url@1.0.9: {} + validate-npm-package-license@3.0.4: dependencies: spdx-correct: 3.2.0 @@ -18716,23 +18599,6 @@ snapshots: vary@1.1.2: {} - viem@1.21.4(bufferutil@4.0.8)(typescript@5.2.2)(utf-8-validate@5.0.10)(zod@3.23.8): - dependencies: - '@adraffy/ens-normalize': 1.10.0 - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@scure/bip32': 1.3.2 - '@scure/bip39': 1.2.1 - abitype: 0.9.8(typescript@5.2.2)(zod@3.23.8) - isows: 1.0.3(ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) - ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - optionalDependencies: - typescript: 5.2.2 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - zod - vite-node@1.6.0(@types/node@20.11.30)(terser@5.31.0): dependencies: cac: 6.7.14 @@ -19311,11 +19177,6 @@ snapshots: bufferutil: 4.0.8 utf-8-validate: 5.0.10 - ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): - optionalDependencies: - bufferutil: 4.0.8 - utf-8-validate: 5.0.10 - ws@8.17.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8 From 0161445b7362fd5b9fa3c89eb0fa6cd22cb2d934 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 30 May 2024 11:44:33 -0400 Subject: [PATCH 16/75] Change scheme from "SIWE" to "EIP4361". --- packages/taco-auth/src/eip4361.ts | 2 +- packages/taco-auth/src/types.ts | 4 ++-- packages/taco-auth/test/taco-auth.test.ts | 12 +++--------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 8e2d3000f..89f952d4b 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -47,7 +47,7 @@ export class EIP4361SignatureProvider { chainId, }); - const scheme = 'SIWE'; + const scheme = 'EIP4361'; const signature = await this.signer.signMessage(siweMessage.toMessage()); return { signature, address, scheme, typedData: siweMessage }; diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/types.ts index 376add2d0..18619eeda 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/types.ts @@ -1,10 +1,10 @@ -import type { SiweMessage } from '@didtools/cacao'; +import type { SiweMessage } from 'siwe'; import { FormattedEip712 } from './eip712'; export interface TypedSignature { signature: string; address: string; - scheme: 'EIP712' | 'SIWE'; + scheme: 'EIP712' | 'EIP4361'; typedData: FormattedEip712 | SiweMessage; } diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 8511592e0..6bd829121 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -21,15 +21,12 @@ describe('taco authorization', () => { const eip712Message = await eip712Provider.getOrCreateWalletSignature(); // Expected format: - // { - // ":userAddress": // { // "signature": "", // "address": "
", - // "scheme": "EIP712" | "SIWE" | ... + // "scheme": "EIP712" | "EIP4361" | ... // "typeData": ... // } - // } expect(eip712Message.signature).toBeDefined(); expect(eip712Message.address).toEqual(await signer.getAddress()); @@ -59,19 +56,16 @@ describe('taco authorization', () => { const siweMessage = await eip4361Provider.getOrCreateSiweMessage(); // Expected format: - // { - // ":userAddress": // { // "signature": "", // "address": "
", - // "scheme": "EIP712" | "SIWE" | ... + // "scheme": "EIP712" | "EIP4361" | ... // "typeData": ... // } - // } expect(siweMessage.signature).toBeDefined(); expect(siweMessage.address).toEqual(await signer.getAddress()); - expect(siweMessage.scheme).toEqual('SIWE'); + expect(siweMessage.scheme).toEqual('EIP4361'); const typedData = siweMessage.typedData as SiweMessage; expect(typedData).toBeDefined(); From b178040054eae9169d65470374010cb23cbe69bc Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 30 May 2024 12:54:02 -0400 Subject: [PATCH 17/75] Fix bug when determining whether condition requires signer or not; caused tests to fail. Co-authored-by: Manuel Montenegro --- packages/taco/src/conditions/condition.ts | 8 ++++---- packages/taco/src/conditions/const.ts | 3 ++- packages/taco/src/conditions/context/context.ts | 7 ++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/taco/src/conditions/condition.ts b/packages/taco/src/conditions/condition.ts index c447ffa14..c8d9ac6d0 100644 --- a/packages/taco/src/conditions/condition.ts +++ b/packages/taco/src/conditions/condition.ts @@ -38,16 +38,16 @@ export class Condition { // TODO: Fix this method and add a test for it public findParamWithSigner(): string | null { const serialized = JSON.stringify(this.value); - USER_ADDRESS_PARAMS.forEach(param => { + for (const param of USER_ADDRESS_PARAMS) { if (serialized.includes(param)) { return param; } - }) - return null; + } + return null } public requiresSigner(): boolean { - return Boolean(this.findParamWithSigner) + return Boolean(this.findParamWithSigner()) } public toObj() { diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 16b648b29..44b3dbdb9 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -19,9 +19,10 @@ export const SUPPORTED_CHAIN_IDS = [ ]; export const USER_ADDRESS_PARAMS = [ - USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361, + // this should always be last + USER_ADDRESS_PARAM_DEFAULT, ]; export const RESERVED_CONTEXT_PARAMS = [ diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index f46ada960..75d5cd693 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -15,7 +15,6 @@ import { USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_EIP712, } from '../const'; -import { version } from 'os'; export type CustomContextParam = string | number | boolean; export type ContextParam = CustomContextParam | TypedSignature; @@ -68,11 +67,9 @@ export class ConditionContext { // Currently doesn't find anything (returns "null") // But when it does return something, use it on the line 72 const requiredParam = this.condition.findParamWithSigner(); - console.log({requiredParam}); - // if (requiredParam && !this.signer) { - if (this.condition.requiresSigner() && !this.signer) { + if (requiredParam && !this.signer) { // throw new Error(requiredParam); - throw new Error("placeholder"); + throw new Error(ERR_SIGNER_REQUIRED(requiredParam)); } } From a200135de0bddc2b07f78bbc22b206abdeae33b0 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 30 May 2024 12:58:13 -0400 Subject: [PATCH 18/75] Run linter. --- packages/taco-auth/src/index.ts | 2 +- packages/taco-auth/src/types.ts | 10 ++-- packages/taco-auth/test/taco-auth.test.ts | 6 +-- packages/taco/src/conditions/condition.ts | 6 +-- .../taco/src/conditions/context/context.ts | 10 ++-- packages/taco/test/conditions/context.test.ts | 46 ++++++++++++++----- 6 files changed, 52 insertions(+), 28 deletions(-) diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts index ece38575d..0372f3939 100644 --- a/packages/taco-auth/src/index.ts +++ b/packages/taco-auth/src/index.ts @@ -1,3 +1,3 @@ -export * from './eip712'; export * from './eip4361'; +export * from './eip712'; export * from './types'; diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/types.ts index 18619eeda..a28224577 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/types.ts @@ -3,8 +3,8 @@ import type { SiweMessage } from 'siwe'; import { FormattedEip712 } from './eip712'; export interface TypedSignature { - signature: string; - address: string; - scheme: 'EIP712' | 'EIP4361'; - typedData: FormattedEip712 | SiweMessage; - } + signature: string; + address: string; + scheme: 'EIP712' | 'EIP4361'; + typedData: FormattedEip712 | SiweMessage; +} diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 6bd829121..2437d8271 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -71,11 +71,9 @@ describe('taco authorization', () => { expect(typedData).toBeDefined(); expect(typedData.domain).toEqual('TACo'); expect(typedData.version).toEqual('1'); - expect(typedData.nonce).toBeDefined(); // random + expect(typedData.nonce).toBeDefined(); // random expect(typedData.uri).toEqual('taco://'); - expect(typedData.chainId).toEqual( - (await provider.getNetwork()).chainId, - ); + expect(typedData.chainId).toEqual((await provider.getNetwork()).chainId); expect(typedData.statement).toEqual( `${typedData.domain} wants you to sign in with your Ethereum account: ${await signer.getAddress()}`, ); diff --git a/packages/taco/src/conditions/condition.ts b/packages/taco/src/conditions/condition.ts index c8d9ac6d0..607bd0681 100644 --- a/packages/taco/src/conditions/condition.ts +++ b/packages/taco/src/conditions/condition.ts @@ -1,7 +1,7 @@ import { objectEquals } from '@nucypher/shared'; import { z } from 'zod'; -import { USER_ADDRESS_PARAMS, USER_ADDRESS_PARAM_DEFAULT } from './const'; +import { USER_ADDRESS_PARAMS } from './const'; type ConditionSchema = z.ZodSchema; export type ConditionProps = z.infer; @@ -43,11 +43,11 @@ export class Condition { return param; } } - return null + return null; } public requiresSigner(): boolean { - return Boolean(this.findParamWithSigner()) + return Boolean(this.findParamWithSigner()); } public toObj() { diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 75d5cd693..95fc2d5b5 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,6 +1,10 @@ import { Context, Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { fromJSON, toJSON } from '@nucypher/shared'; -import { EIP712SignatureProvider, EIP4361SignatureProvider, TypedSignature } from '@nucypher/taco-auth'; +import { + EIP4361SignatureProvider, + EIP712SignatureProvider, + TypedSignature, +} from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { CompoundConditionType } from '../compound-condition'; @@ -10,7 +14,6 @@ import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS, - USER_ADDRESS_PARAMS, USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_EIP712, @@ -23,7 +26,8 @@ const ERR_RESERVED_PARAM = (key: string) => `Cannot use reserved parameter name ${key} as custom parameter`; const ERR_INVALID_CUSTOM_PARAM = (key: string) => `Custom parameter ${key} must start with ${CONTEXT_PARAM_PREFIX}`; -const ERR_SIGNER_REQUIRED = (key: string) => `Signer required to satisfy ${key} context variable in condition`; +const ERR_SIGNER_REQUIRED = (key: string) => + `Signer required to satisfy ${key} context variable in condition`; const ERR_MISSING_CONTEXT_PARAMS = (params: string[]) => `Missing custom context parameter(s): ${params.join(', ')}`; const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 3a488e98c..564e2e059 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -1,9 +1,12 @@ import { initialize } from '@nucypher/nucypher-core'; +import { + EIP4361SignatureProvider, + EIP712SignatureProvider, +} from '@nucypher/taco-auth'; import { fakeProvider, fakeSigner } from '@nucypher/test-utils'; import { ethers } from 'ethers'; import { beforeAll, describe, expect, it, vi } from 'vitest'; -import { EIP4361SignatureProvider, EIP712SignatureProvider } from '@nucypher/taco-auth'; import { toBytes, toHexString } from '../../src'; import { ContractCondition, @@ -19,8 +22,8 @@ import { } from '../../src/conditions/const'; import { CustomContextParam } from '../../src/conditions/context'; import { - ReturnValueTestProps, paramOrContextParamSchema, + ReturnValueTestProps, } from '../../src/conditions/shared'; import { testContractConditionObj, @@ -299,7 +302,7 @@ describe('authentication provider', () => { expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( `Signer required to satisfy ${userAddressParam} context variable in condition`, ); - }) + }); }); it('it supports just one provider at a time', () => { @@ -313,7 +316,9 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, signer)).not.toThrow(); + expect(() => + conditionExpr.buildContext(provider, {}, signer), + ).not.toThrow(); }); it('supports multiple providers when needed', () => { @@ -328,13 +333,18 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, signer)).not.toThrow(); + expect(() => + conditionExpr.buildContext(provider, {}, signer), + ).not.toThrow(); }); // TODO: Consider rewriting those tests to be a bit more comprehensive and deduplicate them it('supports default auth method (eip712)', () => { - const eip712Spy = vi.spyOn(EIP712SignatureProvider.prototype, "getOrCreateWalletSignature"); + const eip712Spy = vi.spyOn( + EIP712SignatureProvider.prototype, + 'getOrCreateWalletSignature', + ); const conditionObj = { ...testContractConditionObj, returnValueTest: { @@ -345,12 +355,17 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, signer).toObj()).not.toThrow(); + expect(() => + conditionExpr.buildContext(provider, {}, signer).toObj(), + ).not.toThrow(); expect(eip712Spy).toHaveBeenCalledOnce(); }); it('supports eip712', () => { - const eip712Spy = vi.spyOn(EIP712SignatureProvider.prototype, "getOrCreateWalletSignature"); + const eip712Spy = vi.spyOn( + EIP712SignatureProvider.prototype, + 'getOrCreateWalletSignature', + ); const conditionObj = { ...testContractConditionObj, returnValueTest: { @@ -361,12 +376,17 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, signer).toObj()).not.toThrow(); + expect(() => + conditionExpr.buildContext(provider, {}, signer).toObj(), + ).not.toThrow(); expect(eip712Spy).toHaveBeenCalledOnce(); }); it('supports eip4361', () => { - const eip4361Spy = vi.spyOn(EIP4361SignatureProvider.prototype, "getOrCreateSiweMessage"); + const eip4361Spy = vi.spyOn( + EIP4361SignatureProvider.prototype, + 'getOrCreateSiweMessage', + ); const conditionObj = { ...testContractConditionObj, returnValueTest: { @@ -377,10 +397,12 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, signer).toObj()).not.toThrow(); + expect(() => + conditionExpr.buildContext(provider, {}, signer).toObj(), + ).not.toThrow(); expect(eip4361Spy).toHaveBeenCalledOnce(); }); -}) +}); describe('param or context param schema', () => { it('accepts a plain string', () => { From 172d9f2c9fa66b5afad1fa8e618e6d4daf5243ed Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 30 May 2024 15:04:45 -0400 Subject: [PATCH 19/75] Update userAddressSchema to accomodate additional userAddress auth-specific values. --- packages/taco/src/conditions/shared.ts | 5 ++++- .../test/conditions/base/contract.test.ts | 20 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 9016a63f0..517b1f795 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -4,6 +4,8 @@ import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, ETH_ADDRESS_REGEXP, + USER_ADDRESS_PARAM_EIP712, + USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_DEFAULT, } from './const'; @@ -36,7 +38,8 @@ export const returnValueTestSchema = z.object({ export type ReturnValueTestProps = z.infer; const EthAddressSchema = z.string().regex(ETH_ADDRESS_REGEXP); -const UserAddressSchema = z.literal(USER_ADDRESS_PARAM_DEFAULT); + +const UserAddressSchema = z.enum([USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_DEFAULT]); export const EthAddressOrUserAddressSchema = z.union([ EthAddressSchema, UserAddressSchema, diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index 8a1024f3a..c55d80fbd 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -10,7 +10,7 @@ import { FunctionAbiProps, } from '../../../src/conditions/base/contract'; import { ConditionExpression } from '../../../src/conditions/condition-expr'; -import { USER_ADDRESS_PARAM_DEFAULT } from '../../../src/conditions/const'; +import { USER_ADDRESS_PARAMS, USER_ADDRESS_PARAM_DEFAULT } from '../../../src/conditions/const'; import { CustomContextParam } from '../../../src/conditions/context'; import { testContractConditionObj, testFunctionAbi } from '../../test-utils'; @@ -150,6 +150,24 @@ describe('accepts either standardContractType or functionAbi but not both or non }); }); +describe('supports various user address params', () => { + it.each( + USER_ADDRESS_PARAMS + )("handles different user address context params", (userAddressContextParam) => { + const contractConditionObj: ContractConditionProps = { + ...testContractConditionObj, + parameters: [userAddressContextParam], + } + + const result = ContractCondition.validate( + contractConditionSchema, + contractConditionObj, + ); + + expect(result.error).toBeUndefined(); + }); +}); + describe('supports custom function abi', () => { const contractConditionObj: ContractConditionProps = { ...testContractConditionObj, From 8a1e7edd63aa538b40a7d23347463530d8487b90 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 30 May 2024 22:20:17 -0400 Subject: [PATCH 20/75] typedData entry for EIP4361 should be a string. Fix the URI used for EIP4361 message to be properly formed - it caused an invalid SIWE message to be created. --- packages/taco-auth/src/eip4361.ts | 7 ++++--- packages/taco-auth/src/types.ts | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 89f952d4b..360914b9c 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -35,7 +35,7 @@ export class EIP4361SignatureProvider { const domain = 'TACo'; const version = '1'; const nonce = generateNonce(); - const uri = 'taco://'; + const uri = 'https://TACo'; const chainId = (await this.provider.getNetwork()).chainId; const siweMessage = new SiweMessage({ domain, @@ -48,8 +48,9 @@ export class EIP4361SignatureProvider { }); const scheme = 'EIP4361'; - const signature = await this.signer.signMessage(siweMessage.toMessage()); + const message = siweMessage.prepareMessage(); + const signature = await this.signer.signMessage(message); - return { signature, address, scheme, typedData: siweMessage }; + return { signature, address, scheme, typedData: message }; } } diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/types.ts index a28224577..28ed40dea 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/types.ts @@ -1,10 +1,8 @@ -import type { SiweMessage } from 'siwe'; - import { FormattedEip712 } from './eip712'; export interface TypedSignature { signature: string; address: string; scheme: 'EIP712' | 'EIP4361'; - typedData: FormattedEip712 | SiweMessage; + typedData: FormattedEip712 | string; } From 5b780826aabb162e61d3269ba8bb3901a1ca8261 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 30 May 2024 22:21:39 -0400 Subject: [PATCH 21/75] Fix fake provider chain id to be a positive number. Negative numbers are invalid for SIWE. --- packages/test-utils/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts index cb4026915..31181f7c2 100644 --- a/packages/test-utils/src/utils.ts +++ b/packages/test-utils/src/utils.ts @@ -58,7 +58,7 @@ const makeFakeProvider = (timestamp: number, blockNumber: number) => { getBlockNumber: () => Promise.resolve(blockNumber), getBlock: () => Promise.resolve(block), _isProvider: true, - getNetwork: () => Promise.resolve({ name: 'mockNetwork', chainId: -1 }), + getNetwork: () => Promise.resolve({ name: 'mockNetwork', chainId: 1234 }), }; }; From 6af0e23c9679774a009c0120ef21c9d72f5f0a64 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 30 May 2024 22:22:33 -0400 Subject: [PATCH 22/75] Fix/improve tests for taco-auth/context. Run linter. --- packages/taco-auth/test/taco-auth.test.ts | 33 +++++----- .../taco/src/conditions/context/context.ts | 4 -- packages/taco/src/conditions/shared.ts | 10 ++- .../test/conditions/base/contract.test.ts | 32 +++++----- packages/taco/test/conditions/context.test.ts | 61 +++++++++++++++---- 5 files changed, 92 insertions(+), 48 deletions(-) diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 2437d8271..0ef6e7b0e 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -1,9 +1,9 @@ -import { SiweMessage } from '@didtools/cacao'; import { bobSecretKeyBytes, fakeProvider, fakeSigner, } from '@nucypher/test-utils'; +import { SiweMessage } from 'siwe'; import { describe, expect, it } from 'vitest'; import { @@ -53,29 +53,32 @@ describe('taco authorization', () => { const signer = fakeSigner(bobSecretKeyBytes); const eip4361Provider = new EIP4361SignatureProvider(provider, signer); - const siweMessage = await eip4361Provider.getOrCreateSiweMessage(); + const typedSignature = await eip4361Provider.getOrCreateSiweMessage(); // Expected format: // { // "signature": "", // "address": "
", // "scheme": "EIP712" | "EIP4361" | ... - // "typeData": ... + // "typedData": ... // } - expect(siweMessage.signature).toBeDefined(); - expect(siweMessage.address).toEqual(await signer.getAddress()); - expect(siweMessage.scheme).toEqual('EIP4361'); + expect(typedSignature.signature).toBeDefined(); + expect(typedSignature.address).toEqual(await signer.getAddress()); + expect(typedSignature.scheme).toEqual('EIP4361'); - const typedData = siweMessage.typedData as SiweMessage; - expect(typedData).toBeDefined(); - expect(typedData.domain).toEqual('TACo'); - expect(typedData.version).toEqual('1'); - expect(typedData.nonce).toBeDefined(); // random - expect(typedData.uri).toEqual('taco://'); - expect(typedData.chainId).toEqual((await provider.getNetwork()).chainId); - expect(typedData.statement).toEqual( - `${typedData.domain} wants you to sign in with your Ethereum account: ${await signer.getAddress()}`, + console.log(typedSignature.typedData); + const typedDataSiweMessage = new SiweMessage(`${typedSignature.typedData}`); + expect(typedDataSiweMessage).toBeDefined(); + expect(typedDataSiweMessage.domain).toEqual('TACo'); + expect(typedDataSiweMessage.version).toEqual('1'); + expect(typedDataSiweMessage.nonce).toBeDefined(); // random + expect(typedDataSiweMessage.uri).toEqual('https://TACo'); + expect(typedDataSiweMessage.chainId).toEqual( + (await provider.getNetwork()).chainId, + ); + expect(typedDataSiweMessage.statement).toEqual( + `${typedDataSiweMessage.domain} wants you to sign in with your Ethereum account: ${await signer.getAddress()}`, ); }); }); diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 95fc2d5b5..bb44415e5 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -67,12 +67,8 @@ export class ConditionContext { } }); - // TODO: Use this `requiredParam` to throw an error - // Currently doesn't find anything (returns "null") - // But when it does return something, use it on the line 72 const requiredParam = this.condition.findParamWithSigner(); if (requiredParam && !this.signer) { - // throw new Error(requiredParam); throw new Error(ERR_SIGNER_REQUIRED(requiredParam)); } } diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 517b1f795..98c61f0b4 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -4,9 +4,9 @@ import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, ETH_ADDRESS_REGEXP, - USER_ADDRESS_PARAM_EIP712, - USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EIP4361, + USER_ADDRESS_PARAM_EIP712, } from './const'; export const contextParamSchema = z.string().regex(CONTEXT_PARAM_REGEXP); @@ -39,7 +39,11 @@ export type ReturnValueTestProps = z.infer; const EthAddressSchema = z.string().regex(ETH_ADDRESS_REGEXP); -const UserAddressSchema = z.enum([USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_DEFAULT]); +const UserAddressSchema = z.enum([ + USER_ADDRESS_PARAM_EIP712, + USER_ADDRESS_PARAM_EIP4361, + USER_ADDRESS_PARAM_DEFAULT, +]); export const EthAddressOrUserAddressSchema = z.union([ EthAddressSchema, UserAddressSchema, diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index c55d80fbd..00e66c39e 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -10,7 +10,10 @@ import { FunctionAbiProps, } from '../../../src/conditions/base/contract'; import { ConditionExpression } from '../../../src/conditions/condition-expr'; -import { USER_ADDRESS_PARAMS, USER_ADDRESS_PARAM_DEFAULT } from '../../../src/conditions/const'; +import { + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAMS, +} from '../../../src/conditions/const'; import { CustomContextParam } from '../../../src/conditions/context'; import { testContractConditionObj, testFunctionAbi } from '../../test-utils'; @@ -151,21 +154,22 @@ describe('accepts either standardContractType or functionAbi but not both or non }); describe('supports various user address params', () => { - it.each( - USER_ADDRESS_PARAMS - )("handles different user address context params", (userAddressContextParam) => { - const contractConditionObj: ContractConditionProps = { - ...testContractConditionObj, - parameters: [userAddressContextParam], - } + it.each(USER_ADDRESS_PARAMS)( + 'handles different user address context params', + (userAddressContextParam) => { + const contractConditionObj: ContractConditionProps = { + ...testContractConditionObj, + parameters: [userAddressContextParam], + }; - const result = ContractCondition.validate( - contractConditionSchema, - contractConditionObj, - ); + const result = ContractCondition.validate( + contractConditionSchema, + contractConditionObj, + ); - expect(result.error).toBeUndefined(); - }); + expect(result.error).toBeUndefined(); + }, + ); }); describe('supports custom function abi', () => { diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 564e2e059..7221dfbe1 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -340,7 +340,7 @@ describe('authentication provider', () => { // TODO: Consider rewriting those tests to be a bit more comprehensive and deduplicate them - it('supports default auth method (eip712)', () => { + it('supports default auth method (eip712)', async () => { const eip712Spy = vi.spyOn( EIP712SignatureProvider.prototype, 'getOrCreateWalletSignature', @@ -355,13 +355,23 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => - conditionExpr.buildContext(provider, {}, signer).toObj(), - ).not.toThrow(); + const builtContext = conditionExpr.buildContext(provider, {}, signer); + + const resolvedContextRecords = await builtContext.toObj(); + + const typeSignature = resolvedContextRecords[USER_ADDRESS_PARAM_DEFAULT]; + expect(typeSignature).toBeDefined(); + expect(typeSignature.signature).toBeDefined(); + expect(typeSignature.scheme).toEqual('EIP712'); + expect(typeSignature.address).toEqual(await signer.getAddress()); + expect(typeSignature.typedData.domain.name).toEqual('TACo'); + expect(typeSignature.typedData.message.address).toEqual( + await signer.getAddress(), + ); expect(eip712Spy).toHaveBeenCalledOnce(); }); - it('supports eip712', () => { + it('supports eip712', async () => { const eip712Spy = vi.spyOn( EIP712SignatureProvider.prototype, 'getOrCreateWalletSignature', @@ -376,13 +386,23 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => - conditionExpr.buildContext(provider, {}, signer).toObj(), - ).not.toThrow(); + + const builtContext = conditionExpr.buildContext(provider, {}, signer); + const resolvedContextRecords = await builtContext.toObj(); + + const typeSignature = resolvedContextRecords[USER_ADDRESS_PARAM_EIP712]; + expect(typeSignature).toBeDefined(); + expect(typeSignature.signature).toBeDefined(); + expect(typeSignature.scheme).toEqual('EIP712'); + expect(typeSignature.address).toEqual(await signer.getAddress()); + expect(typeSignature.typedData.domain.name).toEqual('TACo'); + expect(typeSignature.typedData.message.address).toEqual( + await signer.getAddress(), + ); expect(eip712Spy).toHaveBeenCalledOnce(); }); - it('supports eip4361', () => { + it('supports eip4361', async () => { const eip4361Spy = vi.spyOn( EIP4361SignatureProvider.prototype, 'getOrCreateSiweMessage', @@ -397,9 +417,26 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => - conditionExpr.buildContext(provider, {}, signer).toObj(), - ).not.toThrow(); + + const builtContext = conditionExpr.buildContext(provider, {}, signer); + const resolvedContextRecords = await builtContext.toObj(); + + const typeSignature = resolvedContextRecords[USER_ADDRESS_PARAM_EIP4361]; + expect(typeSignature).toBeDefined(); + expect(typeSignature.signature).toBeDefined(); + expect(typeSignature.scheme).toEqual('EIP4361'); + + const signerAddress = await signer.getAddress(); + expect(typeSignature.address).toEqual(signerAddress); + + expect(typeSignature.typedData).toContain( + `TACo wants you to sign in with your Ethereum account:\n${signerAddress}`, + ); + expect(typeSignature.typedData).toContain('URI: https://TACo'); + + const chainId = (await provider.getNetwork()).chainId; + expect(typeSignature.typedData).toContain(`Chain ID: ${chainId}`); + expect(eip4361Spy).toHaveBeenCalledOnce(); }); }); From d2eda8bf7a6bfc55f648f60a01f36333767a8969 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Fri, 31 May 2024 09:48:29 +0200 Subject: [PATCH 23/75] chore(linter): fix linter --- package.json | 36 +- packages/taco-auth/src/eip4361.ts | 8 +- packages/taco-auth/src/eip712.ts | 17 +- packages/taco-auth/src/types.ts | 7 +- packages/taco-auth/test/taco-auth.test.ts | 4 +- .../taco/src/conditions/context/context.ts | 4 +- packages/taco/test/conditions/context.test.ts | 59 +- pnpm-lock.yaml | 1018 ++++++++++++----- 8 files changed, 779 insertions(+), 374 deletions(-) diff --git a/package.json b/package.json index ab989994d..757f3c33d 100644 --- a/package.json +++ b/package.json @@ -24,37 +24,37 @@ "check-examples": "pnpm run --parallel --aggregate-output --reporter append-only --filter './examples/**' --filter './demos/**' check" }, "dependencies": { - "@changesets/cli": "^2.26.2", - "@nucypher/nucypher-core": "*", + "@changesets/cli": "^2.27.5", + "@nucypher/nucypher-core": "^0.14.4", "ethers": "^5.7.2" }, "devDependencies": { "@skypack/package-check": "^0.2.2", - "@types/node": "^20.11.30", - "@typescript-eslint/eslint-plugin": "^6.18.0", - "@typescript-eslint/parser": "^6.19.0", - "@vitest/coverage-v8": "^1.3.1", - "bundlemon": "^2.0.2", - "eslint": "^8.56.0", - "eslint-config-prettier": "^9.0.0", + "@types/node": "^20.14.2", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "@vitest/coverage-v8": "^1.6.0", + "bundlemon": "^2.1.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-config-typestrict": "^1.0.5", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-no-only-tests": "^3.1.0", "eslint-plugin-simple-import-sort": "^10.0.0", - "eslint-plugin-unused-imports": "^3.0.0", + "eslint-plugin-unused-imports": "^3.2.0", "gh-pages": "^6.1.1", "npm-run-all": "^4.1.5", - "prettier": "^3.2.4", + "prettier": "^3.3.1", "prettier-plugin-organize-imports": "^3.2.4", - "sort-package-json": "^2.6.0", - "ts-node": "^10.9.1", - "ts-unused-exports": "^10.0.1", - "typedoc": "^0.25.4", + "sort-package-json": "^2.10.0", + "ts-node": "^10.9.2", + "ts-unused-exports": "^10.1.0", + "typedoc": "^0.25.13", "typedoc-plugin-coverage": "^2.2.0", - "typedoc-plugin-missing-exports": "^2.1.0", - "typedoc-plugin-zod": "^1.1.0", - "typescript": "^5.2.2", + "typedoc-plugin-missing-exports": "^2.2.0", + "typedoc-plugin-zod": "^1.1.2", + "typescript": "^5.4.5", "vitest": "^1.6.0" }, "pnpm": { diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 360914b9c..7d3d89c0b 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -2,7 +2,9 @@ import { ethers } from 'ethers'; import { generateNonce, SiweMessage } from 'siwe'; import { LocalStorage } from './storage'; -import { TypedSignature } from './types'; +import { AuthSignature } from './types'; + +export type FormattedEIP4361 = string; export class EIP4361SignatureProvider { private readonly storage: LocalStorage; @@ -14,7 +16,7 @@ export class EIP4361SignatureProvider { this.storage = new LocalStorage(); } - public async getOrCreateSiweMessage(): Promise { + public async getOrCreateSiweMessage(): Promise { const address = await this.signer.getAddress(); const storageKey = `eth-signin-message-${address}`; @@ -30,7 +32,7 @@ export class EIP4361SignatureProvider { return typedSignature; } - private async createSiweMessage(): Promise { + private async createSiweMessage(): Promise { const address = await this.signer.getAddress(); const domain = 'TACo'; const version = '1'; diff --git a/packages/taco-auth/src/eip712.ts b/packages/taco-auth/src/eip712.ts index 35e1117f0..3d3a2ccb3 100644 --- a/packages/taco-auth/src/eip712.ts +++ b/packages/taco-auth/src/eip712.ts @@ -3,9 +3,9 @@ import { ethers } from 'ethers'; import { utils as ethersUtils } from 'ethers/lib/ethers'; import { LocalStorage } from './storage'; -import type { TypedSignature } from './types'; +import type { AuthSignature } from './types'; -interface Eip712 { +interface EIP712 { types: { Wallet: { name: string; type: string }[]; }; @@ -23,7 +23,7 @@ interface Eip712 { }; } -export interface FormattedEip712 extends Eip712 { +export interface FormattedEIP712 extends EIP712 { primaryType: 'Wallet'; types: { EIP712Domain: { name: string; type: string }[]; @@ -66,7 +66,7 @@ export class EIP712SignatureProvider { this.storage = new LocalStorage(); } - public async getOrCreateWalletSignature(): Promise { + public async getOrCreateWalletSignature(): Promise { const address = await this.signer.getAddress(); const storageKey = `eip712-signature-${address}`; @@ -82,16 +82,14 @@ export class EIP712SignatureProvider { return typedSignature; } - private async createWalletSignature(): Promise { + private async createWalletSignature(): Promise { // Ensure freshness of the signature const { blockNumber, blockHash, chainId } = await this.getChainData(); const address = await this.signer.getAddress(); const signatureText = `I'm the owner of address ${address} as of block number ${blockNumber}`; const salt = ethersUtils.hexlify(ethersUtils.randomBytes(32)); - const scheme = 'EIP712'; - - const typedData: Eip712 = { + const typedData: EIP712 = { types: { Wallet: [ { name: 'address', type: 'address' }, @@ -118,7 +116,7 @@ export class EIP712SignatureProvider { this.signer as unknown as TypedDataSigner )._signTypedData(typedData.domain, typedData.types, typedData.message); - const formattedTypedData: FormattedEip712 = { + const formattedTypedData: FormattedEIP712 = { ...typedData, primaryType: 'Wallet', types: { @@ -126,6 +124,7 @@ export class EIP712SignatureProvider { EIP712Domain, }, }; + const scheme = 'EIP712'; return { signature, address, scheme, typedData: formattedTypedData }; } diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/types.ts index 28ed40dea..fa3a826bb 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/types.ts @@ -1,8 +1,9 @@ -import { FormattedEip712 } from './eip712'; +import { FormattedEIP4361 } from './eip4361'; +import { FormattedEIP712 } from './eip712'; -export interface TypedSignature { +export interface AuthSignature { signature: string; address: string; scheme: 'EIP712' | 'EIP4361'; - typedData: FormattedEip712 | string; + typedData: FormattedEIP712 | FormattedEIP4361; } diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 0ef6e7b0e..a584b843f 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -9,7 +9,7 @@ import { describe, expect, it } from 'vitest'; import { EIP4361SignatureProvider, EIP712SignatureProvider, - FormattedEip712, + FormattedEIP712, } from '../src'; describe('taco authorization', () => { @@ -32,7 +32,7 @@ describe('taco authorization', () => { expect(eip712Message.address).toEqual(await signer.getAddress()); expect(eip712Message.scheme).toEqual('EIP712'); - const typedData = eip712Message.typedData as FormattedEip712; + const typedData = eip712Message.typedData as FormattedEIP712; expect(typedData).toBeDefined(); expect(typedData.types.Wallet).toBeDefined(); expect(typedData.domain.name).toEqual('TACo'); diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index bb44415e5..d927b0279 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,9 +1,9 @@ import { Context, Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { fromJSON, toJSON } from '@nucypher/shared'; import { + AuthSignature, EIP4361SignatureProvider, EIP712SignatureProvider, - TypedSignature, } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; @@ -20,7 +20,7 @@ import { } from '../const'; export type CustomContextParam = string | number | boolean; -export type ContextParam = CustomContextParam | TypedSignature; +export type ContextParam = CustomContextParam | AuthSignature; const ERR_RESERVED_PARAM = (key: string) => `Cannot use reserved parameter name ${key} as custom parameter`; diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 7221dfbe1..3f13eead7 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -1,7 +1,9 @@ import { initialize } from '@nucypher/nucypher-core'; import { + AuthSignature, EIP4361SignatureProvider, EIP712SignatureProvider, + FormattedEIP712, } from '@nucypher/taco-auth'; import { fakeProvider, fakeSigner } from '@nucypher/test-utils'; import { ethers } from 'ethers'; @@ -21,6 +23,7 @@ import { USER_ADDRESS_PARAM_EIP712, } from '../../src/conditions/const'; import { CustomContextParam } from '../../src/conditions/context'; +import { ContextParam } from '../../src/conditions/context/context'; import { paramOrContextParamSchema, ReturnValueTestProps, @@ -357,17 +360,20 @@ describe('authentication provider', () => { expect(conditionExpr.contextRequiresSigner()).toBe(true); const builtContext = conditionExpr.buildContext(provider, {}, signer); - const resolvedContextRecords = await builtContext.toObj(); + const contextVars = await builtContext.toObj(); - const typeSignature = resolvedContextRecords[USER_ADDRESS_PARAM_DEFAULT]; - expect(typeSignature).toBeDefined(); - expect(typeSignature.signature).toBeDefined(); - expect(typeSignature.scheme).toEqual('EIP712'); - expect(typeSignature.address).toEqual(await signer.getAddress()); - expect(typeSignature.typedData.domain.name).toEqual('TACo'); - expect(typeSignature.typedData.message.address).toEqual( - await signer.getAddress(), - ); + const typedSignature = contextVars[ + USER_ADDRESS_PARAM_DEFAULT + ] as AuthSignature; + expect(typedSignature).toBeDefined(); + expect(typedSignature.signature).toBeDefined(); + expect(typedSignature.scheme).toEqual('EIP712'); + expect(typedSignature.address).toEqual(await signer.getAddress()); + + const typedData = typedSignature.typedData as FormattedEIP712; + expect(typedData).toBeDefined(); + expect(typedData.domain.name).toEqual('TACo'); + expect(typedData.message.address).toEqual(await signer.getAddress()); expect(eip712Spy).toHaveBeenCalledOnce(); }); @@ -390,13 +396,15 @@ describe('authentication provider', () => { const builtContext = conditionExpr.buildContext(provider, {}, signer); const resolvedContextRecords = await builtContext.toObj(); - const typeSignature = resolvedContextRecords[USER_ADDRESS_PARAM_EIP712]; - expect(typeSignature).toBeDefined(); - expect(typeSignature.signature).toBeDefined(); - expect(typeSignature.scheme).toEqual('EIP712'); - expect(typeSignature.address).toEqual(await signer.getAddress()); - expect(typeSignature.typedData.domain.name).toEqual('TACo'); - expect(typeSignature.typedData.message.address).toEqual( + const typedSignature = resolvedContextRecords[USER_ADDRESS_PARAM_EIP712] as AuthSignature; + expect(typedSignature).toBeDefined(); + expect(typedSignature.signature).toBeDefined(); + expect(typedSignature.scheme).toEqual('EIP712'); + expect(typedSignature.address).toEqual(await signer.getAddress()); + + const typedData = typedSignature.typedData as FormattedEIP712; + expect(typedData.domain.name).toEqual('TACo'); + expect(typedData.message.address).toEqual( await signer.getAddress(), ); expect(eip712Spy).toHaveBeenCalledOnce(); @@ -421,21 +429,22 @@ describe('authentication provider', () => { const builtContext = conditionExpr.buildContext(provider, {}, signer); const resolvedContextRecords = await builtContext.toObj(); - const typeSignature = resolvedContextRecords[USER_ADDRESS_PARAM_EIP4361]; - expect(typeSignature).toBeDefined(); - expect(typeSignature.signature).toBeDefined(); - expect(typeSignature.scheme).toEqual('EIP4361'); + const typedSignature: ContextParam = + resolvedContextRecords[USER_ADDRESS_PARAM_EIP4361] as AuthSignature; + expect(typedSignature).toBeDefined(); + expect(typedSignature.signature).toBeDefined(); + expect(typedSignature.scheme).toEqual('EIP4361'); const signerAddress = await signer.getAddress(); - expect(typeSignature.address).toEqual(signerAddress); + expect(typedSignature.address).toEqual(signerAddress); - expect(typeSignature.typedData).toContain( + expect(typedSignature.typedData).toContain( `TACo wants you to sign in with your Ethereum account:\n${signerAddress}`, ); - expect(typeSignature.typedData).toContain('URI: https://TACo'); + expect(typedSignature.typedData).toContain('URI: https://TACo'); const chainId = (await provider.getNetwork()).chainId; - expect(typeSignature.typedData).toContain(`Chain ID: ${chainId}`); + expect(typedSignature.typedData).toContain(`Chain ID: ${chainId}`); expect(eip4361Spy).toHaveBeenCalledOnce(); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a9f3b618..3cbb39f31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,8 +16,8 @@ importers: .: dependencies: '@changesets/cli': - specifier: ^2.26.2 - version: 2.27.3 + specifier: ^2.27.5 + version: 2.27.5 '@nucypher/nucypher-core': specifier: ^0.14.1 version: 0.14.4 @@ -29,44 +29,44 @@ importers: specifier: ^0.2.2 version: 0.2.2 '@types/node': - specifier: ^20.11.30 - version: 20.11.30 + specifier: ^20.14.2 + version: 20.14.2 '@typescript-eslint/eslint-plugin': - specifier: ^6.18.0 - version: 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2) + specifier: ^6.21.0 + version: 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/parser': - specifier: ^6.19.0 - version: 6.21.0(eslint@8.56.0)(typescript@5.2.2) + specifier: ^6.21.0 + version: 6.21.0(eslint@8.57.0)(typescript@5.4.5) '@vitest/coverage-v8': - specifier: ^1.3.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0)) + specifier: ^1.6.0 + version: 1.6.0(vitest@1.6.0(@types/node@20.14.2)(jsdom@16.7.0)(terser@5.31.0)) bundlemon: - specifier: ^2.0.2 + specifier: ^2.1.0 version: 2.1.0 eslint: - specifier: ^8.56.0 - version: 8.56.0 + specifier: ^8.57.0 + version: 8.57.0 eslint-config-prettier: - specifier: ^9.0.0 - version: 9.1.0(eslint@8.56.0) + specifier: ^9.1.0 + version: 9.1.0(eslint@8.57.0) eslint-config-typestrict: specifier: ^1.0.5 - version: 1.0.5(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2))(eslint-plugin-sonarjs@1.0.3(eslint@8.56.0)) + version: 1.0.5(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-sonarjs@1.0.3(eslint@8.57.0)) eslint-plugin-eslint-comments: specifier: ^3.2.0 - version: 3.2.0(eslint@8.56.0) + version: 3.2.0(eslint@8.57.0) eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + version: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0) eslint-plugin-no-only-tests: specifier: ^3.1.0 version: 3.1.0 eslint-plugin-simple-import-sort: specifier: ^10.0.0 - version: 10.0.0(eslint@8.56.0) + version: 10.0.0(eslint@8.57.0) eslint-plugin-unused-imports: - specifier: ^3.0.0 - version: 3.2.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0) + specifier: ^3.2.0 + version: 3.2.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0) gh-pages: specifier: ^6.1.1 version: 6.1.1 @@ -74,38 +74,38 @@ importers: specifier: ^4.1.5 version: 4.1.5 prettier: - specifier: ^3.2.4 - version: 3.2.5 + specifier: ^3.3.1 + version: 3.3.1 prettier-plugin-organize-imports: specifier: ^3.2.4 - version: 3.2.4(prettier@3.2.5)(typescript@5.2.2) + version: 3.2.4(prettier@3.3.1)(typescript@5.4.5) sort-package-json: - specifier: ^2.6.0 + specifier: ^2.10.0 version: 2.10.0 ts-node: - specifier: ^10.9.1 - version: 10.9.2(@types/node@20.11.30)(typescript@5.2.2) + specifier: ^10.9.2 + version: 10.9.2(@types/node@20.14.2)(typescript@5.4.5) ts-unused-exports: - specifier: ^10.0.1 - version: 10.1.0(typescript@5.2.2) + specifier: ^10.1.0 + version: 10.1.0(typescript@5.4.5) typedoc: - specifier: ^0.25.4 - version: 0.25.13(typescript@5.2.2) + specifier: ^0.25.13 + version: 0.25.13(typescript@5.4.5) typedoc-plugin-coverage: specifier: ^2.2.0 - version: 2.2.0(typedoc@0.25.13(typescript@5.2.2)) + version: 2.2.0(typedoc@0.25.13(typescript@5.4.5)) typedoc-plugin-missing-exports: - specifier: ^2.1.0 - version: 2.2.0(typedoc@0.25.13(typescript@5.2.2)) + specifier: ^2.2.0 + version: 2.2.0(typedoc@0.25.13(typescript@5.4.5)) typedoc-plugin-zod: - specifier: ^1.1.0 - version: 1.1.2(typedoc@0.25.13(typescript@5.2.2)) + specifier: ^1.1.2 + version: 1.1.2(typedoc@0.25.13(typescript@5.4.5)) typescript: - specifier: ^5.2.2 - version: 5.2.2 + specifier: ^5.4.5 + version: 5.4.5 vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0) + version: 1.6.0(@types/node@20.14.2)(jsdom@16.7.0)(terser@5.31.0) demos/taco-demo: dependencies: @@ -284,7 +284,7 @@ importers: version: 8.56.0 eslint-config-next: specifier: 14.0.4 - version: 14.0.4(eslint@8.56.0)(typescript@5.2.2) + version: 14.0.4(eslint@8.56.0)(typescript@5.4.5) ethers: specifier: ^5.7.2 version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -336,7 +336,7 @@ importers: version: 18.2.18 react-scripts: specifier: ^5.0.1 - version: 5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10) + version: 5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.57.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(type-fest@0.21.3)(typescript@5.4.5)(utf-8-validate@5.0.10) examples/pre/webpack-5: dependencies: @@ -443,7 +443,7 @@ importers: version: 18.2.18 react-scripts: specifier: ^5.0.1 - version: 5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10) + version: 5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.57.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(type-fest@0.21.3)(typescript@5.4.5)(utf-8-validate@5.0.10) examples/taco/webpack-5: dependencies: @@ -515,7 +515,7 @@ importers: devDependencies: '@typechain/ethers-v5': specifier: ^11.1.2 - version: 11.1.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.2.2))(typescript@5.2.2) + version: 11.1.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5) '@types/deep-equal': specifier: ^1.0.3 version: 1.0.4 @@ -527,13 +527,13 @@ importers: version: 0.2.6 cz-conventional-changelog: specifier: ^3.0.1 - version: 3.3.0(@types/node@20.11.30)(typescript@5.2.2) + version: 3.3.0(@types/node@20.14.2)(typescript@5.4.5) standard-version: specifier: ^9.0.0 version: 9.5.0 typechain: specifier: ^8.3.2 - version: 8.3.2(typescript@5.2.2) + version: 8.3.2(typescript@5.4.5) packages/taco: dependencies: @@ -595,7 +595,7 @@ importers: version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) vitest: specifier: ^1.3.1 - version: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0) + version: 1.6.0(@types/node@20.14.2)(jsdom@16.7.0)(terser@5.31.0) packages: @@ -739,10 +739,18 @@ packages: resolution: {integrity: sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==} engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@7.24.7': + resolution: {integrity: sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.24.6': resolution: {integrity: sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.24.7': + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.24.6': resolution: {integrity: sha512-Jktc8KkF3zIkePb48QO+IapbXlSapOW9S+ogZZkcO6bABgYAxtZcjZ/O005111YLf+j4M84uEgwYoidDkXbCkQ==} engines: {node: '>=6.9.0'} @@ -764,6 +772,11 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/parser@7.24.7': + resolution: {integrity: sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==} + engines: {node: '>=6.0.0'} + hasBin: true + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.6': resolution: {integrity: sha512-bYndrJ6Ph6Ar+GaB5VAc0JPoP80bQCm4qon6JEzXfRl5QZyQ8Ur1K6k7htxWmPA5z+k7JQvaMUrtXlqclWYzKw==} engines: {node: '>=6.9.0'} @@ -791,6 +804,7 @@ packages: '@babel/plugin-proposal-class-properties@7.18.6': resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -803,24 +817,28 @@ packages: '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6': resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-numeric-separator@7.18.6': resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-optional-chaining@7.21.0': resolution: {integrity: sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-private-methods@7.18.6': resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -833,6 +851,7 @@ packages: '@babel/plugin-proposal-private-property-in-object@7.21.11': resolution: {integrity: sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -1327,6 +1346,10 @@ packages: resolution: {integrity: sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==} engines: {node: '>=6.9.0'} + '@babel/runtime@7.24.7': + resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} + engines: {node: '>=6.9.0'} + '@babel/template@7.24.6': resolution: {integrity: sha512-3vgazJlLwNXi9jhrR1ef8qiB65L1RK90+lEQwv4OxveHnqC3BfmnHdgySwRLzf6akhlOYenT+b7AfWq+a//AHw==} engines: {node: '>=6.9.0'} @@ -1339,33 +1362,37 @@ packages: resolution: {integrity: sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==} engines: {node: '>=6.9.0'} + '@babel/types@7.24.7': + resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} + engines: {node: '>=6.9.0'} + '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@changesets/apply-release-plan@7.0.1': - resolution: {integrity: sha512-aPdSq/R++HOyfEeBGjEe6LNG8gs0KMSyRETD/J2092OkNq8mOioAxyKjMbvVUdzgr/HTawzMOz7lfw339KnsCA==} + '@changesets/apply-release-plan@7.0.3': + resolution: {integrity: sha512-klL6LCdmfbEe9oyfLxnidIf/stFXmrbFO/3gT5LU5pcyoZytzJe4gWpTBx3BPmyNPl16dZ1xrkcW7b98e3tYkA==} - '@changesets/assemble-release-plan@6.0.0': - resolution: {integrity: sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==} + '@changesets/assemble-release-plan@6.0.2': + resolution: {integrity: sha512-n9/Tdq+ze+iUtjmq0mZO3pEhJTKkku9hUxtUadW30jlN7kONqJG3O6ALeXrmc6gsi/nvoCuKjqEJ68Hk8RbMTQ==} '@changesets/changelog-git@0.2.0': resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} - '@changesets/cli@2.27.3': - resolution: {integrity: sha512-ve/VpWApILlSs8cr0okNx5C2LKRawI9XZgvfmf58S8sar2nhx5DPJREFXYZBahs0FeTfvH0rdVl+nGe8QF45Ig==} + '@changesets/cli@2.27.5': + resolution: {integrity: sha512-UVppOvzCjjylBenFcwcZNG5IaZ8jsIaEVraV/pbXgukYNb0Oqa0d8UWb0LkYzA1Bf1HmUrOfccFcRLheRuA7pA==} hasBin: true - '@changesets/config@3.0.0': - resolution: {integrity: sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==} + '@changesets/config@3.0.1': + resolution: {integrity: sha512-nCr8pOemUjvGJ8aUu8TYVjqnUL+++bFOQHBVmtNbLvKzIDkN/uiP/Z4RKmr7NNaiujIURHySDEGFPftR4GbTUA==} '@changesets/errors@0.2.0': resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} - '@changesets/get-dependents-graph@2.0.0': - resolution: {integrity: sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==} + '@changesets/get-dependents-graph@2.1.0': + resolution: {integrity: sha512-QOt6pQq9RVXKGHPVvyKimJDYJumx7p4DO5MO9AhRJYgAPgv0emhNqAqqysSVKHBm4sxKlGN4S1zXOIb5yCFuhQ==} - '@changesets/get-release-plan@4.0.0': - resolution: {integrity: sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==} + '@changesets/get-release-plan@4.0.2': + resolution: {integrity: sha512-rOalz7nMuMV2vyeP7KBeAhqEB7FM2GFPO5RQSoOoUKKH9L6wW3QyPA2K+/rG9kBrWl2HckPVES73/AuwPvbH3w==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} @@ -1385,6 +1412,9 @@ packages: '@changesets/read@0.6.0': resolution: {integrity: sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==} + '@changesets/should-skip-package@0.1.0': + resolution: {integrity: sha512-FxG6Mhjw7yFStlSM7Z0Gmg3RiyQ98d/9VpQAZ3Fzr59dCOM9G6ZdYbjiSAt0XtFr9JR5U2tBaJWPjrkGGc618g==} + '@changesets/types@4.1.0': resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} @@ -1795,6 +1825,10 @@ packages: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + '@eslint-community/regexpp@4.10.1': + resolution: {integrity: sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + '@eslint/eslintrc@2.1.4': resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1803,6 +1837,10 @@ packages: resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@eslint/js@8.57.0': + resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@ethersproject/abi@5.7.0': resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} @@ -2590,6 +2628,9 @@ packages: '@types/node@20.11.30': resolution: {integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==} + '@types/node@20.14.2': + resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} + '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -2909,6 +2950,7 @@ packages: abab@2.0.6: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} + deprecated: Use your platform's native atob() and btoa() methods instead accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} @@ -4056,6 +4098,15 @@ packages: supports-color: optional: true + debug@4.3.5: + resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} engines: {node: '>=0.10.0'} @@ -4226,6 +4277,7 @@ packages: domexception@2.0.1: resolution: {integrity: sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==} engines: {node: '>=8'} + deprecated: Use your platform's native DOMException instead domhandler@4.3.1: resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} @@ -4609,6 +4661,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true + eslint@8.57.0: + resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5017,9 +5074,11 @@ packages: glob@7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} + deprecated: Glob versions prior to v9 are no longer supported glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported global-directory@4.0.1: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} @@ -5316,6 +5375,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.3: resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} @@ -7164,8 +7224,8 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + prettier@3.3.1: + resolution: {integrity: sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==} engines: {node: '>=14'} hasBin: true @@ -7246,6 +7306,7 @@ packages: querystring@0.2.1: resolution: {integrity: sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==} engines: {node: '>=0.4.x'} + deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} @@ -7513,6 +7574,7 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rimraf@5.0.7: @@ -7525,6 +7587,7 @@ packages: rollup-plugin-terser@7.0.2: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} + deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser peerDependencies: rollup: ^2.0.0 @@ -7787,6 +7850,7 @@ packages: sourcemap-codec@1.4.8: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} + deprecated: Please use @jridgewell/sourcemap-codec instead spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} @@ -7821,6 +7885,7 @@ packages: stable@0.1.8: resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} + deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} @@ -7918,6 +7983,7 @@ packages: stringify-package@1.0.1: resolution: {integrity: sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==} + deprecated: This module is not used anymore, and has been replaced by @npmcli/package-json strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} @@ -8021,6 +8087,7 @@ packages: svgo@1.3.2: resolution: {integrity: sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==} engines: {node: '>=4.0.0'} + deprecated: This SVGO version is no longer supported. Upgrade to v2.x.x. hasBin: true svgo@2.8.0: @@ -8355,6 +8422,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@5.4.5: + resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} + engines: {node: '>=14.17'} + hasBin: true + typical@4.0.0: resolution: {integrity: sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==} engines: {node: '>=8'} @@ -8549,6 +8621,7 @@ packages: w3c-hr-time@1.0.2: resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} + deprecated: Use your platform's native performance.now() and performance.timeOrigin. w3c-xmlserializer@2.0.0: resolution: {integrity: sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==} @@ -8740,6 +8813,7 @@ packages: workbox-cacheable-response@6.6.0: resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} + deprecated: workbox-background-sync@6.6.0 workbox-core@6.6.0: resolution: {integrity: sha512-GDtFRF7Yg3DD859PMbPAYPeJyg5gJYXuBQAC+wyrWuuXgpfoOrIQIvFRZnQ7+czTIQjIr1DhLEGFzZanAT/3bQ==} @@ -8749,6 +8823,7 @@ packages: workbox-google-analytics@6.6.0: resolution: {integrity: sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==} + deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained workbox-navigation-preload@6.6.0: resolution: {integrity: sha512-utNEWG+uOfXdaZmvhshrh7KzhDu/1iMHyQOV6Aqup8Mm78D286ugu5k9MFD9SzBT5TcwgwSORVvInaXWbvKz9Q==} @@ -8973,18 +9048,18 @@ snapshots: '@babel/traverse': 7.24.6 '@babel/types': 7.24.6 convert-source-map: 2.0.0 - debug: 4.3.4 + debug: 4.3.5 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/eslint-parser@7.24.6(@babel/core@7.24.6)(eslint@8.56.0)': + '@babel/eslint-parser@7.24.6(@babel/core@7.24.6)(eslint@8.57.0)': dependencies: '@babel/core': 7.24.6 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 8.56.0 + eslint: 8.57.0 eslint-visitor-keys: 2.1.0 semver: 6.3.1 @@ -9001,7 +9076,7 @@ snapshots: '@babel/helper-builder-binary-assignment-operator-visitor@7.24.6': dependencies: - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@babel/helper-compilation-targets@7.24.6': dependencies: @@ -9036,7 +9111,7 @@ snapshots: '@babel/core': 7.24.6 '@babel/helper-compilation-targets': 7.24.6 '@babel/helper-plugin-utils': 7.24.6 - debug: 4.3.4 + debug: 4.3.5 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -9047,15 +9122,15 @@ snapshots: '@babel/helper-function-name@7.24.6': dependencies: '@babel/template': 7.24.6 - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@babel/helper-hoist-variables@7.24.6': dependencies: - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@babel/helper-member-expression-to-functions@7.24.6': dependencies: - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@babel/helper-module-imports@7.24.6': dependencies: @@ -9072,7 +9147,7 @@ snapshots: '@babel/helper-optimise-call-expression@7.24.6': dependencies: - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@babel/helper-plugin-utils@7.24.6': {} @@ -9092,7 +9167,7 @@ snapshots: '@babel/helper-simple-access@7.24.6': dependencies: - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@babel/helper-skip-transparent-expression-wrappers@7.24.6': dependencies: @@ -9100,19 +9175,23 @@ snapshots: '@babel/helper-split-export-declaration@7.24.6': dependencies: - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@babel/helper-string-parser@7.24.6': {} + '@babel/helper-string-parser@7.24.7': {} + '@babel/helper-validator-identifier@7.24.6': {} + '@babel/helper-validator-identifier@7.24.7': {} + '@babel/helper-validator-option@7.24.6': {} '@babel/helper-wrap-function@7.24.6': dependencies: '@babel/helper-function-name': 7.24.6 '@babel/template': 7.24.6 - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@babel/helpers@7.24.6': dependencies: @@ -9130,6 +9209,10 @@ snapshots: dependencies: '@babel/types': 7.24.6 + '@babel/parser@7.24.7': + dependencies: + '@babel/types': 7.24.7 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.6(@babel/core@7.24.6)': dependencies: '@babel/core': 7.24.6 @@ -9786,6 +9869,10 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 + '@babel/runtime@7.24.7': + dependencies: + regenerator-runtime: 0.14.1 + '@babel/template@7.24.6': dependencies: '@babel/code-frame': 7.24.6 @@ -9802,7 +9889,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.24.6 '@babel/parser': 7.24.6 '@babel/types': 7.24.6 - debug: 4.3.4 + debug: 4.3.5 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -9813,14 +9900,21 @@ snapshots: '@babel/helper-validator-identifier': 7.24.6 to-fast-properties: 2.0.0 + '@babel/types@7.24.7': + dependencies: + '@babel/helper-string-parser': 7.24.7 + '@babel/helper-validator-identifier': 7.24.7 + to-fast-properties: 2.0.0 + '@bcoe/v8-coverage@0.2.3': {} - '@changesets/apply-release-plan@7.0.1': + '@changesets/apply-release-plan@7.0.3': dependencies: - '@babel/runtime': 7.24.6 - '@changesets/config': 3.0.0 + '@babel/runtime': 7.24.7 + '@changesets/config': 3.0.1 '@changesets/get-version-range-type': 0.4.0 '@changesets/git': 3.0.0 + '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 @@ -9831,11 +9925,12 @@ snapshots: resolve-from: 5.0.0 semver: 7.6.2 - '@changesets/assemble-release-plan@6.0.0': + '@changesets/assemble-release-plan@6.0.2': dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.0.0 + '@changesets/get-dependents-graph': 2.1.0 + '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 semver: 7.6.2 @@ -9844,20 +9939,21 @@ snapshots: dependencies: '@changesets/types': 6.0.0 - '@changesets/cli@2.27.3': + '@changesets/cli@2.27.5': dependencies: - '@babel/runtime': 7.24.6 - '@changesets/apply-release-plan': 7.0.1 - '@changesets/assemble-release-plan': 6.0.0 + '@babel/runtime': 7.24.7 + '@changesets/apply-release-plan': 7.0.3 + '@changesets/assemble-release-plan': 6.0.2 '@changesets/changelog-git': 0.2.0 - '@changesets/config': 3.0.0 + '@changesets/config': 3.0.1 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.0.0 - '@changesets/get-release-plan': 4.0.0 + '@changesets/get-dependents-graph': 2.1.0 + '@changesets/get-release-plan': 4.0.2 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/pre': 2.0.0 '@changesets/read': 0.6.0 + '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@changesets/write': 0.3.1 '@manypkg/get-packages': 1.1.3 @@ -9879,10 +9975,10 @@ snapshots: term-size: 2.2.1 tty-table: 4.2.3 - '@changesets/config@3.0.0': + '@changesets/config@3.0.1': dependencies: '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.0.0 + '@changesets/get-dependents-graph': 2.1.0 '@changesets/logger': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -9893,7 +9989,7 @@ snapshots: dependencies: extendable-error: 0.1.7 - '@changesets/get-dependents-graph@2.0.0': + '@changesets/get-dependents-graph@2.1.0': dependencies: '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -9901,11 +9997,11 @@ snapshots: fs-extra: 7.0.1 semver: 7.6.2 - '@changesets/get-release-plan@4.0.0': + '@changesets/get-release-plan@4.0.2': dependencies: - '@babel/runtime': 7.24.6 - '@changesets/assemble-release-plan': 6.0.0 - '@changesets/config': 3.0.0 + '@babel/runtime': 7.24.7 + '@changesets/assemble-release-plan': 6.0.2 + '@changesets/config': 3.0.1 '@changesets/pre': 2.0.0 '@changesets/read': 0.6.0 '@changesets/types': 6.0.0 @@ -9915,7 +10011,7 @@ snapshots: '@changesets/git@3.0.0': dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -9934,7 +10030,7 @@ snapshots: '@changesets/pre@2.0.0': dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -9942,7 +10038,7 @@ snapshots: '@changesets/read@0.6.0': dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/parse': 0.4.0 @@ -9951,13 +10047,19 @@ snapshots: fs-extra: 7.0.1 p-filter: 2.1.0 + '@changesets/should-skip-package@0.1.0': + dependencies: + '@babel/runtime': 7.24.7 + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 + '@changesets/types@4.1.0': {} '@changesets/types@6.0.0': {} '@changesets/write@0.3.1': dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 '@changesets/types': 6.0.0 fs-extra: 7.0.1 human-id: 1.0.2 @@ -9972,15 +10074,15 @@ snapshots: '@commitlint/execute-rule@19.0.0': optional: true - '@commitlint/load@19.2.0(@types/node@20.11.30)(typescript@5.2.2)': + '@commitlint/load@19.2.0(@types/node@20.14.2)(typescript@5.4.5)': dependencies: '@commitlint/config-validator': 19.0.3 '@commitlint/execute-rule': 19.0.0 '@commitlint/resolve-extends': 19.1.0 '@commitlint/types': 19.0.3 chalk: 5.3.0 - cosmiconfig: 9.0.0(typescript@5.2.2) - cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.30)(cosmiconfig@9.0.0(typescript@5.2.2))(typescript@5.2.2) + cosmiconfig: 9.0.0(typescript@5.4.5) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.14.2)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -10231,8 +10333,15 @@ snapshots: eslint: 8.56.0 eslint-visitor-keys: 3.4.3 + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': + dependencies: + eslint: 8.57.0 + eslint-visitor-keys: 3.4.3 + '@eslint-community/regexpp@4.10.0': {} + '@eslint-community/regexpp@4.10.1': {} + '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 @@ -10249,6 +10358,8 @@ snapshots: '@eslint/js@8.56.0': {} + '@eslint/js@8.57.0': {} + '@ethersproject/abi@5.7.0': dependencies: '@ethersproject/address': 5.7.0 @@ -10607,7 +10718,7 @@ snapshots: jest-util: 28.1.3 slash: 3.0.0 - '@jest/core@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10)': + '@jest/core@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10)': dependencies: '@jest/console': 27.5.1 '@jest/reporters': 27.5.1 @@ -10621,7 +10732,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 27.5.1 - jest-config: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) + jest-config: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10) jest-haste-map: 27.5.1 jest-message-util: 27.5.1 jest-regex-util: 27.5.1 @@ -10801,14 +10912,14 @@ snapshots: '@manypkg/find-root@1.1.0': dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 '@manypkg/get-packages@1.1.3': dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -11301,15 +11412,15 @@ snapshots: '@tsconfig/node16@1.0.4': {} - '@typechain/ethers-v5@11.1.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.2.2))(typescript@5.2.2)': + '@typechain/ethers-v5@11.1.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/providers': 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) lodash: 4.17.21 - ts-essentials: 7.0.3(typescript@5.2.2) - typechain: 8.3.2(typescript@5.2.2) - typescript: 5.2.2 + ts-essentials: 7.0.3(typescript@5.4.5) + typechain: 8.3.2(typescript@5.4.5) + typescript: 5.4.5 '@types/babel__core@7.20.5': dependencies: @@ -11335,31 +11446,31 @@ snapshots: '@types/body-parser@1.19.5': dependencies: '@types/connect': 3.4.38 - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/bonjour@3.5.13': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/cacheable-request@6.0.3': dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/responselike': 1.0.3 '@types/connect-history-api-fallback@1.5.4': dependencies: '@types/express-serve-static-core': 4.19.1 - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/connect@3.4.38': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/conventional-commits-parser@5.0.0': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 optional: true '@types/deep-equal@1.0.4': {} @@ -11380,7 +11491,7 @@ snapshots: '@types/express-serve-static-core@4.19.1': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/qs': 6.9.15 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -11404,7 +11515,7 @@ snapshots: '@types/http-proxy@1.17.14': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/istanbul-lib-coverage@2.0.6': {} @@ -11422,7 +11533,7 @@ snapshots: '@types/keyv@3.1.4': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/lodash@4.17.4': {} @@ -11432,7 +11543,7 @@ snapshots: '@types/node-forge@1.3.11': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/node@11.11.6': {} @@ -11442,6 +11553,10 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/node@20.14.2': + dependencies: + undici-types: 5.26.5 + '@types/normalize-package-data@2.4.4': {} '@types/parse-json@4.0.2': {} @@ -11476,7 +11591,7 @@ snapshots: '@types/responselike@1.0.3': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/retry@0.12.0': {} @@ -11487,7 +11602,7 @@ snapshots: '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/serve-index@1.9.4': dependencies: @@ -11496,12 +11611,12 @@ snapshots: '@types/serve-static@1.15.7': dependencies: '@types/http-errors': 2.0.4 - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/send': 0.17.4 '@types/sockjs@0.3.36': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/stack-utils@2.0.3': {} @@ -11511,11 +11626,11 @@ snapshots: '@types/ws@7.4.7': dependencies: - '@types/node': 20.11.30 + '@types/node': 12.20.55 '@types/ws@8.5.10': dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 '@types/yargs-parser@21.0.3': {} @@ -11527,62 +11642,62 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2)': + '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.2.2) + '@eslint-community/regexpp': 4.10.1 + '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) - debug: 4.3.4 - eslint: 8.56.0 + '@typescript-eslint/type-utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) + debug: 4.3.5 + eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare-lite: 1.4.0 semver: 7.6.2 - tsutils: 3.21.0(typescript@5.2.2) + tsutils: 3.21.0(typescript@5.4.5) optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2)': + '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.2.2) + '@eslint-community/regexpp': 4.10.1 + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/type-utils': 6.21.0(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 - eslint: 8.56.0 + debug: 4.3.5 + eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.2.2) + ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - supports-color - '@typescript-eslint/experimental-utils@5.62.0(eslint@8.56.0)(typescript@5.2.2)': + '@typescript-eslint/experimental-utils@5.62.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) - eslint: 8.56.0 + '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) + eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2)': + '@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) - debug: 4.3.4 - eslint: 8.56.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.5) + debug: 4.3.5 + eslint: 8.57.0 optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - supports-color @@ -11592,13 +11707,39 @@ snapshots: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 + debug: 4.3.5 eslint: 8.56.0 optionalDependencies: typescript: 5.2.2 transitivePeerDependencies: - supports-color + '@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5)': + dependencies: + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.5 + eslint: 8.56.0 + optionalDependencies: + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5)': + dependencies: + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.5 + eslint: 8.57.0 + optionalDependencies: + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/scope-manager@5.62.0': dependencies: '@typescript-eslint/types': 5.62.0 @@ -11609,27 +11750,27 @@ snapshots: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - '@typescript-eslint/type-utils@5.62.0(eslint@8.56.0)(typescript@5.2.2)': + '@typescript-eslint/type-utils@5.62.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) - '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) - debug: 4.3.4 - eslint: 8.56.0 - tsutils: 3.21.0(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) + debug: 4.3.5 + eslint: 8.57.0 + tsutils: 3.21.0(typescript@5.4.5) optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@6.21.0(eslint@8.56.0)(typescript@5.2.2)': + '@typescript-eslint/type-utils@6.21.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2) - '@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.2.2) - debug: 4.3.4 - eslint: 8.56.0 - ts-api-utils: 1.3.0(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) + debug: 4.3.5 + eslint: 8.57.0 + ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - supports-color @@ -11637,17 +11778,17 @@ snapshots: '@typescript-eslint/types@6.21.0': {} - '@typescript-eslint/typescript-estree@5.62.0(typescript@5.2.2)': + '@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.5)': dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4 + debug: 4.3.5 globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 - tsutils: 3.21.0(typescript@5.2.2) + tsutils: 3.21.0(typescript@5.4.5) optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - supports-color @@ -11655,7 +11796,7 @@ snapshots: dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 + debug: 4.3.5 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -11666,30 +11807,45 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@8.56.0)(typescript@5.2.2)': + '@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.5 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.2 + ts-api-utils: 1.3.0(typescript@5.4.5) + optionalDependencies: + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.4.5)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) - eslint: 8.56.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.5) + eslint: 8.57.0 eslint-scope: 5.1.1 semver: 7.6.2 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@6.21.0(eslint@8.56.0)(typescript@5.2.2)': + '@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2) - eslint: 8.56.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) + eslint: 8.57.0 semver: 7.6.2 transitivePeerDependencies: - supports-color @@ -11723,11 +11879,11 @@ snapshots: - node-fetch - supports-color - '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0))': + '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@20.14.2)(jsdom@16.7.0)(terser@5.31.0))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 - debug: 4.3.4 + debug: 4.3.5 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 5.0.4 @@ -11738,7 +11894,7 @@ snapshots: std-env: 3.7.0 strip-literal: 2.1.0 test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0) + vitest: 1.6.0(@types/node@20.14.2)(jsdom@16.7.0)(terser@5.31.0) transitivePeerDependencies: - supports-color @@ -11914,7 +12070,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.4 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -12208,7 +12364,7 @@ snapshots: axios-retry@3.9.1: dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 is-retry-allowed: 2.2.0 axios@1.6.2: @@ -12795,10 +12951,10 @@ snapshots: commander@9.5.0: {} - commitizen@4.3.0(@types/node@20.11.30)(typescript@5.2.2): + commitizen@4.3.0(@types/node@20.14.2)(typescript@5.4.5): dependencies: cachedir: 2.3.0 - cz-conventional-changelog: 3.3.0(@types/node@20.11.30)(typescript@5.2.2) + cz-conventional-changelog: 3.3.0(@types/node@20.14.2)(typescript@5.4.5) dedent: 0.7.0 detect-indent: 6.1.0 find-node-modules: 2.1.3 @@ -13007,12 +13163,12 @@ snapshots: core-util-is@1.0.3: {} - cosmiconfig-typescript-loader@5.0.0(@types/node@20.11.30)(cosmiconfig@9.0.0(typescript@5.2.2))(typescript@5.2.2): + cosmiconfig-typescript-loader@5.0.0(@types/node@20.14.2)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5): dependencies: - '@types/node': 20.11.30 - cosmiconfig: 9.0.0(typescript@5.2.2) + '@types/node': 20.14.2 + cosmiconfig: 9.0.0(typescript@5.4.5) jiti: 1.21.0 - typescript: 5.2.2 + typescript: 5.4.5 optional: true cosmiconfig@6.0.0: @@ -13031,14 +13187,14 @@ snapshots: path-type: 4.0.0 yaml: 1.10.2 - cosmiconfig@9.0.0(typescript@5.2.2): + cosmiconfig@9.0.0(typescript@5.4.5): dependencies: env-paths: 2.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 optional: true create-ecdh@4.0.4: @@ -13254,16 +13410,16 @@ snapshots: csv-stringify: 5.6.5 stream-transform: 2.1.3 - cz-conventional-changelog@3.3.0(@types/node@20.11.30)(typescript@5.2.2): + cz-conventional-changelog@3.3.0(@types/node@20.14.2)(typescript@5.4.5): dependencies: chalk: 2.4.2 - commitizen: 4.3.0(@types/node@20.11.30)(typescript@5.2.2) + commitizen: 4.3.0(@types/node@20.14.2)(typescript@5.4.5) conventional-commit-types: 3.0.0 lodash.map: 4.6.0 longest: 2.0.1 word-wrap: 1.2.5 optionalDependencies: - '@commitlint/load': 19.2.0(@types/node@20.11.30)(typescript@5.2.2) + '@commitlint/load': 19.2.0(@types/node@20.14.2)(typescript@5.4.5) transitivePeerDependencies: - '@types/node' - typescript @@ -13310,6 +13466,10 @@ snapshots: dependencies: ms: 2.1.2 + debug@4.3.5: + dependencies: + ms: 2.1.2 + decamelize-keys@1.1.1: dependencies: decamelize: 1.2.0 @@ -13803,29 +13963,47 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-config-prettier@9.1.0(eslint@8.56.0): + eslint-config-next@14.0.4(eslint@8.56.0)(typescript@5.4.5): dependencies: + '@next/eslint-plugin-next': 14.0.4 + '@rushstack/eslint-patch': 1.10.3 + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.4.5) eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.56.0) + eslint-plugin-jsx-a11y: 6.8.0(eslint@8.56.0) + eslint-plugin-react: 7.34.1(eslint@8.56.0) + eslint-plugin-react-hooks: 4.6.2(eslint@8.56.0) + optionalDependencies: + typescript: 5.4.5 + transitivePeerDependencies: + - eslint-import-resolver-webpack + - supports-color - eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2): + eslint-config-prettier@9.1.0(eslint@8.57.0): + dependencies: + eslint: 8.57.0 + + eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10))(typescript@5.4.5): dependencies: '@babel/core': 7.24.6 - '@babel/eslint-parser': 7.24.6(@babel/core@7.24.6)(eslint@8.56.0) + '@babel/eslint-parser': 7.24.6(@babel/core@7.24.6)(eslint@8.57.0) '@rushstack/eslint-patch': 1.10.3 - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.4.5) babel-preset-react-app: 10.0.1 confusing-browser-globals: 1.0.11 - eslint: 8.56.0 - eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0) - eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2) - eslint-plugin-jsx-a11y: 6.8.0(eslint@8.56.0) - eslint-plugin-react: 7.34.1(eslint@8.56.0) - eslint-plugin-react-hooks: 4.6.2(eslint@8.56.0) - eslint-plugin-testing-library: 5.11.1(eslint@8.56.0)(typescript@5.2.2) + eslint: 8.57.0 + eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0) + eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10))(typescript@5.4.5) + eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) + eslint-plugin-react: 7.34.1(eslint@8.57.0) + eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) + eslint-plugin-testing-library: 5.11.1(eslint@8.57.0)(typescript@5.4.5) optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - '@babel/plugin-syntax-flow' - '@babel/plugin-transform-react-jsx' @@ -13834,10 +14012,10 @@ snapshots: - jest - supports-color - eslint-config-typestrict@1.0.5(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2))(eslint-plugin-sonarjs@1.0.3(eslint@8.56.0)): + eslint-config-typestrict@1.0.5(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-sonarjs@1.0.3(eslint@8.57.0)): dependencies: - '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2) - eslint-plugin-sonarjs: 1.0.3(eslint@8.56.0) + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + eslint-plugin-sonarjs: 1.0.3(eslint@8.57.0) eslint-import-resolver-node@0.3.9: dependencies: @@ -13849,7 +14027,7 @@ snapshots: eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0): dependencies: - debug: 4.3.4 + debug: 4.3.5 enhanced-resolve: 5.16.1 eslint: 8.56.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0) @@ -13864,12 +14042,29 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): + eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0): + dependencies: + debug: 4.3.5 + enhanced-resolve: 5.16.1 + eslint: 8.56.0 + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.56.0) + fast-glob: 3.3.2 + get-tsconfig: 4.7.5 + is-core-module: 2.13.1 + is-glob: 4.0.3 + transitivePeerDependencies: + - '@typescript-eslint/parser' + - eslint-import-resolver-node + - eslint-import-resolver-webpack + - supports-color + + eslint-module-utils@2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.2.2) - eslint: 8.56.0 + '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.4.5) + eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color @@ -13885,21 +14080,52 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-eslint-comments@3.2.0(eslint@8.56.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0): dependencies: - escape-string-regexp: 1.0.5 + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.4.5) + eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + transitivePeerDependencies: + - supports-color + + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): + dependencies: + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + dependencies: + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + + eslint-plugin-eslint-comments@3.2.0(eslint@8.57.0): + dependencies: + escape-string-regexp: 1.0.5 + eslint: 8.57.0 ignore: 5.3.1 - eslint-plugin-flowtype@8.0.3(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.56.0): + eslint-plugin-flowtype@8.0.3(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.57.0): dependencies: '@babel/plugin-syntax-flow': 7.24.6(@babel/core@7.24.6) '@babel/plugin-transform-react-jsx': 7.24.6(@babel/core@7.24.6) - eslint: 8.56.0 + eslint: 8.57.0 lodash: 4.17.21 string-natural-compare: 3.0.1 - eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -13907,9 +14133,9 @@ snapshots: array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.56.0 + eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -13920,7 +14146,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.4.5) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -13953,13 +14179,67 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.56.0): dependencies: - '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) + hasown: 2.0.2 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + optionalDependencies: + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + + eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0): + dependencies: + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + hasown: 2.0.2 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2) - jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + + eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10))(typescript@5.4.5): + dependencies: + '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) + eslint: 8.57.0 + optionalDependencies: + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10) transitivePeerDependencies: - supports-color - typescript @@ -13984,12 +14264,36 @@ snapshots: object.entries: 1.1.8 object.fromentries: 2.0.8 + eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0): + dependencies: + '@babel/runtime': 7.24.6 + aria-query: 5.3.0 + array-includes: 3.1.8 + array.prototype.flatmap: 1.3.2 + ast-types-flow: 0.0.8 + axe-core: 4.7.0 + axobject-query: 3.2.1 + damerau-levenshtein: 1.0.8 + emoji-regex: 9.2.2 + es-iterator-helpers: 1.0.19 + eslint: 8.57.0 + hasown: 2.0.2 + jsx-ast-utils: 3.3.5 + language-tags: 1.0.9 + minimatch: 3.1.2 + object.entries: 1.1.8 + object.fromentries: 2.0.8 + eslint-plugin-no-only-tests@3.1.0: {} eslint-plugin-react-hooks@4.6.2(eslint@8.56.0): dependencies: eslint: 8.56.0 + eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): + dependencies: + eslint: 8.57.0 + eslint-plugin-react@7.34.1(eslint@8.56.0): dependencies: array-includes: 3.1.8 @@ -14012,28 +14316,50 @@ snapshots: semver: 6.3.1 string.prototype.matchall: 4.0.11 - eslint-plugin-simple-import-sort@10.0.0(eslint@8.56.0): + eslint-plugin-react@7.34.1(eslint@8.57.0): dependencies: - eslint: 8.56.0 + array-includes: 3.1.8 + array.prototype.findlast: 1.2.5 + array.prototype.flatmap: 1.3.2 + array.prototype.toreversed: 1.1.2 + array.prototype.tosorted: 1.1.3 + doctrine: 2.1.0 + es-iterator-helpers: 1.0.19 + eslint: 8.57.0 + estraverse: 5.3.0 + jsx-ast-utils: 3.3.5 + minimatch: 3.1.2 + object.entries: 1.1.8 + object.fromentries: 2.0.8 + object.hasown: 1.1.4 + object.values: 1.2.0 + prop-types: 15.8.1 + resolve: 2.0.0-next.5 + semver: 6.3.1 + string.prototype.matchall: 4.0.11 - eslint-plugin-sonarjs@1.0.3(eslint@8.56.0): + eslint-plugin-simple-import-sort@10.0.0(eslint@8.57.0): dependencies: - eslint: 8.56.0 + eslint: 8.57.0 - eslint-plugin-testing-library@5.11.1(eslint@8.56.0)(typescript@5.2.2): + eslint-plugin-sonarjs@1.0.3(eslint@8.57.0): dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) - eslint: 8.56.0 + eslint: 8.57.0 + + eslint-plugin-testing-library@5.11.1(eslint@8.57.0)(typescript@5.4.5): + dependencies: + '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) + eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript - eslint-plugin-unused-imports@3.2.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0): + eslint-plugin-unused-imports@3.2.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0): dependencies: - eslint: 8.56.0 + eslint: 8.57.0 eslint-rule-composer: 0.3.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.2.2))(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) eslint-rule-composer@0.3.0: {} @@ -14051,10 +14377,10 @@ snapshots: eslint-visitor-keys@3.4.3: {} - eslint-webpack-plugin@3.2.0(eslint@8.56.0)(webpack@5.91.0): + eslint-webpack-plugin@3.2.0(eslint@8.57.0)(webpack@5.91.0): dependencies: '@types/eslint': 8.56.10 - eslint: 8.56.0 + eslint: 8.57.0 jest-worker: 28.1.3 micromatch: 4.0.7 normalize-path: 3.0.0 @@ -14104,6 +14430,49 @@ snapshots: transitivePeerDependencies: - supports-color + eslint@8.57.0: + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/regexpp': 4.10.1 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.0 + '@humanwhocodes/config-array': 0.11.14 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.5 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.1 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + espree@9.6.1: dependencies: acorn: 8.11.3 @@ -14304,7 +14673,7 @@ snapshots: '@babel/core': 7.24.6 '@babel/runtime': 7.24.6 core-js: 3.37.1 - debug: 4.3.4 + debug: 4.3.5 glob-to-regexp: 0.4.1 is-subset: 0.1.1 lodash.isequal: 4.5.0 @@ -14436,7 +14805,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@6.5.3(eslint@8.56.0)(typescript@5.2.2)(webpack@5.91.0): + fork-ts-checker-webpack-plugin@6.5.3(eslint@8.57.0)(typescript@5.4.5)(webpack@5.91.0): dependencies: '@babel/code-frame': 7.24.6 '@types/json-schema': 7.0.15 @@ -14451,10 +14820,10 @@ snapshots: schema-utils: 2.7.0 semver: 7.6.2 tapable: 1.1.3 - typescript: 5.2.2 + typescript: 5.4.5 webpack: 5.91.0 optionalDependencies: - eslint: 8.56.0 + eslint: 8.57.0 form-data@3.0.1: dependencies: @@ -14900,7 +15269,7 @@ snapshots: dependencies: '@tootallnate/once': 1.1.2 agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -14932,7 +15301,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -15242,7 +15611,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.4 + debug: 4.3.5 istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -15251,7 +15620,7 @@ snapshots: istanbul-lib-source-maps@5.0.4: dependencies: '@jridgewell/trace-mapping': 0.3.25 - debug: 4.3.4 + debug: 4.3.5 istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -15330,16 +15699,16 @@ snapshots: transitivePeerDependencies: - supports-color - jest-cli@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10): + jest-cli@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10): dependencies: - '@jest/core': 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) + '@jest/core': 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10) '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) + jest-config: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10) jest-util: 27.5.1 jest-validate: 27.5.1 prompts: 2.4.2 @@ -15351,7 +15720,7 @@ snapshots: - ts-node - utf-8-validate - jest-config@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10): + jest-config@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10): dependencies: '@babel/core': 7.24.6 '@jest/test-sequencer': 27.5.1 @@ -15378,7 +15747,7 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - ts-node: 10.9.2(@types/node@20.11.30)(typescript@5.2.2) + ts-node: 10.9.2(@types/node@20.11.30)(typescript@5.4.5) transitivePeerDependencies: - bufferutil - canvas @@ -15606,7 +15975,7 @@ snapshots: '@babel/generator': 7.24.6 '@babel/plugin-syntax-typescript': 7.24.6(@babel/core@7.24.6) '@babel/traverse': 7.24.6 - '@babel/types': 7.24.6 + '@babel/types': 7.24.7 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 '@types/babel__traverse': 7.20.6 @@ -15654,11 +16023,11 @@ snapshots: leven: 3.1.0 pretty-format: 27.5.1 - jest-watch-typeahead@1.1.0(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10)): + jest-watch-typeahead@1.1.0(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10)): dependencies: ansi-escapes: 4.3.2 chalk: 4.1.2 - jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) + jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10) jest-regex-util: 28.0.2 jest-watcher: 28.1.3 slash: 4.0.0 @@ -15694,7 +16063,7 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -15704,11 +16073,11 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10): + jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10): dependencies: - '@jest/core': 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) + '@jest/core': 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10) import-local: 3.1.0 - jest-cli: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) + jest-cli: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - canvas @@ -16006,8 +16375,8 @@ snapshots: magicast@0.3.4: dependencies: - '@babel/parser': 7.24.6 - '@babel/types': 7.24.6 + '@babel/parser': 7.24.7 + '@babel/types': 7.24.7 source-map-js: 1.2.0 make-dir@3.1.0: @@ -16757,13 +17126,13 @@ snapshots: postcss: 8.4.38 postcss-value-parser: 4.2.0 - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)): + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5)): dependencies: lilconfig: 3.1.1 yaml: 2.4.2 optionalDependencies: postcss: 8.4.38 - ts-node: 10.9.2(@types/node@20.11.30)(typescript@5.2.2) + ts-node: 10.9.2(@types/node@20.11.30)(typescript@5.4.5) postcss-loader@6.2.1(postcss@8.4.38)(webpack@5.91.0): dependencies: @@ -17053,14 +17422,14 @@ snapshots: prelude-ls@1.2.1: {} - prettier-plugin-organize-imports@3.2.4(prettier@3.2.5)(typescript@5.2.2): + prettier-plugin-organize-imports@3.2.4(prettier@3.3.1)(typescript@5.4.5): dependencies: - prettier: 3.2.5 - typescript: 5.2.2 + prettier: 3.3.1 + typescript: 5.4.5 prettier@2.8.8: {} - prettier@3.2.5: {} + prettier@3.3.1: {} pretty-bytes@5.6.0: {} @@ -17193,7 +17562,7 @@ snapshots: prop-types: 15.8.1 react: 18.2.0 - react-dev-utils@12.0.1(eslint@8.56.0)(typescript@5.2.2)(webpack@5.91.0): + react-dev-utils@12.0.1(eslint@8.57.0)(typescript@5.4.5)(webpack@5.91.0): dependencies: '@babel/code-frame': 7.24.6 address: 1.2.2 @@ -17204,7 +17573,7 @@ snapshots: escape-string-regexp: 4.0.0 filesize: 8.0.7 find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.56.0)(typescript@5.2.2)(webpack@5.91.0) + fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.57.0)(typescript@5.4.5)(webpack@5.91.0) global-modules: 2.0.0 globby: 11.1.0 gzip-size: 6.0.0 @@ -17221,7 +17590,7 @@ snapshots: text-table: 0.2.0 webpack: 5.91.0 optionalDependencies: - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - eslint - supports-color @@ -17245,7 +17614,7 @@ snapshots: react-refresh@0.14.2: {} - react-scripts@5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.56.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(type-fest@0.21.3)(typescript@5.2.2)(utf-8-validate@5.0.10): + react-scripts@5.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.57.0)(react@18.2.0)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(type-fest@0.21.3)(typescript@5.4.5)(utf-8-validate@5.0.10): dependencies: '@babel/core': 7.24.6 '@pmmmwh/react-refresh-webpack-plugin': 0.5.13(react-refresh@0.11.0)(type-fest@0.21.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0))(webpack@5.91.0) @@ -17262,16 +17631,16 @@ snapshots: css-minimizer-webpack-plugin: 3.4.1(webpack@5.91.0) dotenv: 10.0.0 dotenv-expand: 5.1.0 - eslint: 8.56.0 - eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.56.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10))(typescript@5.2.2) - eslint-webpack-plugin: 3.2.0(eslint@8.56.0)(webpack@5.91.0) + eslint: 8.57.0 + eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.24.6(@babel/core@7.24.6))(@babel/plugin-transform-react-jsx@7.24.6(@babel/core@7.24.6))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10))(typescript@5.4.5) + eslint-webpack-plugin: 3.2.0(eslint@8.57.0)(webpack@5.91.0) file-loader: 6.2.0(webpack@5.91.0) fs-extra: 10.1.0 html-webpack-plugin: 5.6.0(webpack@5.91.0) identity-obj-proxy: 3.0.0 - jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10) + jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10) jest-resolve: 27.5.1 - jest-watch-typeahead: 1.1.0(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2))(utf-8-validate@5.0.10)) + jest-watch-typeahead: 1.1.0(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5))(utf-8-validate@5.0.10)) mini-css-extract-plugin: 2.9.0(webpack@5.91.0) postcss: 8.4.38 postcss-flexbugs-fixes: 5.0.2(postcss@8.4.38) @@ -17281,7 +17650,7 @@ snapshots: prompts: 2.4.2 react: 18.2.0 react-app-polyfill: 3.0.0 - react-dev-utils: 12.0.1(eslint@8.56.0)(typescript@5.2.2)(webpack@5.91.0) + react-dev-utils: 12.0.1(eslint@8.57.0)(typescript@5.4.5)(webpack@5.91.0) react-refresh: 0.11.0 resolve: 1.22.8 resolve-url-loader: 4.0.0 @@ -17289,7 +17658,7 @@ snapshots: semver: 7.6.2 source-map-loader: 3.0.2(webpack@5.91.0) style-loader: 3.3.4(webpack@5.91.0) - tailwindcss: 3.4.3(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)) + tailwindcss: 3.4.3(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5)) terser-webpack-plugin: 5.3.10(webpack@5.91.0) webpack: 5.91.0 webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0) @@ -17297,7 +17666,7 @@ snapshots: workbox-webpack-plugin: 6.6.0(@types/babel__core@7.20.5)(webpack@5.91.0) optionalDependencies: fsevents: 2.3.3 - typescript: 5.2.2 + typescript: 5.4.5 transitivePeerDependencies: - '@babel/plugin-syntax-flow' - '@babel/plugin-transform-react-jsx' @@ -17433,7 +17802,7 @@ snapshots: regenerator-transform@0.15.2: dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 regex-parser@2.3.0: {} @@ -17879,7 +18248,7 @@ snapshots: spdy-transport@3.0.0: dependencies: - debug: 4.3.4 + debug: 4.3.5 detect-node: 2.1.0 hpack.js: 2.1.6 obuf: 1.1.2 @@ -17890,7 +18259,7 @@ snapshots: spdy@4.0.2: dependencies: - debug: 4.3.4 + debug: 4.3.5 handle-thing: 2.0.1 http-deceiver: 1.2.7 select-hose: 2.0.0 @@ -18158,7 +18527,7 @@ snapshots: typical: 5.2.0 wordwrapjs: 4.0.1 - tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)): + tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -18177,7 +18546,7 @@ snapshots: postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2)) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5)) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.1.0 resolve: 1.22.8 @@ -18326,6 +18695,10 @@ snapshots: dependencies: typescript: 5.2.2 + ts-api-utils@1.3.0(typescript@5.4.5): + dependencies: + typescript: 5.4.5 + ts-command-line-args@2.5.1: dependencies: chalk: 4.1.2 @@ -18333,13 +18706,13 @@ snapshots: command-line-usage: 6.1.3 string-format: 2.0.0 - ts-essentials@7.0.3(typescript@5.2.2): + ts-essentials@7.0.3(typescript@5.4.5): dependencies: - typescript: 5.2.2 + typescript: 5.4.5 ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@20.11.30)(typescript@5.2.2): + ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 @@ -18353,15 +18726,34 @@ snapshots: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.2.2 + typescript: 5.4.5 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + optional: true - ts-unused-exports@10.1.0(typescript@5.2.2): + ts-node@10.9.2(@types/node@20.14.2)(typescript@5.4.5): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.14.2 + acorn: 8.11.3 + acorn-walk: 8.3.2 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.4.5 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + + ts-unused-exports@10.1.0(typescript@5.4.5): dependencies: chalk: 4.1.2 tsconfig-paths: 3.15.0 - typescript: 5.2.2 + typescript: 5.4.5 tsconfig-paths@3.15.0: dependencies: @@ -18374,10 +18766,10 @@ snapshots: tslib@2.6.2: {} - tsutils@3.21.0(typescript@5.2.2): + tsutils@3.21.0(typescript@5.4.5): dependencies: tslib: 1.14.1 - typescript: 5.2.2 + typescript: 5.4.5 tty-table@4.2.3: dependencies: @@ -18420,7 +18812,7 @@ snapshots: media-typer: 0.3.0 mime-types: 2.1.35 - typechain@8.3.2(typescript@5.2.2): + typechain@8.3.2(typescript@5.4.5): dependencies: '@types/prettier': 2.7.3 debug: 4.3.4 @@ -18431,8 +18823,8 @@ snapshots: mkdirp: 1.0.4 prettier: 2.8.8 ts-command-line-args: 2.5.1 - ts-essentials: 7.0.3(typescript@5.2.2) - typescript: 5.2.2 + ts-essentials: 7.0.3(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color @@ -18474,30 +18866,32 @@ snapshots: typedarray@0.0.6: {} - typedoc-plugin-coverage@2.2.0(typedoc@0.25.13(typescript@5.2.2)): + typedoc-plugin-coverage@2.2.0(typedoc@0.25.13(typescript@5.4.5)): dependencies: - typedoc: 0.25.13(typescript@5.2.2) + typedoc: 0.25.13(typescript@5.4.5) - typedoc-plugin-missing-exports@2.2.0(typedoc@0.25.13(typescript@5.2.2)): + typedoc-plugin-missing-exports@2.2.0(typedoc@0.25.13(typescript@5.4.5)): dependencies: - typedoc: 0.25.13(typescript@5.2.2) + typedoc: 0.25.13(typescript@5.4.5) - typedoc-plugin-zod@1.1.2(typedoc@0.25.13(typescript@5.2.2)): + typedoc-plugin-zod@1.1.2(typedoc@0.25.13(typescript@5.4.5)): dependencies: - typedoc: 0.25.13(typescript@5.2.2) + typedoc: 0.25.13(typescript@5.4.5) - typedoc@0.25.13(typescript@5.2.2): + typedoc@0.25.13(typescript@5.4.5): dependencies: lunr: 2.3.9 marked: 4.3.0 minimatch: 9.0.4 shiki: 0.14.7 - typescript: 5.2.2 + typescript: 5.4.5 typescript@4.9.5: {} typescript@5.2.2: {} + typescript@5.4.5: {} + typical@4.0.0: {} typical@5.2.0: {} @@ -18599,13 +18993,13 @@ snapshots: vary@1.1.2: {} - vite-node@1.6.0(@types/node@20.11.30)(terser@5.31.0): + vite-node@1.6.0(@types/node@20.14.2)(terser@5.31.0): dependencies: cac: 6.7.14 debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.2.11(@types/node@20.11.30)(terser@5.31.0) + vite: 5.2.11(@types/node@20.14.2)(terser@5.31.0) transitivePeerDependencies: - '@types/node' - less @@ -18616,17 +19010,17 @@ snapshots: - supports-color - terser - vite@5.2.11(@types/node@20.11.30)(terser@5.31.0): + vite@5.2.11(@types/node@20.14.2)(terser@5.31.0): dependencies: esbuild: 0.20.2 postcss: 8.4.38 rollup: 4.18.0 optionalDependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 fsevents: 2.3.3 terser: 5.31.0 - vitest@1.6.0(@types/node@20.11.30)(jsdom@16.7.0)(terser@5.31.0): + vitest@1.6.0(@types/node@20.14.2)(jsdom@16.7.0)(terser@5.31.0): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -18645,11 +19039,11 @@ snapshots: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.2.11(@types/node@20.11.30)(terser@5.31.0) - vite-node: 1.6.0(@types/node@20.11.30)(terser@5.31.0) + vite: 5.2.11(@types/node@20.14.2)(terser@5.31.0) + vite-node: 1.6.0(@types/node@20.14.2)(terser@5.31.0) why-is-node-running: 2.2.2 optionalDependencies: - '@types/node': 20.11.30 + '@types/node': 20.14.2 jsdom: 16.7.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - less @@ -19253,7 +19647,7 @@ snapshots: yup@0.32.11: dependencies: - '@babel/runtime': 7.24.6 + '@babel/runtime': 7.24.7 '@types/lodash': 4.17.4 lodash: 4.17.21 lodash-es: 4.17.21 From da018f266bba5a8ec94e3c420a46187d20e2873e Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 31 May 2024 08:52:39 -0400 Subject: [PATCH 24/75] Change getOrCreateSiweMessage to getOrCreateWalletSignature for EIP4361 to be more accurate and in line with EIP712 auth signature call. This can perhaps be an interface/base class method in the future. Run linter. --- packages/taco-auth/src/eip4361.ts | 2 +- packages/taco-auth/test/taco-auth.test.ts | 2 +- packages/taco/src/conditions/context/context.ts | 2 +- packages/taco/test/conditions/context.test.ts | 15 ++++++++------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 7d3d89c0b..a32a4dc4e 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -16,7 +16,7 @@ export class EIP4361SignatureProvider { this.storage = new LocalStorage(); } - public async getOrCreateSiweMessage(): Promise { + public async getOrCreateWalletSignature(): Promise { const address = await this.signer.getAddress(); const storageKey = `eth-signin-message-${address}`; diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index a584b843f..e9b4a19cb 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -53,7 +53,7 @@ describe('taco authorization', () => { const signer = fakeSigner(bobSecretKeyBytes); const eip4361Provider = new EIP4361SignatureProvider(provider, signer); - const typedSignature = await eip4361Provider.getOrCreateSiweMessage(); + const typedSignature = await eip4361Provider.getOrCreateWalletSignature(); // Expected format: // { diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index d927b0279..9b26146ab 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -161,7 +161,7 @@ export class ConditionContext { throw new Error(ERR_SIGNER_REQUIRED(USER_ADDRESS_PARAM_EIP4361)); } parameters[USER_ADDRESS_PARAM_EIP4361] = - await this.eip4361SignatureProvider.getOrCreateSiweMessage(); + await this.eip4361SignatureProvider.getOrCreateWalletSignature(); // Remove from requested parameters requestedParameters.delete(USER_ADDRESS_PARAM_EIP4361); } diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 3f13eead7..982c6b160 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -396,7 +396,9 @@ describe('authentication provider', () => { const builtContext = conditionExpr.buildContext(provider, {}, signer); const resolvedContextRecords = await builtContext.toObj(); - const typedSignature = resolvedContextRecords[USER_ADDRESS_PARAM_EIP712] as AuthSignature; + const typedSignature = resolvedContextRecords[ + USER_ADDRESS_PARAM_EIP712 + ] as AuthSignature; expect(typedSignature).toBeDefined(); expect(typedSignature.signature).toBeDefined(); expect(typedSignature.scheme).toEqual('EIP712'); @@ -404,16 +406,14 @@ describe('authentication provider', () => { const typedData = typedSignature.typedData as FormattedEIP712; expect(typedData.domain.name).toEqual('TACo'); - expect(typedData.message.address).toEqual( - await signer.getAddress(), - ); + expect(typedData.message.address).toEqual(await signer.getAddress()); expect(eip712Spy).toHaveBeenCalledOnce(); }); it('supports eip4361', async () => { const eip4361Spy = vi.spyOn( EIP4361SignatureProvider.prototype, - 'getOrCreateSiweMessage', + 'getOrCreateWalletSignature', ); const conditionObj = { ...testContractConditionObj, @@ -429,8 +429,9 @@ describe('authentication provider', () => { const builtContext = conditionExpr.buildContext(provider, {}, signer); const resolvedContextRecords = await builtContext.toObj(); - const typedSignature: ContextParam = - resolvedContextRecords[USER_ADDRESS_PARAM_EIP4361] as AuthSignature; + const typedSignature: ContextParam = resolvedContextRecords[ + USER_ADDRESS_PARAM_EIP4361 + ] as AuthSignature; expect(typedSignature).toBeDefined(); expect(typedSignature.signature).toBeDefined(); expect(typedSignature.scheme).toEqual('EIP4361'); From d2b2c80286e61b43725f4cb4f7ff262f5dc7f0cd Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Fri, 31 May 2024 15:19:52 +0200 Subject: [PATCH 25/75] set domain and uri in eip4361 dynamically --- packages/taco-auth/src/eip4361.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index a32a4dc4e..177831664 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -34,10 +34,10 @@ export class EIP4361SignatureProvider { private async createSiweMessage(): Promise { const address = await this.signer.getAddress(); - const domain = 'TACo'; + const domain = (window?.location?.origin || '').split('//')[1].split('.')[0]; const version = '1'; const nonce = generateNonce(); - const uri = 'https://TACo'; + const uri = window?.location?.origin || ''; const chainId = (await this.provider.getNetwork()).chainId; const siweMessage = new SiweMessage({ domain, From 49aa0b265800e206f9cafddb09f14d0996771b55 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 31 May 2024 09:51:23 -0400 Subject: [PATCH 26/75] Update statement to include a mention of "TACo". --- packages/taco-auth/src/eip4361.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index 177831664..d8da3f550 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -42,7 +42,7 @@ export class EIP4361SignatureProvider { const siweMessage = new SiweMessage({ domain, address, - statement: `${domain} wants you to sign in with your Ethereum account: ${address}`, + statement: `TACo wants you to verify ownership of Ethereum account: ${address}`, uri, version, nonce, From 246786e12bfbc2fd9696c2806682fe1fd95576a1 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 4 Jun 2024 14:12:54 +0200 Subject: [PATCH 27/75] fix siwe tests --- packages/taco-auth/src/eip4361.ts | 23 +++++++++++++++---- packages/taco-auth/test/taco-auth.test.ts | 5 ++-- packages/taco/test/conditions/context.test.ts | 4 ++-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/eip4361.ts index d8da3f550..2dfc2ba97 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/eip4361.ts @@ -34,25 +34,38 @@ export class EIP4361SignatureProvider { private async createSiweMessage(): Promise { const address = await this.signer.getAddress(); - const domain = (window?.location?.origin || '').split('//')[1].split('.')[0]; + const { domain, uri } = this.getParametersOrDefault(); const version = '1'; const nonce = generateNonce(); - const uri = window?.location?.origin || ''; const chainId = (await this.provider.getNetwork()).chainId; const siweMessage = new SiweMessage({ domain, address, - statement: `TACo wants you to verify ownership of Ethereum account: ${address}`, + statement: `${domain} wants you to sign in with your Ethereum account: ${address}`, uri, version, nonce, chainId, }); - const scheme = 'EIP4361'; const message = siweMessage.prepareMessage(); const signature = await this.signer.signMessage(message); - return { signature, address, scheme, typedData: message }; } + + private getParametersOrDefault() { + // If we are in a browser environment, we can get the domain and uri from the window object + if (typeof window !== 'undefined') { + const maybeOrigin = window?.location?.origin; + return { + domain: maybeOrigin.split('//')[1].split('.')[0], + uri: maybeOrigin, + }; + } + // TODO: Add a facility to manage this case + return { + domain: 'localhost', + uri: 'http://localhost:3000', + }; + } } diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index e9b4a19cb..df28c9367 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -67,13 +67,12 @@ describe('taco authorization', () => { expect(typedSignature.address).toEqual(await signer.getAddress()); expect(typedSignature.scheme).toEqual('EIP4361'); - console.log(typedSignature.typedData); const typedDataSiweMessage = new SiweMessage(`${typedSignature.typedData}`); expect(typedDataSiweMessage).toBeDefined(); - expect(typedDataSiweMessage.domain).toEqual('TACo'); + expect(typedDataSiweMessage.domain).toEqual('localhost'); expect(typedDataSiweMessage.version).toEqual('1'); expect(typedDataSiweMessage.nonce).toBeDefined(); // random - expect(typedDataSiweMessage.uri).toEqual('https://TACo'); + expect(typedDataSiweMessage.uri).toEqual('http://localhost:3000'); expect(typedDataSiweMessage.chainId).toEqual( (await provider.getNetwork()).chainId, ); diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 982c6b160..2c8d58807 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -440,9 +440,9 @@ describe('authentication provider', () => { expect(typedSignature.address).toEqual(signerAddress); expect(typedSignature.typedData).toContain( - `TACo wants you to sign in with your Ethereum account:\n${signerAddress}`, + `localhost wants you to sign in with your Ethereum account:\n${signerAddress}`, ); - expect(typedSignature.typedData).toContain('URI: https://TACo'); + expect(typedSignature.typedData).toContain('URI: http://localhost:3000'); const chainId = (await provider.getNetwork()).chainId; expect(typedSignature.typedData).toContain(`Chain ID: ${chainId}`); From 63306a6973031d0163db20d79f774526225b6a35 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 4 Jun 2024 15:17:50 +0200 Subject: [PATCH 28/75] deduplicate test methods --- packages/taco/test/conditions/context.test.ts | 101 ++++++------------ 1 file changed, 31 insertions(+), 70 deletions(-) diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 2c8d58807..1ad5eda41 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -23,7 +23,6 @@ import { USER_ADDRESS_PARAM_EIP712, } from '../../src/conditions/const'; import { CustomContextParam } from '../../src/conditions/context'; -import { ContextParam } from '../../src/conditions/context/context'; import { paramOrContextParamSchema, ReturnValueTestProps, @@ -341,73 +340,51 @@ describe('authentication provider', () => { ).not.toThrow(); }); - // TODO: Consider rewriting those tests to be a bit more comprehensive and deduplicate them - - it('supports default auth method (eip712)', async () => { - const eip712Spy = vi.spyOn( - EIP712SignatureProvider.prototype, - 'getOrCreateWalletSignature', - ); + async function makeAuthSignature(authMethod: string) { const conditionObj = { ...testContractConditionObj, returnValueTest: { ...testReturnValueTest, - value: USER_ADDRESS_PARAM_DEFAULT, + value: authMethod, }, }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresSigner()).toBe(true); - const builtContext = conditionExpr.buildContext(provider, {}, signer); + const builtContext = conditionExpr.buildContext(provider, {}, signer); const contextVars = await builtContext.toObj(); + const authSignature = contextVars[authMethod] as AuthSignature; + expect(authSignature).toBeDefined(); - const typedSignature = contextVars[ - USER_ADDRESS_PARAM_DEFAULT - ] as AuthSignature; - expect(typedSignature).toBeDefined(); - expect(typedSignature.signature).toBeDefined(); - expect(typedSignature.scheme).toEqual('EIP712'); - expect(typedSignature.address).toEqual(await signer.getAddress()); + return authSignature; + } - const typedData = typedSignature.typedData as FormattedEIP712; - expect(typedData).toBeDefined(); - expect(typedData.domain.name).toEqual('TACo'); - expect(typedData.message.address).toEqual(await signer.getAddress()); - expect(eip712Spy).toHaveBeenCalledOnce(); - }); - - it('supports eip712', async () => { + async function testEIP712AuthMethod(authMethod: string) { const eip712Spy = vi.spyOn( EIP712SignatureProvider.prototype, 'getOrCreateWalletSignature', ); - const conditionObj = { - ...testContractConditionObj, - returnValueTest: { - ...testReturnValueTest, - value: USER_ADDRESS_PARAM_EIP712, - }, - }; - const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); - - const builtContext = conditionExpr.buildContext(provider, {}, signer); - const resolvedContextRecords = await builtContext.toObj(); - const typedSignature = resolvedContextRecords[ - USER_ADDRESS_PARAM_EIP712 - ] as AuthSignature; - expect(typedSignature).toBeDefined(); - expect(typedSignature.signature).toBeDefined(); - expect(typedSignature.scheme).toEqual('EIP712'); - expect(typedSignature.address).toEqual(await signer.getAddress()); + const authSignature = await makeAuthSignature(authMethod); + expect(authSignature).toBeDefined(); + expect(authSignature.signature).toBeDefined(); + expect(authSignature.scheme).toEqual('EIP712'); + expect(authSignature.address).toEqual(await signer.getAddress()); - const typedData = typedSignature.typedData as FormattedEIP712; + const typedData = authSignature.typedData as FormattedEIP712; + expect(typedData).toBeDefined(); expect(typedData.domain.name).toEqual('TACo'); expect(typedData.message.address).toEqual(await signer.getAddress()); expect(eip712Spy).toHaveBeenCalledOnce(); + } + + it('supports default auth method (eip712)', async () => { + await testEIP712AuthMethod(USER_ADDRESS_PARAM_DEFAULT); + }); + + it('supports eip712', async () => { + await testEIP712AuthMethod(USER_ADDRESS_PARAM_EIP712); }); it('supports eip4361', async () => { @@ -415,37 +392,21 @@ describe('authentication provider', () => { EIP4361SignatureProvider.prototype, 'getOrCreateWalletSignature', ); - const conditionObj = { - ...testContractConditionObj, - returnValueTest: { - ...testReturnValueTest, - value: USER_ADDRESS_PARAM_EIP4361, - }, - }; - const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); - - const builtContext = conditionExpr.buildContext(provider, {}, signer); - const resolvedContextRecords = await builtContext.toObj(); - - const typedSignature: ContextParam = resolvedContextRecords[ - USER_ADDRESS_PARAM_EIP4361 - ] as AuthSignature; - expect(typedSignature).toBeDefined(); - expect(typedSignature.signature).toBeDefined(); - expect(typedSignature.scheme).toEqual('EIP4361'); + const authSignature = await makeAuthSignature(USER_ADDRESS_PARAM_EIP4361); + expect(authSignature).toBeDefined(); + expect(authSignature.signature).toBeDefined(); + expect(authSignature.scheme).toEqual('EIP4361'); const signerAddress = await signer.getAddress(); - expect(typedSignature.address).toEqual(signerAddress); + expect(authSignature.address).toEqual(signerAddress); - expect(typedSignature.typedData).toContain( + expect(authSignature.typedData).toContain( `localhost wants you to sign in with your Ethereum account:\n${signerAddress}`, ); - expect(typedSignature.typedData).toContain('URI: http://localhost:3000'); + expect(authSignature.typedData).toContain('URI: http://localhost:3000'); const chainId = (await provider.getNetwork()).chainId; - expect(typedSignature.typedData).toContain(`Chain ID: ${chainId}`); + expect(authSignature.typedData).toContain(`Chain ID: ${chainId}`); expect(eip4361Spy).toHaveBeenCalledOnce(); }); From 120c0d905868692215835377a1fccd474b393486 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Thu, 13 Jun 2024 13:09:14 +0200 Subject: [PATCH 29/75] refactor(auth-provider): first pass at refactoring taco-auth to support generic auth-provider --- examples/taco/nodejs/src/index.ts | 4 +- examples/taco/webpack-5/src/index.ts | 4 +- packages/taco-auth/src/helper.ts | 12 ++ packages/taco-auth/src/index.ts | 1 + packages/taco-auth/src/types.ts | 29 +++- packages/taco/examples/conditions.ts | 19 +-- packages/taco/examples/context.ts | 2 +- .../taco/src/conditions/condition-expr.ts | 11 +- packages/taco/src/conditions/condition.ts | 6 +- packages/taco/src/conditions/const.ts | 11 +- .../taco/src/conditions/context/context.ts | 132 ++++++------------ .../taco/src/conditions/predefined/erc20.ts | 4 +- .../taco/src/conditions/predefined/erc721.ts | 4 +- packages/taco/src/conditions/shared.ts | 10 +- packages/taco/src/taco.ts | 8 +- packages/taco/src/tdec.ts | 11 +- .../test/conditions/base/contract.test.ts | 6 +- .../test/conditions/condition-expr.test.ts | 2 +- .../taco/test/conditions/conditions.test.ts | 6 +- packages/taco/test/conditions/context.test.ts | 74 +++++----- .../test/conditions/predefined/erc721.test.ts | 2 +- packages/test-utils/package.json | 1 + packages/test-utils/src/utils.ts | 3 + packages/test-utils/tsconfig.json | 3 + pnpm-lock.yaml | 3 + 25 files changed, 194 insertions(+), 174 deletions(-) create mode 100644 packages/taco-auth/src/helper.ts diff --git a/examples/taco/nodejs/src/index.ts b/examples/taco/nodejs/src/index.ts index 42d453f1c..60e8cac85 100644 --- a/examples/taco/nodejs/src/index.ts +++ b/examples/taco/nodejs/src/index.ts @@ -59,8 +59,8 @@ const encryptToBytes = async (messageString: string) => { }, }); console.assert( - hasPositiveBalance.requiresSigner(), - 'Condition requires signer', + hasPositiveBalance.requiresAuthentication(), + 'Condition requires authentication', ); const messageKit = await encrypt( diff --git a/examples/taco/webpack-5/src/index.ts b/examples/taco/webpack-5/src/index.ts index e7a80ebfa..2cfd040d2 100644 --- a/examples/taco/webpack-5/src/index.ts +++ b/examples/taco/webpack-5/src/index.ts @@ -47,8 +47,8 @@ const runExample = async () => { }, }); console.assert( - hasPositiveBalance.requiresSigner(), - 'Condition requires signer', + hasPositiveBalance.requiresAuthentication(), + 'Condition requires authentication', ); const messageKit = await encrypt( provider, diff --git a/packages/taco-auth/src/helper.ts b/packages/taco-auth/src/helper.ts new file mode 100644 index 000000000..87c47dda9 --- /dev/null +++ b/packages/taco-auth/src/helper.ts @@ -0,0 +1,12 @@ +import {ethers} from "ethers"; + +import { EIP4361SignatureProvider } from './eip4361'; +import { EIP712SignatureProvider } from './eip712'; +import { AuthProviders, EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './types'; + +export const makeAuthProviders = (provider: ethers.providers.Provider, signer?: ethers.Signer): AuthProviders => { + return { + [EIP712_AUTH_METHOD]: signer ? new EIP712SignatureProvider(provider, signer) : undefined, + [EIP4361_AUTH_METHOD]: signer ? new EIP4361SignatureProvider(provider, signer) : undefined + } as AuthProviders; +}; diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts index 0372f3939..adf9a4f68 100644 --- a/packages/taco-auth/src/index.ts +++ b/packages/taco-auth/src/index.ts @@ -1,3 +1,4 @@ export * from './eip4361'; export * from './eip712'; export * from './types'; +export * from './helper'; diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/types.ts index fa3a826bb..6d8393321 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/types.ts @@ -1,5 +1,17 @@ -import { FormattedEIP4361 } from './eip4361'; -import { FormattedEIP712 } from './eip712'; +import {EIP4361SignatureProvider, FormattedEIP4361} from './eip4361'; +import {EIP712SignatureProvider, FormattedEIP712} from './eip712'; + +// TODO: Use a generic AuthProvider interface +export type EIP712AuthProvider = EIP712SignatureProvider; +export type EIP4361AuthProvider = EIP4361SignatureProvider; + +export type AuthProvider = EIP712AuthProvider | EIP4361AuthProvider; + +export type AuthProviders = { + [EIP712_AUTH_METHOD]?: EIP712AuthProvider; + [EIP4361_AUTH_METHOD]?: EIP4361AuthProvider; + [key: string]: AuthProvider | undefined; +}; export interface AuthSignature { signature: string; @@ -7,3 +19,16 @@ export interface AuthSignature { scheme: 'EIP712' | 'EIP4361'; typedData: FormattedEIP712 | FormattedEIP4361; } + +export const EIP712_AUTH_METHOD = 'EIP712'; +export const EIP4361_AUTH_METHOD = 'EIP4361'; + +export const USER_ADDRESS_PARAM_DEFAULT = ':userAddress'; +export const USER_ADDRESS_PARAM_EIP712 = `:userAddress${EIP712_AUTH_METHOD}`; +export const USER_ADDRESS_PARAM_EIP4361 = `:userAddress${EIP4361_AUTH_METHOD}`; + +export const AUTH_METHOD_FOR_PARAM: Record = { + [USER_ADDRESS_PARAM_DEFAULT]: EIP712_AUTH_METHOD, + [USER_ADDRESS_PARAM_EIP712]: EIP712_AUTH_METHOD, + [USER_ADDRESS_PARAM_EIP4361]: EIP4361_AUTH_METHOD, +}; diff --git a/packages/taco/examples/conditions.ts b/packages/taco/examples/conditions.ts index f1f54ccda..6e860160e 100644 --- a/packages/taco/examples/conditions.ts +++ b/packages/taco/examples/conditions.ts @@ -1,4 +1,5 @@ import { ChainId } from '@nucypher/shared'; + import { conditions } from '../src'; const ownsNFT = new conditions.predefined.erc721.ERC721Ownership({ @@ -6,7 +7,7 @@ const ownsNFT = new conditions.predefined.erc721.ERC721Ownership({ parameters: [3591], chain: ChainId.SEPOLIA, }); -console.assert(ownsNFT.requiresSigner(), 'ERC721Ownership requires signer'); +console.assert(ownsNFT.requiresAuthentication(), 'ERC721Ownership requires authentication'); const hasAtLeastTwoNFTs = new conditions.predefined.erc721.ERC721Balance({ contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77', @@ -17,8 +18,8 @@ const hasAtLeastTwoNFTs = new conditions.predefined.erc721.ERC721Balance({ }, }); console.assert( - hasAtLeastTwoNFTs.requiresSigner(), - 'ERC721Balance requires signer', + hasAtLeastTwoNFTs.requiresAuthentication(), + 'ERC721Balance requires authentication', ); const ownsNFTRaw = new conditions.base.contract.ContractCondition({ @@ -35,7 +36,7 @@ const ownsNFTRaw = new conditions.base.contract.ContractCondition({ }, }); console.assert( - ownsNFTRaw.requiresSigner(), + ownsNFTRaw.requiresAuthentication(), 'ContractCondition requires a signer', ); @@ -49,8 +50,8 @@ const hasAnyNativeAsset = new conditions.base.rpc.RpcCondition({ }, }); console.assert( - hasAnyNativeAsset.requiresSigner(), - 'RpcCondition requires signer', + hasAnyNativeAsset.requiresAuthentication(), + 'RpcCondition requires authentication', ); const ownsNFTOnChain5 = new conditions.predefined.erc721.ERC721Ownership({ @@ -75,8 +76,8 @@ const multichainCondition = conditions.compound.CompoundCondition.and([ ]); console.assert( - multichainCondition.requiresSigner(), - 'CompoundCondition requires signer', + multichainCondition.requiresAuthentication(), + 'CompoundCondition requires authentication', ); const myFunctionAbi: conditions.base.contract.FunctionAbiProps = { @@ -117,6 +118,6 @@ const myContractCallCondition = new conditions.base.contract.ContractCondition({ }); console.assert( - !myContractCallCondition.requiresSigner(), + !myContractCallCondition.requiresAuthentication(), 'ContractCondition does not require a signer', ); diff --git a/packages/taco/examples/context.ts b/packages/taco/examples/context.ts index 583d0346d..f9495467e 100644 --- a/packages/taco/examples/context.ts +++ b/packages/taco/examples/context.ts @@ -14,7 +14,7 @@ const ownsNFTRaw = new conditions.base.contract.ContractCondition({ }, }); console.assert( - ownsNFTRaw.requiresSigner(), + ownsNFTRaw.requiresAuthentication(), 'ContractCondition requires a signer', ); diff --git a/packages/taco/src/conditions/condition-expr.ts b/packages/taco/src/conditions/condition-expr.ts index 7b290008c..0616cab31 100644 --- a/packages/taco/src/conditions/condition-expr.ts +++ b/packages/taco/src/conditions/condition-expr.ts @@ -1,11 +1,12 @@ import { Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { toJSON } from '@nucypher/shared'; +import {AuthProviders} from "@nucypher/taco-auth"; import { ethers } from 'ethers'; import { SemVer } from 'semver'; import { Condition } from './condition'; import { ConditionFactory } from './condition-factory'; -import { ConditionContext, CustomContextParam } from './context'; +import { ConditionContext, CustomContextParam} from './context'; const ERR_VERSION = (provided: string, current: string) => `Version provided, ${provided}, is incompatible with current version, ${current}`; @@ -67,18 +68,18 @@ export class ConditionExpression { public buildContext( provider: ethers.providers.Provider, customParameters: Record = {}, - signer?: ethers.Signer, + authProviders: AuthProviders = {}, ): ConditionContext { return new ConditionContext( provider, this.condition, customParameters, - signer, + authProviders, ); } - public contextRequiresSigner(): boolean { - return this.condition.requiresSigner(); + public contextRequiresAuthentication(): boolean { + return this.condition.requiresAuthentication(); } public equals(other: ConditionExpression): boolean { diff --git a/packages/taco/src/conditions/condition.ts b/packages/taco/src/conditions/condition.ts index 607bd0681..93cbba25b 100644 --- a/packages/taco/src/conditions/condition.ts +++ b/packages/taco/src/conditions/condition.ts @@ -36,7 +36,7 @@ export class Condition { } // TODO: Fix this method and add a test for it - public findParamWithSigner(): string | null { + public findParamWithAuthentication(): string | null { const serialized = JSON.stringify(this.value); for (const param of USER_ADDRESS_PARAMS) { if (serialized.includes(param)) { @@ -46,8 +46,8 @@ export class Condition { return null; } - public requiresSigner(): boolean { - return Boolean(this.findParamWithSigner()); + public requiresAuthentication(): boolean { + return Boolean(this.findParamWithAuthentication()); } public toObj() { diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 44b3dbdb9..01357b76c 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -1,8 +1,9 @@ -import { ChainId } from '@nucypher/shared'; - -export const USER_ADDRESS_PARAM_DEFAULT = ':userAddress'; -export const USER_ADDRESS_PARAM_EIP712 = ':userAddressEIP712'; -export const USER_ADDRESS_PARAM_EIP4361 = ':userAddressEIP4361'; +import {ChainId} from '@nucypher/shared'; +import { + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EIP4361, + USER_ADDRESS_PARAM_EIP712 +} from "@nucypher/taco-auth"; export const ETH_ADDRESS_REGEXP = new RegExp('^0x[a-fA-F0-9]{40}$'); diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 9b26146ab..b0b4ae936 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,10 +1,10 @@ import { Context, Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { fromJSON, toJSON } from '@nucypher/shared'; import { + AuthProviders, AuthSignature, - EIP4361SignatureProvider, - EIP712SignatureProvider, } from '@nucypher/taco-auth'; +import {AUTH_METHOD_FOR_PARAM} from "@nucypher/taco-auth"; import { ethers } from 'ethers'; import { CompoundConditionType } from '../compound-condition'; @@ -14,9 +14,6 @@ import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS, - USER_ADDRESS_PARAM_DEFAULT, - USER_ADDRESS_PARAM_EIP4361, - USER_ADDRESS_PARAM_EIP712, } from '../const'; export type CustomContextParam = string | number | boolean; @@ -26,38 +23,26 @@ const ERR_RESERVED_PARAM = (key: string) => `Cannot use reserved parameter name ${key} as custom parameter`; const ERR_INVALID_CUSTOM_PARAM = (key: string) => `Custom parameter ${key} must start with ${CONTEXT_PARAM_PREFIX}`; -const ERR_SIGNER_REQUIRED = (key: string) => - `Signer required to satisfy ${key} context variable in condition`; +const ERR_AUTH_PROVIDER_REQUIRED = (key: string) => + `Authentication provider required to satisfy ${key} context variable in condition`; const ERR_MISSING_CONTEXT_PARAMS = (params: string[]) => `Missing custom context parameter(s): ${params.join(', ')}`; const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => `Unknown custom context parameter(s): ${params.join(', ')}`; export class ConditionContext { - private readonly eip712SignatureProvider?: EIP712SignatureProvider; - private readonly eip4361SignatureProvider?: EIP4361SignatureProvider; constructor( private readonly provider: ethers.providers.Provider, private readonly condition: Condition, public readonly customParameters: Record = {}, - private readonly signer?: ethers.Signer, + private readonly authProviders: AuthProviders = {}, ) { - if (this.signer) { - this.eip712SignatureProvider = new EIP712SignatureProvider( - this.provider, - this.signer, - ); - - this.eip4361SignatureProvider = new EIP4361SignatureProvider( - this.provider, - this.signer, - ); - } - this.validate(); + this.validateAuthProviders(this.findRequestedParameters(this.condition.toObj())); + this.validateParameters(); } - private validate(): void { + private validateParameters(): void { Object.keys(this.customParameters).forEach((key) => { if (RESERVED_CONTEXT_PARAMS.includes(key)) { throw new Error(ERR_RESERVED_PARAM(key)); @@ -67,9 +52,9 @@ export class ConditionContext { } }); - const requiredParam = this.condition.findParamWithSigner(); - if (requiredParam && !this.signer) { - throw new Error(ERR_SIGNER_REQUIRED(requiredParam)); + const requiredParam = this.condition.findParamWithAuthentication(); + if (requiredParam && !this.authProviders) { + throw new Error(ERR_AUTH_PROVIDER_REQUIRED(requiredParam)); } } @@ -102,77 +87,42 @@ export class ConditionContext { return parameters; }; - // today - // :user_address -> (:user_address, eip712) - - // in future - // :user_address -> (:user_address, schema: eip712) - // :user_address_eip712 -> (:user_address, schema: eip712) - // :user_address_eip4361 -> (:user_address, schema: eip4361) - - // HasNFTBalance({ - // balanceOf(":user_address") > 10 - // }) - - // HasNFTBalance({ - // balanceOf(":user_address_eip712") > 10 - // }) - - // HasNFTBalance({ - // balanceOf(":user_address_eip4361") > 10 - // }) - private async fillContextParameters( requestedParameters: Set, ): Promise> { - // Now, we can safely add all the parameters - const parameters: Record = {}; - - // Fill in predefined context parameters - - // TODO: Figure out if we can simplify/deduplicate this logic for every - // authentication method we use - - // Handle legacy EIP712 signature denoted by ":userAddress" - if (requestedParameters.has(USER_ADDRESS_PARAM_DEFAULT)) { - if (!this.eip712SignatureProvider) { - throw new Error(ERR_SIGNER_REQUIRED(USER_ADDRESS_PARAM_EIP712)); - } - parameters[USER_ADDRESS_PARAM_DEFAULT] = - await this.eip712SignatureProvider.getOrCreateWalletSignature(); - // Remove from requested parameters - requestedParameters.delete(USER_ADDRESS_PARAM_DEFAULT); - } - - // Handle a new alias for EIP712, ":userAddressEIP712" - if (requestedParameters.has(USER_ADDRESS_PARAM_EIP712)) { - if (!this.eip712SignatureProvider) { - throw new Error(ERR_SIGNER_REQUIRED(USER_ADDRESS_PARAM_EIP712)); - } - parameters[USER_ADDRESS_PARAM_EIP712] = - await this.eip712SignatureProvider.getOrCreateWalletSignature(); - // Remove from requested parameters - requestedParameters.delete(USER_ADDRESS_PARAM_EIP712); - } - - // Handle a new method, EIP4361, with a ":userAddressEIP4361" alias - if (requestedParameters.has(USER_ADDRESS_PARAM_EIP4361)) { - if (!this.eip4361SignatureProvider) { - throw new Error(ERR_SIGNER_REQUIRED(USER_ADDRESS_PARAM_EIP4361)); - } - parameters[USER_ADDRESS_PARAM_EIP4361] = - await this.eip4361SignatureProvider.getOrCreateWalletSignature(); - // Remove from requested parameters - requestedParameters.delete(USER_ADDRESS_PARAM_EIP4361); - } - - // Fill in custom parameters + const parameters = await this.fillAuthContextParameters(requestedParameters); for (const key in this.customParameters) { parameters[key] = this.customParameters[key]; } return parameters; } + private validateAuthProviders(requestedParameters: Set): void { + requestedParameters + .forEach(param => { + const maybeAuthMethod = AUTH_METHOD_FOR_PARAM[param]; + if (!maybeAuthMethod) { + return; + } + if (!this.authProviders[maybeAuthMethod]) { + throw new Error(ERR_AUTH_PROVIDER_REQUIRED(param)); + } + }); + } + + private async fillAuthContextParameters(requestedParameters: Set): Promise> { + const entries = await Promise.all([...requestedParameters] + .map(param => [param, AUTH_METHOD_FOR_PARAM[param]]) + .filter(([, authMethod]) => !!authMethod) + .map(async ([param, authMethod]) => { + const maybeAuthProvider = this.authProviders[authMethod]; + // TODO: Throw here instead of validating in the constructor? + // TODO: Hide getOrCreateWalletSignature behind a more generic interface + return [param, await maybeAuthProvider!.getOrCreateWalletSignature()]; + })); + return Object.fromEntries(entries); + } + private isContextParameter(param: unknown): boolean { return !!String(param).match(CONTEXT_PARAM_REGEXP); } @@ -224,7 +174,7 @@ export class ConditionContext { this.provider, this.condition, params, - this.signer, + this.authProviders, ); } @@ -236,14 +186,14 @@ export class ConditionContext { public static fromConditions( provider: ethers.providers.Provider, conditions: WASMConditions, - signer?: ethers.Signer, + authProviders?: AuthProviders, customParameters?: Record, ): ConditionContext { return new ConditionContext( provider, ConditionExpression.fromWASMConditions(conditions).condition, customParameters, - signer, + authProviders, ); } } diff --git a/packages/taco/src/conditions/predefined/erc20.ts b/packages/taco/src/conditions/predefined/erc20.ts index 265d40a30..c2bdc2766 100644 --- a/packages/taco/src/conditions/predefined/erc20.ts +++ b/packages/taco/src/conditions/predefined/erc20.ts @@ -1,9 +1,11 @@ +import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; + import { ContractCondition, ContractConditionProps, ContractConditionType, } from '../base/contract'; -import { USER_ADDRESS_PARAM_DEFAULT } from '../const'; + type ERC20BalanceFields = 'contractAddress' | 'chain' | 'returnValueTest'; diff --git a/packages/taco/src/conditions/predefined/erc721.ts b/packages/taco/src/conditions/predefined/erc721.ts index 407d9e8a7..75a2f85c5 100644 --- a/packages/taco/src/conditions/predefined/erc721.ts +++ b/packages/taco/src/conditions/predefined/erc721.ts @@ -1,9 +1,11 @@ +import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; + import { ContractCondition, ContractConditionProps, ContractConditionType, } from '../base/contract'; -import { USER_ADDRESS_PARAM_DEFAULT } from '../const'; + type ERC721OwnershipFields = 'contractAddress' | 'chain' | 'parameters'; diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 98c61f0b4..720fa5038 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -1,12 +1,16 @@ +import { + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EIP4361, + USER_ADDRESS_PARAM_EIP712 +} from "@nucypher/taco-auth"; import { z } from 'zod'; import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, ETH_ADDRESS_REGEXP, - USER_ADDRESS_PARAM_DEFAULT, - USER_ADDRESS_PARAM_EIP4361, - USER_ADDRESS_PARAM_EIP712, + + } from './const'; export const contextParamSchema = z.string().regex(CONTEXT_PARAM_REGEXP); diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index 308a58792..cd8fc6656 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -13,12 +13,13 @@ import { GlobalAllowListAgent, toBytes, } from '@nucypher/shared'; +import { makeAuthProviders } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { keccak256 } from 'ethers/lib/utils'; import { Condition } from './conditions/condition'; import { ConditionExpression } from './conditions/condition-expr'; -import { CustomContextParam } from './conditions/context'; +import { CustomContextParam} from './conditions/context'; import { DkgClient } from './dkg'; import { retrieveAndDecrypt } from './tdec'; @@ -153,6 +154,8 @@ export const decrypt = async ( messageKit.acp.publicKey, ); const ritual = await DkgClient.getActiveRitual(provider, domain, ritualId); + // TODO: Temporary helper method to keep the external taco.ts decrypt function simple + const authProviders = makeAuthProviders(provider, signer); return retrieveAndDecrypt( provider, domain, @@ -161,11 +164,12 @@ export const decrypt = async ( ritualId, ritual.sharesNum, ritual.threshold, - signer, + authProviders, customParameters, ); }; + /** * Checks if the encryption from the provided messageKit is authorized for the specified ritual. * diff --git a/packages/taco/src/tdec.ts b/packages/taco/src/tdec.ts index 7ed9546d6..f2ba473b5 100644 --- a/packages/taco/src/tdec.ts +++ b/packages/taco/src/tdec.ts @@ -20,11 +20,12 @@ import { PorterClient, toBytes, } from '@nucypher/shared'; +import {AuthProviders} from "@nucypher/taco-auth"; import { ethers } from 'ethers'; import { arrayify, keccak256 } from 'ethers/lib/utils'; import { ConditionExpression } from './conditions/condition-expr'; -import { ConditionContext, CustomContextParam } from './conditions/context'; +import { ConditionContext, CustomContextParam} from './conditions/context'; const ERR_DECRYPTION_FAILED = (errors: unknown) => `Threshold of responses not met; TACo decryption failed with errors: ${JSON.stringify( @@ -66,7 +67,7 @@ export const retrieveAndDecrypt = async ( ritualId: number, sharesNum: number, threshold: number, - signer?: ethers.Signer, + authProviders?: AuthProviders, customParameters?: Record, ): Promise => { const decryptionShares = await retrieve( @@ -77,7 +78,7 @@ export const retrieveAndDecrypt = async ( ritualId, sharesNum, threshold, - signer, + authProviders, customParameters, ); const sharedSecret = combineDecryptionSharesSimple(decryptionShares); @@ -93,7 +94,7 @@ const retrieve = async ( ritualId: number, sharesNum: number, threshold: number, - signer?: ethers.Signer, + authProviders?: AuthProviders, customParameters?: Record, ): Promise => { const dkgParticipants = await DkgCoordinatorAgent.getParticipants( @@ -105,7 +106,7 @@ const retrieve = async ( const wasmContext = await ConditionContext.fromConditions( provider, thresholdMessageKit.acp.conditions, - signer, + authProviders, customParameters, ).toWASMContext(); const { sharedSecrets, encryptedRequests } = await makeDecryptionRequests( diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index 00e66c39e..23baf7d22 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -1,5 +1,6 @@ import { initialize } from '@nucypher/nucypher-core'; -import { fakeProvider, fakeSigner } from '@nucypher/test-utils'; +import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; +import { fakeAuthProviders, fakeProvider } from '@nucypher/test-utils'; import { beforeAll, describe, expect, it } from 'vitest'; import { @@ -11,7 +12,6 @@ import { } from '../../../src/conditions/base/contract'; import { ConditionExpression } from '../../../src/conditions/condition-expr'; import { - USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAMS, } from '../../../src/conditions/const'; import { CustomContextParam } from '../../../src/conditions/context'; @@ -196,7 +196,7 @@ describe('supports custom function abi', () => { it('accepts custom function abi with a custom parameter', async () => { const asJson = await conditionExpr - .buildContext(fakeProvider(), {}, fakeSigner()) + .buildContext(fakeProvider(), {}, fakeAuthProviders()) .withCustomParams(customParams) .toJson(); diff --git a/packages/taco/test/conditions/condition-expr.test.ts b/packages/taco/test/conditions/condition-expr.test.ts index 90452cb15..4d868d03f 100644 --- a/packages/taco/test/conditions/condition-expr.test.ts +++ b/packages/taco/test/conditions/condition-expr.test.ts @@ -1,5 +1,6 @@ import { initialize } from '@nucypher/nucypher-core'; import { objectEquals, toJSON } from '@nucypher/shared'; +import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; import { TEST_CHAIN_ID, TEST_CONTRACT_ADDR } from '@nucypher/test-utils'; import { SemVer } from 'semver'; import { beforeAll, describe, expect, it } from 'vitest'; @@ -15,7 +16,6 @@ import { } from '../../src/conditions/base/time'; import { CompoundCondition } from '../../src/conditions/compound-condition'; import { ConditionExpression } from '../../src/conditions/condition-expr'; -import { USER_ADDRESS_PARAM_DEFAULT } from '../../src/conditions/const'; import { ERC721Balance } from '../../src/conditions/predefined/erc721'; import { testContractConditionObj, diff --git a/packages/taco/test/conditions/conditions.test.ts b/packages/taco/test/conditions/conditions.test.ts index 55aa7c09a..ac80105dd 100644 --- a/packages/taco/test/conditions/conditions.test.ts +++ b/packages/taco/test/conditions/conditions.test.ts @@ -1,5 +1,5 @@ import { ChainId } from '@nucypher/shared'; -import { fakeProvider, fakeSigner } from '@nucypher/test-utils'; +import { fakeAuthProviders, fakeProvider } from '@nucypher/test-utils'; import { beforeAll, describe, expect, it } from 'vitest'; import { initialize } from '../../src'; @@ -35,13 +35,13 @@ describe('conditions', () => { operands: [hasPositiveBalance, timeIsGreaterThan], }); expect(condition).toBeDefined(); - expect(condition.requiresSigner()).toBeTruthy(); + expect(condition.requiresAuthentication()).toBeTruthy(); const context = new ConditionContext( fakeProvider(), condition, { ':time': 100 }, - fakeSigner(), + fakeAuthProviders(), ); expect(context).toBeDefined(); diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 1ad5eda41..e681f9a19 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -1,11 +1,18 @@ import { initialize } from '@nucypher/nucypher-core'; import { + AuthProviders, AuthSignature, EIP4361SignatureProvider, EIP712SignatureProvider, FormattedEIP712, + makeAuthProviders, } from '@nucypher/taco-auth'; -import { fakeProvider, fakeSigner } from '@nucypher/test-utils'; +import { + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EIP4361, + USER_ADDRESS_PARAM_EIP712 +} from "@nucypher/taco-auth"; +import {fakeAuthProviders, fakeProvider, fakeSigner} from '@nucypher/test-utils'; import { ethers } from 'ethers'; import { beforeAll, describe, expect, it, vi } from 'vitest'; @@ -18,9 +25,6 @@ import { RpcCondition } from '../../src/conditions/base/rpc'; import { ConditionExpression } from '../../src/conditions/condition-expr'; import { RESERVED_CONTEXT_PARAMS, - USER_ADDRESS_PARAM_DEFAULT, - USER_ADDRESS_PARAM_EIP4361, - USER_ADDRESS_PARAM_EIP712, } from '../../src/conditions/const'; import { CustomContextParam } from '../../src/conditions/context'; import { @@ -36,12 +40,12 @@ import { describe('context', () => { let provider: ethers.providers.Provider; - let signer: ethers.Signer; + let authProviders: AuthProviders; beforeAll(async () => { await initialize(); provider = fakeProvider(); - signer = fakeSigner(); + authProviders = fakeAuthProviders(); }); describe('serialization', () => { @@ -56,7 +60,7 @@ describe('context', () => { }); const conditionContext = new ConditionExpression( rpcCondition, - ).buildContext(provider, {}, signer); + ).buildContext(provider, {}, authProviders); const asJson = await conditionContext.toJson(); expect(asJson).toBeDefined(); @@ -78,7 +82,7 @@ describe('context', () => { }; const contractCondition = new ContractCondition(contractConditionObj); const conditionExpr = new ConditionExpression(contractCondition); - const context = conditionExpr.buildContext(provider, {}, signer); + const context = conditionExpr.buildContext(provider, {}, authProviders); describe('custom parameters', () => { it('serializes bytes as hex strings', async () => { @@ -133,7 +137,7 @@ describe('context', () => { ); }); - it('detects when signer is required by parameters', () => { + it('detects when auth provider is required by parameters', () => { const conditionObj = { ...testContractConditionObj, parameters: [USER_ADDRESS_PARAM_DEFAULT], @@ -144,10 +148,10 @@ describe('context', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(conditionExpr.buildContext(provider, {}, signer)).toBeDefined(); + expect(conditionExpr.contextRequiresAuthentication()).toBe(true); + expect(conditionExpr.buildContext(provider, {}, authProviders)).toBeDefined(); expect(() => conditionExpr.buildContext(provider, {})).toThrow( - `Signer required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -164,10 +168,10 @@ describe('context', () => { } as ContractConditionProps; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(conditionExpr.buildContext(provider, {}, signer)).toBeDefined(); + expect(conditionExpr.contextRequiresAuthentication()).toBe(true); + expect(conditionExpr.buildContext(provider, {}, authProviders)).toBeDefined(); expect(() => conditionExpr.buildContext(provider, {})).toThrow( - `Signer required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -177,8 +181,8 @@ describe('context', () => { expect( JSON.stringify(condition.toObj()).includes(USER_ADDRESS_PARAM_DEFAULT), ).toBe(false); - expect(conditionExpr.contextRequiresSigner()).toBe(false); - expect(conditionExpr.buildContext(provider, {}, signer)).toBeDefined(); + expect(conditionExpr.contextRequiresAuthentication()).toBe(false); + expect(conditionExpr.buildContext(provider, {}, authProviders)).toBeDefined(); expect(conditionExpr.buildContext(provider, {})).toBeDefined(); }); @@ -192,9 +196,9 @@ describe('context', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( - `Signer required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -208,9 +212,9 @@ describe('context', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( - `Signer required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -233,7 +237,7 @@ describe('context', () => { }); const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext(provider, {}, signer); + ).buildContext(provider, {}, authProviders); await expect(async () => conditionContext.toObj()).rejects.toThrow( `Missing custom context parameter(s): ${customParamKey}`, @@ -247,7 +251,7 @@ describe('context', () => { }); const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext(provider, {}, signer); + ).buildContext(provider, {}, authProviders); const asObj = await conditionContext.toObj(); expect(asObj).toBeDefined(); @@ -266,7 +270,7 @@ describe('context', () => { customParameters[customParamKey] = falsyParam; const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext(provider, customParameters, signer); + ).buildContext(provider, customParameters, authProviders); const asObj = await conditionContext.toObj(); expect(asObj).toBeDefined(); @@ -282,14 +286,16 @@ describe('context', () => { describe('authentication provider', () => { let provider: ethers.providers.Provider; let signer: ethers.Signer; + let authProviders: AuthProviders; beforeAll(async () => { await initialize(); provider = fakeProvider(); signer = fakeSigner(); + authProviders = makeAuthProviders(provider, signer); }); - it('throws an error if there is no signer', () => { + it('throws an error if there is no auth provider', () => { RESERVED_CONTEXT_PARAMS.forEach((userAddressParam) => { const conditionObj = { ...testContractConditionObj, @@ -300,9 +306,9 @@ describe('authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( - `Signer required to satisfy ${userAddressParam} context variable in condition`, + expect(conditionExpr.contextRequiresAuthentication()).toBe(true); + expect(() => conditionExpr.buildContext(provider, {}, {})).toThrow( + `Authentication provider required to satisfy ${userAddressParam} context variable in condition`, ); }); }); @@ -317,9 +323,9 @@ describe('authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => - conditionExpr.buildContext(provider, {}, signer), + conditionExpr.buildContext(provider, {}, authProviders), ).not.toThrow(); }); @@ -334,9 +340,9 @@ describe('authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => - conditionExpr.buildContext(provider, {}, signer), + conditionExpr.buildContext(provider, {}, authProviders), ).not.toThrow(); }); @@ -350,9 +356,9 @@ describe('authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresSigner()).toBe(true); + expect(conditionExpr.contextRequiresAuthentication()).toBe(true); - const builtContext = conditionExpr.buildContext(provider, {}, signer); + const builtContext = conditionExpr.buildContext(provider, {}, authProviders); const contextVars = await builtContext.toObj(); const authSignature = contextVars[authMethod] as AuthSignature; expect(authSignature).toBeDefined(); diff --git a/packages/taco/test/conditions/predefined/erc721.test.ts b/packages/taco/test/conditions/predefined/erc721.test.ts index 8285a87d3..6038d8f97 100644 --- a/packages/taco/test/conditions/predefined/erc721.test.ts +++ b/packages/taco/test/conditions/predefined/erc721.test.ts @@ -1,8 +1,8 @@ +import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; import { TEST_CHAIN_ID, TEST_CONTRACT_ADDR } from '@nucypher/test-utils'; import { describe, expect, it } from 'vitest'; import { ContractConditionProps } from '../../../src/conditions/base/contract'; -import { USER_ADDRESS_PARAM_DEFAULT } from '../../../src/conditions/const'; import { ERC721Balance, ERC721Ownership, diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index d9af610e6..18c4793af 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -31,6 +31,7 @@ "dependencies": { "@nucypher/nucypher-core": "*", "@nucypher/shared": "workspace:*", + "@nucypher/taco-auth": "workspace:*", "axios": "^1.6.8", "ethers": "^5.7.2", "vitest": "^1.3.1" diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts index 31181f7c2..1b067de18 100644 --- a/packages/test-utils/src/utils.ts +++ b/packages/test-utils/src/utils.ts @@ -39,6 +39,7 @@ import { Ursula, zip, } from '@nucypher/shared'; +import {makeAuthProviders} from "@nucypher/taco-auth"; import axios from 'axios'; import { ethers, providers, Wallet } from 'ethers'; import { expect, SpyInstance, vi } from 'vitest'; @@ -78,6 +79,8 @@ export const fakeSigner = ( } as unknown as ethers.providers.JsonRpcSigner; }; +export const fakeAuthProviders = () => makeAuthProviders(fakeProvider(), fakeSigner()); + export const fakeProvider = ( secretKeyBytes = SecretKey.random().toBEBytes(), blockNumber = 1000, diff --git a/packages/test-utils/tsconfig.json b/packages/test-utils/tsconfig.json index 47bb9e178..d2bb62394 100644 --- a/packages/test-utils/tsconfig.json +++ b/packages/test-utils/tsconfig.json @@ -9,5 +9,8 @@ { "path": "../shared/tsconfig.es.json", }, + { + "path": "../taco-auth/tsconfig.es.json", + } ], } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3cbb39f31..3d109aaf3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -587,6 +587,9 @@ importers: '@nucypher/shared': specifier: workspace:* version: link:../shared + '@nucypher/taco-auth': + specifier: workspace:* + version: link:../taco-auth axios: specifier: ^1.6.8 version: 1.7.2 From c46bb8279e51ad3128da98b24dd0c61800f7c971 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Thu, 13 Jun 2024 14:42:50 +0200 Subject: [PATCH 30/75] refactor(auth-provider): introduce generic auth provider --- packages/taco-auth/src/helper.ts | 8 +++---- packages/taco-auth/src/index.ts | 4 ++-- .../taco-auth/src/{ => providers}/eip4361.ts | 8 +++---- .../taco-auth/src/{ => providers}/eip712.ts | 8 +++---- packages/taco-auth/src/providers/index.ts | 24 +++++++++++++++++++ packages/taco-auth/src/types.ts | 13 +++++----- packages/taco-auth/test/taco-auth.test.ts | 12 +++++----- .../taco/src/conditions/context/context.ts | 4 ++-- packages/taco/test/conditions/context.test.ts | 12 +++++----- 9 files changed, 58 insertions(+), 35 deletions(-) rename packages/taco-auth/src/{ => providers}/eip4361.ts (91%) rename packages/taco-auth/src/{ => providers}/eip712.ts (93%) create mode 100644 packages/taco-auth/src/providers/index.ts diff --git a/packages/taco-auth/src/helper.ts b/packages/taco-auth/src/helper.ts index 87c47dda9..864dd4952 100644 --- a/packages/taco-auth/src/helper.ts +++ b/packages/taco-auth/src/helper.ts @@ -1,12 +1,12 @@ import {ethers} from "ethers"; -import { EIP4361SignatureProvider } from './eip4361'; -import { EIP712SignatureProvider } from './eip712'; +import { EIP4361AuthProvider } from './providers/eip4361'; +import { EIP712AuthProvider } from './providers/eip712'; import { AuthProviders, EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './types'; export const makeAuthProviders = (provider: ethers.providers.Provider, signer?: ethers.Signer): AuthProviders => { return { - [EIP712_AUTH_METHOD]: signer ? new EIP712SignatureProvider(provider, signer) : undefined, - [EIP4361_AUTH_METHOD]: signer ? new EIP4361SignatureProvider(provider, signer) : undefined + [EIP712_AUTH_METHOD]: signer ? new EIP712AuthProvider(provider, signer) : undefined, + [EIP4361_AUTH_METHOD]: signer ? new EIP4361AuthProvider(provider, signer) : undefined } as AuthProviders; }; diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts index adf9a4f68..a9c8e7631 100644 --- a/packages/taco-auth/src/index.ts +++ b/packages/taco-auth/src/index.ts @@ -1,4 +1,4 @@ -export * from './eip4361'; -export * from './eip712'; +export * from './providers/eip4361'; +export * from './providers/eip712'; export * from './types'; export * from './helper'; diff --git a/packages/taco-auth/src/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts similarity index 91% rename from packages/taco-auth/src/eip4361.ts rename to packages/taco-auth/src/providers/eip4361.ts index 2dfc2ba97..446c973bb 100644 --- a/packages/taco-auth/src/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -1,12 +1,12 @@ import { ethers } from 'ethers'; import { generateNonce, SiweMessage } from 'siwe'; -import { LocalStorage } from './storage'; -import { AuthSignature } from './types'; +import { LocalStorage } from '../storage'; +import { AuthSignature } from '../types'; export type FormattedEIP4361 = string; -export class EIP4361SignatureProvider { +export class EIP4361AuthProvider { private readonly storage: LocalStorage; constructor( @@ -16,7 +16,7 @@ export class EIP4361SignatureProvider { this.storage = new LocalStorage(); } - public async getOrCreateWalletSignature(): Promise { + public async getOrCreateAuthSignature(): Promise { const address = await this.signer.getAddress(); const storageKey = `eth-signin-message-${address}`; diff --git a/packages/taco-auth/src/eip712.ts b/packages/taco-auth/src/providers/eip712.ts similarity index 93% rename from packages/taco-auth/src/eip712.ts rename to packages/taco-auth/src/providers/eip712.ts index 3d3a2ccb3..572a6543c 100644 --- a/packages/taco-auth/src/eip712.ts +++ b/packages/taco-auth/src/providers/eip712.ts @@ -2,8 +2,8 @@ import type { TypedDataSigner } from '@ethersproject/abstract-signer'; import { ethers } from 'ethers'; import { utils as ethersUtils } from 'ethers/lib/ethers'; -import { LocalStorage } from './storage'; -import type { AuthSignature } from './types'; +import { LocalStorage } from '../storage'; +import type { AuthProvider, AuthSignature } from '../types'; interface EIP712 { types: { @@ -56,7 +56,7 @@ const EIP712Domain = [ }, ]; -export class EIP712SignatureProvider { +export class EIP712AuthProvider implements AuthProvider { private readonly storage: LocalStorage; constructor( @@ -66,7 +66,7 @@ export class EIP712SignatureProvider { this.storage = new LocalStorage(); } - public async getOrCreateWalletSignature(): Promise { + public async getOrCreateAuthSignature(): Promise { const address = await this.signer.getAddress(); const storageKey = `eip712-signature-${address}`; diff --git a/packages/taco-auth/src/providers/index.ts b/packages/taco-auth/src/providers/index.ts new file mode 100644 index 000000000..984004894 --- /dev/null +++ b/packages/taco-auth/src/providers/index.ts @@ -0,0 +1,24 @@ +import { EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from '../types'; + +import { EIP4361AuthProvider, FormattedEIP4361 } from './eip4361'; +import { EIP712AuthProvider, FormattedEIP712 } from './eip712'; + +export interface AuthSignatureProvider { + getOrCreateAuthSignature(): Promise; +} + +export type AuthProviders = { + [EIP712_AUTH_METHOD]?: EIP712AuthProvider; + [EIP4361_AUTH_METHOD]?: EIP4361AuthProvider; + // Fallback to satisfy type checking + [key: string]: AuthProvider | undefined; +}; + +export interface AuthSignature { + signature: string; + address: string; + scheme: 'EIP712' | 'EIP4361'; + typedData: FormattedEIP712 | FormattedEIP4361; +} + +export type AuthProvider = AuthSignatureProvider; diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/types.ts index 6d8393321..7042376b5 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/types.ts @@ -1,15 +1,14 @@ -import {EIP4361SignatureProvider, FormattedEIP4361} from './eip4361'; -import {EIP712SignatureProvider, FormattedEIP712} from './eip712'; +import {EIP4361AuthProvider, FormattedEIP4361} from './providers/eip4361'; +import {EIP712AuthProvider, FormattedEIP712} from './providers/eip712'; -// TODO: Use a generic AuthProvider interface -export type EIP712AuthProvider = EIP712SignatureProvider; -export type EIP4361AuthProvider = EIP4361SignatureProvider; - -export type AuthProvider = EIP712AuthProvider | EIP4361AuthProvider; +export interface AuthProvider { + getOrCreateAuthSignature(): Promise; +} export type AuthProviders = { [EIP712_AUTH_METHOD]?: EIP712AuthProvider; [EIP4361_AUTH_METHOD]?: EIP4361AuthProvider; + // Fallback to satisfy type checking [key: string]: AuthProvider | undefined; }; diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index df28c9367..77002e646 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -7,8 +7,8 @@ import { SiweMessage } from 'siwe'; import { describe, expect, it } from 'vitest'; import { - EIP4361SignatureProvider, - EIP712SignatureProvider, + EIP4361AuthProvider, + EIP712AuthProvider, FormattedEIP712, } from '../src'; @@ -16,9 +16,9 @@ describe('taco authorization', () => { it('creates a new EIP-712 message', async () => { const provider = fakeProvider(bobSecretKeyBytes); const signer = fakeSigner(bobSecretKeyBytes); - const eip712Provider = new EIP712SignatureProvider(provider, signer); + const eip712Provider = new EIP712AuthProvider(provider, signer); - const eip712Message = await eip712Provider.getOrCreateWalletSignature(); + const eip712Message = await eip712Provider.getOrCreateAuthSignature(); // Expected format: // { @@ -52,8 +52,8 @@ describe('taco authorization', () => { const provider = fakeProvider(bobSecretKeyBytes); const signer = fakeSigner(bobSecretKeyBytes); - const eip4361Provider = new EIP4361SignatureProvider(provider, signer); - const typedSignature = await eip4361Provider.getOrCreateWalletSignature(); + const eip4361Provider = new EIP4361AuthProvider(provider, signer); + const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); // Expected format: // { diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index b0b4ae936..c6ccbd918 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -117,8 +117,8 @@ export class ConditionContext { .map(async ([param, authMethod]) => { const maybeAuthProvider = this.authProviders[authMethod]; // TODO: Throw here instead of validating in the constructor? - // TODO: Hide getOrCreateWalletSignature behind a more generic interface - return [param, await maybeAuthProvider!.getOrCreateWalletSignature()]; + // TODO: Hide getOrCreateAuthSignature behind a more generic interface + return [param, await maybeAuthProvider!.getOrCreateAuthSignature()]; })); return Object.fromEntries(entries); } diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index e681f9a19..94565cc55 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -2,8 +2,8 @@ import { initialize } from '@nucypher/nucypher-core'; import { AuthProviders, AuthSignature, - EIP4361SignatureProvider, - EIP712SignatureProvider, + EIP4361AuthProvider, + EIP712AuthProvider, FormattedEIP712, makeAuthProviders, } from '@nucypher/taco-auth'; @@ -368,8 +368,8 @@ describe('authentication provider', () => { async function testEIP712AuthMethod(authMethod: string) { const eip712Spy = vi.spyOn( - EIP712SignatureProvider.prototype, - 'getOrCreateWalletSignature', + EIP712AuthProvider.prototype, + 'getOrCreateAuthSignature', ); const authSignature = await makeAuthSignature(authMethod); @@ -395,8 +395,8 @@ describe('authentication provider', () => { it('supports eip4361', async () => { const eip4361Spy = vi.spyOn( - EIP4361SignatureProvider.prototype, - 'getOrCreateWalletSignature', + EIP4361AuthProvider.prototype, + 'getOrCreateAuthSignature', ); const authSignature = await makeAuthSignature(USER_ADDRESS_PARAM_EIP4361); expect(authSignature).toBeDefined(); From 78001fe1965ea01acf1083851c829b0c8ce486f2 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Thu, 13 Jun 2024 14:53:25 +0200 Subject: [PATCH 31/75] refactor: clean up naming and todos --- packages/taco-auth/src/providers/eip4361.ts | 16 +++++++------ packages/taco-auth/src/providers/eip712.ts | 13 +++++----- packages/taco-auth/src/providers/index.ts | 7 +++--- packages/taco-auth/src/types.ts | 6 ++--- packages/taco-auth/test/taco-auth.test.ts | 24 +++---------------- packages/taco/test/conditions/context.test.ts | 5 ++-- 6 files changed, 28 insertions(+), 43 deletions(-) diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts index 446c973bb..db35aee7f 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -2,14 +2,15 @@ import { ethers } from 'ethers'; import { generateNonce, SiweMessage } from 'siwe'; import { LocalStorage } from '../storage'; -import { AuthSignature } from '../types'; +import { AuthSignature, EIP4361_AUTH_METHOD } from '../types'; -export type FormattedEIP4361 = string; +export type EIP4361TypedData = string; export class EIP4361AuthProvider { private readonly storage: LocalStorage; constructor( + // TODO: We only need the provider to fetch the chainId, consider removing it private readonly provider: ethers.providers.Provider, private readonly signer: ethers.Signer, ) { @@ -18,7 +19,7 @@ export class EIP4361AuthProvider { public async getOrCreateAuthSignature(): Promise { const address = await this.signer.getAddress(); - const storageKey = `eth-signin-message-${address}`; + const storageKey = `eth-${EIP4361_AUTH_METHOD}-message-${address}`; // If we have a message in localStorage, return it const maybeMessage = this.storage.getItem(storageKey); @@ -27,12 +28,12 @@ export class EIP4361AuthProvider { } // If at this point we didn't return, we need to create a new message - const typedSignature = await this.createSiweMessage(); - this.storage.setItem(storageKey, JSON.stringify(typedSignature)); - return typedSignature; + const authMessage = await this.createSIWEAuthMessage(); + this.storage.setItem(storageKey, JSON.stringify(authMessage)); + return authMessage; } - private async createSiweMessage(): Promise { + private async createSIWEAuthMessage(): Promise { const address = await this.signer.getAddress(); const { domain, uri } = this.getParametersOrDefault(); const version = '1'; @@ -53,6 +54,7 @@ export class EIP4361AuthProvider { return { signature, address, scheme, typedData: message }; } + // TODO: Create a facility to set these parameters or expose them to the user private getParametersOrDefault() { // If we are in a browser environment, we can get the domain and uri from the window object if (typeof window !== 'undefined') { diff --git a/packages/taco-auth/src/providers/eip712.ts b/packages/taco-auth/src/providers/eip712.ts index 572a6543c..5dd4c6b79 100644 --- a/packages/taco-auth/src/providers/eip712.ts +++ b/packages/taco-auth/src/providers/eip712.ts @@ -23,7 +23,7 @@ interface EIP712 { }; } -export interface FormattedEIP712 extends EIP712 { +export interface EIP712TypedData extends EIP712 { primaryType: 'Wallet'; types: { EIP712Domain: { name: string; type: string }[]; @@ -60,6 +60,7 @@ export class EIP712AuthProvider implements AuthProvider { private readonly storage: LocalStorage; constructor( + // TODO: We only need the provider to fetch the chainId, consider removing it private readonly provider: ethers.providers.Provider, private readonly signer: ethers.Signer, ) { @@ -77,12 +78,12 @@ export class EIP712AuthProvider implements AuthProvider { } // If at this point we didn't return, we need to create a new signature - const typedSignature = await this.createWalletSignature(); - this.storage.setItem(storageKey, JSON.stringify(typedSignature)); - return typedSignature; + const authMessage = await this.createAuthMessage(); + this.storage.setItem(storageKey, JSON.stringify(authMessage)); + return authMessage; } - private async createWalletSignature(): Promise { + private async createAuthMessage(): Promise { // Ensure freshness of the signature const { blockNumber, blockHash, chainId } = await this.getChainData(); const address = await this.signer.getAddress(); @@ -116,7 +117,7 @@ export class EIP712AuthProvider implements AuthProvider { this.signer as unknown as TypedDataSigner )._signTypedData(typedData.domain, typedData.types, typedData.message); - const formattedTypedData: FormattedEIP712 = { + const formattedTypedData: EIP712TypedData = { ...typedData, primaryType: 'Wallet', types: { diff --git a/packages/taco-auth/src/providers/index.ts b/packages/taco-auth/src/providers/index.ts index 984004894..5efc21c6d 100644 --- a/packages/taco-auth/src/providers/index.ts +++ b/packages/taco-auth/src/providers/index.ts @@ -1,7 +1,7 @@ import { EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from '../types'; -import { EIP4361AuthProvider, FormattedEIP4361 } from './eip4361'; -import { EIP712AuthProvider, FormattedEIP712 } from './eip712'; +import { EIP4361AuthProvider, EIP4361TypedData } from './eip4361'; +import { EIP712AuthProvider, EIP712TypedData } from './eip712'; export interface AuthSignatureProvider { getOrCreateAuthSignature(): Promise; @@ -18,7 +18,8 @@ export interface AuthSignature { signature: string; address: string; scheme: 'EIP712' | 'EIP4361'; - typedData: FormattedEIP712 | FormattedEIP4361; + typedData: EIP712TypedData | EIP4361TypedData; } +// Add other providers here export type AuthProvider = AuthSignatureProvider; diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/types.ts index 7042376b5..316731bb4 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/types.ts @@ -1,5 +1,5 @@ -import {EIP4361AuthProvider, FormattedEIP4361} from './providers/eip4361'; -import {EIP712AuthProvider, FormattedEIP712} from './providers/eip712'; +import {EIP4361AuthProvider, EIP4361TypedData} from './providers/eip4361'; +import {EIP712AuthProvider, EIP712TypedData} from './providers/eip712'; export interface AuthProvider { getOrCreateAuthSignature(): Promise; @@ -16,7 +16,7 @@ export interface AuthSignature { signature: string; address: string; scheme: 'EIP712' | 'EIP4361'; - typedData: FormattedEIP712 | FormattedEIP4361; + typedData: EIP712TypedData | EIP4361TypedData; } export const EIP712_AUTH_METHOD = 'EIP712'; diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 77002e646..80e4da215 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -9,30 +9,21 @@ import { describe, expect, it } from 'vitest'; import { EIP4361AuthProvider, EIP712AuthProvider, - FormattedEIP712, + EIP712TypedData, } from '../src'; describe('taco authorization', () => { it('creates a new EIP-712 message', async () => { const provider = fakeProvider(bobSecretKeyBytes); const signer = fakeSigner(bobSecretKeyBytes); - const eip712Provider = new EIP712AuthProvider(provider, signer); + const eip712Provider = new EIP712AuthProvider(provider, signer); const eip712Message = await eip712Provider.getOrCreateAuthSignature(); - - // Expected format: - // { - // "signature": "", - // "address": "
", - // "scheme": "EIP712" | "EIP4361" | ... - // "typeData": ... - // } - expect(eip712Message.signature).toBeDefined(); expect(eip712Message.address).toEqual(await signer.getAddress()); expect(eip712Message.scheme).toEqual('EIP712'); - const typedData = eip712Message.typedData as FormattedEIP712; + const typedData = eip712Message.typedData as EIP712TypedData; expect(typedData).toBeDefined(); expect(typedData.types.Wallet).toBeDefined(); expect(typedData.domain.name).toEqual('TACo'); @@ -54,15 +45,6 @@ describe('taco authorization', () => { const eip4361Provider = new EIP4361AuthProvider(provider, signer); const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); - - // Expected format: - // { - // "signature": "", - // "address": "
", - // "scheme": "EIP712" | "EIP4361" | ... - // "typedData": ... - // } - expect(typedSignature.signature).toBeDefined(); expect(typedSignature.address).toEqual(await signer.getAddress()); expect(typedSignature.scheme).toEqual('EIP4361'); diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 94565cc55..6ebc0d6ae 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -3,8 +3,7 @@ import { AuthProviders, AuthSignature, EIP4361AuthProvider, - EIP712AuthProvider, - FormattedEIP712, + EIP712AuthProvider, EIP712TypedData, makeAuthProviders, } from '@nucypher/taco-auth'; import { @@ -378,7 +377,7 @@ describe('authentication provider', () => { expect(authSignature.scheme).toEqual('EIP712'); expect(authSignature.address).toEqual(await signer.getAddress()); - const typedData = authSignature.typedData as FormattedEIP712; + const typedData = authSignature.typedData as EIP712TypedData; expect(typedData).toBeDefined(); expect(typedData.domain.name).toEqual('TACo'); expect(typedData.message.address).toEqual(await signer.getAddress()); From 524dff3ed682b381dbfd1d0682f2f95b4efde33f Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Fri, 14 Jun 2024 13:16:15 +0200 Subject: [PATCH 32/75] test(conditions): document context behavior --- packages/taco/src/conditions/context/context.ts | 4 ++++ packages/taco/test/conditions/context.test.ts | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index c6ccbd918..cc2ebbf25 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -42,6 +42,10 @@ export class ConditionContext { this.validateParameters(); } + public requestedParameters = (): Set => { + return this.findRequestedParameters(this.condition.toObj()); + }; + private validateParameters(): void { Object.keys(this.customParameters).forEach((key) => { if (RESERVED_CONTEXT_PARAMS.includes(key)) { diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 6ebc0d6ae..06be0ee07 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -98,6 +98,11 @@ describe('context', () => { expect(asObj).toBeDefined(); expect(asObj[customParamKey]).toEqual(`0x${toHexString(customParam)}`); }); + + it('detects when a custom parameter is requested', ()=> { + const requestedParams = context.requestedParameters(); + expect(requestedParams).toContain(customParamKey); + }); }); describe('return value test', () => { @@ -127,7 +132,7 @@ describe('context', () => { it('rejects on using a custom parameter that was not requested', async () => { const badCustomParamKey = ':notRequested'; const badCustomParams: Record = {}; - badCustomParams[':customParam'] = 'this-is-fine'; + badCustomParams[customParamKey] = 'this-is-fine'; badCustomParams[badCustomParamKey] = 'this-will-throw'; await expect( context.withCustomParams(badCustomParams).toObj(), @@ -229,6 +234,12 @@ describe('context', () => { }, }; + it('handles both custom and auth context parameters', ()=> { + const requestedParams = context.requestedParameters(); + expect(requestedParams).not.toContain(USER_ADDRESS_PARAM_DEFAULT); + expect(requestedParams).toContain(customParamKey); + }); + it('rejects on a missing parameter ', async () => { const customContractCondition = new ContractCondition({ ...contractConditionObj, @@ -260,7 +271,6 @@ describe('context', () => { it.each([0, ''])( 'accepts on a falsy parameter value: %s', async (falsyParam) => { - const customParamKey = ':customParam'; const customContractCondition = new ContractCondition({ ...contractConditionObj, parameters: [USER_ADDRESS_PARAM_DEFAULT, customParamKey], From 8455f9fade8b69ff225bdb9224892af5fb49427e Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Fri, 14 Jun 2024 14:23:40 +0200 Subject: [PATCH 33/75] refactor!(context): remove unused context method --- packages/taco/src/conditions/context/context.ts | 16 ---------------- .../taco/test/conditions/base/contract.test.ts | 3 +-- packages/taco/test/conditions/context.test.ts | 17 +++++++++-------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index cc2ebbf25..e84e22a5c 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -55,11 +55,6 @@ export class ConditionContext { throw new Error(ERR_INVALID_CUSTOM_PARAM(key)); } }); - - const requiredParam = this.condition.findParamWithAuthentication(); - if (requiredParam && !this.authProviders) { - throw new Error(ERR_AUTH_PROVIDER_REQUIRED(requiredParam)); - } } public toObj = async (): Promise> => { @@ -171,17 +166,6 @@ export class ConditionContext { return toJSON(parameters); } - public withCustomParams( - params: Record, - ): ConditionContext { - return new ConditionContext( - this.provider, - this.condition, - params, - this.authProviders, - ); - } - public async toWASMContext(): Promise { const asJson = await this.toJson(); return new Context(asJson); diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index 23baf7d22..02afa7849 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -196,8 +196,7 @@ describe('supports custom function abi', () => { it('accepts custom function abi with a custom parameter', async () => { const asJson = await conditionExpr - .buildContext(fakeProvider(), {}, fakeAuthProviders()) - .withCustomParams(customParams) + .buildContext(fakeProvider(), customParams, fakeAuthProviders()) .toJson(); expect(asJson).toBeDefined(); diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 06be0ee07..738867481 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -90,11 +90,10 @@ describe('context', () => { // Uint8Array is not a valid CustomContextParam, override the type: customParamsWithBytes[customParamKey] = customParam as unknown as string; - - const asJson = await context - .withCustomParams(customParamsWithBytes) + const contextAsJson = await conditionExpr + .buildContext(provider, customParamsWithBytes) .toJson(); - const asObj = JSON.parse(asJson); + const asObj = JSON.parse(contextAsJson); expect(asObj).toBeDefined(); expect(asObj[customParamKey]).toEqual(`0x${toHexString(customParam)}`); }); @@ -107,7 +106,7 @@ describe('context', () => { describe('return value test', () => { it('accepts on a custom context parameters', async () => { - const asObj = await context.withCustomParams(customParams).toObj(); + const asObj = await conditionExpr.buildContext(provider, customParams).toObj(); expect(asObj).toBeDefined(); expect(asObj[customParamKey]).toEqual(1234); }); @@ -123,7 +122,7 @@ describe('context', () => { RESERVED_CONTEXT_PARAMS.forEach((reservedParam) => { const badCustomParams: Record = {}; badCustomParams[reservedParam] = 'this-will-throw'; - expect(() => context.withCustomParams(badCustomParams)).toThrow( + expect(() => conditionExpr.buildContext(provider, badCustomParams)).toThrow( `Cannot use reserved parameter name ${reservedParam} as custom parameter`, ); }); @@ -135,7 +134,7 @@ describe('context', () => { badCustomParams[customParamKey] = 'this-is-fine'; badCustomParams[badCustomParamKey] = 'this-will-throw'; await expect( - context.withCustomParams(badCustomParams).toObj(), + conditionExpr.buildContext(provider, badCustomParams).toObj(), ).rejects.toThrow( `Unknown custom context parameter(s): ${badCustomParamKey}`, ); @@ -235,7 +234,9 @@ describe('context', () => { }; it('handles both custom and auth context parameters', ()=> { - const requestedParams = context.requestedParameters(); + const requestedParams = new ConditionExpression(contractCondition) + .buildContext(provider, {}, authProviders) + .requestedParameters(); expect(requestedParams).not.toContain(USER_ADDRESS_PARAM_DEFAULT); expect(requestedParams).toContain(customParamKey); }); From dc91ce0d520dfe888a768231ccaf74ed06553ad8 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Fri, 14 Jun 2024 14:43:23 +0200 Subject: [PATCH 34/75] refactor!(context): remove unused provider parameter --- .../taco/src/conditions/condition-expr.ts | 3 -- .../taco/src/conditions/context/context.ts | 4 -- packages/taco/src/tdec.ts | 1 - .../test/conditions/base/contract.test.ts | 5 +- .../taco/test/conditions/conditions.test.ts | 3 +- packages/taco/test/conditions/context.test.ts | 46 +++++++++---------- 6 files changed, 25 insertions(+), 37 deletions(-) diff --git a/packages/taco/src/conditions/condition-expr.ts b/packages/taco/src/conditions/condition-expr.ts index 0616cab31..e7c9f3b56 100644 --- a/packages/taco/src/conditions/condition-expr.ts +++ b/packages/taco/src/conditions/condition-expr.ts @@ -1,7 +1,6 @@ import { Conditions as WASMConditions } from '@nucypher/nucypher-core'; import { toJSON } from '@nucypher/shared'; import {AuthProviders} from "@nucypher/taco-auth"; -import { ethers } from 'ethers'; import { SemVer } from 'semver'; import { Condition } from './condition'; @@ -66,12 +65,10 @@ export class ConditionExpression { } public buildContext( - provider: ethers.providers.Provider, customParameters: Record = {}, authProviders: AuthProviders = {}, ): ConditionContext { return new ConditionContext( - provider, this.condition, customParameters, authProviders, diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index e84e22a5c..0d64b8425 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -5,7 +5,6 @@ import { AuthSignature, } from '@nucypher/taco-auth'; import {AUTH_METHOD_FOR_PARAM} from "@nucypher/taco-auth"; -import { ethers } from 'ethers'; import { CompoundConditionType } from '../compound-condition'; import { Condition, ConditionProps } from '../condition'; @@ -33,7 +32,6 @@ const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => export class ConditionContext { constructor( - private readonly provider: ethers.providers.Provider, private readonly condition: Condition, public readonly customParameters: Record = {}, private readonly authProviders: AuthProviders = {}, @@ -172,13 +170,11 @@ export class ConditionContext { } public static fromConditions( - provider: ethers.providers.Provider, conditions: WASMConditions, authProviders?: AuthProviders, customParameters?: Record, ): ConditionContext { return new ConditionContext( - provider, ConditionExpression.fromWASMConditions(conditions).condition, customParameters, authProviders, diff --git a/packages/taco/src/tdec.ts b/packages/taco/src/tdec.ts index f2ba473b5..36a932251 100644 --- a/packages/taco/src/tdec.ts +++ b/packages/taco/src/tdec.ts @@ -104,7 +104,6 @@ const retrieve = async ( sharesNum, ); const wasmContext = await ConditionContext.fromConditions( - provider, thresholdMessageKit.acp.conditions, authProviders, customParameters, diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index 02afa7849..aec30a6dd 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -1,6 +1,6 @@ import { initialize } from '@nucypher/nucypher-core'; import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; -import { fakeAuthProviders, fakeProvider } from '@nucypher/test-utils'; +import { fakeAuthProviders} from '@nucypher/test-utils'; import { beforeAll, describe, expect, it } from 'vitest'; import { @@ -196,9 +196,8 @@ describe('supports custom function abi', () => { it('accepts custom function abi with a custom parameter', async () => { const asJson = await conditionExpr - .buildContext(fakeProvider(), customParams, fakeAuthProviders()) + .buildContext(customParams, fakeAuthProviders()) .toJson(); - expect(asJson).toBeDefined(); expect(asJson).toContain(USER_ADDRESS_PARAM_DEFAULT); expect(asJson).toContain(myCustomParam); diff --git a/packages/taco/test/conditions/conditions.test.ts b/packages/taco/test/conditions/conditions.test.ts index ac80105dd..242eb7fd0 100644 --- a/packages/taco/test/conditions/conditions.test.ts +++ b/packages/taco/test/conditions/conditions.test.ts @@ -1,5 +1,5 @@ import { ChainId } from '@nucypher/shared'; -import { fakeAuthProviders, fakeProvider } from '@nucypher/test-utils'; +import { fakeAuthProviders } from '@nucypher/test-utils'; import { beforeAll, describe, expect, it } from 'vitest'; import { initialize } from '../../src'; @@ -38,7 +38,6 @@ describe('conditions', () => { expect(condition.requiresAuthentication()).toBeTruthy(); const context = new ConditionContext( - fakeProvider(), condition, { ':time': 100 }, fakeAuthProviders(), diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 738867481..098f844b8 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -38,12 +38,10 @@ import { } from '../test-utils'; describe('context', () => { - let provider: ethers.providers.Provider; let authProviders: AuthProviders; beforeAll(async () => { await initialize(); - provider = fakeProvider(); authProviders = fakeAuthProviders(); }); @@ -59,7 +57,7 @@ describe('context', () => { }); const conditionContext = new ConditionExpression( rpcCondition, - ).buildContext(provider, {}, authProviders); + ).buildContext({}, authProviders); const asJson = await conditionContext.toJson(); expect(asJson).toBeDefined(); @@ -81,7 +79,7 @@ describe('context', () => { }; const contractCondition = new ContractCondition(contractConditionObj); const conditionExpr = new ConditionExpression(contractCondition); - const context = conditionExpr.buildContext(provider, {}, authProviders); + const context = conditionExpr.buildContext({}, authProviders); describe('custom parameters', () => { it('serializes bytes as hex strings', async () => { @@ -91,7 +89,7 @@ describe('context', () => { customParamsWithBytes[customParamKey] = customParam as unknown as string; const contextAsJson = await conditionExpr - .buildContext(provider, customParamsWithBytes) + .buildContext(customParamsWithBytes) .toJson(); const asObj = JSON.parse(contextAsJson); expect(asObj).toBeDefined(); @@ -106,7 +104,7 @@ describe('context', () => { describe('return value test', () => { it('accepts on a custom context parameters', async () => { - const asObj = await conditionExpr.buildContext(provider, customParams).toObj(); + const asObj = await conditionExpr.buildContext(customParams).toObj(); expect(asObj).toBeDefined(); expect(asObj[customParamKey]).toEqual(1234); }); @@ -122,7 +120,7 @@ describe('context', () => { RESERVED_CONTEXT_PARAMS.forEach((reservedParam) => { const badCustomParams: Record = {}; badCustomParams[reservedParam] = 'this-will-throw'; - expect(() => conditionExpr.buildContext(provider, badCustomParams)).toThrow( + expect(() => conditionExpr.buildContext(badCustomParams)).toThrow( `Cannot use reserved parameter name ${reservedParam} as custom parameter`, ); }); @@ -134,7 +132,7 @@ describe('context', () => { badCustomParams[customParamKey] = 'this-is-fine'; badCustomParams[badCustomParamKey] = 'this-will-throw'; await expect( - conditionExpr.buildContext(provider, badCustomParams).toObj(), + conditionExpr.buildContext(badCustomParams).toObj(), ).rejects.toThrow( `Unknown custom context parameter(s): ${badCustomParamKey}`, ); @@ -152,8 +150,8 @@ describe('context', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresAuthentication()).toBe(true); - expect(conditionExpr.buildContext(provider, {}, authProviders)).toBeDefined(); - expect(() => conditionExpr.buildContext(provider, {})).toThrow( + expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); + expect(() => conditionExpr.buildContext({})).toThrow( `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -172,8 +170,8 @@ describe('context', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresAuthentication()).toBe(true); - expect(conditionExpr.buildContext(provider, {}, authProviders)).toBeDefined(); - expect(() => conditionExpr.buildContext(provider, {})).toThrow( + expect(conditionExpr.buildContext( {}, authProviders)).toBeDefined(); + expect(() => conditionExpr.buildContext( {})).toThrow( `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -185,8 +183,8 @@ describe('context', () => { JSON.stringify(condition.toObj()).includes(USER_ADDRESS_PARAM_DEFAULT), ).toBe(false); expect(conditionExpr.contextRequiresAuthentication()).toBe(false); - expect(conditionExpr.buildContext(provider, {}, authProviders)).toBeDefined(); - expect(conditionExpr.buildContext(provider, {})).toBeDefined(); + expect(conditionExpr.buildContext( {}, authProviders)).toBeDefined(); + expect(conditionExpr.buildContext( {})).toBeDefined(); }); it('rejects on a missing signer', () => { @@ -200,7 +198,7 @@ describe('context', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresAuthentication()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( + expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -216,7 +214,7 @@ describe('context', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresAuthentication()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, undefined)).toThrow( + expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -235,7 +233,7 @@ describe('context', () => { it('handles both custom and auth context parameters', ()=> { const requestedParams = new ConditionExpression(contractCondition) - .buildContext(provider, {}, authProviders) + .buildContext( {}, authProviders) .requestedParameters(); expect(requestedParams).not.toContain(USER_ADDRESS_PARAM_DEFAULT); expect(requestedParams).toContain(customParamKey); @@ -248,7 +246,7 @@ describe('context', () => { }); const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext(provider, {}, authProviders); + ).buildContext( {}, authProviders); await expect(async () => conditionContext.toObj()).rejects.toThrow( `Missing custom context parameter(s): ${customParamKey}`, @@ -262,7 +260,7 @@ describe('context', () => { }); const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext(provider, {}, authProviders); + ).buildContext( {}, authProviders); const asObj = await conditionContext.toObj(); expect(asObj).toBeDefined(); @@ -280,7 +278,7 @@ describe('context', () => { customParameters[customParamKey] = falsyParam; const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext(provider, customParameters, authProviders); + ).buildContext( customParameters, authProviders); const asObj = await conditionContext.toObj(); expect(asObj).toBeDefined(); @@ -317,7 +315,7 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresAuthentication()).toBe(true); - expect(() => conditionExpr.buildContext(provider, {}, {})).toThrow( + expect(() => conditionExpr.buildContext( {}, {})).toThrow( `Authentication provider required to satisfy ${userAddressParam} context variable in condition`, ); }); @@ -335,7 +333,7 @@ describe('authentication provider', () => { const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => - conditionExpr.buildContext(provider, {}, authProviders), + conditionExpr.buildContext( {}, authProviders), ).not.toThrow(); }); @@ -352,7 +350,7 @@ describe('authentication provider', () => { const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => - conditionExpr.buildContext(provider, {}, authProviders), + conditionExpr.buildContext( {}, authProviders), ).not.toThrow(); }); @@ -368,7 +366,7 @@ describe('authentication provider', () => { const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.contextRequiresAuthentication()).toBe(true); - const builtContext = conditionExpr.buildContext(provider, {}, authProviders); + const builtContext = conditionExpr.buildContext( {}, authProviders); const contextVars = await builtContext.toObj(); const authSignature = contextVars[authMethod] as AuthSignature; expect(authSignature).toBeDefined(); From 7c44a99030651a44a22f5e819a31b4a4d1fa59b5 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Fri, 14 Jun 2024 15:50:36 +0200 Subject: [PATCH 35/75] refactor!(context): refactor validation and rename public methods --- .../taco/src/conditions/condition-expr.ts | 8 +-- packages/taco/src/conditions/condition.ts | 2 +- .../taco/src/conditions/context/context.ts | 65 +++++++++---------- packages/taco/src/taco.ts | 2 +- packages/taco/src/tdec.ts | 14 ++-- packages/taco/src/types.ts | 2 + .../test/conditions/condition-expr.test.ts | 16 ++--- .../taco/test/conditions/conditions.test.ts | 2 +- packages/taco/test/conditions/context.test.ts | 22 +++---- 9 files changed, 65 insertions(+), 68 deletions(-) create mode 100644 packages/taco/src/types.ts diff --git a/packages/taco/src/conditions/condition-expr.ts b/packages/taco/src/conditions/condition-expr.ts index e7c9f3b56..ee1e2882a 100644 --- a/packages/taco/src/conditions/condition-expr.ts +++ b/packages/taco/src/conditions/condition-expr.ts @@ -1,4 +1,4 @@ -import { Conditions as WASMConditions } from '@nucypher/nucypher-core'; +import { Conditions as CoreConditions } from '@nucypher/nucypher-core'; import { toJSON } from '@nucypher/shared'; import {AuthProviders} from "@nucypher/taco-auth"; import { SemVer } from 'semver'; @@ -56,11 +56,11 @@ export class ConditionExpression { return ConditionExpression.fromObj(JSON.parse(json)); } - public toWASMConditions(): WASMConditions { - return new WASMConditions(toJSON(this.toObj())); + public toCoreCondition(): CoreConditions { + return new CoreConditions(toJSON(this.toObj())); } - public static fromWASMConditions(conditions: WASMConditions) { + public static fromCoreConditions(conditions: CoreConditions) { return ConditionExpression.fromJSON(conditions.toString()); } diff --git a/packages/taco/src/conditions/condition.ts b/packages/taco/src/conditions/condition.ts index 93cbba25b..519bd189b 100644 --- a/packages/taco/src/conditions/condition.ts +++ b/packages/taco/src/conditions/condition.ts @@ -50,7 +50,7 @@ export class Condition { return Boolean(this.findParamWithAuthentication()); } - public toObj() { + public toObj(): ConditionProps { const { data, error } = Condition.validate(this.schema, this.value); if (error) { throw new Error(ERR_INVALID_CONDITION(error)); diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 0d64b8425..a74a4c4b1 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,19 +1,11 @@ -import { Context, Conditions as WASMConditions } from '@nucypher/nucypher-core'; -import { fromJSON, toJSON } from '@nucypher/shared'; -import { - AuthProviders, - AuthSignature, -} from '@nucypher/taco-auth'; -import {AUTH_METHOD_FOR_PARAM} from "@nucypher/taco-auth"; +import { toJSON } from '@nucypher/shared'; +import { AUTH_METHOD_FOR_PARAM, AuthProviders, AuthSignature } from '@nucypher/taco-auth'; +import { CoreConditions, CoreContext } from '../../types'; import { CompoundConditionType } from '../compound-condition'; import { Condition, ConditionProps } from '../condition'; import { ConditionExpression } from '../condition-expr'; -import { - CONTEXT_PARAM_PREFIX, - CONTEXT_PARAM_REGEXP, - RESERVED_CONTEXT_PARAMS, -} from '../const'; +import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS } from '../const'; export type CustomContextParam = string | number | boolean; export type ContextParam = CustomContextParam | AuthSignature; @@ -30,20 +22,20 @@ const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => `Unknown custom context parameter(s): ${params.join(', ')}`; export class ConditionContext { + public requestedParameters: Set; constructor( - private readonly condition: Condition, + condition: Condition, public readonly customParameters: Record = {}, private readonly authProviders: AuthProviders = {}, ) { - this.validateAuthProviders(this.findRequestedParameters(this.condition.toObj())); + const condProps = condition.toObj(); this.validateParameters(); + this.validateCoreConditions(condProps); + this.requestedParameters = this.findRequestedParameters(condProps); + this.validateAuthProviders(this.requestedParameters); } - public requestedParameters = (): Set => { - return this.findRequestedParameters(this.condition.toObj()); - }; - private validateParameters(): void { Object.keys(this.customParameters).forEach((key) => { if (RESERVED_CONTEXT_PARAMS.includes(key)) { @@ -55,17 +47,16 @@ export class ConditionContext { }); } - public toObj = async (): Promise> => { - const condObject = this.condition.toObj(); - const parsedCondObject = fromJSON( - new WASMConditions(toJSON(condObject)).toString(), - ); - const requestedParameters = this.findRequestedParameters(parsedCondObject); - const parameters = await this.fillContextParameters(requestedParameters); + private validateCoreConditions(condObject: ConditionProps) { + // Checking whether the condition is compatible with the current version of the library + // Intentionally ignoring the return value of the function + new CoreConditions(toJSON(condObject)); + } + private validateMissingParameters(parameters: Record) { // Ok, so at this point we should have all the parameters we need // If we don't, we have a problem and we should throw - const missingParameters = Array.from(requestedParameters).filter( + const missingParameters = Array.from(this.requestedParameters).filter( (key) => parameters[key] === undefined, ); if (missingParameters.length > 0) { @@ -75,14 +66,12 @@ export class ConditionContext { // We may also have some parameters that are not used const unknownParameters = Object.keys(parameters).filter( (key) => - !requestedParameters.has(key) && !RESERVED_CONTEXT_PARAMS.includes(key), + !this.requestedParameters.has(key) && !RESERVED_CONTEXT_PARAMS.includes(key), ); if (unknownParameters.length > 0) { throw new Error(ERR_UNKNOWN_CONTEXT_PARAMS(unknownParameters)); } - - return parameters; - }; + } private async fillContextParameters( requestedParameters: Set, @@ -160,22 +149,28 @@ export class ConditionContext { } public async toJson(): Promise { - const parameters = await this.toObj(); + const parameters = await this.toContextParameters(); return toJSON(parameters); } - public async toWASMContext(): Promise { + public async toCoreContext(): Promise { const asJson = await this.toJson(); - return new Context(asJson); + return new CoreContext(asJson); } + public toContextParameters = async (): Promise> => { + const parameters = await this.fillContextParameters(this.requestedParameters); + this.validateMissingParameters(parameters); + return parameters; + }; + public static fromConditions( - conditions: WASMConditions, + conditions: CoreConditions, authProviders?: AuthProviders, customParameters?: Record, ): ConditionContext { return new ConditionContext( - ConditionExpression.fromWASMConditions(conditions).condition, + ConditionExpression.fromCoreConditions(conditions).condition, customParameters, authProviders, ); diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index cd8fc6656..6baa2b0b6 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -103,7 +103,7 @@ export const encryptWithPublicKey = async ( const [ciphertext, authenticatedData] = encryptForDkg( message, dkgPublicKey, - conditionExpr.toWASMConditions(), + conditionExpr.toCoreCondition(), ); const headerHash = keccak256(ciphertext.header.toBytes()); diff --git a/packages/taco/src/tdec.ts b/packages/taco/src/tdec.ts index 36a932251..a3f1b9444 100644 --- a/packages/taco/src/tdec.ts +++ b/packages/taco/src/tdec.ts @@ -1,7 +1,6 @@ import { AccessControlPolicy, combineDecryptionSharesSimple, - Context, DecryptionShareSimple, DkgPublicKey, EncryptedThresholdDecryptionRequest, @@ -45,7 +44,7 @@ export const encryptMessage = async ( const [ciphertext, authenticatedData] = encryptForDkg( plaintext instanceof Uint8Array ? plaintext : toBytes(plaintext), encryptingKey, - conditions.toWASMConditions(), + conditions.toCoreCondition(), ); const headerHash = keccak256(ciphertext.header.toBytes()); @@ -103,14 +102,14 @@ const retrieve = async ( ritualId, sharesNum, ); - const wasmContext = await ConditionContext.fromConditions( + const conditionContext = await ConditionContext.fromConditions( thresholdMessageKit.acp.conditions, authProviders, customParameters, - ).toWASMContext(); + ); const { sharedSecrets, encryptedRequests } = await makeDecryptionRequests( ritualId, - wasmContext, + conditionContext, dkgParticipants, thresholdMessageKit, ); @@ -148,19 +147,20 @@ const makeDecryptionShares = ( const makeDecryptionRequests = async ( ritualId: number, - wasmContext: Context, + conditionContext: ConditionContext, dkgParticipants: Array, thresholdMessageKit: ThresholdMessageKit, ): Promise<{ sharedSecrets: Record; encryptedRequests: Record; }> => { + const coreContext = await conditionContext.toCoreContext(); const decryptionRequest = new ThresholdDecryptionRequest( ritualId, FerveoVariant.simple, thresholdMessageKit.ciphertextHeader, thresholdMessageKit.acp, - wasmContext, + coreContext, ); const ephemeralSessionKey = makeSessionKey(); diff --git a/packages/taco/src/types.ts b/packages/taco/src/types.ts new file mode 100644 index 000000000..76c88ed69 --- /dev/null +++ b/packages/taco/src/types.ts @@ -0,0 +1,2 @@ +// Re-exporting core types to avoid confusion with taco types +export { Context as CoreContext, Conditions as CoreConditions } from '@nucypher/nucypher-core'; diff --git a/packages/taco/test/conditions/condition-expr.test.ts b/packages/taco/test/conditions/condition-expr.test.ts index 4d868d03f..9a3f38e30 100644 --- a/packages/taco/test/conditions/condition-expr.test.ts +++ b/packages/taco/test/conditions/condition-expr.test.ts @@ -194,18 +194,18 @@ describe('condition set', () => { expect(conditionExprFromJson).toBeDefined(); expect(conditionExprFromJson.equals(conditionExprFromJson)).toBeTruthy(); - const asWasmConditions = conditionExprFromJson.toWASMConditions(); - const fromWasmConditions = - ConditionExpression.fromWASMConditions(asWasmConditions); - expect(fromWasmConditions).toBeDefined(); - expect(fromWasmConditions.equals(conditionExprFromJson)).toBeTruthy(); + const asCoreCondition = conditionExprFromJson.toCoreCondition(); + const fromCoreCondition = + ConditionExpression.fromCoreConditions(asCoreCondition); + expect(fromCoreCondition).toBeDefined(); + expect(fromCoreCondition.equals(conditionExprFromJson)).toBeTruthy(); }); it('serializes to and from WASM conditions', () => { const conditionExpr = new ConditionExpression(erc721Balance); - const wasmConditions = conditionExpr.toWASMConditions(); - const fromWasm = ConditionExpression.fromWASMConditions(wasmConditions); - expect(conditionExpr.equals(fromWasm)).toBeTruthy(); + const coreConditions = conditionExpr.toCoreCondition(); + const fromCoreConditions = ConditionExpression.fromCoreConditions(coreConditions); + expect(conditionExpr.equals(fromCoreConditions)).toBeTruthy(); }); it('incompatible version', () => { diff --git a/packages/taco/test/conditions/conditions.test.ts b/packages/taco/test/conditions/conditions.test.ts index 242eb7fd0..ad5d735b2 100644 --- a/packages/taco/test/conditions/conditions.test.ts +++ b/packages/taco/test/conditions/conditions.test.ts @@ -44,7 +44,7 @@ describe('conditions', () => { ); expect(context).toBeDefined(); - const asObj = await context.toObj(); + const asObj = await context.toContextParameters(); expect(asObj).toBeDefined(); expect(asObj[':time']).toBe(100); }); diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 098f844b8..a43b21814 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -79,7 +79,6 @@ describe('context', () => { }; const contractCondition = new ContractCondition(contractConditionObj); const conditionExpr = new ConditionExpression(contractCondition); - const context = conditionExpr.buildContext({}, authProviders); describe('custom parameters', () => { it('serializes bytes as hex strings', async () => { @@ -97,20 +96,21 @@ describe('context', () => { }); it('detects when a custom parameter is requested', ()=> { - const requestedParams = context.requestedParameters(); - expect(requestedParams).toContain(customParamKey); + const context = conditionExpr.buildContext({}, authProviders); + expect(context.requestedParameters).toContain(customParamKey); }); }); describe('return value test', () => { it('accepts on a custom context parameters', async () => { - const asObj = await conditionExpr.buildContext(customParams).toObj(); + const asObj = await conditionExpr.buildContext(customParams).toContextParameters(); expect(asObj).toBeDefined(); expect(asObj[customParamKey]).toEqual(1234); }); it('rejects on a missing custom context parameter', async () => { - await expect(context.toObj()).rejects.toThrow( + const context = conditionExpr.buildContext({}, authProviders); + await expect(context.toContextParameters()).rejects.toThrow( `Missing custom context parameter(s): ${customParamKey}`, ); }); @@ -132,7 +132,7 @@ describe('context', () => { badCustomParams[customParamKey] = 'this-is-fine'; badCustomParams[badCustomParamKey] = 'this-will-throw'; await expect( - conditionExpr.buildContext(badCustomParams).toObj(), + conditionExpr.buildContext(badCustomParams).toContextParameters(), ).rejects.toThrow( `Unknown custom context parameter(s): ${badCustomParamKey}`, ); @@ -234,7 +234,7 @@ describe('context', () => { it('handles both custom and auth context parameters', ()=> { const requestedParams = new ConditionExpression(contractCondition) .buildContext( {}, authProviders) - .requestedParameters(); + .requestedParameters; expect(requestedParams).not.toContain(USER_ADDRESS_PARAM_DEFAULT); expect(requestedParams).toContain(customParamKey); }); @@ -248,7 +248,7 @@ describe('context', () => { customContractCondition, ).buildContext( {}, authProviders); - await expect(async () => conditionContext.toObj()).rejects.toThrow( + await expect(async () => conditionContext.toContextParameters()).rejects.toThrow( `Missing custom context parameter(s): ${customParamKey}`, ); }); @@ -262,7 +262,7 @@ describe('context', () => { customContractCondition, ).buildContext( {}, authProviders); - const asObj = await conditionContext.toObj(); + const asObj = await conditionContext.toContextParameters(); expect(asObj).toBeDefined(); expect(asObj[USER_ADDRESS_PARAM_DEFAULT]).toBeDefined(); }); @@ -280,7 +280,7 @@ describe('context', () => { customContractCondition, ).buildContext( customParameters, authProviders); - const asObj = await conditionContext.toObj(); + const asObj = await conditionContext.toContextParameters(); expect(asObj).toBeDefined(); expect(asObj[USER_ADDRESS_PARAM_DEFAULT]).toBeDefined(); expect(asObj[customParamKey]).toBeDefined(); @@ -367,7 +367,7 @@ describe('authentication provider', () => { expect(conditionExpr.contextRequiresAuthentication()).toBe(true); const builtContext = conditionExpr.buildContext( {}, authProviders); - const contextVars = await builtContext.toObj(); + const contextVars = await builtContext.toContextParameters(); const authSignature = contextVars[authMethod] as AuthSignature; expect(authSignature).toBeDefined(); From 12c7e7ad2bbc15f67653fb06baae37eb7ae1105b Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 19 Jun 2024 17:30:57 +0200 Subject: [PATCH 36/75] apply pr comments --- packages/taco/src/conditions/context/context.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index a74a4c4b1..719632676 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -53,7 +53,7 @@ export class ConditionContext { new CoreConditions(toJSON(condObject)); } - private validateMissingParameters(parameters: Record) { + private validateNoMissingParameters(parameters: Record) { // Ok, so at this point we should have all the parameters we need // If we don't, we have a problem and we should throw const missingParameters = Array.from(this.requestedParameters).filter( @@ -160,7 +160,7 @@ export class ConditionContext { public toContextParameters = async (): Promise> => { const parameters = await this.fillContextParameters(this.requestedParameters); - this.validateMissingParameters(parameters); + this.validateNoMissingParameters(parameters); return parameters; }; From 2c9ff524c61078f042a92fb1772f7395dd045d3e Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Thu, 20 Jun 2024 09:27:09 +0200 Subject: [PATCH 37/75] feat(cond): expose requested params in user facing api --- .../taco/src/conditions/context/context.ts | 15 +++++++--- packages/taco/test/taco.test.ts | 30 +++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 719632676..3ff615572 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,3 +1,4 @@ +import { ThresholdMessageKit } from '@nucypher/nucypher-core'; import { toJSON } from '@nucypher/shared'; import { AUTH_METHOD_FOR_PARAM, AuthProviders, AuthSignature } from '@nucypher/taco-auth'; @@ -7,6 +8,7 @@ import { Condition, ConditionProps } from '../condition'; import { ConditionExpression } from '../condition-expr'; import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS } from '../const'; + export type CustomContextParam = string | number | boolean; export type ContextParam = CustomContextParam | AuthSignature; @@ -32,7 +34,7 @@ export class ConditionContext { const condProps = condition.toObj(); this.validateParameters(); this.validateCoreConditions(condProps); - this.requestedParameters = this.findRequestedParameters(condProps); + this.requestedParameters = ConditionContext.findRequestedParameters(condProps); this.validateAuthProviders(this.requestedParameters); } @@ -109,11 +111,11 @@ export class ConditionContext { return Object.fromEntries(entries); } - private isContextParameter(param: unknown): boolean { + private static isContextParameter(param: unknown): boolean { return !!String(param).match(CONTEXT_PARAM_REGEXP); } - private findRequestedParameters(condition: ConditionProps) { + public static findRequestedParameters(condition: ConditionProps) { // First, we want to find all the parameters we need to add const requestedParameters = new Set(); @@ -121,7 +123,7 @@ export class ConditionContext { // Check return value test if (condition.returnValueTest) { const rvt = condition.returnValueTest.value; - if (this.isContextParameter(rvt)) { + if (ConditionContext.isContextParameter(rvt)) { requestedParameters.add(rvt); } } @@ -175,4 +177,9 @@ export class ConditionContext { authProviders, ); } + + public static requestedParameters(messageKit: ThresholdMessageKit): Set { + const conditionExpr = ConditionExpression.fromCoreConditions(messageKit.acp.conditions); + return ConditionContext.findRequestedParameters(conditionExpr.condition.toObj()); + } } diff --git a/packages/taco/test/taco.test.ts b/packages/taco/test/taco.test.ts index f07e7656c..0f38a5f4f 100644 --- a/packages/taco/test/taco.test.ts +++ b/packages/taco/test/taco.test.ts @@ -3,6 +3,7 @@ import { initialize, SessionStaticSecret, } from '@nucypher/nucypher-core'; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { aliceSecretKeyBytes, fakeDkgFlow, @@ -94,4 +95,33 @@ describe('taco', () => { expect(decryptSpy).toHaveBeenCalled(); expect(decryptedMessage).toEqual(toBytes(message)); }); + + it('exposes requested parameters', async ()=> { + const mockedDkg = fakeDkgFlow(FerveoVariant.precomputed, 0, 4, 4); + const mockedDkgRitual = fakeDkgRitual(mockedDkg); + const provider = fakeProvider(aliceSecretKeyBytes); + const signer = fakeSigner(aliceSecretKeyBytes); + const getFinalizedRitualSpy = mockGetActiveRitual(mockedDkgRitual); + + + const customParamKey = ":nftId"; + const ownsNFTWithCustomParams = new conditions.predefined.erc721.ERC721Ownership({ + contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77', + parameters: [customParamKey], + chain: TEST_CHAIN_ID, + }); + + const messageKit = await taco.encrypt( + provider, + domains.DEVNET, + message, + ownsNFTWithCustomParams, + mockedDkg.ritualId, + signer, + ); + expect(getFinalizedRitualSpy).toHaveBeenCalled(); + + const requestedParameters = taco.conditions.context.ConditionContext.requestedParameters(messageKit); + expect(requestedParameters).toEqual(new Set([customParamKey, USER_ADDRESS_PARAM_DEFAULT])); + }) }); From 119f2b9cf4f0f9fff07ea48e91ba4eebb9077f76 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Mon, 24 Jun 2024 08:23:21 +0200 Subject: [PATCH 38/75] feat!(cond): remove auth checking from cond expr --- packages/taco/src/conditions/condition-expr.ts | 4 ---- packages/taco/test/conditions/context.test.ts | 9 --------- 2 files changed, 13 deletions(-) diff --git a/packages/taco/src/conditions/condition-expr.ts b/packages/taco/src/conditions/condition-expr.ts index ee1e2882a..405daece1 100644 --- a/packages/taco/src/conditions/condition-expr.ts +++ b/packages/taco/src/conditions/condition-expr.ts @@ -75,10 +75,6 @@ export class ConditionExpression { ); } - public contextRequiresAuthentication(): boolean { - return this.condition.requiresAuthentication(); - } - public equals(other: ConditionExpression): boolean { return [ this.version === other.version, diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index a43b21814..281d45ee4 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -149,7 +149,6 @@ describe('context', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); expect(() => conditionExpr.buildContext({})).toThrow( `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, @@ -169,7 +168,6 @@ describe('context', () => { } as ContractConditionProps; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(conditionExpr.buildContext( {}, authProviders)).toBeDefined(); expect(() => conditionExpr.buildContext( {})).toThrow( `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, @@ -182,7 +180,6 @@ describe('context', () => { expect( JSON.stringify(condition.toObj()).includes(USER_ADDRESS_PARAM_DEFAULT), ).toBe(false); - expect(conditionExpr.contextRequiresAuthentication()).toBe(false); expect(conditionExpr.buildContext( {}, authProviders)).toBeDefined(); expect(conditionExpr.buildContext( {})).toBeDefined(); }); @@ -197,7 +194,6 @@ describe('context', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); @@ -213,7 +209,6 @@ describe('context', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); @@ -314,7 +309,6 @@ describe('authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => conditionExpr.buildContext( {}, {})).toThrow( `Authentication provider required to satisfy ${userAddressParam} context variable in condition`, ); @@ -331,7 +325,6 @@ describe('authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => conditionExpr.buildContext( {}, authProviders), ).not.toThrow(); @@ -348,7 +341,6 @@ describe('authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresAuthentication()).toBe(true); expect(() => conditionExpr.buildContext( {}, authProviders), ).not.toThrow(); @@ -364,7 +356,6 @@ describe('authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.contextRequiresAuthentication()).toBe(true); const builtContext = conditionExpr.buildContext( {}, authProviders); const contextVars = await builtContext.toContextParameters(); From 62a0f78e5f6b3f467e2b821946f58577737b4a5e Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Mon, 24 Jun 2024 08:29:55 +0200 Subject: [PATCH 39/75] refactor: rename methods for consistency --- .../taco/src/conditions/context/context.ts | 18 +++++++++--------- packages/taco/test/taco.test.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 3ff615572..a365fb7de 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -32,13 +32,13 @@ export class ConditionContext { private readonly authProviders: AuthProviders = {}, ) { const condProps = condition.toObj(); - this.validateParameters(); + this.validateContextParameters(); this.validateCoreConditions(condProps); - this.requestedParameters = ConditionContext.findRequestedParameters(condProps); + this.requestedParameters = ConditionContext.findContextParameters(condProps); this.validateAuthProviders(this.requestedParameters); } - private validateParameters(): void { + private validateContextParameters(): void { Object.keys(this.customParameters).forEach((key) => { if (RESERVED_CONTEXT_PARAMS.includes(key)) { throw new Error(ERR_RESERVED_PARAM(key)); @@ -55,7 +55,7 @@ export class ConditionContext { new CoreConditions(toJSON(condObject)); } - private validateNoMissingParameters(parameters: Record) { + private validateNoMissingContextParameters(parameters: Record) { // Ok, so at this point we should have all the parameters we need // If we don't, we have a problem and we should throw const missingParameters = Array.from(this.requestedParameters).filter( @@ -115,7 +115,7 @@ export class ConditionContext { return !!String(param).match(CONTEXT_PARAM_REGEXP); } - public static findRequestedParameters(condition: ConditionProps) { + public static findContextParameters(condition: ConditionProps) { // First, we want to find all the parameters we need to add const requestedParameters = new Set(); @@ -138,7 +138,7 @@ export class ConditionContext { // If it's a compound condition, check operands if (condition.conditionType === CompoundConditionType) { for (const key in condition.operands) { - const innerParams = this.findRequestedParameters( + const innerParams = this.findContextParameters( condition.operands[key], ); for (const param of innerParams) { @@ -162,7 +162,7 @@ export class ConditionContext { public toContextParameters = async (): Promise> => { const parameters = await this.fillContextParameters(this.requestedParameters); - this.validateNoMissingParameters(parameters); + this.validateNoMissingContextParameters(parameters); return parameters; }; @@ -178,8 +178,8 @@ export class ConditionContext { ); } - public static requestedParameters(messageKit: ThresholdMessageKit): Set { + public static requestedContextParameters(messageKit: ThresholdMessageKit): Set { const conditionExpr = ConditionExpression.fromCoreConditions(messageKit.acp.conditions); - return ConditionContext.findRequestedParameters(conditionExpr.condition.toObj()); + return ConditionContext.findContextParameters(conditionExpr.condition.toObj()); } } diff --git a/packages/taco/test/taco.test.ts b/packages/taco/test/taco.test.ts index 0f38a5f4f..8ae3a5b1b 100644 --- a/packages/taco/test/taco.test.ts +++ b/packages/taco/test/taco.test.ts @@ -121,7 +121,7 @@ describe('taco', () => { ); expect(getFinalizedRitualSpy).toHaveBeenCalled(); - const requestedParameters = taco.conditions.context.ConditionContext.requestedParameters(messageKit); + const requestedParameters = taco.conditions.context.ConditionContext.requestedContextParameters(messageKit); expect(requestedParameters).toEqual(new Set([customParamKey, USER_ADDRESS_PARAM_DEFAULT])); }) }); From 333fb43b7466ebc42e7abc176566081f29f3fa87 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 12 Jun 2024 11:47:10 +0200 Subject: [PATCH 40/75] feat(eip4361): allow for reusing siwe messages --- packages/taco/src/conditions/const.ts | 6 +- .../taco/src/conditions/context/context.ts | 48 +++++++--- packages/taco/test/conditions/context.test.ts | 95 +++++++++++++++---- 3 files changed, 115 insertions(+), 34 deletions(-) diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 01357b76c..626b3088b 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -5,6 +5,9 @@ import { USER_ADDRESS_PARAM_EIP712 } from "@nucypher/taco-auth"; +export const USER_ADDRESS_PARAM_EXTERNAL_EIP4361 = + ':userAddressExternalEIP4361'; + export const ETH_ADDRESS_REGEXP = new RegExp('^0x[a-fA-F0-9]{40}$'); // Only allow alphanumeric characters and underscores @@ -22,7 +25,8 @@ export const SUPPORTED_CHAIN_IDS = [ export const USER_ADDRESS_PARAMS = [ USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361, - // this should always be last + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, + // Ordering matters, this should always be last USER_ADDRESS_PARAM_DEFAULT, ]; diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index a365fb7de..d55a5d9d0 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -6,10 +6,10 @@ import { CoreConditions, CoreContext } from '../../types'; import { CompoundConditionType } from '../compound-condition'; import { Condition, ConditionProps } from '../condition'; import { ConditionExpression } from '../condition-expr'; -import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS } from '../const'; +import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS, USER_ADDRESS_PARAMS } from '../const'; -export type CustomContextParam = string | number | boolean; +export type CustomContextParam = string | number | boolean | AuthSignature; export type ContextParam = CustomContextParam | AuthSignature; const ERR_RESERVED_PARAM = (key: string) => @@ -17,11 +17,13 @@ const ERR_RESERVED_PARAM = (key: string) => const ERR_INVALID_CUSTOM_PARAM = (key: string) => `Custom parameter ${key} must start with ${CONTEXT_PARAM_PREFIX}`; const ERR_AUTH_PROVIDER_REQUIRED = (key: string) => - `Authentication provider required to satisfy ${key} context variable in condition`; + `No authentication provider required to satisfy ${key} context variable in condition`; const ERR_MISSING_CONTEXT_PARAMS = (params: string[]) => `Missing custom context parameter(s): ${params.join(', ')}`; const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => `Unknown custom context parameter(s): ${params.join(', ')}`; +const ERR_NO_AUTH_PROVIDER_FOR_PARAM = (param: string) => + `No custom parameter for requested context parameter: ${param}`; export class ConditionContext { public requestedParameters: Set; @@ -86,16 +88,24 @@ export class ConditionContext { } private validateAuthProviders(requestedParameters: Set): void { - requestedParameters - .forEach(param => { - const maybeAuthMethod = AUTH_METHOD_FOR_PARAM[param]; - if (!maybeAuthMethod) { - return; - } - if (!this.authProviders[maybeAuthMethod]) { - throw new Error(ERR_AUTH_PROVIDER_REQUIRED(param)); - } - }); + for (const param of requestedParameters) { + // If it's not a user address parameter, we can skip + if (!USER_ADDRESS_PARAMS.includes(param)) { + continue; + } + + // If it's a user address parameter, we need to check if we have an auth provider + const authMethod = AUTH_METHOD_FOR_PARAM[param]; + if (!authMethod && !this.customParameters[param]) { + // If we don't have an auth method, and we don't have a custom parameter, we have a problem + throw new Error(ERR_NO_AUTH_PROVIDER_FOR_PARAM(param)); + } + + // If we have an auth method, but we don't have an auth provider, we have a problem + if (authMethod && !this.authProviders[authMethod]) { + throw new Error(ERR_AUTH_PROVIDER_REQUIRED(param)); + } + } } private async fillAuthContextParameters(requestedParameters: Set): Promise> { @@ -119,12 +129,20 @@ export class ConditionContext { // First, we want to find all the parameters we need to add const requestedParameters = new Set(); - // Search conditions for parameters // Check return value test if (condition.returnValueTest) { const rvt = condition.returnValueTest.value; - if (ConditionContext.isContextParameter(rvt)) { + // Return value test can be a single parameter or an array of parameters + if (Array.isArray(rvt)) { + rvt.forEach((value) => { + if (ConditionContext.isContextParameter(value)) { + requestedParameters.add(value); + } + }); + } else if (ConditionContext.isContextParameter(rvt)) { requestedParameters.add(rvt); + } else { + // Not a context parameter, we can skip } } diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 281d45ee4..373ca924f 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -1,7 +1,7 @@ import { initialize } from '@nucypher/nucypher-core'; import { AuthProviders, - AuthSignature, + AuthSignature, EIP4361_AUTH_METHOD, EIP4361AuthProvider, EIP712AuthProvider, EIP712TypedData, makeAuthProviders, @@ -24,6 +24,7 @@ import { RpcCondition } from '../../src/conditions/base/rpc'; import { ConditionExpression } from '../../src/conditions/condition-expr'; import { RESERVED_CONTEXT_PARAMS, + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, } from '../../src/conditions/const'; import { CustomContextParam } from '../../src/conditions/context'; import { @@ -151,7 +152,7 @@ describe('context', () => { const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); expect(() => conditionExpr.buildContext({})).toThrow( - `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `No authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -170,7 +171,7 @@ describe('context', () => { const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.buildContext( {}, authProviders)).toBeDefined(); expect(() => conditionExpr.buildContext( {})).toThrow( - `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `No authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -195,7 +196,7 @@ describe('context', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( - `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `No authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -210,7 +211,7 @@ describe('context', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( - `Authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `No authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -286,11 +287,29 @@ describe('context', () => { }); }); -describe('authentication provider', () => { +// TODO: Move to a separate file +describe('No authentication provider', () => { let provider: ethers.providers.Provider; let signer: ethers.Signer; let authProviders: AuthProviders; + async function testEIP4361AuthSignature(authSignature: AuthSignature) { + expect(authSignature).toBeDefined(); + expect(authSignature.signature).toBeDefined(); + expect(authSignature.scheme).toEqual('EIP4361'); + + const signerAddress = await signer.getAddress(); + expect(authSignature.address).toEqual(signerAddress); + + expect(authSignature.typedData).toContain( + `localhost wants you to sign in with your Ethereum account:\n${signerAddress}`, + ); + expect(authSignature.typedData).toContain('URI: http://localhost:3000'); + + const chainId = (await provider.getNetwork()).chainId; + expect(authSignature.typedData).toContain(`Chain ID: ${chainId}`); + } + beforeAll(async () => { await initialize(); provider = fakeProvider(); @@ -310,7 +329,7 @@ describe('authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(() => conditionExpr.buildContext( {}, {})).toThrow( - `Authentication provider required to satisfy ${userAddressParam} context variable in condition`, + `No authentication provider required to satisfy ${userAddressParam} context variable in condition`, ); }); }); @@ -397,23 +416,63 @@ describe('authentication provider', () => { EIP4361AuthProvider.prototype, 'getOrCreateAuthSignature', ); + const authSignature = await makeAuthSignature(USER_ADDRESS_PARAM_EIP4361); - expect(authSignature).toBeDefined(); - expect(authSignature.signature).toBeDefined(); - expect(authSignature.scheme).toEqual('EIP4361'); + await testEIP4361AuthSignature(authSignature); - const signerAddress = await signer.getAddress(); - expect(authSignature.address).toEqual(signerAddress); + expect(eip4361Spy).toHaveBeenCalledOnce(); + }); - expect(authSignature.typedData).toContain( - `localhost wants you to sign in with your Ethereum account:\n${signerAddress}`, + it('supports reusing external eip4361', async () => { + // Because we are reusing an existing SIWE auth message, we have to pass it as a custom parameter + const authMessage = await makeAuthSignature(USER_ADDRESS_PARAM_EIP4361); + const customParams: Record = { + [USER_ADDRESS_PARAM_EXTERNAL_EIP4361]: authMessage as CustomContextParam, + }; + + // Spying on the EIP4361 provider to make sure it's not called + const eip4361Spy = vi.spyOn( + EIP4361AuthProvider.prototype, + 'getOrCreateAuthSignature', ); - expect(authSignature.typedData).toContain('URI: http://localhost:3000'); - const chainId = (await provider.getNetwork()).chainId; - expect(authSignature.typedData).toContain(`Chain ID: ${chainId}`); + // Now, creating the condition context to run the actual test + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: USER_ADDRESS_PARAM_EXTERNAL_EIP4361, + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionExpr = new ConditionExpression(condition); - expect(eip4361Spy).toHaveBeenCalledOnce(); + // Make sure we remove the EIP4361 auth method from the auth providers first + delete authProviders[EIP4361_AUTH_METHOD]; + // Should throw an error if we don't pass the custom parameter + expect( + () => conditionExpr.buildContext( {}, authProviders) + ).toThrow( + `No custom parameter for requested context parameter: ${USER_ADDRESS_PARAM_EXTERNAL_EIP4361}`, + ); + + // Remembering to pass in customParams here: + const builtContext = conditionExpr.buildContext( + customParams, + authProviders, + ); + const contextVars = await builtContext.toContextParameters(); + expect(eip4361Spy).not.toHaveBeenCalledOnce(); + + // Now, we expect that the auth signature will be available in the context variables + const authSignature = contextVars[ + USER_ADDRESS_PARAM_EXTERNAL_EIP4361 + ] as AuthSignature; + expect(authSignature).toBeDefined(); + await testEIP4361AuthSignature(authSignature); + + // TODO: Should we enforce that? It does not affect the server-side verification of the signature + // expect(contextVars[USER_ADDRESS_PARAM_EXTERNAL_EIP4361]).not.toBeDefined(); }); }); From 7d9f561fd918eecdc5ac9b78412c13c560f56a18 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Mon, 24 Jun 2024 08:34:56 +0200 Subject: [PATCH 41/75] refactor: don't reuse eip4361 alias --- packages/taco/test/conditions/context.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 373ca924f..19662417a 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -470,9 +470,6 @@ describe('No authentication provider', () => { ] as AuthSignature; expect(authSignature).toBeDefined(); await testEIP4361AuthSignature(authSignature); - - // TODO: Should we enforce that? It does not affect the server-side verification of the signature - // expect(contextVars[USER_ADDRESS_PARAM_EXTERNAL_EIP4361]).not.toBeDefined(); }); }); From 914be0d51ce128b073b14d492a8e32bf0a44f110 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Mon, 24 Jun 2024 14:21:13 +0200 Subject: [PATCH 42/75] chore: document external eip4361 behavior --- packages/taco/src/conditions/const.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 626b3088b..601888c31 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -34,4 +34,6 @@ export const RESERVED_CONTEXT_PARAMS = [ USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361, + // USER_ADDRESS_PARAM_EXTERNAL_EIP4361 is not reserved and can be used as a custom context parameter + // USER_ADDRESS_PARAM_EXTERNAL_EIP4361 ]; From baf894208783a3ea0c18e4622b2e77d5bb97b3e3 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 25 Jun 2024 10:38:43 +0200 Subject: [PATCH 43/75] apply pr suggestions --- packages/taco/src/conditions/context/context.ts | 2 +- packages/taco/test/conditions/context.test.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index d55a5d9d0..b68181ed3 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -17,7 +17,7 @@ const ERR_RESERVED_PARAM = (key: string) => const ERR_INVALID_CUSTOM_PARAM = (key: string) => `Custom parameter ${key} must start with ${CONTEXT_PARAM_PREFIX}`; const ERR_AUTH_PROVIDER_REQUIRED = (key: string) => - `No authentication provider required to satisfy ${key} context variable in condition`; + `No matching authentication provider to satisfy ${key} context variable in condition`; const ERR_MISSING_CONTEXT_PARAMS = (params: string[]) => `Missing custom context parameter(s): ${params.join(', ')}`; const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 19662417a..7b17d16f2 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -152,7 +152,7 @@ describe('context', () => { const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); expect(() => conditionExpr.buildContext({})).toThrow( - `No authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -171,7 +171,7 @@ describe('context', () => { const conditionExpr = new ConditionExpression(condition); expect(conditionExpr.buildContext( {}, authProviders)).toBeDefined(); expect(() => conditionExpr.buildContext( {})).toThrow( - `No authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -196,7 +196,7 @@ describe('context', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( - `No authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -211,7 +211,7 @@ describe('context', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( - `No authentication provider required to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -329,7 +329,7 @@ describe('No authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); expect(() => conditionExpr.buildContext( {}, {})).toThrow( - `No authentication provider required to satisfy ${userAddressParam} context variable in condition`, + `No matching authentication provider to satisfy ${userAddressParam} context variable in condition`, ); }); }); From dfd96fb0c896960fe6272d83cee6c0318fd3fed4 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 25 Jun 2024 10:55:49 +0200 Subject: [PATCH 44/75] feat(auth): set defaults for eip4361 providers --- packages/taco-auth/src/helper.ts | 10 +++++--- packages/taco-auth/src/providers/eip4361.ts | 25 ++++++++++++++----- packages/taco-auth/test/taco-auth.test.ts | 4 +-- packages/taco/test/conditions/context.test.ts | 4 +-- packages/test-utils/src/variables.ts | 5 ++++ 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/packages/taco-auth/src/helper.ts b/packages/taco-auth/src/helper.ts index 864dd4952..22d94a0ad 100644 --- a/packages/taco-auth/src/helper.ts +++ b/packages/taco-auth/src/helper.ts @@ -1,12 +1,16 @@ import {ethers} from "ethers"; -import { EIP4361AuthProvider } from './providers/eip4361'; +import { EIP4361AuthProvider, EIP4361AuthProviderParams } from './providers/eip4361'; import { EIP712AuthProvider } from './providers/eip712'; import { AuthProviders, EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './types'; -export const makeAuthProviders = (provider: ethers.providers.Provider, signer?: ethers.Signer): AuthProviders => { +export const makeAuthProviders = ( + provider: ethers.providers.Provider, + signer?: ethers.Signer, + siweDefaultParams?: EIP4361AuthProviderParams +): AuthProviders => { return { [EIP712_AUTH_METHOD]: signer ? new EIP712AuthProvider(provider, signer) : undefined, - [EIP4361_AUTH_METHOD]: signer ? new EIP4361AuthProvider(provider, signer) : undefined + [EIP4361_AUTH_METHOD]: signer ? new EIP4361AuthProvider(provider, signer, siweDefaultParams) : undefined } as AuthProviders; }; diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts index db35aee7f..48c3fc1a0 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -6,6 +6,13 @@ import { AuthSignature, EIP4361_AUTH_METHOD } from '../types'; export type EIP4361TypedData = string; +export type EIP4361AuthProviderParams = { + domain: string; + uri: string; +} + +const ERR_MISSING_SIWE_PARAMETERS = 'Missing default SIWE parameters'; + export class EIP4361AuthProvider { private readonly storage: LocalStorage; @@ -13,6 +20,7 @@ export class EIP4361AuthProvider { // TODO: We only need the provider to fetch the chainId, consider removing it private readonly provider: ethers.providers.Provider, private readonly signer: ethers.Signer, + private readonly providerParams?: EIP4361AuthProviderParams, ) { this.storage = new LocalStorage(); } @@ -55,7 +63,10 @@ export class EIP4361AuthProvider { } // TODO: Create a facility to set these parameters or expose them to the user - private getParametersOrDefault() { + private getParametersOrDefault(): { + domain: string; + uri: string; + } { // If we are in a browser environment, we can get the domain and uri from the window object if (typeof window !== 'undefined') { const maybeOrigin = window?.location?.origin; @@ -64,10 +75,12 @@ export class EIP4361AuthProvider { uri: maybeOrigin, }; } - // TODO: Add a facility to manage this case - return { - domain: 'localhost', - uri: 'http://localhost:3000', - }; + if (this.providerParams) { + return { + domain: this.providerParams.domain, + uri: this.providerParams.uri, + } + } + throw new Error(ERR_MISSING_SIWE_PARAMETERS); } } diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/taco-auth.test.ts index 80e4da215..7cf7d0175 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/taco-auth.test.ts @@ -1,7 +1,7 @@ import { bobSecretKeyBytes, fakeProvider, - fakeSigner, + fakeSigner, TEST_SIWE_PARAMS, } from '@nucypher/test-utils'; import { SiweMessage } from 'siwe'; import { describe, expect, it } from 'vitest'; @@ -43,7 +43,7 @@ describe('taco authorization', () => { const provider = fakeProvider(bobSecretKeyBytes); const signer = fakeSigner(bobSecretKeyBytes); - const eip4361Provider = new EIP4361AuthProvider(provider, signer); + const eip4361Provider = new EIP4361AuthProvider(provider, signer, TEST_SIWE_PARAMS); const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); expect(typedSignature.signature).toBeDefined(); expect(typedSignature.address).toEqual(await signer.getAddress()); diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 7b17d16f2..a48aa7e45 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -11,7 +11,7 @@ import { USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_EIP712 } from "@nucypher/taco-auth"; -import {fakeAuthProviders, fakeProvider, fakeSigner} from '@nucypher/test-utils'; +import { fakeAuthProviders, fakeProvider, fakeSigner, TEST_SIWE_PARAMS } from '@nucypher/test-utils'; import { ethers } from 'ethers'; import { beforeAll, describe, expect, it, vi } from 'vitest'; @@ -314,7 +314,7 @@ describe('No authentication provider', () => { await initialize(); provider = fakeProvider(); signer = fakeSigner(); - authProviders = makeAuthProviders(provider, signer); + authProviders = makeAuthProviders(provider, signer, TEST_SIWE_PARAMS); }); it('throws an error if there is no auth provider', () => { diff --git a/packages/test-utils/src/variables.ts b/packages/test-utils/src/variables.ts index 85da75d92..462f56609 100644 --- a/packages/test-utils/src/variables.ts +++ b/packages/test-utils/src/variables.ts @@ -14,3 +14,8 @@ export const TEST_CONTRACT_ADDR = '0x0000000000000000000000000000000000000001'; export const TEST_CONTRACT_ADDR_2 = '0x0000000000000000000000000000000000000002'; export const TEST_CHAIN_ID = ChainId.SEPOLIA; + +export const TEST_SIWE_PARAMS = { + domain: 'localhost', + uri: 'http://localhost:3000', +}; From 5a4d072bfbf1731d685dacd625dab276eda3b998 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 2 Jul 2024 10:40:16 +0200 Subject: [PATCH 45/75] chore: update lockfile --- pnpm-lock.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d109aaf3..290860c64 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - '@nucypher/nucypher-core': ^0.14.1 + '@nucypher/nucypher-core': ^0.14.5 glob-parent@<5.1.2: '>=5.1.2' node-forge@<1.0.0: '>=1.0.0' node-forge@<1.3.0: '>=1.3.0' @@ -19,8 +19,8 @@ importers: specifier: ^2.27.5 version: 2.27.5 '@nucypher/nucypher-core': - specifier: ^0.14.1 - version: 0.14.4 + specifier: ^0.14.5 + version: 0.14.5 ethers: specifier: ^5.7.2 version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -473,8 +473,8 @@ importers: packages/pre: dependencies: '@nucypher/nucypher-core': - specifier: ^0.14.1 - version: 0.14.4 + specifier: ^0.14.5 + version: 0.14.5 '@nucypher/shared': specifier: workspace:* version: link:../shared @@ -498,8 +498,8 @@ importers: specifier: ^0.22.0 version: 0.22.0 '@nucypher/nucypher-core': - specifier: ^0.14.1 - version: 0.14.4 + specifier: ^0.14.5 + version: 0.14.5 axios: specifier: ^1.6.8 version: 1.7.2 @@ -538,8 +538,8 @@ importers: packages/taco: dependencies: '@nucypher/nucypher-core': - specifier: ^0.14.1 - version: 0.14.4 + specifier: ^0.14.5 + version: 0.14.5 '@nucypher/shared': specifier: workspace:* version: link:../shared @@ -582,8 +582,8 @@ importers: packages/test-utils: dependencies: '@nucypher/nucypher-core': - specifier: ^0.14.1 - version: 0.14.4 + specifier: ^0.14.5 + version: 0.14.5 '@nucypher/shared': specifier: workspace:* version: link:../shared @@ -2214,8 +2214,8 @@ packages: '@nucypher/nucypher-contracts@0.22.0': resolution: {integrity: sha512-poWxFBi2qL5KnPZYsqr4AWn/O26Z2Q6X9EoARjQZIZdcEqYvE6iMHHgiw/RKL036u1jh1/rzo44eZRCt6ErMpA==} - '@nucypher/nucypher-core@0.14.4': - resolution: {integrity: sha512-LIQbT0wKhoBwDx2E7SlxRg0P4HLaTr/S3TRIed1TqejYqqYvFckyKJmkovVSH9qE7fVuSYpZ1OiAqLFaAtx82A==} + '@nucypher/nucypher-core@0.14.5': + resolution: {integrity: sha512-Q3kBuJL0qtTtnxrM5DEQauQUvDlXmwubm9u1h7gbyLhs+aZNC9WDyjEUbE43+uahlHu4k1hKEMxD1gjV165ChA==} '@nucypher/shared@0.2.2': resolution: {integrity: sha512-T8nIo1cn7WOFpmx67SZQTuxzOTNe1A6XgcfCa2vX+WiLWZagqHFhByoVqCAbKM2PX6F78qziZmxKNBLSszEjUw==} @@ -11086,14 +11086,14 @@ snapshots: '@nucypher/nucypher-contracts@0.22.0': {} - '@nucypher/nucypher-core@0.14.4': {} + '@nucypher/nucypher-core@0.14.5': {} '@nucypher/shared@0.2.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/providers': 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@nucypher/nucypher-contracts': 0.22.0 - '@nucypher/nucypher-core': 0.14.4 + '@nucypher/nucypher-core': 0.14.5 axios: 1.7.2 deep-equal: 2.2.3 ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -11106,7 +11106,7 @@ snapshots: '@nucypher/taco@0.2.6(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abstract-signer': 5.7.0 - '@nucypher/nucypher-core': 0.14.4 + '@nucypher/nucypher-core': 0.14.5 '@nucypher/shared': 0.2.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) semver: 7.6.2 From 4fcb8ed3e4826c4991032779313e9c5c12faea7b Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Fri, 21 Jun 2024 14:03:21 +0200 Subject: [PATCH 46/75] feat!(cond): deprecate eip712 auth provider --- packages/taco-auth/src/providers/eip712.ts | 7 +++++++ packages/taco-auth/src/types.ts | 3 +++ 2 files changed, 10 insertions(+) diff --git a/packages/taco-auth/src/providers/eip712.ts b/packages/taco-auth/src/providers/eip712.ts index 5dd4c6b79..3c5f4f7ba 100644 --- a/packages/taco-auth/src/providers/eip712.ts +++ b/packages/taco-auth/src/providers/eip712.ts @@ -56,6 +56,9 @@ const EIP712Domain = [ }, ]; +/** + * @deprecated Use EIP4361AuthProvider instead. + */ export class EIP712AuthProvider implements AuthProvider { private readonly storage: LocalStorage; @@ -64,6 +67,10 @@ export class EIP712AuthProvider implements AuthProvider { private readonly provider: ethers.providers.Provider, private readonly signer: ethers.Signer, ) { + console.warn( + 'DeprecationWarning: The EIP712AuthProvider authentication provider is deprecated. ' + + 'Please use EIP4361AuthProvider instead. Refer to the documentation for more details.' + ); this.storage = new LocalStorage(); } diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/types.ts index 316731bb4..dc09b4fd1 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/types.ts @@ -19,6 +19,9 @@ export interface AuthSignature { typedData: EIP712TypedData | EIP4361TypedData; } +/** + * @deprecated Use EIP4361_AUTH_METHOD instead. + */ export const EIP712_AUTH_METHOD = 'EIP712'; export const EIP4361_AUTH_METHOD = 'EIP4361'; From be42ddc34a2054dd3c8297d0f3246a838734687a Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Fri, 28 Jun 2024 12:02:01 +0200 Subject: [PATCH 47/75] feat(auth): validate user-provided auth signature --- packages/shared/package.json | 3 +- packages/shared/src/index.ts | 1 + packages/shared/src/schemas.ts | 4 + packages/taco-auth/package.json | 3 +- .../src/{types.ts => auth-provider.ts} | 24 ++--- packages/taco-auth/src/auth-sig.ts | 19 ++++ packages/taco-auth/src/helper.ts | 15 +-- packages/taco-auth/src/index.ts | 6 +- packages/taco-auth/src/providers/eip4361.ts | 19 ++-- packages/taco-auth/src/providers/eip712.ts | 76 ++++++++------- packages/taco-auth/src/providers/index.ts | 27 +----- packages/taco-auth/src/storage.ts | 31 ++++-- ...aco-auth.test.ts => auth-provider.test.ts} | 7 +- packages/taco-auth/test/auth-sig.test.ts | 94 +++++++++++++++++++ packages/taco/package.json | 2 +- packages/taco/src/conditions/base/contract.ts | 2 +- packages/taco/src/conditions/const.ts | 3 - packages/taco/src/conditions/shared.ts | 6 +- packages/taco/test/conditions/context.test.ts | 6 +- packages/test-utils/src/utils.ts | 10 +- pnpm-lock.yaml | 8 +- 21 files changed, 246 insertions(+), 120 deletions(-) create mode 100644 packages/shared/src/schemas.ts rename packages/taco-auth/src/{types.ts => auth-provider.ts} (74%) create mode 100644 packages/taco-auth/src/auth-sig.ts rename packages/taco-auth/test/{taco-auth.test.ts => auth-provider.test.ts} (95%) create mode 100644 packages/taco-auth/test/auth-sig.test.ts diff --git a/packages/shared/package.json b/packages/shared/package.json index 950bc6d30..7b3ee3832 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -47,7 +47,8 @@ "axios": "^1.6.8", "deep-equal": "^2.2.3", "ethers": "*", - "qs": "^6.12.1" + "qs": "^6.12.1", + "zod": "*" }, "devDependencies": { "@typechain/ethers-v5": "^11.1.2", diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 63f08aa5a..0ca14e2b0 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -3,6 +3,7 @@ export * from './porter'; export type * from './types'; export * from './utils'; export * from './web3'; +export * from './schemas'; // Re-exports export { diff --git a/packages/shared/src/schemas.ts b/packages/shared/src/schemas.ts new file mode 100644 index 000000000..0f083c130 --- /dev/null +++ b/packages/shared/src/schemas.ts @@ -0,0 +1,4 @@ +import { z } from 'zod'; + +export const ETH_ADDRESS_REGEXP = new RegExp('^0x[a-fA-F0-9]{40}$'); +export const EthAddressSchema = z.string().regex(ETH_ADDRESS_REGEXP); diff --git a/packages/taco-auth/package.json b/packages/taco-auth/package.json index 0e821b87c..639c80f8c 100644 --- a/packages/taco-auth/package.json +++ b/packages/taco-auth/package.json @@ -41,7 +41,8 @@ "dependencies": { "@ethersproject/abstract-signer": "^5.7.0", "@nucypher/shared": "workspace:*", - "siwe": "^2.3.2" + "siwe": "^2.3.2", + "zod": "^3.22.4" }, "devDependencies": { "@nucypher/test-utils": "workspace:*" diff --git a/packages/taco-auth/src/types.ts b/packages/taco-auth/src/auth-provider.ts similarity index 74% rename from packages/taco-auth/src/types.ts rename to packages/taco-auth/src/auth-provider.ts index dc09b4fd1..8f7d18578 100644 --- a/packages/taco-auth/src/types.ts +++ b/packages/taco-auth/src/auth-provider.ts @@ -1,5 +1,12 @@ -import {EIP4361AuthProvider, EIP4361TypedData} from './providers/eip4361'; -import {EIP712AuthProvider, EIP712TypedData} from './providers/eip712'; +import { AuthSignature } from './auth-sig'; +import { EIP4361AuthProvider, EIP712AuthProvider } from './providers'; + +/** + * @deprecated Use EIP4361_AUTH_METHOD instead. + */ +export const EIP712_AUTH_METHOD = 'EIP712'; +export const EIP4361_AUTH_METHOD = 'EIP4361'; + export interface AuthProvider { getOrCreateAuthSignature(): Promise; @@ -12,19 +19,6 @@ export type AuthProviders = { [key: string]: AuthProvider | undefined; }; -export interface AuthSignature { - signature: string; - address: string; - scheme: 'EIP712' | 'EIP4361'; - typedData: EIP712TypedData | EIP4361TypedData; -} - -/** - * @deprecated Use EIP4361_AUTH_METHOD instead. - */ -export const EIP712_AUTH_METHOD = 'EIP712'; -export const EIP4361_AUTH_METHOD = 'EIP4361'; - export const USER_ADDRESS_PARAM_DEFAULT = ':userAddress'; export const USER_ADDRESS_PARAM_EIP712 = `:userAddress${EIP712_AUTH_METHOD}`; export const USER_ADDRESS_PARAM_EIP4361 = `:userAddress${EIP4361_AUTH_METHOD}`; diff --git a/packages/taco-auth/src/auth-sig.ts b/packages/taco-auth/src/auth-sig.ts new file mode 100644 index 000000000..4e21677b0 --- /dev/null +++ b/packages/taco-auth/src/auth-sig.ts @@ -0,0 +1,19 @@ +import { EthAddressSchema } from '@nucypher/shared'; +import { z } from 'zod'; + +import { EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './auth-provider'; +import { EIP4361TypedDataSchema, EIP712TypedDataSchema } from './providers'; + + +export const authSignatureSchema = z.object({ + signature: z.string(), + address: EthAddressSchema, + scheme: z.enum([EIP712_AUTH_METHOD, EIP4361_AUTH_METHOD]), + typedData: z.union([ + EIP4361TypedDataSchema, + // TODO(#536): Remove post EIP712 deprecation + EIP712TypedDataSchema, + ]), +}); + +export type AuthSignature = z.infer; diff --git a/packages/taco-auth/src/helper.ts b/packages/taco-auth/src/helper.ts index 22d94a0ad..894353afb 100644 --- a/packages/taco-auth/src/helper.ts +++ b/packages/taco-auth/src/helper.ts @@ -1,16 +1,19 @@ -import {ethers} from "ethers"; +import { ethers } from 'ethers'; -import { EIP4361AuthProvider, EIP4361AuthProviderParams } from './providers/eip4361'; -import { EIP712AuthProvider } from './providers/eip712'; -import { AuthProviders, EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './types'; +import { AuthProviders, EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './auth-provider'; +import { + EIP4361AuthProvider, + EIP4361AuthProviderParams, + EIP712AuthProvider, +} from './providers'; export const makeAuthProviders = ( provider: ethers.providers.Provider, signer?: ethers.Signer, - siweDefaultParams?: EIP4361AuthProviderParams + siweDefaultParams?: EIP4361AuthProviderParams, ): AuthProviders => { return { [EIP712_AUTH_METHOD]: signer ? new EIP712AuthProvider(provider, signer) : undefined, - [EIP4361_AUTH_METHOD]: signer ? new EIP4361AuthProvider(provider, signer, siweDefaultParams) : undefined + [EIP4361_AUTH_METHOD]: signer ? new EIP4361AuthProvider(provider, signer, siweDefaultParams) : undefined, } as AuthProviders; }; diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts index a9c8e7631..a7cb7846a 100644 --- a/packages/taco-auth/src/index.ts +++ b/packages/taco-auth/src/index.ts @@ -1,4 +1,4 @@ -export * from './providers/eip4361'; -export * from './providers/eip712'; -export * from './types'; +export * from './providers'; export * from './helper'; +export * from './auth-sig'; +export * from './auth-provider'; diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts index 48c3fc1a0..af754a9d4 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -1,10 +1,13 @@ import { ethers } from 'ethers'; import { generateNonce, SiweMessage } from 'siwe'; +import { z } from 'zod'; +import { EIP4361_AUTH_METHOD } from '../auth-provider'; +import { AuthSignature } from '../auth-sig'; import { LocalStorage } from '../storage'; -import { AuthSignature, EIP4361_AUTH_METHOD } from '../types'; -export type EIP4361TypedData = string; + +export const EIP4361TypedDataSchema = z.string(); export type EIP4361AuthProviderParams = { domain: string; @@ -29,15 +32,15 @@ export class EIP4361AuthProvider { const address = await this.signer.getAddress(); const storageKey = `eth-${EIP4361_AUTH_METHOD}-message-${address}`; - // If we have a message in localStorage, return it - const maybeMessage = this.storage.getItem(storageKey); - if (maybeMessage) { - return JSON.parse(maybeMessage); + // If we have a signature in localStorage, return it + const maybeSignature = this.storage.getAuthSignature(storageKey); + if (maybeSignature) { + return maybeSignature; } // If at this point we didn't return, we need to create a new message const authMessage = await this.createSIWEAuthMessage(); - this.storage.setItem(storageKey, JSON.stringify(authMessage)); + this.storage.setAuthSignature(storageKey, authMessage); return authMessage; } @@ -79,7 +82,7 @@ export class EIP4361AuthProvider { return { domain: this.providerParams.domain, uri: this.providerParams.uri, - } + }; } throw new Error(ERR_MISSING_SIWE_PARAMETERS); } diff --git a/packages/taco-auth/src/providers/eip712.ts b/packages/taco-auth/src/providers/eip712.ts index 3c5f4f7ba..fb554f16a 100644 --- a/packages/taco-auth/src/providers/eip712.ts +++ b/packages/taco-auth/src/providers/eip712.ts @@ -1,35 +1,44 @@ import type { TypedDataSigner } from '@ethersproject/abstract-signer'; import { ethers } from 'ethers'; import { utils as ethersUtils } from 'ethers/lib/ethers'; +import { z } from 'zod'; +import { AuthProvider } from '../auth-provider'; +import { AuthSignature } from '../auth-sig'; import { LocalStorage } from '../storage'; -import type { AuthProvider, AuthSignature } from '../types'; - -interface EIP712 { - types: { - Wallet: { name: string; type: string }[]; - }; - domain: { - salt: string; - chainId: number; - name: string; - version: string; - }; - message: { - blockHash: string; - address: string; - blockNumber: number; - signatureText: string; - }; -} -export interface EIP712TypedData extends EIP712 { - primaryType: 'Wallet'; - types: { - EIP712Domain: { name: string; type: string }[]; - Wallet: { name: string; type: string }[]; - }; -} + +const typeFieldSchema = z.object({ + name: z.string(), + type: z.string(), +}); + +const domain = z.object({ + salt: z.string(), + chainId: z.number(), + name: z.string(), + version: z.string(), +}); + +const messageSchema = z.object({ + blockHash: z.string(), + address: z.string(), + blockNumber: z.number(), + signatureText: z.string(), +}); + +export const EIP712TypedDataSchema = z.object({ + primaryType: z.literal('Wallet'), + types: z.object({ + EIP712Domain: z.array(typeFieldSchema), + Wallet: z.array(typeFieldSchema), + }), + domain: domain, + message: messageSchema, +}); + + +export type EIP712TypedData = z.infer; interface ChainData { blockHash: string; @@ -79,15 +88,15 @@ export class EIP712AuthProvider implements AuthProvider { const storageKey = `eip712-signature-${address}`; // If we have a signature in localStorage, return it - const maybeSignature = this.storage.getItem(storageKey); + const maybeSignature = this.storage.getAuthSignature(storageKey); if (maybeSignature) { - return JSON.parse(maybeSignature); + return maybeSignature; } // If at this point we didn't return, we need to create a new signature - const authMessage = await this.createAuthMessage(); - this.storage.setItem(storageKey, JSON.stringify(authMessage)); - return authMessage; + const authSignature = await this.createAuthMessage(); + this.storage.setAuthSignature(storageKey, authSignature); + return authSignature; } private async createAuthMessage(): Promise { @@ -97,7 +106,7 @@ export class EIP712AuthProvider implements AuthProvider { const signatureText = `I'm the owner of address ${address} as of block number ${blockNumber}`; const salt = ethersUtils.hexlify(ethersUtils.randomBytes(32)); - const typedData: EIP712 = { + const typedData = { types: { Wallet: [ { name: 'address', type: 'address' }, @@ -138,7 +147,8 @@ export class EIP712AuthProvider implements AuthProvider { private async getChainData(): Promise { const blockNumber = await this.provider.getBlockNumber(); - const blockHash = (await this.provider.getBlock(blockNumber)).hash; + const block = await this.provider.getBlock(blockNumber); + const blockHash = block.hash; const chainId = (await this.provider.getNetwork()).chainId; return { blockNumber, blockHash, chainId }; } diff --git a/packages/taco-auth/src/providers/index.ts b/packages/taco-auth/src/providers/index.ts index 5efc21c6d..6b5476af1 100644 --- a/packages/taco-auth/src/providers/index.ts +++ b/packages/taco-auth/src/providers/index.ts @@ -1,25 +1,2 @@ -import { EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from '../types'; - -import { EIP4361AuthProvider, EIP4361TypedData } from './eip4361'; -import { EIP712AuthProvider, EIP712TypedData } from './eip712'; - -export interface AuthSignatureProvider { - getOrCreateAuthSignature(): Promise; -} - -export type AuthProviders = { - [EIP712_AUTH_METHOD]?: EIP712AuthProvider; - [EIP4361_AUTH_METHOD]?: EIP4361AuthProvider; - // Fallback to satisfy type checking - [key: string]: AuthProvider | undefined; -}; - -export interface AuthSignature { - signature: string; - address: string; - scheme: 'EIP712' | 'EIP4361'; - typedData: EIP712TypedData | EIP4361TypedData; -} - -// Add other providers here -export type AuthProvider = AuthSignatureProvider; +export * from './eip712'; +export * from './eip4361'; diff --git a/packages/taco-auth/src/storage.ts b/packages/taco-auth/src/storage.ts index c692fb0c8..435297b03 100644 --- a/packages/taco-auth/src/storage.ts +++ b/packages/taco-auth/src/storage.ts @@ -1,3 +1,5 @@ +import { AuthSignature, authSignatureSchema } from './index'; + interface IStorage { getItem(key: string): string | null; @@ -5,11 +7,11 @@ interface IStorage { } class BrowserStorage implements IStorage { - getItem(key: string): string | null { + public getItem(key: string): string | null { return localStorage.getItem(key); } - setItem(key: string, value: string): void { + public setItem(key: string, value: string): void { localStorage.setItem(key, value); } } @@ -17,11 +19,11 @@ class BrowserStorage implements IStorage { class NodeStorage implements IStorage { private storage: Record = {}; - getItem(key: string): string | null { + public getItem(key: string): string | null { return this.storage[key] || null; } - setItem(key: string, value: string): void { + public setItem(key: string, value: string): void { this.storage[key] = value; } } @@ -36,11 +38,24 @@ export class LocalStorage { : new BrowserStorage(); } - getItem(key: string): string | null { - return this.storage.getItem(key); + public getAuthSignature(key: string): AuthSignature | null { + const asJson = this.storage.getItem(key); + if (!asJson) { + return null; + } + return LocalStorage.fromJson(asJson); + } + + public setAuthSignature(key: string, authSignature: AuthSignature): void { + const asJson = LocalStorage.toJson(authSignature); + this.storage.setItem(key, asJson); + } + + public static fromJson(json: string): AuthSignature { + return authSignatureSchema.parse(JSON.parse(json)); } - setItem(key: string, value: string): void { - this.storage.setItem(key, value); + public static toJson(signature: AuthSignature): string { + return JSON.stringify(signature); } } diff --git a/packages/taco-auth/test/taco-auth.test.ts b/packages/taco-auth/test/auth-provider.test.ts similarity index 95% rename from packages/taco-auth/test/taco-auth.test.ts rename to packages/taco-auth/test/auth-provider.test.ts index 7cf7d0175..1ced7495a 100644 --- a/packages/taco-auth/test/taco-auth.test.ts +++ b/packages/taco-auth/test/auth-provider.test.ts @@ -1,7 +1,8 @@ import { bobSecretKeyBytes, fakeProvider, - fakeSigner, TEST_SIWE_PARAMS, + fakeSigner, + TEST_SIWE_PARAMS, } from '@nucypher/test-utils'; import { SiweMessage } from 'siwe'; import { describe, expect, it } from 'vitest'; @@ -12,7 +13,7 @@ import { EIP712TypedData, } from '../src'; -describe('taco authorization', () => { +describe('auth provider', () => { it('creates a new EIP-712 message', async () => { const provider = fakeProvider(bobSecretKeyBytes); const signer = fakeSigner(bobSecretKeyBytes); @@ -36,7 +37,7 @@ describe('taco authorization', () => { expect(typedData.message.blockNumber).toEqual( await provider.getBlockNumber(), ); - expect(typedData.message).toHaveProperty('blockHash'); + expect(typedData.message['blockHash']).toBeDefined(); }); it('creates a new SIWE message', async () => { diff --git a/packages/taco-auth/test/auth-sig.test.ts b/packages/taco-auth/test/auth-sig.test.ts new file mode 100644 index 000000000..1eabf42fb --- /dev/null +++ b/packages/taco-auth/test/auth-sig.test.ts @@ -0,0 +1,94 @@ +import { describe, expect, it } from 'vitest'; + +import { + authSignatureSchema, +} from '../src'; + +const eip712AuthSignature = { + 'signature': 'fake-typed-signature', + 'address': '0x0000000000000000000000000000000000000000', + 'scheme': 'EIP712', + 'typedData': { + 'types': { + 'Wallet': [ + { + 'name': 'address', + 'type': 'address', + }, + { + 'name': 'signatureText', + 'type': 'string', + }, + { + 'name': 'blockNumber', + 'type': 'uint256', + }, + { + 'name': 'blockHash', + 'type': 'bytes32', + }, + ], + 'EIP712Domain': [ + { + 'name': 'name', + 'type': 'string', + }, + { + 'name': 'version', + 'type': 'string', + }, + { + 'name': 'chainId', + 'type': 'uint256', + }, + { + 'name': 'salt', + 'type': 'bytes32', + }, + ], + }, + 'domain': { + 'name': 'TACo', + 'version': '1', + 'chainId': 1234, + 'salt': '0x55d90a3b041db6dda74671bc83a25d1508979b19a105be17f57f86fe08627dbd', + }, + 'message': { + 'address': '0x0000000000000000000000000000000000000000', + 'signatureText': 'I\'m the owner of address 0x0000000000000000000000000000000000000000 as of block number 1000', + 'blockNumber': 1000, + 'blockHash': '0x0000000000000000000000000000000000000000', + }, + 'primaryType': 'Wallet', + }, +}; +const eip4361AuthSignature = { + 'signature': 'fake-signature', + 'address': '0x0000000000000000000000000000000000000000', + 'scheme': 'EIP4361', + 'typedData': 'localhost wants you to sign in with your Ethereum account:\n0x0000000000000000000000000000000000000000\n\nlocalhost wants you to sign in with your Ethereum account: 0x0000000000000000000000000000000000000000\n\nURI: http://localhost:3000\nVersion: 1\nChain ID: 1234\nNonce: 5ixAg1odyfDnrbfGa\nIssued At: 2024-07-01T10:32:39.631Z', +}; + +describe('auth signature', () => { + it('accepts a well-formed EIP172 auth signature', async () => { + authSignatureSchema.parse(eip712AuthSignature); + }); + + it('rejects an EIP712 auth signature with missing fields', async () => { + expect(() => authSignatureSchema.parse({ + ...eip712AuthSignature, + 'signature': undefined, + })).toThrow(); + }); + + it('accepts a well-formed EIP4361 auth signature', async () => { + authSignatureSchema.parse(eip4361AuthSignature); + }); + + it('rejects an EIP4361 auth signature with missing fields', async () => { + expect(() => authSignatureSchema.parse({ + ...eip4361AuthSignature, + 'signature': undefined, + })).toThrow(); + }); +}); diff --git a/packages/taco/package.json b/packages/taco/package.json index db3e4e442..dc54631eb 100644 --- a/packages/taco/package.json +++ b/packages/taco/package.json @@ -44,7 +44,7 @@ "@nucypher/taco-auth": "workspace:*", "ethers": "*", "semver": "^7.5.2", - "zod": "^3.22.4" + "zod": "*" }, "devDependencies": { "@nucypher/test-utils": "workspace:*", diff --git a/packages/taco/src/conditions/base/contract.ts b/packages/taco/src/conditions/base/contract.ts index 0fdaa991b..b170849ab 100644 --- a/packages/taco/src/conditions/base/contract.ts +++ b/packages/taco/src/conditions/base/contract.ts @@ -1,8 +1,8 @@ +import { ETH_ADDRESS_REGEXP } from '@nucypher/shared'; import { ethers } from 'ethers'; import { z } from 'zod'; import { Condition } from '../condition'; -import { ETH_ADDRESS_REGEXP } from '../const'; import { OmitConditionType, paramOrContextParamSchema } from '../shared'; import { rpcConditionSchema } from './rpc'; diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 601888c31..45f25c44c 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -8,8 +8,6 @@ import { export const USER_ADDRESS_PARAM_EXTERNAL_EIP4361 = ':userAddressExternalEIP4361'; -export const ETH_ADDRESS_REGEXP = new RegExp('^0x[a-fA-F0-9]{40}$'); - // Only allow alphanumeric characters and underscores export const CONTEXT_PARAM_REGEXP = new RegExp('^:[a-zA-Z_][a-zA-Z0-9_]*$'); @@ -35,5 +33,4 @@ export const RESERVED_CONTEXT_PARAMS = [ USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361, // USER_ADDRESS_PARAM_EXTERNAL_EIP4361 is not reserved and can be used as a custom context parameter - // USER_ADDRESS_PARAM_EXTERNAL_EIP4361 ]; diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 720fa5038..7f4a63e77 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -1,3 +1,4 @@ +import { EthAddressSchema } from '@nucypher/shared'; import { USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAM_EIP4361, @@ -8,9 +9,6 @@ import { z } from 'zod'; import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, - ETH_ADDRESS_REGEXP, - - } from './const'; export const contextParamSchema = z.string().regex(CONTEXT_PARAM_REGEXP); @@ -41,8 +39,6 @@ export const returnValueTestSchema = z.object({ export type ReturnValueTestProps = z.infer; -const EthAddressSchema = z.string().regex(ETH_ADDRESS_REGEXP); - const UserAddressSchema = z.enum([ USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361, diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index a48aa7e45..1a42ad330 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -1,9 +1,11 @@ import { initialize } from '@nucypher/nucypher-core'; import { AuthProviders, - AuthSignature, EIP4361_AUTH_METHOD, + AuthSignature, + EIP4361_AUTH_METHOD, EIP4361AuthProvider, - EIP712AuthProvider, EIP712TypedData, + EIP712AuthProvider, + EIP712TypedData, makeAuthProviders, } from '@nucypher/taco-auth'; import { diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts index 1b067de18..de6bbc986 100644 --- a/packages/test-utils/src/utils.ts +++ b/packages/test-utils/src/utils.ts @@ -53,8 +53,8 @@ export const fromBytes = (bytes: Uint8Array): string => export const fakePorterUri = 'https://_this_should_crash.com/'; -const makeFakeProvider = (timestamp: number, blockNumber: number) => { - const block = { timestamp }; +const makeFakeProvider = (timestamp: number, blockNumber: number, blockHash: string) => { + const block = { timestamp, hash: blockHash }; return { getBlockNumber: () => Promise.resolve(blockNumber), getBlock: () => Promise.resolve(block), @@ -67,8 +67,9 @@ export const fakeSigner = ( secretKeyBytes = SecretKey.random().toBEBytes(), blockNumber = 1000, blockTimestamp = 1000, + blockHash = '0x0000000000000000000000000000000000000000', ) => { - const provider = makeFakeProvider(blockNumber, blockTimestamp); + const provider = makeFakeProvider(blockNumber, blockTimestamp, blockHash); return { ...new Wallet(secretKeyBytes), provider: provider, @@ -85,8 +86,9 @@ export const fakeProvider = ( secretKeyBytes = SecretKey.random().toBEBytes(), blockNumber = 1000, blockTimestamp = 1000, + blockHash = '0x0000000000000000000000000000000000000000', ): ethers.providers.Web3Provider => { - const fakeProvider = makeFakeProvider(blockTimestamp, blockNumber); + const fakeProvider = makeFakeProvider(blockTimestamp, blockNumber, blockHash); const fakeSignerWithProvider = fakeSigner( secretKeyBytes, blockNumber, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 290860c64..45e838fb2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -512,6 +512,9 @@ importers: qs: specifier: ^6.12.1 version: 6.12.1 + zod: + specifier: '*' + version: 3.23.8 devDependencies: '@typechain/ethers-v5': specifier: ^11.1.2 @@ -553,7 +556,7 @@ importers: specifier: ^7.5.2 version: 7.6.2 zod: - specifier: ^3.22.4 + specifier: '*' version: 3.23.8 devDependencies: '@nucypher/test-utils': @@ -574,6 +577,9 @@ importers: siwe: specifier: ^2.3.2 version: 2.3.2(ethers@5.7.2) + zod: + specifier: ^3.22.4 + version: 3.23.8 devDependencies: '@nucypher/test-utils': specifier: workspace:* From c62ae73c4ef81cc1bafb4b129527627ec22cea56 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 3 Jul 2024 12:28:07 +0200 Subject: [PATCH 48/75] apply pr suggestions --- packages/shared/src/schemas.ts | 14 +++++++++++++- packages/shared/test/schemas.test.ts | 16 ++++++++++++++++ packages/taco-auth/src/storage.ts | 12 ++---------- packages/taco/test/conditions/base/rpc.test.ts | 4 ++-- packages/test-utils/src/utils.ts | 6 +++++- 5 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 packages/shared/test/schemas.test.ts diff --git a/packages/shared/src/schemas.ts b/packages/shared/src/schemas.ts index 0f083c130..911388d31 100644 --- a/packages/shared/src/schemas.ts +++ b/packages/shared/src/schemas.ts @@ -1,4 +1,16 @@ +import { ethers } from 'ethers'; import { z } from 'zod'; export const ETH_ADDRESS_REGEXP = new RegExp('^0x[a-fA-F0-9]{40}$'); -export const EthAddressSchema = z.string().regex(ETH_ADDRESS_REGEXP); + +const isAddress = (address: string) => { + try { + return ethers.utils.getAddress(address); + } catch { + return false; + } +}; + +export const EthAddressSchema = z.string() + .regex(ETH_ADDRESS_REGEXP) + .refine(isAddress, { message: 'Invalid Ethereum address' }); diff --git a/packages/shared/test/schemas.test.ts b/packages/shared/test/schemas.test.ts new file mode 100644 index 000000000..fd77e4222 --- /dev/null +++ b/packages/shared/test/schemas.test.ts @@ -0,0 +1,16 @@ +import {describe, expect, it} from 'vitest'; + +import { EthAddressSchema } from '../src'; + + +describe('ethereum address schema', () => { + it('should accept valid ethereum address', () => { + const validAddress = '0x1234567890123456789012345678901234567890'; + EthAddressSchema.parse(validAddress); + }); + + it('should reject invalid ethereum address', () => { + const invalidAddress = '0x123456789012345678901234567890123456789'; + expect(() => EthAddressSchema.parse(invalidAddress)).toThrow(); + }); +}); diff --git a/packages/taco-auth/src/storage.ts b/packages/taco-auth/src/storage.ts index 435297b03..a0d48d511 100644 --- a/packages/taco-auth/src/storage.ts +++ b/packages/taco-auth/src/storage.ts @@ -43,19 +43,11 @@ export class LocalStorage { if (!asJson) { return null; } - return LocalStorage.fromJson(asJson); + return authSignatureSchema.parse(JSON.parse(asJson)); } public setAuthSignature(key: string, authSignature: AuthSignature): void { - const asJson = LocalStorage.toJson(authSignature); + const asJson = JSON.stringify(authSignature); this.storage.setItem(key, asJson); } - - public static fromJson(json: string): AuthSignature { - return authSignatureSchema.parse(JSON.parse(json)); - } - - public static toJson(signature: AuthSignature): string { - return JSON.stringify(signature); - } } diff --git a/packages/taco/test/conditions/base/rpc.test.ts b/packages/taco/test/conditions/base/rpc.test.ts index 58a8f8cb5..69f352e05 100644 --- a/packages/taco/test/conditions/base/rpc.test.ts +++ b/packages/taco/test/conditions/base/rpc.test.ts @@ -89,10 +89,10 @@ describe('validation', () => { expect(result.error?.format()).toMatchObject({ parameters: { '1': { - _errors: ['Invalid'], + _errors: ['Invalid', 'Invalid Ethereum address'], }, '2': { - _errors: ['Invalid'], + _errors: ['Invalid', 'Invalid Ethereum address'], }, }, }); diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts index de6bbc986..d9dbacc20 100644 --- a/packages/test-utils/src/utils.ts +++ b/packages/test-utils/src/utils.ts @@ -53,7 +53,11 @@ export const fromBytes = (bytes: Uint8Array): string => export const fakePorterUri = 'https://_this_should_crash.com/'; -const makeFakeProvider = (timestamp: number, blockNumber: number, blockHash: string) => { +const makeFakeProvider = ( + timestamp: number, + blockNumber: number, + blockHash: string +) => { const block = { timestamp, hash: blockHash }; return { getBlockNumber: () => Promise.resolve(blockNumber), From 6638c5d8bee82a9568191b8d983ce72f86ba5881 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 3 Jul 2024 12:35:21 +0200 Subject: [PATCH 49/75] chore: fix duplicated vitest dependency --- packages/test-utils/package.json | 2 +- pnpm-lock.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 18c4793af..9312afb64 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -34,7 +34,7 @@ "@nucypher/taco-auth": "workspace:*", "axios": "^1.6.8", "ethers": "^5.7.2", - "vitest": "^1.3.1" + "vitest": "*" }, "engines": { "node": ">=18", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45e838fb2..23365a723 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -603,7 +603,7 @@ importers: specifier: ^5.7.2 version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) vitest: - specifier: ^1.3.1 + specifier: '*' version: 1.6.0(@types/node@20.14.2)(jsdom@16.7.0)(terser@5.31.0) packages: @@ -19005,7 +19005,7 @@ snapshots: vite-node@1.6.0(@types/node@20.14.2)(terser@5.31.0): dependencies: cac: 6.7.14 - debug: 4.3.4 + debug: 4.3.5 pathe: 1.1.2 picocolors: 1.0.1 vite: 5.2.11(@types/node@20.14.2)(terser@5.31.0) @@ -19038,7 +19038,7 @@ snapshots: '@vitest/utils': 1.6.0 acorn-walk: 8.3.2 chai: 4.4.1 - debug: 4.3.4 + debug: 4.3.5 execa: 8.0.1 local-pkg: 0.5.0 magic-string: 0.30.10 From f9e203023327dc343e9aaf26fe2a362d5c8f2683 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 3 Jul 2024 14:36:03 +0200 Subject: [PATCH 50/75] validate eip4361 siwe message --- packages/taco-auth/src/providers/eip4361.ts | 11 +++++++- packages/taco-auth/test/auth-provider.test.ts | 26 ++++++++++++------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts index af754a9d4..cf653dc27 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -6,8 +6,17 @@ import { EIP4361_AUTH_METHOD } from '../auth-provider'; import { AuthSignature } from '../auth-sig'; import { LocalStorage } from '../storage'; +const isSiweMessage = (message: string): boolean => { + try { + new SiweMessage(message); + return true; + } catch { + return false; + } +}; -export const EIP4361TypedDataSchema = z.string(); +export const EIP4361TypedDataSchema = z.string() + .refine(isSiweMessage, { message: 'Invalid SIWE message' }); export type EIP4361AuthProviderParams = { domain: string; diff --git a/packages/taco-auth/test/auth-provider.test.ts b/packages/taco-auth/test/auth-provider.test.ts index 1ced7495a..89daee884 100644 --- a/packages/taco-auth/test/auth-provider.test.ts +++ b/packages/taco-auth/test/auth-provider.test.ts @@ -8,17 +8,18 @@ import { SiweMessage } from 'siwe'; import { describe, expect, it } from 'vitest'; import { - EIP4361AuthProvider, + EIP4361AuthProvider, EIP4361TypedDataSchema, EIP712AuthProvider, EIP712TypedData, } from '../src'; describe('auth provider', () => { - it('creates a new EIP-712 message', async () => { - const provider = fakeProvider(bobSecretKeyBytes); - const signer = fakeSigner(bobSecretKeyBytes); + const provider = fakeProvider(bobSecretKeyBytes); + const signer = fakeSigner(bobSecretKeyBytes); + const eip712Provider = new EIP712AuthProvider(provider, signer); + const eip4361Provider = new EIP4361AuthProvider(provider, signer, TEST_SIWE_PARAMS); - const eip712Provider = new EIP712AuthProvider(provider, signer); + it('creates a new EIP-712 message', async () => { const eip712Message = await eip712Provider.getOrCreateAuthSignature(); expect(eip712Message.signature).toBeDefined(); expect(eip712Message.address).toEqual(await signer.getAddress()); @@ -41,10 +42,6 @@ describe('auth provider', () => { }); it('creates a new SIWE message', async () => { - const provider = fakeProvider(bobSecretKeyBytes); - const signer = fakeSigner(bobSecretKeyBytes); - - const eip4361Provider = new EIP4361AuthProvider(provider, signer, TEST_SIWE_PARAMS); const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); expect(typedSignature.signature).toBeDefined(); expect(typedSignature.address).toEqual(await signer.getAddress()); @@ -63,4 +60,15 @@ describe('auth provider', () => { `${typedDataSiweMessage.domain} wants you to sign in with your Ethereum account: ${await signer.getAddress()}`, ); }); + + it('accepts a valid EIP4361 message', async () => { + const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); + EIP4361TypedDataSchema.parse(typedSignature.typedData); + }); + + it('rejects an invalid EIP4361 message', async () => { + const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); + typedSignature.typedData = 'invalid-typed-data'; + expect(() => EIP4361TypedDataSchema.parse(typedSignature.typedData)).toThrow(); + }); }); From 9ce1a99c7972b7262c2ff935ec7d695981bb524a Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 25 Jun 2024 11:09:34 +0200 Subject: [PATCH 51/75] feat(taco): expose auth providers from taco --- examples/taco/nodejs/package.json | 1 + examples/taco/nodejs/src/index.ts | 11 +++-- examples/taco/nodejs/tsconfig.json | 3 ++ packages/taco-auth/src/providers/eip4361.ts | 45 ++++++++++----------- packages/taco/src/index.ts | 2 +- packages/taco/src/taco.ts | 25 ++++++++++-- packages/taco/test/taco.test.ts | 31 +++++++++----- packages/taco/test/test-utils.ts | 1 + packages/test-utils/src/utils.ts | 4 +- pnpm-lock.yaml | 3 ++ 10 files changed, 84 insertions(+), 42 deletions(-) diff --git a/examples/taco/nodejs/package.json b/examples/taco/nodejs/package.json index 5309319ae..2a3b8b05b 100644 --- a/examples/taco/nodejs/package.json +++ b/examples/taco/nodejs/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@nucypher/taco": "workspace:*", + "@nucypher/taco-auth": "workspace:*", "dotenv": "^16.3.1", "ethers": "^5.7.2" } diff --git a/examples/taco/nodejs/src/index.ts b/examples/taco/nodejs/src/index.ts index 60e8cac85..5b17cd7cc 100644 --- a/examples/taco/nodejs/src/index.ts +++ b/examples/taco/nodejs/src/index.ts @@ -2,7 +2,7 @@ import { format } from 'node:util'; import { conditions, - decrypt, + decryptWithAuthProviders, domains, encrypt, fromBytes, @@ -12,6 +12,7 @@ import { toBytes, toHexString, } from '@nucypher/taco'; +import { makeAuthProviders } from '@nucypher/taco-auth'; import * as dotenv from 'dotenv'; import { ethers } from 'ethers'; @@ -84,12 +85,16 @@ const decryptFromBytes = async (encryptedBytes: Uint8Array) => { const messageKit = ThresholdMessageKit.fromBytes(encryptedBytes); console.log('Decrypting message ...'); - return decrypt( + const authProviders = makeAuthProviders(provider, consumerSigner, { + domain: 'localhost', + uri: 'http://localhost:3000', + }); + return decryptWithAuthProviders( provider, domain, messageKit, + authProviders, getPorterUri(domain), - consumerSigner, ); }; diff --git a/examples/taco/nodejs/tsconfig.json b/examples/taco/nodejs/tsconfig.json index 50ed3c7ac..42cf00a51 100644 --- a/examples/taco/nodejs/tsconfig.json +++ b/examples/taco/nodejs/tsconfig.json @@ -10,5 +10,8 @@ { "path": "../../../packages/taco/tsconfig.cjs.json", }, + { + "path": "../../../packages/taco-auth/tsconfig.cjs.json", + } ], } diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts index af754a9d4..9e06fcce5 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -18,14 +18,33 @@ const ERR_MISSING_SIWE_PARAMETERS = 'Missing default SIWE parameters'; export class EIP4361AuthProvider { private readonly storage: LocalStorage; + private readonly providerParams: EIP4361AuthProviderParams; constructor( // TODO: We only need the provider to fetch the chainId, consider removing it private readonly provider: ethers.providers.Provider, private readonly signer: ethers.Signer, - private readonly providerParams?: EIP4361AuthProviderParams, + providerParams?: EIP4361AuthProviderParams, ) { this.storage = new LocalStorage(); + if (providerParams) { + this.providerParams = providerParams; + } else { + this.providerParams = this.getDefaultParameters(); + } + } + + private getDefaultParameters() { + if (typeof window !== 'undefined') { + // If we are in a browser environment, we can get the domain and uri from the window object + const maybeOrigin = window?.location?.origin; + return { + domain: maybeOrigin.split('//')[1].split('.')[0], + uri: maybeOrigin, + }; + } + // If not, we have no choice but to throw an error + throw new Error(ERR_MISSING_SIWE_PARAMETERS); } public async getOrCreateAuthSignature(): Promise { @@ -46,7 +65,7 @@ export class EIP4361AuthProvider { private async createSIWEAuthMessage(): Promise { const address = await this.signer.getAddress(); - const { domain, uri } = this.getParametersOrDefault(); + const { domain, uri } = this.providerParams; const version = '1'; const nonce = generateNonce(); const chainId = (await this.provider.getNetwork()).chainId; @@ -64,26 +83,4 @@ export class EIP4361AuthProvider { const signature = await this.signer.signMessage(message); return { signature, address, scheme, typedData: message }; } - - // TODO: Create a facility to set these parameters or expose them to the user - private getParametersOrDefault(): { - domain: string; - uri: string; - } { - // If we are in a browser environment, we can get the domain and uri from the window object - if (typeof window !== 'undefined') { - const maybeOrigin = window?.location?.origin; - return { - domain: maybeOrigin.split('//')[1].split('.')[0], - uri: maybeOrigin, - }; - } - if (this.providerParams) { - return { - domain: this.providerParams.domain, - uri: this.providerParams.uri, - }; - } - throw new Error(ERR_MISSING_SIWE_PARAMETERS); - } } diff --git a/packages/taco/src/index.ts b/packages/taco/src/index.ts index d737d6ed6..26b93c60e 100644 --- a/packages/taco/src/index.ts +++ b/packages/taco/src/index.ts @@ -11,4 +11,4 @@ export { export * as conditions from './conditions'; // Expose registerEncrypters from taco API (#324) -export { decrypt, encrypt, encryptWithPublicKey, isAuthorized } from './taco'; +export { decrypt, decryptWithAuthProviders, encrypt, encryptWithPublicKey, isAuthorized } from './taco'; diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index 6baa2b0b6..7ef2e7cba 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -13,7 +13,7 @@ import { GlobalAllowListAgent, toBytes, } from '@nucypher/shared'; -import { makeAuthProviders } from '@nucypher/taco-auth'; +import { AuthProviders, makeAuthProviders } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { keccak256 } from 'ethers/lib/utils'; @@ -143,6 +143,25 @@ export const decrypt = async ( porterUri?: string, signer?: ethers.Signer, customParameters?: Record, +): Promise => { + const authProviders = makeAuthProviders(provider, signer); + return decryptWithAuthProviders( + provider, + domain, + messageKit, + authProviders, + porterUri, + customParameters, + ); +}; + +export const decryptWithAuthProviders = async ( + provider: ethers.providers.Provider, + domain: Domain, + messageKit: ThresholdMessageKit, + authProviders?: AuthProviders, + porterUri?: string, + customParameters?: Record, ): Promise => { if (!porterUri) { porterUri = getPorterUri(domain); @@ -154,8 +173,6 @@ export const decrypt = async ( messageKit.acp.publicKey, ); const ritual = await DkgClient.getActiveRitual(provider, domain, ritualId); - // TODO: Temporary helper method to keep the external taco.ts decrypt function simple - const authProviders = makeAuthProviders(provider, signer); return retrieveAndDecrypt( provider, domain, @@ -188,7 +205,7 @@ export const isAuthorized = async ( domain: Domain, messageKit: ThresholdMessageKit, ritualId: number, -) => +): Promise => DkgCoordinatorAgent.isEncryptionAuthorized( provider, domain, diff --git a/packages/taco/test/taco.test.ts b/packages/taco/test/taco.test.ts index 8ae3a5b1b..c4a738345 100644 --- a/packages/taco/test/taco.test.ts +++ b/packages/taco/test/taco.test.ts @@ -4,6 +4,7 @@ import { SessionStaticSecret, } from '@nucypher/nucypher-core'; import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; +import * as tacoAuth from '@nucypher/taco-auth'; import { aliceSecretKeyBytes, fakeDkgFlow, @@ -13,9 +14,9 @@ import { fakeTDecFlow, mockGetRitualIdFromPublicKey, mockTacoDecrypt, - TEST_CHAIN_ID, + TEST_CHAIN_ID, TEST_SIWE_PARAMS, } from '@nucypher/test-utils'; -import { beforeAll, describe, expect, it } from 'vitest'; +import { beforeAll, describe, expect, it, vi } from 'vitest'; import * as taco from '../src'; import { conditions, domains, toBytes } from '../src'; @@ -36,6 +37,7 @@ const ownsNFT = new conditions.predefined.erc721.ERC721Ownership({ chain: TEST_CHAIN_ID, }); + describe('taco', () => { beforeAll(async () => { await initialize(); @@ -81,30 +83,41 @@ describe('taco', () => { ); const getRitualSpy = mockGetActiveRitual(mockedDkgRitual); - const decryptedMessage = await taco.decrypt( + const authProviders = tacoAuth.makeAuthProviders(provider, signer,TEST_SIWE_PARAMS); + const decryptedMessage1 = await taco.decryptWithAuthProviders( provider, domains.DEVNET, messageKit, + authProviders, fakePorterUri, - signer, ); + expect(decryptedMessage1).toEqual(toBytes(message)); expect(getParticipantsSpy).toHaveBeenCalled(); expect(sessionKeySpy).toHaveBeenCalled(); expect(getRitualIdFromPublicKey).toHaveBeenCalled(); expect(getRitualSpy).toHaveBeenCalled(); expect(decryptSpy).toHaveBeenCalled(); - expect(decryptedMessage).toEqual(toBytes(message)); + + const makeAuthProvidersSpy = vi.spyOn(tacoAuth, 'makeAuthProviders').mockImplementation(() => authProviders); + const decryptedMessage2 = await taco.decrypt( + provider, + domains.DEVNET, + messageKit, + fakePorterUri, + signer, + ); + expect(makeAuthProvidersSpy).toHaveBeenCalled(); + expect(decryptedMessage2).toEqual(toBytes(message)); }); - it('exposes requested parameters', async ()=> { + it('exposes requested parameters', async () => { const mockedDkg = fakeDkgFlow(FerveoVariant.precomputed, 0, 4, 4); const mockedDkgRitual = fakeDkgRitual(mockedDkg); const provider = fakeProvider(aliceSecretKeyBytes); const signer = fakeSigner(aliceSecretKeyBytes); const getFinalizedRitualSpy = mockGetActiveRitual(mockedDkgRitual); - - const customParamKey = ":nftId"; + const customParamKey = ':nftId'; const ownsNFTWithCustomParams = new conditions.predefined.erc721.ERC721Ownership({ contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77', parameters: [customParamKey], @@ -123,5 +136,5 @@ describe('taco', () => { const requestedParameters = taco.conditions.context.ConditionContext.requestedContextParameters(messageKit); expect(requestedParameters).toEqual(new Set([customParamKey, USER_ADDRESS_PARAM_DEFAULT])); - }) + }); }); diff --git a/packages/taco/test/test-utils.ts b/packages/taco/test/test-utils.ts index 02de484f3..92f477ae6 100644 --- a/packages/taco/test/test-utils.ts +++ b/packages/taco/test/test-utils.ts @@ -54,6 +54,7 @@ import { ReturnValueTestProps } from '../src/conditions/shared'; import { DkgClient, DkgRitual } from '../src/dkg'; import { encryptMessage } from '../src/tdec'; + export const fakeDkgTDecFlowE2E: ( ritualId?: number, variant?: FerveoVariant, diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts index d9dbacc20..c72822466 100644 --- a/packages/test-utils/src/utils.ts +++ b/packages/test-utils/src/utils.ts @@ -44,6 +44,8 @@ import axios from 'axios'; import { ethers, providers, Wallet } from 'ethers'; import { expect, SpyInstance, vi } from 'vitest'; +import { TEST_SIWE_PARAMS } from './variables'; + export const bytesEqual = (first: Uint8Array, second: Uint8Array): boolean => first.length === second.length && first.every((value, index) => value === second[index]); @@ -84,7 +86,7 @@ export const fakeSigner = ( } as unknown as ethers.providers.JsonRpcSigner; }; -export const fakeAuthProviders = () => makeAuthProviders(fakeProvider(), fakeSigner()); +export const fakeAuthProviders = () => makeAuthProviders(fakeProvider(), fakeSigner(), TEST_SIWE_PARAMS); export const fakeProvider = ( secretKeyBytes = SecretKey.random().toBEBytes(), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 23365a723..ff5e622a9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -407,6 +407,9 @@ importers: '@nucypher/taco': specifier: workspace:* version: link:../../../packages/taco + '@nucypher/taco-auth': + specifier: workspace:* + version: link:../../../packages/taco-auth dotenv: specifier: ^16.3.1 version: 16.4.5 From f452c6ad8af8ff8f0244a7cacc1afd89e08e4e54 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 9 Jul 2024 15:56:28 +0200 Subject: [PATCH 52/75] feat!(auth): expose eip4361 auth provider in taco api --- demos/taco-demo/src/App.tsx | 6 ++-- examples/taco/nextjs/src/hooks/useTaco.ts | 10 +++++-- examples/taco/nextjs/tsconfig.build.json | 3 -- examples/taco/nodejs/package.json | 1 - examples/taco/nodejs/src/index.ts | 13 +++++---- examples/taco/nodejs/tsconfig.json | 3 -- examples/taco/react/src/hooks/useTaco.ts | 10 +++++-- examples/taco/react/tsconfig.build.json | 2 +- examples/taco/webpack-5/src/index.ts | 4 ++- packages/taco-auth/src/auth-provider.ts | 2 +- packages/taco-auth/src/providers/eip4361.ts | 5 ++-- packages/taco/examples/encrypt-decrypt.ts | 7 +++-- packages/taco/src/index.ts | 7 +++-- packages/taco/src/taco.ts | 28 ++++--------------- packages/taco/test/conditions/context.test.ts | 24 ++++++++-------- packages/taco/test/taco.test.ts | 21 ++++---------- pnpm-lock.yaml | 3 -- 17 files changed, 64 insertions(+), 85 deletions(-) diff --git a/demos/taco-demo/src/App.tsx b/demos/taco-demo/src/App.tsx index 7fe6c9c39..2aa5f07a8 100644 --- a/demos/taco-demo/src/App.tsx +++ b/demos/taco-demo/src/App.tsx @@ -13,11 +13,11 @@ import { ethers } from 'ethers'; import React, { useEffect, useState } from 'react'; import { ConditionBuilder } from './ConditionBuilder'; -import { DEFAULT_DOMAIN, DEFAULT_RITUAL_ID } from './config'; import { Decrypt } from './Decrypt'; import { Encrypt } from './Encrypt'; -import { downloadData, getWebIrys, uploadData } from './irys'; import { Spinner } from './Spinner'; +import { DEFAULT_DOMAIN, DEFAULT_RITUAL_ID } from './config'; +import { downloadData, getWebIrys, uploadData } from './irys'; const chainIdForDomain = { [domains.DEVNET]: 80002, @@ -121,7 +121,7 @@ export default function App() {

Notice

In production (mainnet domain), your wallet address (encryptor) will also have - to be allow-listed for this specific ritual. However, we have + to be allow-listed for this specific ritual. However, we have publicly available testnet rituals for use when developing your apps.

diff --git a/examples/taco/nextjs/src/hooks/useTaco.ts b/examples/taco/nextjs/src/hooks/useTaco.ts index 376a80a62..81ff0dc5d 100644 --- a/examples/taco/nextjs/src/hooks/useTaco.ts +++ b/examples/taco/nextjs/src/hooks/useTaco.ts @@ -2,6 +2,7 @@ import { conditions, decrypt, Domain, + EIP4361AuthProvider, encrypt, getPorterUri, initialize, @@ -26,15 +27,18 @@ export default function useTaco({ }, []); const decryptDataFromBytes = useCallback( - async (encryptedBytes: Uint8Array, signer?: ethers.Signer) => { - if (!isInit || !provider) return; + async (encryptedBytes: Uint8Array, signer: ethers.Signer) => { + if (!isInit || !provider) { + return; + } const messageKit = ThresholdMessageKit.fromBytes(encryptedBytes); + const authProvider = new EIP4361AuthProvider(provider, signer); return decrypt( provider, domain, messageKit, + authProvider, getPorterUri(domain), - signer, ); }, [isInit, provider, domain], diff --git a/examples/taco/nextjs/tsconfig.build.json b/examples/taco/nextjs/tsconfig.build.json index beb822b78..7213342cb 100644 --- a/examples/taco/nextjs/tsconfig.build.json +++ b/examples/taco/nextjs/tsconfig.build.json @@ -10,8 +10,5 @@ { "path": "../../../packages/taco/tsconfig.es.json" }, - { - "path": "../../../packages/taco-auth/tsconfig.es.json" - } ] } diff --git a/examples/taco/nodejs/package.json b/examples/taco/nodejs/package.json index 2a3b8b05b..5309319ae 100644 --- a/examples/taco/nodejs/package.json +++ b/examples/taco/nodejs/package.json @@ -11,7 +11,6 @@ }, "dependencies": { "@nucypher/taco": "workspace:*", - "@nucypher/taco-auth": "workspace:*", "dotenv": "^16.3.1", "ethers": "^5.7.2" } diff --git a/examples/taco/nodejs/src/index.ts b/examples/taco/nodejs/src/index.ts index 5b17cd7cc..8c4459ed8 100644 --- a/examples/taco/nodejs/src/index.ts +++ b/examples/taco/nodejs/src/index.ts @@ -2,8 +2,9 @@ import { format } from 'node:util'; import { conditions, - decryptWithAuthProviders, + decrypt, domains, + EIP4361AuthProvider, encrypt, fromBytes, getPorterUri, @@ -12,7 +13,6 @@ import { toBytes, toHexString, } from '@nucypher/taco'; -import { makeAuthProviders } from '@nucypher/taco-auth'; import * as dotenv from 'dotenv'; import { ethers } from 'ethers'; @@ -85,15 +85,16 @@ const decryptFromBytes = async (encryptedBytes: Uint8Array) => { const messageKit = ThresholdMessageKit.fromBytes(encryptedBytes); console.log('Decrypting message ...'); - const authProviders = makeAuthProviders(provider, consumerSigner, { + const siweParams = { domain: 'localhost', uri: 'http://localhost:3000', - }); - return decryptWithAuthProviders( + }; + const authProvider = new EIP4361AuthProvider(provider, consumerSigner, siweParams); + return decrypt( provider, domain, messageKit, - authProviders, + authProvider, getPorterUri(domain), ); }; diff --git a/examples/taco/nodejs/tsconfig.json b/examples/taco/nodejs/tsconfig.json index 42cf00a51..50ed3c7ac 100644 --- a/examples/taco/nodejs/tsconfig.json +++ b/examples/taco/nodejs/tsconfig.json @@ -10,8 +10,5 @@ { "path": "../../../packages/taco/tsconfig.cjs.json", }, - { - "path": "../../../packages/taco-auth/tsconfig.cjs.json", - } ], } diff --git a/examples/taco/react/src/hooks/useTaco.ts b/examples/taco/react/src/hooks/useTaco.ts index 376a80a62..81ff0dc5d 100644 --- a/examples/taco/react/src/hooks/useTaco.ts +++ b/examples/taco/react/src/hooks/useTaco.ts @@ -2,6 +2,7 @@ import { conditions, decrypt, Domain, + EIP4361AuthProvider, encrypt, getPorterUri, initialize, @@ -26,15 +27,18 @@ export default function useTaco({ }, []); const decryptDataFromBytes = useCallback( - async (encryptedBytes: Uint8Array, signer?: ethers.Signer) => { - if (!isInit || !provider) return; + async (encryptedBytes: Uint8Array, signer: ethers.Signer) => { + if (!isInit || !provider) { + return; + } const messageKit = ThresholdMessageKit.fromBytes(encryptedBytes); + const authProvider = new EIP4361AuthProvider(provider, signer); return decrypt( provider, domain, messageKit, + authProvider, getPorterUri(domain), - signer, ); }, [isInit, provider, domain], diff --git a/examples/taco/react/tsconfig.build.json b/examples/taco/react/tsconfig.build.json index 22ff2bd0b..7213342cb 100644 --- a/examples/taco/react/tsconfig.build.json +++ b/examples/taco/react/tsconfig.build.json @@ -9,6 +9,6 @@ "references": [ { "path": "../../../packages/taco/tsconfig.es.json" - } + }, ] } diff --git a/examples/taco/webpack-5/src/index.ts b/examples/taco/webpack-5/src/index.ts index 2cfd040d2..740153f5d 100644 --- a/examples/taco/webpack-5/src/index.ts +++ b/examples/taco/webpack-5/src/index.ts @@ -2,6 +2,7 @@ import { conditions, decrypt, domains, + EIP4361AuthProvider, encrypt, fromBytes, getPorterUri, @@ -60,12 +61,13 @@ const runExample = async () => { ); console.log('Decrypting message...'); + const authProvider = new EIP4361AuthProvider(provider, signer); const decryptedBytes = await decrypt( provider, domain, messageKit, + authProvider, getPorterUri(domain), - signer, ); const decryptedMessage = fromBytes(decryptedBytes); console.log('Decrypted message:', decryptedMessage); diff --git a/packages/taco-auth/src/auth-provider.ts b/packages/taco-auth/src/auth-provider.ts index 8f7d18578..18e83d5e6 100644 --- a/packages/taco-auth/src/auth-provider.ts +++ b/packages/taco-auth/src/auth-provider.ts @@ -24,7 +24,7 @@ export const USER_ADDRESS_PARAM_EIP712 = `:userAddress${EIP712_AUTH_METHOD}`; export const USER_ADDRESS_PARAM_EIP4361 = `:userAddress${EIP4361_AUTH_METHOD}`; export const AUTH_METHOD_FOR_PARAM: Record = { - [USER_ADDRESS_PARAM_DEFAULT]: EIP712_AUTH_METHOD, + [USER_ADDRESS_PARAM_DEFAULT]: EIP4361_AUTH_METHOD, [USER_ADDRESS_PARAM_EIP712]: EIP712_AUTH_METHOD, [USER_ADDRESS_PARAM_EIP4361]: EIP4361_AUTH_METHOD, }; diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts index 9e06fcce5..5f95e30ab 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -37,10 +37,9 @@ export class EIP4361AuthProvider { private getDefaultParameters() { if (typeof window !== 'undefined') { // If we are in a browser environment, we can get the domain and uri from the window object - const maybeOrigin = window?.location?.origin; return { - domain: maybeOrigin.split('//')[1].split('.')[0], - uri: maybeOrigin, + domain: window.location?.host, + uri: window.location?.origin, }; } // If not, we have no choice but to throw an error diff --git a/packages/taco/examples/encrypt-decrypt.ts b/packages/taco/examples/encrypt-decrypt.ts index cfa835025..441706853 100644 --- a/packages/taco/examples/encrypt-decrypt.ts +++ b/packages/taco/examples/encrypt-decrypt.ts @@ -1,10 +1,10 @@ +import { ChainId } from '@nucypher/shared'; import { ethers } from 'ethers'; -import { ChainId } from '@nucypher/shared'; import { conditions, decrypt, - domains, + domains, EIP4361AuthProvider, encrypt, getPorterUri, initialize, @@ -45,12 +45,13 @@ const run = async () => { // @ts-ignore const web3Provider = new ethers.providers.Web3Provider(window.ethereum); + const authProvider = new EIP4361AuthProvider(web3Provider, web3Provider.getSigner()); const decryptedMessage = await decrypt( web3Provider, domains.TESTNET, messageKit, + authProvider, getPorterUri(domains.TESTNET), - web3Provider.getSigner(), ); return decryptedMessage; }; diff --git a/packages/taco/src/index.ts b/packages/taco/src/index.ts index 26b93c60e..00f86507d 100644 --- a/packages/taco/src/index.ts +++ b/packages/taco/src/index.ts @@ -10,5 +10,8 @@ export { } from '@nucypher/shared'; export * as conditions from './conditions'; -// Expose registerEncrypters from taco API (#324) -export { decrypt, decryptWithAuthProviders, encrypt, encryptWithPublicKey, isAuthorized } from './taco'; +// TODO(#324): Expose registerEncrypters from taco API +export { decrypt, encrypt, encryptWithPublicKey, isAuthorized } from './taco'; + +// TODO: Remove this re-export once `@nucypher/taco-auth` is mature and published +export { EIP4361AuthProvider } from '@nucypher/taco-auth'; diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index 7ef2e7cba..5e59de4de 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -13,7 +13,7 @@ import { GlobalAllowListAgent, toBytes, } from '@nucypher/shared'; -import { AuthProviders, makeAuthProviders } from '@nucypher/taco-auth'; +import { AuthProviders, EIP4361_AUTH_METHOD, EIP4361AuthProvider } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { keccak256 } from 'ethers/lib/utils'; @@ -125,9 +125,9 @@ export const encryptWithPublicKey = async ( * @param {Domain} domain - Represents the logical network in which the decryption will be performed. * Must match the `ritualId`. * @param {ThresholdMessageKit} messageKit - The kit containing the message to be decrypted + * @param authProvider * @param {string} [porterUri] - The URI for the Porter service. If not provided, a value will be obtained * from the Domain - * @param {ethers.Signer} [signer] - An optional signer for the decryption * @param {Record} [customParameters] - Optional custom parameters that may be required * depending on the condition used * @@ -140,26 +140,7 @@ export const decrypt = async ( provider: ethers.providers.Provider, domain: Domain, messageKit: ThresholdMessageKit, - porterUri?: string, - signer?: ethers.Signer, - customParameters?: Record, -): Promise => { - const authProviders = makeAuthProviders(provider, signer); - return decryptWithAuthProviders( - provider, - domain, - messageKit, - authProviders, - porterUri, - customParameters, - ); -}; - -export const decryptWithAuthProviders = async ( - provider: ethers.providers.Provider, - domain: Domain, - messageKit: ThresholdMessageKit, - authProviders?: AuthProviders, + authProvider: EIP4361AuthProvider, porterUri?: string, customParameters?: Record, ): Promise => { @@ -173,6 +154,9 @@ export const decryptWithAuthProviders = async ( messageKit.acp.publicKey, ); const ritual = await DkgClient.getActiveRitual(provider, domain, ritualId); + const authProviders: AuthProviders = { + [EIP4361_AUTH_METHOD]: authProvider, + }; return retrieveAndDecrypt( provider, domain, diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 1a42ad330..5120a8685 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -405,8 +405,18 @@ describe('No authentication provider', () => { expect(eip712Spy).toHaveBeenCalledOnce(); } - it('supports default auth method (eip712)', async () => { - await testEIP712AuthMethod(USER_ADDRESS_PARAM_DEFAULT); + async function testEIP4361AuthMethod(authMethod: string) { + const eip4361Spy = vi.spyOn( + EIP4361AuthProvider.prototype, + 'getOrCreateAuthSignature', + ); + const authSignature = await makeAuthSignature(authMethod); + await testEIP4361AuthSignature(authSignature); + expect(eip4361Spy).toHaveBeenCalledOnce(); + } + + it('supports default auth method (eip4361)', async () => { + await testEIP4361AuthMethod(USER_ADDRESS_PARAM_DEFAULT); }); it('supports eip712', async () => { @@ -414,15 +424,7 @@ describe('No authentication provider', () => { }); it('supports eip4361', async () => { - const eip4361Spy = vi.spyOn( - EIP4361AuthProvider.prototype, - 'getOrCreateAuthSignature', - ); - - const authSignature = await makeAuthSignature(USER_ADDRESS_PARAM_EIP4361); - await testEIP4361AuthSignature(authSignature); - - expect(eip4361Spy).toHaveBeenCalledOnce(); + await testEIP4361AuthMethod(USER_ADDRESS_PARAM_EIP4361); }); it('supports reusing external eip4361', async () => { diff --git a/packages/taco/test/taco.test.ts b/packages/taco/test/taco.test.ts index c4a738345..af3a06c2c 100644 --- a/packages/taco/test/taco.test.ts +++ b/packages/taco/test/taco.test.ts @@ -16,7 +16,7 @@ import { mockTacoDecrypt, TEST_CHAIN_ID, TEST_SIWE_PARAMS, } from '@nucypher/test-utils'; -import { beforeAll, describe, expect, it, vi } from 'vitest'; +import { beforeAll, describe, expect, it } from 'vitest'; import * as taco from '../src'; import { conditions, domains, toBytes } from '../src'; @@ -83,31 +83,20 @@ describe('taco', () => { ); const getRitualSpy = mockGetActiveRitual(mockedDkgRitual); - const authProviders = tacoAuth.makeAuthProviders(provider, signer,TEST_SIWE_PARAMS); - const decryptedMessage1 = await taco.decryptWithAuthProviders( + const authProvider = new tacoAuth.EIP4361AuthProvider(provider, signer, TEST_SIWE_PARAMS); + const decryptedMessage = await taco.decrypt( provider, domains.DEVNET, messageKit, - authProviders, + authProvider, fakePorterUri, ); - expect(decryptedMessage1).toEqual(toBytes(message)); + expect(decryptedMessage).toEqual(toBytes(message)); expect(getParticipantsSpy).toHaveBeenCalled(); expect(sessionKeySpy).toHaveBeenCalled(); expect(getRitualIdFromPublicKey).toHaveBeenCalled(); expect(getRitualSpy).toHaveBeenCalled(); expect(decryptSpy).toHaveBeenCalled(); - - const makeAuthProvidersSpy = vi.spyOn(tacoAuth, 'makeAuthProviders').mockImplementation(() => authProviders); - const decryptedMessage2 = await taco.decrypt( - provider, - domains.DEVNET, - messageKit, - fakePorterUri, - signer, - ); - expect(makeAuthProvidersSpy).toHaveBeenCalled(); - expect(decryptedMessage2).toEqual(toBytes(message)); }); it('exposes requested parameters', async () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ff5e622a9..23365a723 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -407,9 +407,6 @@ importers: '@nucypher/taco': specifier: workspace:* version: link:../../../packages/taco - '@nucypher/taco-auth': - specifier: workspace:* - version: link:../../../packages/taco-auth dotenv: specifier: ^16.3.1 version: 16.4.5 From 08367ad5a4bb0576069a9a00674d2d20600f630c Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 10 Jul 2024 10:25:29 +0200 Subject: [PATCH 53/75] apply pr suggestions --- packages/taco/src/taco.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index 5e59de4de..d05b210cc 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -13,13 +13,17 @@ import { GlobalAllowListAgent, toBytes, } from '@nucypher/shared'; -import { AuthProviders, EIP4361_AUTH_METHOD, EIP4361AuthProvider } from '@nucypher/taco-auth'; +import { + AuthProviders, + EIP4361_AUTH_METHOD, + EIP4361AuthProvider, +} from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { keccak256 } from 'ethers/lib/utils'; import { Condition } from './conditions/condition'; import { ConditionExpression } from './conditions/condition-expr'; -import { CustomContextParam} from './conditions/context'; +import { CustomContextParam } from './conditions/context'; import { DkgClient } from './dkg'; import { retrieveAndDecrypt } from './tdec'; @@ -125,7 +129,7 @@ export const encryptWithPublicKey = async ( * @param {Domain} domain - Represents the logical network in which the decryption will be performed. * Must match the `ritualId`. * @param {ThresholdMessageKit} messageKit - The kit containing the message to be decrypted - * @param authProvider + * @param authProvider - The authentication provider that will be used to provide the authorization * @param {string} [porterUri] - The URI for the Porter service. If not provided, a value will be obtained * from the Domain * @param {Record} [customParameters] - Optional custom parameters that may be required @@ -140,7 +144,7 @@ export const decrypt = async ( provider: ethers.providers.Provider, domain: Domain, messageKit: ThresholdMessageKit, - authProvider: EIP4361AuthProvider, + authProvider?: EIP4361AuthProvider, porterUri?: string, customParameters?: Record, ): Promise => { @@ -154,9 +158,11 @@ export const decrypt = async ( messageKit.acp.publicKey, ); const ritual = await DkgClient.getActiveRitual(provider, domain, ritualId); - const authProviders: AuthProviders = { - [EIP4361_AUTH_METHOD]: authProvider, - }; + const authProviders: AuthProviders = authProvider + ? { + [EIP4361_AUTH_METHOD]: authProvider, + } + : {}; return retrieveAndDecrypt( provider, domain, @@ -170,7 +176,6 @@ export const decrypt = async ( ); }; - /** * Checks if the encryption from the provided messageKit is authorized for the specified ritual. * From 0fba5c52a82fe74266a45735b19af13c2958255f Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Wed, 10 Jul 2024 11:57:00 +0200 Subject: [PATCH 54/75] fix test not cathing edge cases --- packages/taco/test/conditions/context.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 5120a8685..7b7af3f9f 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -466,7 +466,7 @@ describe('No authentication provider', () => { authProviders, ); const contextVars = await builtContext.toContextParameters(); - expect(eip4361Spy).not.toHaveBeenCalledOnce(); + expect(eip4361Spy).not.toHaveBeenCalled(); // Now, we expect that the auth signature will be available in the context variables const authSignature = contextVars[ From 899eba4f60fffba54e4f57f8b9333faa2f7a2c68 Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Tue, 9 Jul 2024 16:59:52 +0200 Subject: [PATCH 55/75] feat!(auth): remove eip712 --- packages/taco-auth/src/auth-provider.ts | 12 +- packages/taco-auth/src/auth-sig.ts | 12 +- packages/taco-auth/src/helper.ts | 19 --- packages/taco-auth/src/index.ts | 1 - packages/taco-auth/src/providers/eip712.ts | 155 ------------------ packages/taco-auth/src/providers/index.ts | 1 - packages/taco-auth/test/auth-provider.test.ts | 29 +--- packages/taco-auth/test/auth-sig.test.ts | 74 +-------- packages/taco/src/conditions/const.ts | 12 +- packages/taco/src/conditions/shared.ts | 8 +- .../test/conditions/base/contract.test.ts | 4 +- packages/taco/test/conditions/context.test.ts | 54 +----- packages/test-utils/src/utils.ts | 26 +-- 13 files changed, 31 insertions(+), 376 deletions(-) delete mode 100644 packages/taco-auth/src/helper.ts delete mode 100644 packages/taco-auth/src/providers/eip712.ts diff --git a/packages/taco-auth/src/auth-provider.ts b/packages/taco-auth/src/auth-provider.ts index 18e83d5e6..fbb8d4c64 100644 --- a/packages/taco-auth/src/auth-provider.ts +++ b/packages/taco-auth/src/auth-provider.ts @@ -1,30 +1,20 @@ import { AuthSignature } from './auth-sig'; -import { EIP4361AuthProvider, EIP712AuthProvider } from './providers'; +import { EIP4361AuthProvider } from './providers'; -/** - * @deprecated Use EIP4361_AUTH_METHOD instead. - */ -export const EIP712_AUTH_METHOD = 'EIP712'; export const EIP4361_AUTH_METHOD = 'EIP4361'; - export interface AuthProvider { getOrCreateAuthSignature(): Promise; } export type AuthProviders = { - [EIP712_AUTH_METHOD]?: EIP712AuthProvider; [EIP4361_AUTH_METHOD]?: EIP4361AuthProvider; // Fallback to satisfy type checking [key: string]: AuthProvider | undefined; }; export const USER_ADDRESS_PARAM_DEFAULT = ':userAddress'; -export const USER_ADDRESS_PARAM_EIP712 = `:userAddress${EIP712_AUTH_METHOD}`; -export const USER_ADDRESS_PARAM_EIP4361 = `:userAddress${EIP4361_AUTH_METHOD}`; export const AUTH_METHOD_FOR_PARAM: Record = { [USER_ADDRESS_PARAM_DEFAULT]: EIP4361_AUTH_METHOD, - [USER_ADDRESS_PARAM_EIP712]: EIP712_AUTH_METHOD, - [USER_ADDRESS_PARAM_EIP4361]: EIP4361_AUTH_METHOD, }; diff --git a/packages/taco-auth/src/auth-sig.ts b/packages/taco-auth/src/auth-sig.ts index 4e21677b0..5d51d7491 100644 --- a/packages/taco-auth/src/auth-sig.ts +++ b/packages/taco-auth/src/auth-sig.ts @@ -1,19 +1,15 @@ import { EthAddressSchema } from '@nucypher/shared'; import { z } from 'zod'; -import { EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './auth-provider'; -import { EIP4361TypedDataSchema, EIP712TypedDataSchema } from './providers'; +import { EIP4361_AUTH_METHOD } from './auth-provider'; +import { EIP4361TypedDataSchema } from './providers'; export const authSignatureSchema = z.object({ signature: z.string(), address: EthAddressSchema, - scheme: z.enum([EIP712_AUTH_METHOD, EIP4361_AUTH_METHOD]), - typedData: z.union([ - EIP4361TypedDataSchema, - // TODO(#536): Remove post EIP712 deprecation - EIP712TypedDataSchema, - ]), + scheme: z.enum([EIP4361_AUTH_METHOD]), + typedData: EIP4361TypedDataSchema, }); export type AuthSignature = z.infer; diff --git a/packages/taco-auth/src/helper.ts b/packages/taco-auth/src/helper.ts deleted file mode 100644 index 894353afb..000000000 --- a/packages/taco-auth/src/helper.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ethers } from 'ethers'; - -import { AuthProviders, EIP4361_AUTH_METHOD, EIP712_AUTH_METHOD } from './auth-provider'; -import { - EIP4361AuthProvider, - EIP4361AuthProviderParams, - EIP712AuthProvider, -} from './providers'; - -export const makeAuthProviders = ( - provider: ethers.providers.Provider, - signer?: ethers.Signer, - siweDefaultParams?: EIP4361AuthProviderParams, -): AuthProviders => { - return { - [EIP712_AUTH_METHOD]: signer ? new EIP712AuthProvider(provider, signer) : undefined, - [EIP4361_AUTH_METHOD]: signer ? new EIP4361AuthProvider(provider, signer, siweDefaultParams) : undefined, - } as AuthProviders; -}; diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts index a7cb7846a..48718042f 100644 --- a/packages/taco-auth/src/index.ts +++ b/packages/taco-auth/src/index.ts @@ -1,4 +1,3 @@ export * from './providers'; -export * from './helper'; export * from './auth-sig'; export * from './auth-provider'; diff --git a/packages/taco-auth/src/providers/eip712.ts b/packages/taco-auth/src/providers/eip712.ts deleted file mode 100644 index fb554f16a..000000000 --- a/packages/taco-auth/src/providers/eip712.ts +++ /dev/null @@ -1,155 +0,0 @@ -import type { TypedDataSigner } from '@ethersproject/abstract-signer'; -import { ethers } from 'ethers'; -import { utils as ethersUtils } from 'ethers/lib/ethers'; -import { z } from 'zod'; - -import { AuthProvider } from '../auth-provider'; -import { AuthSignature } from '../auth-sig'; -import { LocalStorage } from '../storage'; - - -const typeFieldSchema = z.object({ - name: z.string(), - type: z.string(), -}); - -const domain = z.object({ - salt: z.string(), - chainId: z.number(), - name: z.string(), - version: z.string(), -}); - -const messageSchema = z.object({ - blockHash: z.string(), - address: z.string(), - blockNumber: z.number(), - signatureText: z.string(), -}); - -export const EIP712TypedDataSchema = z.object({ - primaryType: z.literal('Wallet'), - types: z.object({ - EIP712Domain: z.array(typeFieldSchema), - Wallet: z.array(typeFieldSchema), - }), - domain: domain, - message: messageSchema, -}); - - -export type EIP712TypedData = z.infer; - -interface ChainData { - blockHash: string; - chainId: number; - blockNumber: number; -} - -const EIP712Domain = [ - { - name: 'name', - type: 'string', - }, - { - name: 'version', - type: 'string', - }, - { - name: 'chainId', - type: 'uint256', - }, - { - name: 'salt', - type: 'bytes32', - }, -]; - -/** - * @deprecated Use EIP4361AuthProvider instead. - */ -export class EIP712AuthProvider implements AuthProvider { - private readonly storage: LocalStorage; - - constructor( - // TODO: We only need the provider to fetch the chainId, consider removing it - private readonly provider: ethers.providers.Provider, - private readonly signer: ethers.Signer, - ) { - console.warn( - 'DeprecationWarning: The EIP712AuthProvider authentication provider is deprecated. ' + - 'Please use EIP4361AuthProvider instead. Refer to the documentation for more details.' - ); - this.storage = new LocalStorage(); - } - - public async getOrCreateAuthSignature(): Promise { - const address = await this.signer.getAddress(); - const storageKey = `eip712-signature-${address}`; - - // If we have a signature in localStorage, return it - const maybeSignature = this.storage.getAuthSignature(storageKey); - if (maybeSignature) { - return maybeSignature; - } - - // If at this point we didn't return, we need to create a new signature - const authSignature = await this.createAuthMessage(); - this.storage.setAuthSignature(storageKey, authSignature); - return authSignature; - } - - private async createAuthMessage(): Promise { - // Ensure freshness of the signature - const { blockNumber, blockHash, chainId } = await this.getChainData(); - const address = await this.signer.getAddress(); - const signatureText = `I'm the owner of address ${address} as of block number ${blockNumber}`; - const salt = ethersUtils.hexlify(ethersUtils.randomBytes(32)); - - const typedData = { - types: { - Wallet: [ - { name: 'address', type: 'address' }, - { name: 'signatureText', type: 'string' }, - { name: 'blockNumber', type: 'uint256' }, - { name: 'blockHash', type: 'bytes32' }, - ], - }, - domain: { - name: 'TACo', - version: '1', - chainId, - salt, - }, - message: { - address, - signatureText, - blockNumber, - blockHash, - }, - }; - // https://github.com/ethers-io/ethers.js/issues/1431#issuecomment-813950552 - const signature = await ( - this.signer as unknown as TypedDataSigner - )._signTypedData(typedData.domain, typedData.types, typedData.message); - - const formattedTypedData: EIP712TypedData = { - ...typedData, - primaryType: 'Wallet', - types: { - ...typedData.types, - EIP712Domain, - }, - }; - const scheme = 'EIP712'; - return { signature, address, scheme, typedData: formattedTypedData }; - } - - private async getChainData(): Promise { - const blockNumber = await this.provider.getBlockNumber(); - const block = await this.provider.getBlock(blockNumber); - const blockHash = block.hash; - const chainId = (await this.provider.getNetwork()).chainId; - return { blockNumber, blockHash, chainId }; - } -} diff --git a/packages/taco-auth/src/providers/index.ts b/packages/taco-auth/src/providers/index.ts index 6b5476af1..5bc7a7faf 100644 --- a/packages/taco-auth/src/providers/index.ts +++ b/packages/taco-auth/src/providers/index.ts @@ -1,2 +1 @@ -export * from './eip712'; export * from './eip4361'; diff --git a/packages/taco-auth/test/auth-provider.test.ts b/packages/taco-auth/test/auth-provider.test.ts index 89daee884..0b8851a7c 100644 --- a/packages/taco-auth/test/auth-provider.test.ts +++ b/packages/taco-auth/test/auth-provider.test.ts @@ -7,40 +7,13 @@ import { import { SiweMessage } from 'siwe'; import { describe, expect, it } from 'vitest'; -import { - EIP4361AuthProvider, EIP4361TypedDataSchema, - EIP712AuthProvider, - EIP712TypedData, -} from '../src'; +import { EIP4361AuthProvider, EIP4361TypedDataSchema } from '../src'; describe('auth provider', () => { const provider = fakeProvider(bobSecretKeyBytes); const signer = fakeSigner(bobSecretKeyBytes); - const eip712Provider = new EIP712AuthProvider(provider, signer); const eip4361Provider = new EIP4361AuthProvider(provider, signer, TEST_SIWE_PARAMS); - it('creates a new EIP-712 message', async () => { - const eip712Message = await eip712Provider.getOrCreateAuthSignature(); - expect(eip712Message.signature).toBeDefined(); - expect(eip712Message.address).toEqual(await signer.getAddress()); - expect(eip712Message.scheme).toEqual('EIP712'); - - const typedData = eip712Message.typedData as EIP712TypedData; - expect(typedData).toBeDefined(); - expect(typedData.types.Wallet).toBeDefined(); - expect(typedData.domain.name).toEqual('TACo'); - expect(typedData.domain.version).toEqual('1'); - expect(typedData.domain.chainId).toEqual( - (await provider.getNetwork()).chainId, - ); - expect(typedData.domain.salt).toBeDefined(); - expect(typedData.message.address).toEqual(await signer.getAddress()); - expect(typedData.message.blockNumber).toEqual( - await provider.getBlockNumber(), - ); - expect(typedData.message['blockHash']).toBeDefined(); - }); - it('creates a new SIWE message', async () => { const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); expect(typedSignature.signature).toBeDefined(); diff --git a/packages/taco-auth/test/auth-sig.test.ts b/packages/taco-auth/test/auth-sig.test.ts index 1eabf42fb..cc8eca343 100644 --- a/packages/taco-auth/test/auth-sig.test.ts +++ b/packages/taco-auth/test/auth-sig.test.ts @@ -1,67 +1,8 @@ import { describe, expect, it } from 'vitest'; -import { - authSignatureSchema, -} from '../src'; +import { authSignatureSchema } from '../src'; + -const eip712AuthSignature = { - 'signature': 'fake-typed-signature', - 'address': '0x0000000000000000000000000000000000000000', - 'scheme': 'EIP712', - 'typedData': { - 'types': { - 'Wallet': [ - { - 'name': 'address', - 'type': 'address', - }, - { - 'name': 'signatureText', - 'type': 'string', - }, - { - 'name': 'blockNumber', - 'type': 'uint256', - }, - { - 'name': 'blockHash', - 'type': 'bytes32', - }, - ], - 'EIP712Domain': [ - { - 'name': 'name', - 'type': 'string', - }, - { - 'name': 'version', - 'type': 'string', - }, - { - 'name': 'chainId', - 'type': 'uint256', - }, - { - 'name': 'salt', - 'type': 'bytes32', - }, - ], - }, - 'domain': { - 'name': 'TACo', - 'version': '1', - 'chainId': 1234, - 'salt': '0x55d90a3b041db6dda74671bc83a25d1508979b19a105be17f57f86fe08627dbd', - }, - 'message': { - 'address': '0x0000000000000000000000000000000000000000', - 'signatureText': 'I\'m the owner of address 0x0000000000000000000000000000000000000000 as of block number 1000', - 'blockNumber': 1000, - 'blockHash': '0x0000000000000000000000000000000000000000', - }, - 'primaryType': 'Wallet', - }, -}; const eip4361AuthSignature = { 'signature': 'fake-signature', 'address': '0x0000000000000000000000000000000000000000', @@ -70,17 +11,6 @@ const eip4361AuthSignature = { }; describe('auth signature', () => { - it('accepts a well-formed EIP172 auth signature', async () => { - authSignatureSchema.parse(eip712AuthSignature); - }); - - it('rejects an EIP712 auth signature with missing fields', async () => { - expect(() => authSignatureSchema.parse({ - ...eip712AuthSignature, - 'signature': undefined, - })).toThrow(); - }); - it('accepts a well-formed EIP4361 auth signature', async () => { authSignatureSchema.parse(eip4361AuthSignature); }); diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 45f25c44c..3cfff3d09 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -1,9 +1,5 @@ -import {ChainId} from '@nucypher/shared'; -import { - USER_ADDRESS_PARAM_DEFAULT, - USER_ADDRESS_PARAM_EIP4361, - USER_ADDRESS_PARAM_EIP712 -} from "@nucypher/taco-auth"; +import { ChainId } from '@nucypher/shared'; +import { USER_ADDRESS_PARAM_DEFAULT } from "@nucypher/taco-auth"; export const USER_ADDRESS_PARAM_EXTERNAL_EIP4361 = ':userAddressExternalEIP4361'; @@ -21,8 +17,6 @@ export const SUPPORTED_CHAIN_IDS = [ ]; export const USER_ADDRESS_PARAMS = [ - USER_ADDRESS_PARAM_EIP712, - USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_EXTERNAL_EIP4361, // Ordering matters, this should always be last USER_ADDRESS_PARAM_DEFAULT, @@ -30,7 +24,5 @@ export const USER_ADDRESS_PARAMS = [ export const RESERVED_CONTEXT_PARAMS = [ USER_ADDRESS_PARAM_DEFAULT, - USER_ADDRESS_PARAM_EIP712, - USER_ADDRESS_PARAM_EIP4361, // USER_ADDRESS_PARAM_EXTERNAL_EIP4361 is not reserved and can be used as a custom context parameter ]; diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 7f4a63e77..025bbdf6b 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -1,9 +1,5 @@ import { EthAddressSchema } from '@nucypher/shared'; -import { - USER_ADDRESS_PARAM_DEFAULT, - USER_ADDRESS_PARAM_EIP4361, - USER_ADDRESS_PARAM_EIP712 -} from "@nucypher/taco-auth"; +import { USER_ADDRESS_PARAM_DEFAULT } from "@nucypher/taco-auth"; import { z } from 'zod'; import { @@ -40,8 +36,6 @@ export const returnValueTestSchema = z.object({ export type ReturnValueTestProps = z.infer; const UserAddressSchema = z.enum([ - USER_ADDRESS_PARAM_EIP712, - USER_ADDRESS_PARAM_EIP4361, USER_ADDRESS_PARAM_DEFAULT, ]); export const EthAddressOrUserAddressSchema = z.union([ diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index aec30a6dd..8ab390791 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -1,6 +1,6 @@ import { initialize } from '@nucypher/nucypher-core'; -import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; -import { fakeAuthProviders} from '@nucypher/test-utils'; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; +import { fakeAuthProviders } from '@nucypher/test-utils'; import { beforeAll, describe, expect, it } from 'vitest'; import { diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 7b7af3f9f..61d5a50cb 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -4,16 +4,11 @@ import { AuthSignature, EIP4361_AUTH_METHOD, EIP4361AuthProvider, - EIP712AuthProvider, - EIP712TypedData, - makeAuthProviders, } from '@nucypher/taco-auth'; import { USER_ADDRESS_PARAM_DEFAULT, - USER_ADDRESS_PARAM_EIP4361, - USER_ADDRESS_PARAM_EIP712 } from "@nucypher/taco-auth"; -import { fakeAuthProviders, fakeProvider, fakeSigner, TEST_SIWE_PARAMS } from '@nucypher/test-utils'; +import { fakeAuthProviders, fakeProvider, fakeSigner } from '@nucypher/test-utils'; import { ethers } from 'ethers'; import { beforeAll, describe, expect, it, vi } from 'vitest'; @@ -316,7 +311,7 @@ describe('No authentication provider', () => { await initialize(); provider = fakeProvider(); signer = fakeSigner(); - authProviders = makeAuthProviders(provider, signer, TEST_SIWE_PARAMS); + authProviders = fakeAuthProviders(); }); it('throws an error if there is no auth provider', () => { @@ -351,22 +346,6 @@ describe('No authentication provider', () => { ).not.toThrow(); }); - it('supports multiple providers when needed', () => { - const conditionObj = { - ...testContractConditionObj, - returnValueTest: { - ...testReturnValueTest, - // TODO: Is it supposed to work? Multiple providers at the same time? - value: [USER_ADDRESS_PARAM_EIP712, USER_ADDRESS_PARAM_EIP4361], - }, - }; - const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(() => - conditionExpr.buildContext( {}, authProviders), - ).not.toThrow(); - }); - async function makeAuthSignature(authMethod: string) { const conditionObj = { ...testContractConditionObj, @@ -386,25 +365,6 @@ describe('No authentication provider', () => { return authSignature; } - async function testEIP712AuthMethod(authMethod: string) { - const eip712Spy = vi.spyOn( - EIP712AuthProvider.prototype, - 'getOrCreateAuthSignature', - ); - - const authSignature = await makeAuthSignature(authMethod); - expect(authSignature).toBeDefined(); - expect(authSignature.signature).toBeDefined(); - expect(authSignature.scheme).toEqual('EIP712'); - expect(authSignature.address).toEqual(await signer.getAddress()); - - const typedData = authSignature.typedData as EIP712TypedData; - expect(typedData).toBeDefined(); - expect(typedData.domain.name).toEqual('TACo'); - expect(typedData.message.address).toEqual(await signer.getAddress()); - expect(eip712Spy).toHaveBeenCalledOnce(); - } - async function testEIP4361AuthMethod(authMethod: string) { const eip4361Spy = vi.spyOn( EIP4361AuthProvider.prototype, @@ -419,17 +379,9 @@ describe('No authentication provider', () => { await testEIP4361AuthMethod(USER_ADDRESS_PARAM_DEFAULT); }); - it('supports eip712', async () => { - await testEIP712AuthMethod(USER_ADDRESS_PARAM_EIP712); - }); - - it('supports eip4361', async () => { - await testEIP4361AuthMethod(USER_ADDRESS_PARAM_EIP4361); - }); - it('supports reusing external eip4361', async () => { // Because we are reusing an existing SIWE auth message, we have to pass it as a custom parameter - const authMessage = await makeAuthSignature(USER_ADDRESS_PARAM_EIP4361); + const authMessage = await makeAuthSignature(USER_ADDRESS_PARAM_DEFAULT); const customParams: Record = { [USER_ADDRESS_PARAM_EXTERNAL_EIP4361]: authMessage as CustomContextParam, }; diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts index c72822466..2ab380469 100644 --- a/packages/test-utils/src/utils.ts +++ b/packages/test-utils/src/utils.ts @@ -39,7 +39,7 @@ import { Ursula, zip, } from '@nucypher/shared'; -import {makeAuthProviders} from "@nucypher/taco-auth"; +import { EIP4361_AUTH_METHOD, EIP4361AuthProvider } from '@nucypher/taco-auth'; import axios from 'axios'; import { ethers, providers, Wallet } from 'ethers'; import { expect, SpyInstance, vi } from 'vitest'; @@ -58,7 +58,7 @@ export const fakePorterUri = 'https://_this_should_crash.com/'; const makeFakeProvider = ( timestamp: number, blockNumber: number, - blockHash: string + blockHash: string, ) => { const block = { timestamp, hash: blockHash }; return { @@ -86,7 +86,11 @@ export const fakeSigner = ( } as unknown as ethers.providers.JsonRpcSigner; }; -export const fakeAuthProviders = () => makeAuthProviders(fakeProvider(), fakeSigner(), TEST_SIWE_PARAMS); +export const fakeAuthProviders = () => { + return { + [EIP4361_AUTH_METHOD]: new EIP4361AuthProvider(fakeProvider(), fakeSigner(), TEST_SIWE_PARAMS), + }; +}; export const fakeProvider = ( secretKeyBytes = SecretKey.random().toBEBytes(), @@ -254,14 +258,14 @@ interface FakeDkgRitualFlow { } export const fakeTDecFlow = ({ - validators, - validatorKeypairs, - ritualId, - sharesNum, - threshold, - receivedMessages, - message, - thresholdMessageKit, + validators, + validatorKeypairs, + ritualId, + sharesNum, + threshold, + receivedMessages, + message, + thresholdMessageKit, }: FakeDkgRitualFlow) => { // Having aggregated the transcripts, the validators can now create decryption shares const decryptionShares: DecryptionShareSimple[] = []; From 918dba7f6ab3234546a769de55e22f1fa6b746bf Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Thu, 11 Jul 2024 14:17:16 +0200 Subject: [PATCH 56/75] Add a sketch for reusing SIWE message --- packages/taco-auth/src/auth-sig.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/taco-auth/src/auth-sig.ts b/packages/taco-auth/src/auth-sig.ts index 5d51d7491..613ec073c 100644 --- a/packages/taco-auth/src/auth-sig.ts +++ b/packages/taco-auth/src/auth-sig.ts @@ -3,6 +3,7 @@ import { z } from 'zod'; import { EIP4361_AUTH_METHOD } from './auth-provider'; import { EIP4361TypedDataSchema } from './providers'; +import { SiweMessage } from 'siwe'; export const authSignatureSchema = z.object({ @@ -13,3 +14,15 @@ export const authSignatureSchema = z.object({ }); export type AuthSignature = z.infer; + +// TODO: create a AuthSignature class. + +// TODO: Where do we get the signature from? +export const fromSIWEMessage = (siweMessage: SiweMessage, signature: ???): AuthSignature => { + return { + signature: ??? + address: siweMessage.address, + scheme: EIP4361_AUTH_METHOD, + typedData: siweMessage.prepareMessage() + } +} From 7d787ccef2f3c45b3ab249dc23a2f050077a7071 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 12 Jul 2024 15:44:07 -0400 Subject: [PATCH 57/75] Use constant for EIP4361 auth scheme instead of string. --- packages/taco-auth/src/providers/eip4361.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts index db35dfadd..70358cbc8 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -86,7 +86,7 @@ export class EIP4361AuthProvider { nonce, chainId, }); - const scheme = 'EIP4361'; + const scheme = EIP4361_AUTH_METHOD; const message = siweMessage.prepareMessage(); const signature = await this.signer.signMessage(message); return { signature, address, scheme, typedData: message }; From 6d9e8b33edbe56b38dd6275d49f66b1a902c1b05 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 12 Jul 2024 16:10:13 -0400 Subject: [PATCH 58/75] Allow :userAddressExternalEIP4361 context variable wherever :userAddress is allowed. --- packages/taco/src/conditions/shared.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 025bbdf6b..003260b6b 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -5,6 +5,8 @@ import { z } from 'zod'; import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, + // TODO consider moving this + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, } from './const'; export const contextParamSchema = z.string().regex(CONTEXT_PARAM_REGEXP); @@ -37,6 +39,7 @@ export type ReturnValueTestProps = z.infer; const UserAddressSchema = z.enum([ USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, ]); export const EthAddressOrUserAddressSchema = z.union([ EthAddressSchema, From 7bcb0f95a5bd21ccc21c4e49326d4e065ec0055d Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 12 Jul 2024 16:51:38 -0400 Subject: [PATCH 59/75] Add single sign-on EIP4361 auth provider for constructing auth signatures from external SIWE messages. --- packages/taco-auth/src/auth-sig.ts | 12 -------- .../src/providers/external-eip4361.ts | 28 +++++++++++++++++++ packages/taco-auth/src/providers/index.ts | 1 + 3 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 packages/taco-auth/src/providers/external-eip4361.ts diff --git a/packages/taco-auth/src/auth-sig.ts b/packages/taco-auth/src/auth-sig.ts index 613ec073c..2f84d95ed 100644 --- a/packages/taco-auth/src/auth-sig.ts +++ b/packages/taco-auth/src/auth-sig.ts @@ -14,15 +14,3 @@ export const authSignatureSchema = z.object({ }); export type AuthSignature = z.infer; - -// TODO: create a AuthSignature class. - -// TODO: Where do we get the signature from? -export const fromSIWEMessage = (siweMessage: SiweMessage, signature: ???): AuthSignature => { - return { - signature: ??? - address: siweMessage.address, - scheme: EIP4361_AUTH_METHOD, - typedData: siweMessage.prepareMessage() - } -} diff --git a/packages/taco-auth/src/providers/external-eip4361.ts b/packages/taco-auth/src/providers/external-eip4361.ts new file mode 100644 index 000000000..f0c4c1a6d --- /dev/null +++ b/packages/taco-auth/src/providers/external-eip4361.ts @@ -0,0 +1,28 @@ +import { SiweMessage } from 'siwe'; + +import { EIP4361_AUTH_METHOD } from '../auth-provider'; +import { AuthSignature } from '../auth-sig'; + + +export class SingleSignOnEIP4361AuthProvider { + public static async fromExistingSiweInfo(existingSiweMessage: string, signature: string): Promise { + // validation + const siweMessage = new SiweMessage(existingSiweMessage); + await siweMessage.verify({signature}); + // create provider + const authProvider = new SingleSignOnEIP4361AuthProvider(siweMessage.prepareMessage(), siweMessage.address, signature); + return authProvider; + } + + private constructor( + private readonly existingSiweMessage: string, + private readonly address: string, + private readonly signature: string, + ) { + } + + public async getOrCreateAuthSignature(): Promise { + const scheme = EIP4361_AUTH_METHOD; + return { signature: this.signature, address: this.address, scheme, typedData: this.existingSiweMessage }; + } +} diff --git a/packages/taco-auth/src/providers/index.ts b/packages/taco-auth/src/providers/index.ts index 5bc7a7faf..14f5a1f3f 100644 --- a/packages/taco-auth/src/providers/index.ts +++ b/packages/taco-auth/src/providers/index.ts @@ -1 +1,2 @@ export * from './eip4361'; +export * from './external-eip4361'; From 6709bf3c7f9eaee148669e7af40ccb0f2139f8af Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 12 Jul 2024 16:54:55 -0400 Subject: [PATCH 60/75] Run 'pnpm fix' to address linting issues. --- examples/taco/nodejs/src/index.ts | 6 +- packages/shared/src/index.ts | 2 +- packages/shared/src/schemas.ts | 3 +- packages/shared/test/schemas.test.ts | 3 +- packages/taco-auth/src/auth-sig.ts | 2 - packages/taco-auth/src/index.ts | 4 +- packages/taco-auth/src/providers/eip4361.ts | 5 +- .../src/providers/external-eip4361.ts | 24 ++++-- packages/taco-auth/test/auth-provider.test.ts | 10 ++- packages/taco-auth/test/auth-sig.test.ts | 20 ++--- packages/taco/examples/conditions.ts | 5 +- packages/taco/examples/encrypt-decrypt.ts | 8 +- .../taco/src/conditions/condition-expr.ts | 4 +- packages/taco/src/conditions/const.ts | 2 +- .../taco/src/conditions/context/context.ts | 75 ++++++++++++------- .../taco/src/conditions/predefined/erc20.ts | 3 +- .../taco/src/conditions/predefined/erc721.ts | 3 +- packages/taco/src/conditions/shared.ts | 2 +- packages/taco/src/taco.ts | 4 +- packages/taco/src/tdec.ts | 4 +- packages/taco/src/types.ts | 5 +- .../test/conditions/base/contract.test.ts | 4 +- .../test/conditions/condition-expr.test.ts | 5 +- packages/taco/test/conditions/context.test.ts | 56 +++++++------- .../test/conditions/predefined/erc721.test.ts | 2 +- packages/taco/test/taco.test.ts | 32 +++++--- packages/taco/test/test-utils.ts | 1 - packages/test-utils/src/utils.ts | 22 +++--- 28 files changed, 192 insertions(+), 124 deletions(-) diff --git a/examples/taco/nodejs/src/index.ts b/examples/taco/nodejs/src/index.ts index 8c4459ed8..bc00640ab 100644 --- a/examples/taco/nodejs/src/index.ts +++ b/examples/taco/nodejs/src/index.ts @@ -89,7 +89,11 @@ const decryptFromBytes = async (encryptedBytes: Uint8Array) => { domain: 'localhost', uri: 'http://localhost:3000', }; - const authProvider = new EIP4361AuthProvider(provider, consumerSigner, siweParams); + const authProvider = new EIP4361AuthProvider( + provider, + consumerSigner, + siweParams, + ); return decrypt( provider, domain, diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 0ca14e2b0..526d9cc5b 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -1,9 +1,9 @@ export * from './contracts'; export * from './porter'; +export * from './schemas'; export type * from './types'; export * from './utils'; export * from './web3'; -export * from './schemas'; // Re-exports export { diff --git a/packages/shared/src/schemas.ts b/packages/shared/src/schemas.ts index 911388d31..b404ec6ee 100644 --- a/packages/shared/src/schemas.ts +++ b/packages/shared/src/schemas.ts @@ -11,6 +11,7 @@ const isAddress = (address: string) => { } }; -export const EthAddressSchema = z.string() +export const EthAddressSchema = z + .string() .regex(ETH_ADDRESS_REGEXP) .refine(isAddress, { message: 'Invalid Ethereum address' }); diff --git a/packages/shared/test/schemas.test.ts b/packages/shared/test/schemas.test.ts index fd77e4222..a082be503 100644 --- a/packages/shared/test/schemas.test.ts +++ b/packages/shared/test/schemas.test.ts @@ -1,8 +1,7 @@ -import {describe, expect, it} from 'vitest'; +import { describe, expect, it } from 'vitest'; import { EthAddressSchema } from '../src'; - describe('ethereum address schema', () => { it('should accept valid ethereum address', () => { const validAddress = '0x1234567890123456789012345678901234567890'; diff --git a/packages/taco-auth/src/auth-sig.ts b/packages/taco-auth/src/auth-sig.ts index 2f84d95ed..01e04ada6 100644 --- a/packages/taco-auth/src/auth-sig.ts +++ b/packages/taco-auth/src/auth-sig.ts @@ -3,8 +3,6 @@ import { z } from 'zod'; import { EIP4361_AUTH_METHOD } from './auth-provider'; import { EIP4361TypedDataSchema } from './providers'; -import { SiweMessage } from 'siwe'; - export const authSignatureSchema = z.object({ signature: z.string(), diff --git a/packages/taco-auth/src/index.ts b/packages/taco-auth/src/index.ts index 48718042f..2791ece39 100644 --- a/packages/taco-auth/src/index.ts +++ b/packages/taco-auth/src/index.ts @@ -1,3 +1,3 @@ -export * from './providers'; -export * from './auth-sig'; export * from './auth-provider'; +export * from './auth-sig'; +export * from './providers'; diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361.ts index 70358cbc8..8c9a475c6 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361.ts @@ -15,13 +15,14 @@ const isSiweMessage = (message: string): boolean => { } }; -export const EIP4361TypedDataSchema = z.string() +export const EIP4361TypedDataSchema = z + .string() .refine(isSiweMessage, { message: 'Invalid SIWE message' }); export type EIP4361AuthProviderParams = { domain: string; uri: string; -} +}; const ERR_MISSING_SIWE_PARAMETERS = 'Missing default SIWE parameters'; diff --git a/packages/taco-auth/src/providers/external-eip4361.ts b/packages/taco-auth/src/providers/external-eip4361.ts index f0c4c1a6d..b2c550b86 100644 --- a/packages/taco-auth/src/providers/external-eip4361.ts +++ b/packages/taco-auth/src/providers/external-eip4361.ts @@ -3,14 +3,20 @@ import { SiweMessage } from 'siwe'; import { EIP4361_AUTH_METHOD } from '../auth-provider'; import { AuthSignature } from '../auth-sig'; - export class SingleSignOnEIP4361AuthProvider { - public static async fromExistingSiweInfo(existingSiweMessage: string, signature: string): Promise { + public static async fromExistingSiweInfo( + existingSiweMessage: string, + signature: string, + ): Promise { // validation const siweMessage = new SiweMessage(existingSiweMessage); - await siweMessage.verify({signature}); + await siweMessage.verify({ signature }); // create provider - const authProvider = new SingleSignOnEIP4361AuthProvider(siweMessage.prepareMessage(), siweMessage.address, signature); + const authProvider = new SingleSignOnEIP4361AuthProvider( + siweMessage.prepareMessage(), + siweMessage.address, + signature, + ); return authProvider; } @@ -18,11 +24,15 @@ export class SingleSignOnEIP4361AuthProvider { private readonly existingSiweMessage: string, private readonly address: string, private readonly signature: string, - ) { - } + ) {} public async getOrCreateAuthSignature(): Promise { const scheme = EIP4361_AUTH_METHOD; - return { signature: this.signature, address: this.address, scheme, typedData: this.existingSiweMessage }; + return { + signature: this.signature, + address: this.address, + scheme, + typedData: this.existingSiweMessage, + }; } } diff --git a/packages/taco-auth/test/auth-provider.test.ts b/packages/taco-auth/test/auth-provider.test.ts index 0b8851a7c..a457370d9 100644 --- a/packages/taco-auth/test/auth-provider.test.ts +++ b/packages/taco-auth/test/auth-provider.test.ts @@ -12,7 +12,11 @@ import { EIP4361AuthProvider, EIP4361TypedDataSchema } from '../src'; describe('auth provider', () => { const provider = fakeProvider(bobSecretKeyBytes); const signer = fakeSigner(bobSecretKeyBytes); - const eip4361Provider = new EIP4361AuthProvider(provider, signer, TEST_SIWE_PARAMS); + const eip4361Provider = new EIP4361AuthProvider( + provider, + signer, + TEST_SIWE_PARAMS, + ); it('creates a new SIWE message', async () => { const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); @@ -42,6 +46,8 @@ describe('auth provider', () => { it('rejects an invalid EIP4361 message', async () => { const typedSignature = await eip4361Provider.getOrCreateAuthSignature(); typedSignature.typedData = 'invalid-typed-data'; - expect(() => EIP4361TypedDataSchema.parse(typedSignature.typedData)).toThrow(); + expect(() => + EIP4361TypedDataSchema.parse(typedSignature.typedData), + ).toThrow(); }); }); diff --git a/packages/taco-auth/test/auth-sig.test.ts b/packages/taco-auth/test/auth-sig.test.ts index cc8eca343..c20e9c30f 100644 --- a/packages/taco-auth/test/auth-sig.test.ts +++ b/packages/taco-auth/test/auth-sig.test.ts @@ -2,12 +2,12 @@ import { describe, expect, it } from 'vitest'; import { authSignatureSchema } from '../src'; - const eip4361AuthSignature = { - 'signature': 'fake-signature', - 'address': '0x0000000000000000000000000000000000000000', - 'scheme': 'EIP4361', - 'typedData': 'localhost wants you to sign in with your Ethereum account:\n0x0000000000000000000000000000000000000000\n\nlocalhost wants you to sign in with your Ethereum account: 0x0000000000000000000000000000000000000000\n\nURI: http://localhost:3000\nVersion: 1\nChain ID: 1234\nNonce: 5ixAg1odyfDnrbfGa\nIssued At: 2024-07-01T10:32:39.631Z', + signature: 'fake-signature', + address: '0x0000000000000000000000000000000000000000', + scheme: 'EIP4361', + typedData: + 'localhost wants you to sign in with your Ethereum account:\n0x0000000000000000000000000000000000000000\n\nlocalhost wants you to sign in with your Ethereum account: 0x0000000000000000000000000000000000000000\n\nURI: http://localhost:3000\nVersion: 1\nChain ID: 1234\nNonce: 5ixAg1odyfDnrbfGa\nIssued At: 2024-07-01T10:32:39.631Z', }; describe('auth signature', () => { @@ -16,9 +16,11 @@ describe('auth signature', () => { }); it('rejects an EIP4361 auth signature with missing fields', async () => { - expect(() => authSignatureSchema.parse({ - ...eip4361AuthSignature, - 'signature': undefined, - })).toThrow(); + expect(() => + authSignatureSchema.parse({ + ...eip4361AuthSignature, + signature: undefined, + }), + ).toThrow(); }); }); diff --git a/packages/taco/examples/conditions.ts b/packages/taco/examples/conditions.ts index 6e860160e..3ac71b0e0 100644 --- a/packages/taco/examples/conditions.ts +++ b/packages/taco/examples/conditions.ts @@ -7,7 +7,10 @@ const ownsNFT = new conditions.predefined.erc721.ERC721Ownership({ parameters: [3591], chain: ChainId.SEPOLIA, }); -console.assert(ownsNFT.requiresAuthentication(), 'ERC721Ownership requires authentication'); +console.assert( + ownsNFT.requiresAuthentication(), + 'ERC721Ownership requires authentication', +); const hasAtLeastTwoNFTs = new conditions.predefined.erc721.ERC721Balance({ contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77', diff --git a/packages/taco/examples/encrypt-decrypt.ts b/packages/taco/examples/encrypt-decrypt.ts index 441706853..8d6b7f0f6 100644 --- a/packages/taco/examples/encrypt-decrypt.ts +++ b/packages/taco/examples/encrypt-decrypt.ts @@ -4,7 +4,8 @@ import { ethers } from 'ethers'; import { conditions, decrypt, - domains, EIP4361AuthProvider, + domains, + EIP4361AuthProvider, encrypt, getPorterUri, initialize, @@ -45,7 +46,10 @@ const run = async () => { // @ts-ignore const web3Provider = new ethers.providers.Web3Provider(window.ethereum); - const authProvider = new EIP4361AuthProvider(web3Provider, web3Provider.getSigner()); + const authProvider = new EIP4361AuthProvider( + web3Provider, + web3Provider.getSigner(), + ); const decryptedMessage = await decrypt( web3Provider, domains.TESTNET, diff --git a/packages/taco/src/conditions/condition-expr.ts b/packages/taco/src/conditions/condition-expr.ts index 405daece1..e62ed2b49 100644 --- a/packages/taco/src/conditions/condition-expr.ts +++ b/packages/taco/src/conditions/condition-expr.ts @@ -1,11 +1,11 @@ import { Conditions as CoreConditions } from '@nucypher/nucypher-core'; import { toJSON } from '@nucypher/shared'; -import {AuthProviders} from "@nucypher/taco-auth"; +import { AuthProviders } from '@nucypher/taco-auth'; import { SemVer } from 'semver'; import { Condition } from './condition'; import { ConditionFactory } from './condition-factory'; -import { ConditionContext, CustomContextParam} from './context'; +import { ConditionContext, CustomContextParam } from './context'; const ERR_VERSION = (provided: string, current: string) => `Version provided, ${provided}, is incompatible with current version, ${current}`; diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 3cfff3d09..1eb809a92 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -1,5 +1,5 @@ import { ChainId } from '@nucypher/shared'; -import { USER_ADDRESS_PARAM_DEFAULT } from "@nucypher/taco-auth"; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; export const USER_ADDRESS_PARAM_EXTERNAL_EIP4361 = ':userAddressExternalEIP4361'; diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index b68181ed3..015c34afc 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,13 +1,21 @@ import { ThresholdMessageKit } from '@nucypher/nucypher-core'; import { toJSON } from '@nucypher/shared'; -import { AUTH_METHOD_FOR_PARAM, AuthProviders, AuthSignature } from '@nucypher/taco-auth'; +import { + AUTH_METHOD_FOR_PARAM, + AuthProviders, + AuthSignature, +} from '@nucypher/taco-auth'; import { CoreConditions, CoreContext } from '../../types'; import { CompoundConditionType } from '../compound-condition'; import { Condition, ConditionProps } from '../condition'; import { ConditionExpression } from '../condition-expr'; -import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS, USER_ADDRESS_PARAMS } from '../const'; - +import { + CONTEXT_PARAM_PREFIX, + CONTEXT_PARAM_REGEXP, + RESERVED_CONTEXT_PARAMS, + USER_ADDRESS_PARAMS, +} from '../const'; export type CustomContextParam = string | number | boolean | AuthSignature; export type ContextParam = CustomContextParam | AuthSignature; @@ -36,7 +44,8 @@ export class ConditionContext { const condProps = condition.toObj(); this.validateContextParameters(); this.validateCoreConditions(condProps); - this.requestedParameters = ConditionContext.findContextParameters(condProps); + this.requestedParameters = + ConditionContext.findContextParameters(condProps); this.validateAuthProviders(this.requestedParameters); } @@ -57,7 +66,9 @@ export class ConditionContext { new CoreConditions(toJSON(condObject)); } - private validateNoMissingContextParameters(parameters: Record) { + private validateNoMissingContextParameters( + parameters: Record, + ) { // Ok, so at this point we should have all the parameters we need // If we don't, we have a problem and we should throw const missingParameters = Array.from(this.requestedParameters).filter( @@ -70,7 +81,8 @@ export class ConditionContext { // We may also have some parameters that are not used const unknownParameters = Object.keys(parameters).filter( (key) => - !this.requestedParameters.has(key) && !RESERVED_CONTEXT_PARAMS.includes(key), + !this.requestedParameters.has(key) && + !RESERVED_CONTEXT_PARAMS.includes(key), ); if (unknownParameters.length > 0) { throw new Error(ERR_UNKNOWN_CONTEXT_PARAMS(unknownParameters)); @@ -80,7 +92,8 @@ export class ConditionContext { private async fillContextParameters( requestedParameters: Set, ): Promise> { - const parameters = await this.fillAuthContextParameters(requestedParameters); + const parameters = + await this.fillAuthContextParameters(requestedParameters); for (const key in this.customParameters) { parameters[key] = this.customParameters[key]; } @@ -108,16 +121,20 @@ export class ConditionContext { } } - private async fillAuthContextParameters(requestedParameters: Set): Promise> { - const entries = await Promise.all([...requestedParameters] - .map(param => [param, AUTH_METHOD_FOR_PARAM[param]]) - .filter(([, authMethod]) => !!authMethod) - .map(async ([param, authMethod]) => { - const maybeAuthProvider = this.authProviders[authMethod]; - // TODO: Throw here instead of validating in the constructor? - // TODO: Hide getOrCreateAuthSignature behind a more generic interface - return [param, await maybeAuthProvider!.getOrCreateAuthSignature()]; - })); + private async fillAuthContextParameters( + requestedParameters: Set, + ): Promise> { + const entries = await Promise.all( + [...requestedParameters] + .map((param) => [param, AUTH_METHOD_FOR_PARAM[param]]) + .filter(([, authMethod]) => !!authMethod) + .map(async ([param, authMethod]) => { + const maybeAuthProvider = this.authProviders[authMethod]; + // TODO: Throw here instead of validating in the constructor? + // TODO: Hide getOrCreateAuthSignature behind a more generic interface + return [param, await maybeAuthProvider!.getOrCreateAuthSignature()]; + }), + ); return Object.fromEntries(entries); } @@ -156,9 +173,7 @@ export class ConditionContext { // If it's a compound condition, check operands if (condition.conditionType === CompoundConditionType) { for (const key in condition.operands) { - const innerParams = this.findContextParameters( - condition.operands[key], - ); + const innerParams = this.findContextParameters(condition.operands[key]); for (const param of innerParams) { requestedParameters.add(param); } @@ -178,8 +193,12 @@ export class ConditionContext { return new CoreContext(asJson); } - public toContextParameters = async (): Promise> => { - const parameters = await this.fillContextParameters(this.requestedParameters); + public toContextParameters = async (): Promise< + Record + > => { + const parameters = await this.fillContextParameters( + this.requestedParameters, + ); this.validateNoMissingContextParameters(parameters); return parameters; }; @@ -196,8 +215,14 @@ export class ConditionContext { ); } - public static requestedContextParameters(messageKit: ThresholdMessageKit): Set { - const conditionExpr = ConditionExpression.fromCoreConditions(messageKit.acp.conditions); - return ConditionContext.findContextParameters(conditionExpr.condition.toObj()); + public static requestedContextParameters( + messageKit: ThresholdMessageKit, + ): Set { + const conditionExpr = ConditionExpression.fromCoreConditions( + messageKit.acp.conditions, + ); + return ConditionContext.findContextParameters( + conditionExpr.condition.toObj(), + ); } } diff --git a/packages/taco/src/conditions/predefined/erc20.ts b/packages/taco/src/conditions/predefined/erc20.ts index c2bdc2766..cd3087e7f 100644 --- a/packages/taco/src/conditions/predefined/erc20.ts +++ b/packages/taco/src/conditions/predefined/erc20.ts @@ -1,4 +1,4 @@ -import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { ContractCondition, @@ -6,7 +6,6 @@ import { ContractConditionType, } from '../base/contract'; - type ERC20BalanceFields = 'contractAddress' | 'chain' | 'returnValueTest'; const ERC20BalanceDefaults: Omit = { diff --git a/packages/taco/src/conditions/predefined/erc721.ts b/packages/taco/src/conditions/predefined/erc721.ts index 75a2f85c5..90b2a33de 100644 --- a/packages/taco/src/conditions/predefined/erc721.ts +++ b/packages/taco/src/conditions/predefined/erc721.ts @@ -1,4 +1,4 @@ -import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { ContractCondition, @@ -6,7 +6,6 @@ import { ContractConditionType, } from '../base/contract'; - type ERC721OwnershipFields = 'contractAddress' | 'chain' | 'parameters'; const ERC721OwnershipDefaults: Omit< diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 003260b6b..87ea85f7c 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -1,5 +1,5 @@ import { EthAddressSchema } from '@nucypher/shared'; -import { USER_ADDRESS_PARAM_DEFAULT } from "@nucypher/taco-auth"; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { z } from 'zod'; import { diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index d05b210cc..28f629567 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -160,8 +160,8 @@ export const decrypt = async ( const ritual = await DkgClient.getActiveRitual(provider, domain, ritualId); const authProviders: AuthProviders = authProvider ? { - [EIP4361_AUTH_METHOD]: authProvider, - } + [EIP4361_AUTH_METHOD]: authProvider, + } : {}; return retrieveAndDecrypt( provider, diff --git a/packages/taco/src/tdec.ts b/packages/taco/src/tdec.ts index a3f1b9444..cfe516519 100644 --- a/packages/taco/src/tdec.ts +++ b/packages/taco/src/tdec.ts @@ -19,12 +19,12 @@ import { PorterClient, toBytes, } from '@nucypher/shared'; -import {AuthProviders} from "@nucypher/taco-auth"; +import { AuthProviders } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { arrayify, keccak256 } from 'ethers/lib/utils'; import { ConditionExpression } from './conditions/condition-expr'; -import { ConditionContext, CustomContextParam} from './conditions/context'; +import { ConditionContext, CustomContextParam } from './conditions/context'; const ERR_DECRYPTION_FAILED = (errors: unknown) => `Threshold of responses not met; TACo decryption failed with errors: ${JSON.stringify( diff --git a/packages/taco/src/types.ts b/packages/taco/src/types.ts index 76c88ed69..406bf6910 100644 --- a/packages/taco/src/types.ts +++ b/packages/taco/src/types.ts @@ -1,2 +1,5 @@ // Re-exporting core types to avoid confusion with taco types -export { Context as CoreContext, Conditions as CoreConditions } from '@nucypher/nucypher-core'; +export { + Conditions as CoreConditions, + Context as CoreContext, +} from '@nucypher/nucypher-core'; diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index 8ab390791..849ae2b5f 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -11,9 +11,7 @@ import { FunctionAbiProps, } from '../../../src/conditions/base/contract'; import { ConditionExpression } from '../../../src/conditions/condition-expr'; -import { - USER_ADDRESS_PARAMS, -} from '../../../src/conditions/const'; +import { USER_ADDRESS_PARAMS } from '../../../src/conditions/const'; import { CustomContextParam } from '../../../src/conditions/context'; import { testContractConditionObj, testFunctionAbi } from '../../test-utils'; diff --git a/packages/taco/test/conditions/condition-expr.test.ts b/packages/taco/test/conditions/condition-expr.test.ts index 9a3f38e30..bf4fe8946 100644 --- a/packages/taco/test/conditions/condition-expr.test.ts +++ b/packages/taco/test/conditions/condition-expr.test.ts @@ -1,6 +1,6 @@ import { initialize } from '@nucypher/nucypher-core'; import { objectEquals, toJSON } from '@nucypher/shared'; -import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { TEST_CHAIN_ID, TEST_CONTRACT_ADDR } from '@nucypher/test-utils'; import { SemVer } from 'semver'; import { beforeAll, describe, expect, it } from 'vitest'; @@ -204,7 +204,8 @@ describe('condition set', () => { it('serializes to and from WASM conditions', () => { const conditionExpr = new ConditionExpression(erc721Balance); const coreConditions = conditionExpr.toCoreCondition(); - const fromCoreConditions = ConditionExpression.fromCoreConditions(coreConditions); + const fromCoreConditions = + ConditionExpression.fromCoreConditions(coreConditions); expect(conditionExpr.equals(fromCoreConditions)).toBeTruthy(); }); diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 61d5a50cb..fb8bce5b9 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -4,11 +4,13 @@ import { AuthSignature, EIP4361_AUTH_METHOD, EIP4361AuthProvider, + USER_ADDRESS_PARAM_DEFAULT, } from '@nucypher/taco-auth'; import { - USER_ADDRESS_PARAM_DEFAULT, -} from "@nucypher/taco-auth"; -import { fakeAuthProviders, fakeProvider, fakeSigner } from '@nucypher/test-utils'; + fakeAuthProviders, + fakeProvider, + fakeSigner, +} from '@nucypher/test-utils'; import { ethers } from 'ethers'; import { beforeAll, describe, expect, it, vi } from 'vitest'; @@ -93,7 +95,7 @@ describe('context', () => { expect(asObj[customParamKey]).toEqual(`0x${toHexString(customParam)}`); }); - it('detects when a custom parameter is requested', ()=> { + it('detects when a custom parameter is requested', () => { const context = conditionExpr.buildContext({}, authProviders); expect(context.requestedParameters).toContain(customParamKey); }); @@ -101,7 +103,9 @@ describe('context', () => { describe('return value test', () => { it('accepts on a custom context parameters', async () => { - const asObj = await conditionExpr.buildContext(customParams).toContextParameters(); + const asObj = await conditionExpr + .buildContext(customParams) + .toContextParameters(); expect(asObj).toBeDefined(); expect(asObj[customParamKey]).toEqual(1234); }); @@ -166,8 +170,8 @@ describe('context', () => { } as ContractConditionProps; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.buildContext( {}, authProviders)).toBeDefined(); - expect(() => conditionExpr.buildContext( {})).toThrow( + expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); + expect(() => conditionExpr.buildContext({})).toThrow( `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -178,8 +182,8 @@ describe('context', () => { expect( JSON.stringify(condition.toObj()).includes(USER_ADDRESS_PARAM_DEFAULT), ).toBe(false); - expect(conditionExpr.buildContext( {}, authProviders)).toBeDefined(); - expect(conditionExpr.buildContext( {})).toBeDefined(); + expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); + expect(conditionExpr.buildContext({})).toBeDefined(); }); it('rejects on a missing signer', () => { @@ -192,7 +196,7 @@ describe('context', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( + expect(() => conditionExpr.buildContext({}, undefined)).toThrow( `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -207,7 +211,7 @@ describe('context', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(() => conditionExpr.buildContext( {}, undefined)).toThrow( + expect(() => conditionExpr.buildContext({}, undefined)).toThrow( `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); @@ -224,10 +228,10 @@ describe('context', () => { }, }; - it('handles both custom and auth context parameters', ()=> { - const requestedParams = new ConditionExpression(contractCondition) - .buildContext( {}, authProviders) - .requestedParameters; + it('handles both custom and auth context parameters', () => { + const requestedParams = new ConditionExpression( + contractCondition, + ).buildContext({}, authProviders).requestedParameters; expect(requestedParams).not.toContain(USER_ADDRESS_PARAM_DEFAULT); expect(requestedParams).toContain(customParamKey); }); @@ -239,9 +243,11 @@ describe('context', () => { }); const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext( {}, authProviders); + ).buildContext({}, authProviders); - await expect(async () => conditionContext.toContextParameters()).rejects.toThrow( + await expect(async () => + conditionContext.toContextParameters(), + ).rejects.toThrow( `Missing custom context parameter(s): ${customParamKey}`, ); }); @@ -253,7 +259,7 @@ describe('context', () => { }); const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext( {}, authProviders); + ).buildContext({}, authProviders); const asObj = await conditionContext.toContextParameters(); expect(asObj).toBeDefined(); @@ -271,7 +277,7 @@ describe('context', () => { customParameters[customParamKey] = falsyParam; const conditionContext = new ConditionExpression( customContractCondition, - ).buildContext( customParameters, authProviders); + ).buildContext(customParameters, authProviders); const asObj = await conditionContext.toContextParameters(); expect(asObj).toBeDefined(); @@ -325,7 +331,7 @@ describe('No authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(() => conditionExpr.buildContext( {}, {})).toThrow( + expect(() => conditionExpr.buildContext({}, {})).toThrow( `No matching authentication provider to satisfy ${userAddressParam} context variable in condition`, ); }); @@ -341,9 +347,7 @@ describe('No authentication provider', () => { }; const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - expect(() => - conditionExpr.buildContext( {}, authProviders), - ).not.toThrow(); + expect(() => conditionExpr.buildContext({}, authProviders)).not.toThrow(); }); async function makeAuthSignature(authMethod: string) { @@ -357,7 +361,7 @@ describe('No authentication provider', () => { const condition = new ContractCondition(conditionObj); const conditionExpr = new ConditionExpression(condition); - const builtContext = conditionExpr.buildContext( {}, authProviders); + const builtContext = conditionExpr.buildContext({}, authProviders); const contextVars = await builtContext.toContextParameters(); const authSignature = contextVars[authMethod] as AuthSignature; expect(authSignature).toBeDefined(); @@ -406,9 +410,7 @@ describe('No authentication provider', () => { // Make sure we remove the EIP4361 auth method from the auth providers first delete authProviders[EIP4361_AUTH_METHOD]; // Should throw an error if we don't pass the custom parameter - expect( - () => conditionExpr.buildContext( {}, authProviders) - ).toThrow( + expect(() => conditionExpr.buildContext({}, authProviders)).toThrow( `No custom parameter for requested context parameter: ${USER_ADDRESS_PARAM_EXTERNAL_EIP4361}`, ); diff --git a/packages/taco/test/conditions/predefined/erc721.test.ts b/packages/taco/test/conditions/predefined/erc721.test.ts index 6038d8f97..c79b9e14a 100644 --- a/packages/taco/test/conditions/predefined/erc721.test.ts +++ b/packages/taco/test/conditions/predefined/erc721.test.ts @@ -1,4 +1,4 @@ -import {USER_ADDRESS_PARAM_DEFAULT} from "@nucypher/taco-auth"; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { TEST_CHAIN_ID, TEST_CONTRACT_ADDR } from '@nucypher/test-utils'; import { describe, expect, it } from 'vitest'; diff --git a/packages/taco/test/taco.test.ts b/packages/taco/test/taco.test.ts index af3a06c2c..f965fa80c 100644 --- a/packages/taco/test/taco.test.ts +++ b/packages/taco/test/taco.test.ts @@ -3,8 +3,8 @@ import { initialize, SessionStaticSecret, } from '@nucypher/nucypher-core'; -import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import * as tacoAuth from '@nucypher/taco-auth'; +import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { aliceSecretKeyBytes, fakeDkgFlow, @@ -14,7 +14,8 @@ import { fakeTDecFlow, mockGetRitualIdFromPublicKey, mockTacoDecrypt, - TEST_CHAIN_ID, TEST_SIWE_PARAMS, + TEST_CHAIN_ID, + TEST_SIWE_PARAMS, } from '@nucypher/test-utils'; import { beforeAll, describe, expect, it } from 'vitest'; @@ -37,7 +38,6 @@ const ownsNFT = new conditions.predefined.erc721.ERC721Ownership({ chain: TEST_CHAIN_ID, }); - describe('taco', () => { beforeAll(async () => { await initialize(); @@ -83,7 +83,11 @@ describe('taco', () => { ); const getRitualSpy = mockGetActiveRitual(mockedDkgRitual); - const authProvider = new tacoAuth.EIP4361AuthProvider(provider, signer, TEST_SIWE_PARAMS); + const authProvider = new tacoAuth.EIP4361AuthProvider( + provider, + signer, + TEST_SIWE_PARAMS, + ); const decryptedMessage = await taco.decrypt( provider, domains.DEVNET, @@ -107,11 +111,12 @@ describe('taco', () => { const getFinalizedRitualSpy = mockGetActiveRitual(mockedDkgRitual); const customParamKey = ':nftId'; - const ownsNFTWithCustomParams = new conditions.predefined.erc721.ERC721Ownership({ - contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77', - parameters: [customParamKey], - chain: TEST_CHAIN_ID, - }); + const ownsNFTWithCustomParams = + new conditions.predefined.erc721.ERC721Ownership({ + contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77', + parameters: [customParamKey], + chain: TEST_CHAIN_ID, + }); const messageKit = await taco.encrypt( provider, @@ -123,7 +128,12 @@ describe('taco', () => { ); expect(getFinalizedRitualSpy).toHaveBeenCalled(); - const requestedParameters = taco.conditions.context.ConditionContext.requestedContextParameters(messageKit); - expect(requestedParameters).toEqual(new Set([customParamKey, USER_ADDRESS_PARAM_DEFAULT])); + const requestedParameters = + taco.conditions.context.ConditionContext.requestedContextParameters( + messageKit, + ); + expect(requestedParameters).toEqual( + new Set([customParamKey, USER_ADDRESS_PARAM_DEFAULT]), + ); }); }); diff --git a/packages/taco/test/test-utils.ts b/packages/taco/test/test-utils.ts index 92f477ae6..02de484f3 100644 --- a/packages/taco/test/test-utils.ts +++ b/packages/taco/test/test-utils.ts @@ -54,7 +54,6 @@ import { ReturnValueTestProps } from '../src/conditions/shared'; import { DkgClient, DkgRitual } from '../src/dkg'; import { encryptMessage } from '../src/tdec'; - export const fakeDkgTDecFlowE2E: ( ritualId?: number, variant?: FerveoVariant, diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts index 2ab380469..9a52848eb 100644 --- a/packages/test-utils/src/utils.ts +++ b/packages/test-utils/src/utils.ts @@ -88,7 +88,11 @@ export const fakeSigner = ( export const fakeAuthProviders = () => { return { - [EIP4361_AUTH_METHOD]: new EIP4361AuthProvider(fakeProvider(), fakeSigner(), TEST_SIWE_PARAMS), + [EIP4361_AUTH_METHOD]: new EIP4361AuthProvider( + fakeProvider(), + fakeSigner(), + TEST_SIWE_PARAMS, + ), }; }; @@ -258,14 +262,14 @@ interface FakeDkgRitualFlow { } export const fakeTDecFlow = ({ - validators, - validatorKeypairs, - ritualId, - sharesNum, - threshold, - receivedMessages, - message, - thresholdMessageKit, + validators, + validatorKeypairs, + ritualId, + sharesNum, + threshold, + receivedMessages, + message, + thresholdMessageKit, }: FakeDkgRitualFlow) => { // Having aggregated the transcripts, the validators can now create decryption shares const decryptionShares: DecryptionShareSimple[] = []; From aa9e65ea66c7f63d1dd416351e8c14116662cdf7 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Wed, 17 Jul 2024 16:00:27 -0400 Subject: [PATCH 61/75] Simplify calls to retrieveAndDecrypt and retrieve. We don't need to get the ritual so early; obtaining it later saves us from passing additional parameters. --- packages/taco/src/taco.ts | 4 +--- packages/taco/src/tdec.ts | 15 ++++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index 28f629567..442371156 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -157,7 +157,6 @@ export const decrypt = async ( domain, messageKit.acp.publicKey, ); - const ritual = await DkgClient.getActiveRitual(provider, domain, ritualId); const authProviders: AuthProviders = authProvider ? { [EIP4361_AUTH_METHOD]: authProvider, @@ -169,8 +168,6 @@ export const decrypt = async ( porterUri, messageKit, ritualId, - ritual.sharesNum, - ritual.threshold, authProviders, customParameters, ); @@ -202,6 +199,7 @@ export const isAuthorized = async ( messageKit, ); +// TODO is this still valid and actually needed? should we remove this? export const registerEncrypters = async ( provider: ethers.providers.Provider, signer: ethers.Signer, diff --git a/packages/taco/src/tdec.ts b/packages/taco/src/tdec.ts index cfe516519..34424c198 100644 --- a/packages/taco/src/tdec.ts +++ b/packages/taco/src/tdec.ts @@ -25,6 +25,7 @@ import { arrayify, keccak256 } from 'ethers/lib/utils'; import { ConditionExpression } from './conditions/condition-expr'; import { ConditionContext, CustomContextParam } from './conditions/context'; +import { DkgClient } from './dkg'; const ERR_DECRYPTION_FAILED = (errors: unknown) => `Threshold of responses not met; TACo decryption failed with errors: ${JSON.stringify( @@ -64,8 +65,6 @@ export const retrieveAndDecrypt = async ( porterUri: string, thresholdMessageKit: ThresholdMessageKit, ritualId: number, - sharesNum: number, - threshold: number, authProviders?: AuthProviders, customParameters?: Record, ): Promise => { @@ -75,8 +74,6 @@ export const retrieveAndDecrypt = async ( porterUri, thresholdMessageKit, ritualId, - sharesNum, - threshold, authProviders, customParameters, ); @@ -91,16 +88,16 @@ const retrieve = async ( porterUri: string, thresholdMessageKit: ThresholdMessageKit, ritualId: number, - sharesNum: number, - threshold: number, authProviders?: AuthProviders, customParameters?: Record, ): Promise => { + const ritual = await DkgClient.getActiveRitual(provider, domain, ritualId); + const dkgParticipants = await DkgCoordinatorAgent.getParticipants( provider, domain, ritualId, - sharesNum, + ritual.sharesNum, ); const conditionContext = await ConditionContext.fromConditions( thresholdMessageKit.acp.conditions, @@ -117,9 +114,9 @@ const retrieve = async ( const porter = new PorterClient(porterUri); const { encryptedResponses, errors } = await porter.tacoDecrypt( encryptedRequests, - threshold, + ritual.threshold, ); - if (Object.keys(encryptedResponses).length < threshold) { + if (Object.keys(encryptedResponses).length < ritual.threshold) { throw new Error(ERR_DECRYPTION_FAILED(errors)); } From 6c23e7b9c197dd4ae2a94f1b07821c0d544ddc71 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 18 Jul 2024 16:29:53 -0400 Subject: [PATCH 62/75] Allow creation of Context from a message kit. Allow Context to be created with a condition, and subsequently populated with authProviders and customParameters. Make :userAddressExternalEIP4361 a reserved context variable because the context will use the provided authProviders to populate its (and :userAddress) values in the overall context used for decryption. --- packages/taco/src/conditions/const.ts | 2 +- .../taco/src/conditions/context/context.ts | 145 +++++++++--------- 2 files changed, 76 insertions(+), 71 deletions(-) diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 1eb809a92..da603bdda 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -23,6 +23,6 @@ export const USER_ADDRESS_PARAMS = [ ]; export const RESERVED_CONTEXT_PARAMS = [ + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, USER_ADDRESS_PARAM_DEFAULT, - // USER_ADDRESS_PARAM_EXTERNAL_EIP4361 is not reserved and can be used as a custom context parameter ]; diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 015c34afc..60aab9e8d 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -1,9 +1,11 @@ import { ThresholdMessageKit } from '@nucypher/nucypher-core'; import { toJSON } from '@nucypher/shared'; import { - AUTH_METHOD_FOR_PARAM, - AuthProviders, + AuthProvider, AuthSignature, + EIP4361AuthProvider, + SingleSignOnEIP4361AuthProvider, + USER_ADDRESS_PARAM_DEFAULT, } from '@nucypher/taco-auth'; import { CoreConditions, CoreContext } from '../../types'; @@ -14,10 +16,11 @@ import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, RESERVED_CONTEXT_PARAMS, + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, USER_ADDRESS_PARAMS, } from '../const'; -export type CustomContextParam = string | number | boolean | AuthSignature; +export type CustomContextParam = string | number | boolean; export type ContextParam = CustomContextParam | AuthSignature; const ERR_RESERVED_PARAM = (key: string) => @@ -28,39 +31,26 @@ const ERR_AUTH_PROVIDER_REQUIRED = (key: string) => `No matching authentication provider to satisfy ${key} context variable in condition`; const ERR_MISSING_CONTEXT_PARAMS = (params: string[]) => `Missing custom context parameter(s): ${params.join(', ')}`; -const ERR_UNKNOWN_CONTEXT_PARAMS = (params: string[]) => - `Unknown custom context parameter(s): ${params.join(', ')}`; -const ERR_NO_AUTH_PROVIDER_FOR_PARAM = (param: string) => - `No custom parameter for requested context parameter: ${param}`; +const ERR_UNKNOWN_CUSTOM_CONTEXT_PARAM = (param: string) => + `Unknown custom context parameter: ${param}`; +const ERR_INVALID_AUTH_PROVIDER_TYPE = (param: string, expected: string) => + `Invalid AuthProvider type for ${param}; expected ${expected}`; +const ERR_AUTH_PROVIDER_NOT_NEEDED_FOR_CONTEXT_PARAM = (param: string) => + `AuthProvider not necessary for context parameter: ${param}`; export class ConditionContext { public requestedParameters: Set; + private customParameters: Record = {}; + private authProviders: Record = {}; - constructor( - condition: Condition, - public readonly customParameters: Record = {}, - private readonly authProviders: AuthProviders = {}, - ) { + constructor(condition: Condition) { const condProps = condition.toObj(); - this.validateContextParameters(); - this.validateCoreConditions(condProps); + ConditionContext.validateCoreConditions(condProps); this.requestedParameters = ConditionContext.findContextParameters(condProps); - this.validateAuthProviders(this.requestedParameters); } - private validateContextParameters(): void { - Object.keys(this.customParameters).forEach((key) => { - if (RESERVED_CONTEXT_PARAMS.includes(key)) { - throw new Error(ERR_RESERVED_PARAM(key)); - } - if (!key.startsWith(CONTEXT_PARAM_PREFIX)) { - throw new Error(ERR_INVALID_CUSTOM_PARAM(key)); - } - }); - } - - private validateCoreConditions(condObject: ConditionProps) { + private static validateCoreConditions(condObject: ConditionProps) { // Checking whether the condition is compatible with the current version of the library // Intentionally ignoring the return value of the function new CoreConditions(toJSON(condObject)); @@ -77,16 +67,6 @@ export class ConditionContext { if (missingParameters.length > 0) { throw new Error(ERR_MISSING_CONTEXT_PARAMS(missingParameters)); } - - // We may also have some parameters that are not used - const unknownParameters = Object.keys(parameters).filter( - (key) => - !this.requestedParameters.has(key) && - !RESERVED_CONTEXT_PARAMS.includes(key), - ); - if (unknownParameters.length > 0) { - throw new Error(ERR_UNKNOWN_CONTEXT_PARAMS(unknownParameters)); - } } private async fillContextParameters( @@ -100,22 +80,15 @@ export class ConditionContext { return parameters; } - private validateAuthProviders(requestedParameters: Set): void { - for (const param of requestedParameters) { + private validateAuthProviders(): void { + for (const param of this.requestedParameters) { // If it's not a user address parameter, we can skip if (!USER_ADDRESS_PARAMS.includes(param)) { continue; } - // If it's a user address parameter, we need to check if we have an auth provider - const authMethod = AUTH_METHOD_FOR_PARAM[param]; - if (!authMethod && !this.customParameters[param]) { - // If we don't have an auth method, and we don't have a custom parameter, we have a problem - throw new Error(ERR_NO_AUTH_PROVIDER_FOR_PARAM(param)); - } - - // If we have an auth method, but we don't have an auth provider, we have a problem - if (authMethod && !this.authProviders[authMethod]) { + // we don't have a corresponding auth provider, we have a problem + if (!this.authProviders[param]) { throw new Error(ERR_AUTH_PROVIDER_REQUIRED(param)); } } @@ -126,10 +99,9 @@ export class ConditionContext { ): Promise> { const entries = await Promise.all( [...requestedParameters] - .map((param) => [param, AUTH_METHOD_FOR_PARAM[param]]) - .filter(([, authMethod]) => !!authMethod) - .map(async ([param, authMethod]) => { - const maybeAuthProvider = this.authProviders[authMethod]; + .filter((param) => USER_ADDRESS_PARAMS.includes(param)) + .map(async (param) => { + const maybeAuthProvider = this.authProviders[param]; // TODO: Throw here instead of validating in the constructor? // TODO: Hide getOrCreateAuthSignature behind a more generic interface return [param, await maybeAuthProvider!.getOrCreateAuthSignature()]; @@ -138,11 +110,25 @@ export class ConditionContext { return Object.fromEntries(entries); } + private validateCustomContextParameter(customParam: string): void { + if (!ConditionContext.isContextParameter(customParam)) { + throw new Error(ERR_INVALID_CUSTOM_PARAM(customParam)); + } + + if (RESERVED_CONTEXT_PARAMS.includes(customParam)) { + throw new Error(ERR_RESERVED_PARAM(customParam)); + } + + if (!this.requestedParameters.has(customParam)) { + throw new Error(ERR_UNKNOWN_CUSTOM_CONTEXT_PARAM(customParam)); + } + } + private static isContextParameter(param: unknown): boolean { return !!String(param).match(CONTEXT_PARAM_REGEXP); } - public static findContextParameters(condition: ConditionProps) { + private static findContextParameters(condition: ConditionProps) { // First, we want to find all the parameters we need to add const requestedParameters = new Set(); @@ -183,6 +169,38 @@ export class ConditionContext { return requestedParameters; } + public addCustomContextParameterValues( + customParameters: Record, + ) { + Object.keys(customParameters).forEach((key) => { + this.validateCustomContextParameter(key); + this.customParameters[key] = customParameters[key]; + }); + } + + public addAuthProvider(contextParam: string, authProvider: AuthProvider) { + if (!USER_ADDRESS_PARAMS.includes(contextParam)) { + throw new Error( + ERR_AUTH_PROVIDER_NOT_NEEDED_FOR_CONTEXT_PARAM(contextParam), + ); + } + + if (contextParam === USER_ADDRESS_PARAM_DEFAULT) { + if (authProvider instanceof EIP4361AuthProvider) { + this.authProviders[contextParam] = authProvider; + return; + } + } else if (contextParam === USER_ADDRESS_PARAM_EXTERNAL_EIP4361) { + if (authProvider instanceof SingleSignOnEIP4361AuthProvider) { + this.authProviders[contextParam] = authProvider; + return; + } + } + throw new Error( + ERR_INVALID_AUTH_PROVIDER_TYPE(contextParam, typeof authProvider), + ); + } + public async toJson(): Promise { const parameters = await this.toContextParameters(); return toJSON(parameters); @@ -196,6 +214,7 @@ export class ConditionContext { public toContextParameters = async (): Promise< Record > => { + this.validateAuthProviders(); const parameters = await this.fillContextParameters( this.requestedParameters, ); @@ -203,26 +222,12 @@ export class ConditionContext { return parameters; }; - public static fromConditions( - conditions: CoreConditions, - authProviders?: AuthProviders, - customParameters?: Record, - ): ConditionContext { - return new ConditionContext( - ConditionExpression.fromCoreConditions(conditions).condition, - customParameters, - authProviders, - ); - } - - public static requestedContextParameters( + public static fromMessageKit( messageKit: ThresholdMessageKit, - ): Set { + ): ConditionContext { const conditionExpr = ConditionExpression.fromCoreConditions( messageKit.acp.conditions, ); - return ConditionContext.findContextParameters( - conditionExpr.condition.toObj(), - ); + return new ConditionContext(conditionExpr.condition); } } From e275628d577058acf0198e99efb9e09fa11c0db0 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 18 Jul 2024 16:31:30 -0400 Subject: [PATCH 63/75] Don't have ConditionExpr build a context, the context can be created on its own. --- packages/taco/src/conditions/condition-expr.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/taco/src/conditions/condition-expr.ts b/packages/taco/src/conditions/condition-expr.ts index e62ed2b49..752ad5fcc 100644 --- a/packages/taco/src/conditions/condition-expr.ts +++ b/packages/taco/src/conditions/condition-expr.ts @@ -1,11 +1,9 @@ import { Conditions as CoreConditions } from '@nucypher/nucypher-core'; import { toJSON } from '@nucypher/shared'; -import { AuthProviders } from '@nucypher/taco-auth'; import { SemVer } from 'semver'; import { Condition } from './condition'; import { ConditionFactory } from './condition-factory'; -import { ConditionContext, CustomContextParam } from './context'; const ERR_VERSION = (provided: string, current: string) => `Version provided, ${provided}, is incompatible with current version, ${current}`; @@ -64,17 +62,6 @@ export class ConditionExpression { return ConditionExpression.fromJSON(conditions.toString()); } - public buildContext( - customParameters: Record = {}, - authProviders: AuthProviders = {}, - ): ConditionContext { - return new ConditionContext( - this.condition, - customParameters, - authProviders, - ); - } - public equals(other: ConditionExpression): boolean { return [ this.version === other.version, From e0301b81af244edb8a4b401bf161767b45a0b406 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 18 Jul 2024 16:32:28 -0400 Subject: [PATCH 64/75] Allow ConditionContext to be an optional parameter for decryption; it replaces authProvider and customParmeters since those are now encompassed in the context itself. --- packages/taco/src/taco.ts | 24 +++++------------------- packages/taco/src/tdec.ts | 21 ++++++++------------- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index 442371156..c5d5d2dd1 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -13,17 +13,12 @@ import { GlobalAllowListAgent, toBytes, } from '@nucypher/shared'; -import { - AuthProviders, - EIP4361_AUTH_METHOD, - EIP4361AuthProvider, -} from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { keccak256 } from 'ethers/lib/utils'; import { Condition } from './conditions/condition'; import { ConditionExpression } from './conditions/condition-expr'; -import { CustomContextParam } from './conditions/context'; +import { ConditionContext } from './conditions/context'; import { DkgClient } from './dkg'; import { retrieveAndDecrypt } from './tdec'; @@ -129,11 +124,9 @@ export const encryptWithPublicKey = async ( * @param {Domain} domain - Represents the logical network in which the decryption will be performed. * Must match the `ritualId`. * @param {ThresholdMessageKit} messageKit - The kit containing the message to be decrypted - * @param authProvider - The authentication provider that will be used to provide the authorization - * @param {string} [porterUri] - The URI for the Porter service. If not provided, a value will be obtained + * @param {ConditionContext} context - Optional context data used for decryption time values for the condition(s) within the `messageKit`. + * @param {string} [porterUri] - Optional URI for the Porter service. If not provided, a value will be obtained * from the Domain - * @param {Record} [customParameters] - Optional custom parameters that may be required - * depending on the condition used * * @returns {Promise} Returns Promise that resolves with a decrypted message * @@ -144,9 +137,8 @@ export const decrypt = async ( provider: ethers.providers.Provider, domain: Domain, messageKit: ThresholdMessageKit, - authProvider?: EIP4361AuthProvider, + context?: ConditionContext, porterUri?: string, - customParameters?: Record, ): Promise => { if (!porterUri) { porterUri = getPorterUri(domain); @@ -157,19 +149,13 @@ export const decrypt = async ( domain, messageKit.acp.publicKey, ); - const authProviders: AuthProviders = authProvider - ? { - [EIP4361_AUTH_METHOD]: authProvider, - } - : {}; return retrieveAndDecrypt( provider, domain, porterUri, messageKit, ritualId, - authProviders, - customParameters, + context, ); }; diff --git a/packages/taco/src/tdec.ts b/packages/taco/src/tdec.ts index 34424c198..e6b86b5df 100644 --- a/packages/taco/src/tdec.ts +++ b/packages/taco/src/tdec.ts @@ -19,12 +19,11 @@ import { PorterClient, toBytes, } from '@nucypher/shared'; -import { AuthProviders } from '@nucypher/taco-auth'; import { ethers } from 'ethers'; import { arrayify, keccak256 } from 'ethers/lib/utils'; import { ConditionExpression } from './conditions/condition-expr'; -import { ConditionContext, CustomContextParam } from './conditions/context'; +import { ConditionContext } from './conditions/context'; import { DkgClient } from './dkg'; const ERR_DECRYPTION_FAILED = (errors: unknown) => @@ -65,8 +64,7 @@ export const retrieveAndDecrypt = async ( porterUri: string, thresholdMessageKit: ThresholdMessageKit, ritualId: number, - authProviders?: AuthProviders, - customParameters?: Record, + context?: ConditionContext, ): Promise => { const decryptionShares = await retrieve( provider, @@ -74,8 +72,7 @@ export const retrieveAndDecrypt = async ( porterUri, thresholdMessageKit, ritualId, - authProviders, - customParameters, + context, ); const sharedSecret = combineDecryptionSharesSimple(decryptionShares); return thresholdMessageKit.decryptWithSharedSecret(sharedSecret); @@ -88,8 +85,7 @@ const retrieve = async ( porterUri: string, thresholdMessageKit: ThresholdMessageKit, ritualId: number, - authProviders?: AuthProviders, - customParameters?: Record, + context?: ConditionContext, ): Promise => { const ritual = await DkgClient.getActiveRitual(provider, domain, ritualId); @@ -99,11 +95,10 @@ const retrieve = async ( ritualId, ritual.sharesNum, ); - const conditionContext = await ConditionContext.fromConditions( - thresholdMessageKit.acp.conditions, - authProviders, - customParameters, - ); + const conditionContext = context + ? context + : ConditionContext.fromMessageKit(thresholdMessageKit); + const { sharedSecrets, encryptedRequests } = await makeDecryptionRequests( ritualId, conditionContext, From 3f7967c5118a2d0ad9152a51849b3cb3359dc451 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 18 Jul 2024 16:33:16 -0400 Subject: [PATCH 65/75] Allow address property to be public for SingleSignOnExternalEIP4361AuthProvider. --- packages/taco-auth/src/providers/external-eip4361.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taco-auth/src/providers/external-eip4361.ts b/packages/taco-auth/src/providers/external-eip4361.ts index b2c550b86..9ebd60892 100644 --- a/packages/taco-auth/src/providers/external-eip4361.ts +++ b/packages/taco-auth/src/providers/external-eip4361.ts @@ -22,7 +22,7 @@ export class SingleSignOnEIP4361AuthProvider { private constructor( private readonly existingSiweMessage: string, - private readonly address: string, + public readonly address: string, private readonly signature: string, ) {} From d9f34815ed658713f3e4ce282bc7f5cca562e71a Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 18 Jul 2024 16:33:49 -0400 Subject: [PATCH 66/75] Update tests to accomodate new architecture for ConditionContext. --- .../test/conditions/base/contract.test.ts | 25 +- .../taco/test/conditions/conditions.test.ts | 13 +- packages/taco/test/conditions/context.test.ts | 219 ++++++++++-------- packages/taco/test/taco.test.ts | 11 +- packages/test-utils/src/utils.ts | 36 ++- 5 files changed, 183 insertions(+), 121 deletions(-) diff --git a/packages/taco/test/conditions/base/contract.test.ts b/packages/taco/test/conditions/base/contract.test.ts index 849ae2b5f..67e3ec26f 100644 --- a/packages/taco/test/conditions/base/contract.test.ts +++ b/packages/taco/test/conditions/base/contract.test.ts @@ -1,5 +1,5 @@ import { initialize } from '@nucypher/nucypher-core'; -import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; +import { AuthProvider, USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { fakeAuthProviders } from '@nucypher/test-utils'; import { beforeAll, describe, expect, it } from 'vitest'; @@ -10,9 +10,11 @@ import { ContractConditionType, FunctionAbiProps, } from '../../../src/conditions/base/contract'; -import { ConditionExpression } from '../../../src/conditions/condition-expr'; import { USER_ADDRESS_PARAMS } from '../../../src/conditions/const'; -import { CustomContextParam } from '../../../src/conditions/context'; +import { + ConditionContext, + CustomContextParam, +} from '../../../src/conditions/context'; import { testContractConditionObj, testFunctionAbi } from '../../test-utils'; describe('validation', () => { @@ -170,7 +172,7 @@ describe('supports various user address params', () => { ); }); -describe('supports custom function abi', () => { +describe('supports custom function abi', async () => { const contractConditionObj: ContractConditionProps = { ...testContractConditionObj, standardContractType: undefined, @@ -183,19 +185,26 @@ describe('supports custom function abi', () => { }, }; const contractCondition = new ContractCondition(contractConditionObj); - const conditionExpr = new ConditionExpression(contractCondition); const myCustomParam = ':customParam'; const customParams: Record = {}; customParams[myCustomParam] = 1234; + let authProviders: Record; beforeAll(async () => { await initialize(); + authProviders = await fakeAuthProviders(); }); it('accepts custom function abi with a custom parameter', async () => { - const asJson = await conditionExpr - .buildContext(customParams, fakeAuthProviders()) - .toJson(); + const conditionContext = new ConditionContext(contractCondition); + conditionContext.addCustomContextParameterValues(customParams); + + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ); + + const asJson = await conditionContext.toJson(); expect(asJson).toBeDefined(); expect(asJson).toContain(USER_ADDRESS_PARAM_DEFAULT); expect(asJson).toContain(myCustomParam); diff --git a/packages/taco/test/conditions/conditions.test.ts b/packages/taco/test/conditions/conditions.test.ts index ad5d735b2..3be3f664a 100644 --- a/packages/taco/test/conditions/conditions.test.ts +++ b/packages/taco/test/conditions/conditions.test.ts @@ -1,4 +1,5 @@ import { ChainId } from '@nucypher/shared'; +import { AuthProvider, USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; import { fakeAuthProviders } from '@nucypher/test-utils'; import { beforeAll, describe, expect, it } from 'vitest'; @@ -8,8 +9,10 @@ import { SUPPORTED_CHAIN_IDS } from '../../src/conditions/const'; import { ConditionContext } from '../../src/conditions/context'; describe('conditions', () => { + let authProviders: Record; beforeAll(async () => { await initialize(); + authProviders = await fakeAuthProviders(); }); it('creates a complex condition with custom parameters', async () => { @@ -37,11 +40,13 @@ describe('conditions', () => { expect(condition).toBeDefined(); expect(condition.requiresAuthentication()).toBeTruthy(); - const context = new ConditionContext( - condition, - { ':time': 100 }, - fakeAuthProviders(), + const context = new ConditionContext(condition); + context.addCustomContextParameterValues({ ':time': 100 }); + context.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], ); + expect(context).toBeDefined(); const asObj = await context.toContextParameters(); diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index fb8bce5b9..f007ae926 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -1,9 +1,9 @@ import { initialize } from '@nucypher/nucypher-core'; import { - AuthProviders, + AuthProvider, AuthSignature, - EIP4361_AUTH_METHOD, EIP4361AuthProvider, + SingleSignOnEIP4361AuthProvider, USER_ADDRESS_PARAM_DEFAULT, } from '@nucypher/taco-auth'; import { @@ -20,12 +20,14 @@ import { ContractConditionProps, } from '../../src/conditions/base/contract'; import { RpcCondition } from '../../src/conditions/base/rpc'; -import { ConditionExpression } from '../../src/conditions/condition-expr'; import { RESERVED_CONTEXT_PARAMS, USER_ADDRESS_PARAM_EXTERNAL_EIP4361, } from '../../src/conditions/const'; -import { CustomContextParam } from '../../src/conditions/context'; +import { + ConditionContext, + CustomContextParam, +} from '../../src/conditions/context'; import { paramOrContextParamSchema, ReturnValueTestProps, @@ -38,11 +40,10 @@ import { } from '../test-utils'; describe('context', () => { - let authProviders: AuthProviders; - + let authProviders: Record; beforeAll(async () => { await initialize(); - authProviders = fakeAuthProviders(); + authProviders = await fakeAuthProviders(); }); describe('serialization', () => { @@ -55,9 +56,11 @@ describe('context', () => { value: USER_ADDRESS_PARAM_DEFAULT, }, }); - const conditionContext = new ConditionExpression( - rpcCondition, - ).buildContext({}, authProviders); + const conditionContext = new ConditionContext(rpcCondition); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ); const asJson = await conditionContext.toJson(); expect(asJson).toBeDefined(); @@ -78,69 +81,74 @@ describe('context', () => { }, }; const contractCondition = new ContractCondition(contractConditionObj); - const conditionExpr = new ConditionExpression(contractCondition); - describe('custom parameters', () => { + it('detects when a custom parameter is requested', () => { + const conditionContext = new ConditionContext(contractCondition); + expect(conditionContext.requestedParameters).toContain(customParamKey); + }); + it('serializes bytes as hex strings', async () => { const customParamsWithBytes: Record = {}; const customParam = toBytes('hello'); // Uint8Array is not a valid CustomContextParam, override the type: customParamsWithBytes[customParamKey] = customParam as unknown as string; - const contextAsJson = await conditionExpr - .buildContext(customParamsWithBytes) - .toJson(); + + const conditionContext = new ConditionContext(contractCondition); + conditionContext.addCustomContextParameterValues(customParamsWithBytes); + const contextAsJson = await conditionContext.toJson(); const asObj = JSON.parse(contextAsJson); expect(asObj).toBeDefined(); expect(asObj[customParamKey]).toEqual(`0x${toHexString(customParam)}`); }); - - it('detects when a custom parameter is requested', () => { - const context = conditionExpr.buildContext({}, authProviders); - expect(context.requestedParameters).toContain(customParamKey); - }); }); describe('return value test', () => { - it('accepts on a custom context parameters', async () => { - const asObj = await conditionExpr - .buildContext(customParams) - .toContextParameters(); + it('accepts only custom context parameters', async () => { + const conditionContext = new ConditionContext(contractCondition); + conditionContext.addCustomContextParameterValues(customParams); + const asObj = await conditionContext.toContextParameters(); expect(asObj).toBeDefined(); expect(asObj[customParamKey]).toEqual(1234); }); it('rejects on a missing custom context parameter', async () => { - const context = conditionExpr.buildContext({}, authProviders); - await expect(context.toContextParameters()).rejects.toThrow( + const conditionContext = new ConditionContext(contractCondition); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ); + await expect(conditionContext.toContextParameters()).rejects.toThrow( `Missing custom context parameter(s): ${customParamKey}`, ); }); }); it('rejects on using reserved context parameter', () => { + const conditionContext = new ConditionContext(contractCondition); RESERVED_CONTEXT_PARAMS.forEach((reservedParam) => { const badCustomParams: Record = {}; badCustomParams[reservedParam] = 'this-will-throw'; - expect(() => conditionExpr.buildContext(badCustomParams)).toThrow( + expect(() => + conditionContext.addCustomContextParameterValues(badCustomParams), + ).toThrow( `Cannot use reserved parameter name ${reservedParam} as custom parameter`, ); }); }); - it('rejects on using a custom parameter that was not requested', async () => { + it('rejects on using a custom parameter that was not requested', () => { const badCustomParamKey = ':notRequested'; const badCustomParams: Record = {}; badCustomParams[customParamKey] = 'this-is-fine'; badCustomParams[badCustomParamKey] = 'this-will-throw'; - await expect( - conditionExpr.buildContext(badCustomParams).toContextParameters(), - ).rejects.toThrow( - `Unknown custom context parameter(s): ${badCustomParamKey}`, - ); + const conditionContext = new ConditionContext(contractCondition); + expect(() => + conditionContext.addCustomContextParameterValues(badCustomParams), + ).toThrow(`Unknown custom context parameter: ${badCustomParamKey}`); }); - it('detects when auth provider is required by parameters', () => { + it('detects when auth provider is required by parameters', async () => { const conditionObj = { ...testContractConditionObj, parameters: [USER_ADDRESS_PARAM_DEFAULT], @@ -150,14 +158,13 @@ describe('context', () => { } as ReturnValueTestProps, }; const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); - expect(() => conditionExpr.buildContext({})).toThrow( + const conditionContext = new ConditionContext(condition); + await expect(conditionContext.toContextParameters()).rejects.toThrow( `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); - it('detects when signer is required by return value test', () => { + it('detects when signer is required by return value test', async () => { const conditionObj = { ...testContractConditionObj, standardContractType: 'ERC721', @@ -169,24 +176,22 @@ describe('context', () => { }, } as ContractConditionProps; const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); - expect(() => conditionExpr.buildContext({})).toThrow( + const conditionContext = new ConditionContext(condition); + await expect(conditionContext.toContextParameters()).rejects.toThrow( `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); - it('detects when signer is not required', () => { + it('detects when signer is not required', async () => { const condition = new RpcCondition(testRpcConditionObj); - const conditionExpr = new ConditionExpression(condition); + const conditionContext = new ConditionContext(condition); expect( JSON.stringify(condition.toObj()).includes(USER_ADDRESS_PARAM_DEFAULT), ).toBe(false); - expect(conditionExpr.buildContext({}, authProviders)).toBeDefined(); - expect(conditionExpr.buildContext({})).toBeDefined(); + await expect(conditionContext.toContextParameters()).toBeDefined(); }); - it('rejects on a missing signer', () => { + it('rejects on a missing signer', async () => { const conditionObj = { ...testContractConditionObj, returnValueTest: { @@ -195,24 +200,24 @@ describe('context', () => { }, }; const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(() => conditionExpr.buildContext({}, undefined)).toThrow( + const conditionContext = new ConditionContext(condition); + await expect(conditionContext.toContextParameters()).rejects.toThrow( `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, ); }); - it('rejects on a missing signer', () => { + it('rejects on a missing signer for single sign-on EIP4361', async () => { const conditionObj = { ...testContractConditionObj, returnValueTest: { ...testReturnValueTest, - value: USER_ADDRESS_PARAM_DEFAULT, + value: USER_ADDRESS_PARAM_EXTERNAL_EIP4361, }, }; const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(() => conditionExpr.buildContext({}, undefined)).toThrow( - `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_DEFAULT} context variable in condition`, + const conditionContext = new ConditionContext(condition); + await expect(conditionContext.toContextParameters()).rejects.toThrow( + `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_EXTERNAL_EIP4361} context variable in condition`, ); }); @@ -229,21 +234,22 @@ describe('context', () => { }; it('handles both custom and auth context parameters', () => { - const requestedParams = new ConditionExpression( - contractCondition, - ).buildContext({}, authProviders).requestedParameters; + const requestedParams = new ConditionContext(contractCondition) + .requestedParameters; expect(requestedParams).not.toContain(USER_ADDRESS_PARAM_DEFAULT); expect(requestedParams).toContain(customParamKey); }); - it('rejects on a missing parameter ', async () => { + it('rejects on a missing custom parameter ', async () => { const customContractCondition = new ContractCondition({ ...contractConditionObj, parameters: [USER_ADDRESS_PARAM_DEFAULT, customParamKey], }); - const conditionContext = new ConditionExpression( - customContractCondition, - ).buildContext({}, authProviders); + const conditionContext = new ConditionContext(customContractCondition); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ); await expect(async () => conditionContext.toContextParameters(), @@ -257,9 +263,11 @@ describe('context', () => { ...contractConditionObj, parameters: [USER_ADDRESS_PARAM_DEFAULT, 100], }); - const conditionContext = new ConditionExpression( - customContractCondition, - ).buildContext({}, authProviders); + const conditionContext = new ConditionContext(customContractCondition); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ); const asObj = await conditionContext.toContextParameters(); expect(asObj).toBeDefined(); @@ -275,9 +283,15 @@ describe('context', () => { }); const customParameters: Record = {}; customParameters[customParamKey] = falsyParam; - const conditionContext = new ConditionExpression( + + const conditionContext = new ConditionContext( customContractCondition, - ).buildContext(customParameters, authProviders); + ); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ); + conditionContext.addCustomContextParameterValues(customParameters); const asObj = await conditionContext.toContextParameters(); expect(asObj).toBeDefined(); @@ -294,18 +308,23 @@ describe('context', () => { describe('No authentication provider', () => { let provider: ethers.providers.Provider; let signer: ethers.Signer; - let authProviders: AuthProviders; + let authProviders: Record; - async function testEIP4361AuthSignature(authSignature: AuthSignature) { + async function testEIP4361AuthSignature( + authSignature: AuthSignature, + expectedAddress?: string, + ) { expect(authSignature).toBeDefined(); expect(authSignature.signature).toBeDefined(); expect(authSignature.scheme).toEqual('EIP4361'); - const signerAddress = await signer.getAddress(); - expect(authSignature.address).toEqual(signerAddress); + const addressToUse = expectedAddress + ? expectedAddress + : await signer.getAddress(); + expect(authSignature.address).toEqual(addressToUse); expect(authSignature.typedData).toContain( - `localhost wants you to sign in with your Ethereum account:\n${signerAddress}`, + `localhost wants you to sign in with your Ethereum account:\n${addressToUse}`, ); expect(authSignature.typedData).toContain('URI: http://localhost:3000'); @@ -317,11 +336,11 @@ describe('No authentication provider', () => { await initialize(); provider = fakeProvider(); signer = fakeSigner(); - authProviders = fakeAuthProviders(); + authProviders = await fakeAuthProviders(); }); it('throws an error if there is no auth provider', () => { - RESERVED_CONTEXT_PARAMS.forEach((userAddressParam) => { + RESERVED_CONTEXT_PARAMS.forEach(async (userAddressParam) => { const conditionObj = { ...testContractConditionObj, returnValueTest: { @@ -330,14 +349,14 @@ describe('No authentication provider', () => { }, }; const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(() => conditionExpr.buildContext({}, {})).toThrow( + const conditionContext = new ConditionContext(condition); + await expect(conditionContext.toContextParameters()).rejects.toThrow( `No matching authentication provider to satisfy ${userAddressParam} context variable in condition`, ); }); }); - it('it supports just one provider at a time', () => { + it('it supports just one provider at a time', async () => { const conditionObj = { ...testContractConditionObj, returnValueTest: { @@ -346,8 +365,12 @@ describe('No authentication provider', () => { }, }; const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - expect(() => conditionExpr.buildContext({}, authProviders)).not.toThrow(); + const conditionContext = new ConditionContext(condition); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ); + expect(async () => conditionContext.toContextParameters()).not.toThrow(); }); async function makeAuthSignature(authMethod: string) { @@ -359,10 +382,13 @@ describe('No authentication provider', () => { }, }; const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); - const builtContext = conditionExpr.buildContext({}, authProviders); - const contextVars = await builtContext.toContextParameters(); + const conditionContext = new ConditionContext(condition); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ); + const contextVars = await conditionContext.toContextParameters(); const authSignature = contextVars[authMethod] as AuthSignature; expect(authSignature).toBeDefined(); @@ -384,12 +410,6 @@ describe('No authentication provider', () => { }); it('supports reusing external eip4361', async () => { - // Because we are reusing an existing SIWE auth message, we have to pass it as a custom parameter - const authMessage = await makeAuthSignature(USER_ADDRESS_PARAM_DEFAULT); - const customParams: Record = { - [USER_ADDRESS_PARAM_EXTERNAL_EIP4361]: authMessage as CustomContextParam, - }; - // Spying on the EIP4361 provider to make sure it's not called const eip4361Spy = vi.spyOn( EIP4361AuthProvider.prototype, @@ -405,21 +425,19 @@ describe('No authentication provider', () => { }, }; const condition = new ContractCondition(conditionObj); - const conditionExpr = new ConditionExpression(condition); + const conditionContext = new ConditionContext(condition); - // Make sure we remove the EIP4361 auth method from the auth providers first - delete authProviders[EIP4361_AUTH_METHOD]; // Should throw an error if we don't pass the custom parameter - expect(() => conditionExpr.buildContext({}, authProviders)).toThrow( - `No custom parameter for requested context parameter: ${USER_ADDRESS_PARAM_EXTERNAL_EIP4361}`, + await expect(conditionContext.toContextParameters()).rejects.toThrow( + `No matching authentication provider to satisfy ${USER_ADDRESS_PARAM_EXTERNAL_EIP4361} context variable in condition`, ); - // Remembering to pass in customParams here: - const builtContext = conditionExpr.buildContext( - customParams, - authProviders, + // Remembering to pass in auth provider + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, + authProviders[USER_ADDRESS_PARAM_EXTERNAL_EIP4361], ); - const contextVars = await builtContext.toContextParameters(); + const contextVars = await conditionContext.toContextParameters(); expect(eip4361Spy).not.toHaveBeenCalled(); // Now, we expect that the auth signature will be available in the context variables @@ -427,7 +445,14 @@ describe('No authentication provider', () => { USER_ADDRESS_PARAM_EXTERNAL_EIP4361 ] as AuthSignature; expect(authSignature).toBeDefined(); - await testEIP4361AuthSignature(authSignature); + await testEIP4361AuthSignature( + authSignature, + ( + authProviders[ + USER_ADDRESS_PARAM_EXTERNAL_EIP4361 + ] as SingleSignOnEIP4361AuthProvider + ).address, + ); }); }); diff --git a/packages/taco/test/taco.test.ts b/packages/taco/test/taco.test.ts index f965fa80c..800d1dde3 100644 --- a/packages/taco/test/taco.test.ts +++ b/packages/taco/test/taco.test.ts @@ -21,6 +21,7 @@ import { beforeAll, describe, expect, it } from 'vitest'; import * as taco from '../src'; import { conditions, domains, toBytes } from '../src'; +import { ConditionContext } from '../src/conditions/context'; import { fakeDkgRitual, @@ -88,11 +89,13 @@ describe('taco', () => { signer, TEST_SIWE_PARAMS, ); + const conditionContext = ConditionContext.fromMessageKit(messageKit); + conditionContext.addAuthProvider(USER_ADDRESS_PARAM_DEFAULT, authProvider); const decryptedMessage = await taco.decrypt( provider, domains.DEVNET, messageKit, - authProvider, + conditionContext, fakePorterUri, ); expect(decryptedMessage).toEqual(toBytes(message)); @@ -128,10 +131,8 @@ describe('taco', () => { ); expect(getFinalizedRitualSpy).toHaveBeenCalled(); - const requestedParameters = - taco.conditions.context.ConditionContext.requestedContextParameters( - messageKit, - ); + const conditionContext = ConditionContext.fromMessageKit(messageKit); + const requestedParameters = conditionContext.requestedParameters; expect(requestedParameters).toEqual( new Set([customParamKey, USER_ADDRESS_PARAM_DEFAULT]), ); diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts index 9a52848eb..8f255c401 100644 --- a/packages/test-utils/src/utils.ts +++ b/packages/test-utils/src/utils.ts @@ -39,7 +39,11 @@ import { Ursula, zip, } from '@nucypher/shared'; -import { EIP4361_AUTH_METHOD, EIP4361AuthProvider } from '@nucypher/taco-auth'; +import { + EIP4361AuthProvider, + SingleSignOnEIP4361AuthProvider, + USER_ADDRESS_PARAM_DEFAULT, +} from '@nucypher/taco-auth'; import axios from 'axios'; import { ethers, providers, Wallet } from 'ethers'; import { expect, SpyInstance, vi } from 'vitest'; @@ -86,13 +90,11 @@ export const fakeSigner = ( } as unknown as ethers.providers.JsonRpcSigner; }; -export const fakeAuthProviders = () => { +export const fakeAuthProviders = async () => { return { - [EIP4361_AUTH_METHOD]: new EIP4361AuthProvider( - fakeProvider(), - fakeSigner(), - TEST_SIWE_PARAMS, - ), + [USER_ADDRESS_PARAM_DEFAULT]: fakeEIP4351AuthProvider(), + [':userAddressExternalEIP4361']: + await fakeSingleSignOnEIP4361AuthProvider(), }; }; @@ -114,6 +116,26 @@ export const fakeProvider = ( } as unknown as ethers.providers.Web3Provider; }; +const fakeEIP4351AuthProvider = () => { + return new EIP4361AuthProvider( + fakeProvider(), + fakeSigner(), + TEST_SIWE_PARAMS, + ); +}; + +const fakeSingleSignOnEIP4361AuthProvider = async () => { + const message = + 'localhost wants you to sign in with your Ethereum account:\n0x924c255297BF9032583dF6E06a8633dc720aB52D\n\nSign-In With Ethereum Example Statement\n\nURI: http://localhost:3000\nVersion: 1\nChain ID: 1234\nNonce: bTyXgcQxn2htgkjJn\nIssued At: 2024-07-18T16:53:39.093516Z'; + const signature = + '0x22cc163b9c37cf425997b76ebafd44a0d68043d0dc9a1dbf823e78c320924476644f28abcf0974d54b8604eff8a62a51559994537d4b8a85cdee977e02ee98921b'; + + return SingleSignOnEIP4361AuthProvider.fromExistingSiweInfo( + message, + signature, + ); +}; + const genChecksumAddress = (i: number): ChecksumAddress => `0x${'0'.repeat(40 - i.toString(16).length)}${i.toString( 16, From 1c92bfd0282535ba47640b97e83188a4e7ea4a53 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 18 Jul 2024 19:17:45 -0400 Subject: [PATCH 67/75] Reconfigure taco-auth providers folder to have an eip4361 folder and common elements for both ei4361 provider and single sign-on provider. Move user address context variable for external eip4361 to taco-auth as well. Update relevant imports. --- packages/taco-auth/src/auth-provider.ts | 15 --------------- packages/taco-auth/src/auth-sig.ts | 6 ++++-- .../taco-auth/src/providers/eip4361/common.ts | 17 +++++++++++++++++ .../src/providers/{ => eip4361}/eip4361.ts | 19 ++++--------------- .../{ => eip4361}/external-eip4361.ts | 8 ++++++-- packages/taco-auth/src/providers/index.ts | 4 ++-- packages/taco-auth/test/auth-provider.test.ts | 3 ++- packages/taco/src/conditions/const.ts | 8 ++++---- .../taco/src/conditions/context/context.ts | 1 + packages/taco/src/conditions/shared.ts | 12 +++++------- packages/taco/test/conditions/context.test.ts | 1 + 11 files changed, 46 insertions(+), 48 deletions(-) create mode 100644 packages/taco-auth/src/providers/eip4361/common.ts rename packages/taco-auth/src/providers/{ => eip4361}/eip4361.ts (85%) rename packages/taco-auth/src/providers/{ => eip4361}/external-eip4361.ts (84%) diff --git a/packages/taco-auth/src/auth-provider.ts b/packages/taco-auth/src/auth-provider.ts index fbb8d4c64..cc91f1765 100644 --- a/packages/taco-auth/src/auth-provider.ts +++ b/packages/taco-auth/src/auth-provider.ts @@ -1,20 +1,5 @@ import { AuthSignature } from './auth-sig'; -import { EIP4361AuthProvider } from './providers'; - -export const EIP4361_AUTH_METHOD = 'EIP4361'; export interface AuthProvider { getOrCreateAuthSignature(): Promise; } - -export type AuthProviders = { - [EIP4361_AUTH_METHOD]?: EIP4361AuthProvider; - // Fallback to satisfy type checking - [key: string]: AuthProvider | undefined; -}; - -export const USER_ADDRESS_PARAM_DEFAULT = ':userAddress'; - -export const AUTH_METHOD_FOR_PARAM: Record = { - [USER_ADDRESS_PARAM_DEFAULT]: EIP4361_AUTH_METHOD, -}; diff --git a/packages/taco-auth/src/auth-sig.ts b/packages/taco-auth/src/auth-sig.ts index 01e04ada6..03727842c 100644 --- a/packages/taco-auth/src/auth-sig.ts +++ b/packages/taco-auth/src/auth-sig.ts @@ -1,8 +1,10 @@ import { EthAddressSchema } from '@nucypher/shared'; import { z } from 'zod'; -import { EIP4361_AUTH_METHOD } from './auth-provider'; -import { EIP4361TypedDataSchema } from './providers'; +import { + EIP4361_AUTH_METHOD, + EIP4361TypedDataSchema, +} from './providers/eip4361/common'; export const authSignatureSchema = z.object({ signature: z.string(), diff --git a/packages/taco-auth/src/providers/eip4361/common.ts b/packages/taco-auth/src/providers/eip4361/common.ts new file mode 100644 index 000000000..e6cff1600 --- /dev/null +++ b/packages/taco-auth/src/providers/eip4361/common.ts @@ -0,0 +1,17 @@ +import { SiweMessage } from 'siwe'; +import { z } from 'zod'; + +export const EIP4361_AUTH_METHOD = 'EIP4361'; + +const isSiweMessage = (message: string): boolean => { + try { + new SiweMessage(message); + return true; + } catch { + return false; + } +}; + +export const EIP4361TypedDataSchema = z + .string() + .refine(isSiweMessage, { message: 'Invalid SIWE message' }); diff --git a/packages/taco-auth/src/providers/eip4361.ts b/packages/taco-auth/src/providers/eip4361/eip4361.ts similarity index 85% rename from packages/taco-auth/src/providers/eip4361.ts rename to packages/taco-auth/src/providers/eip4361/eip4361.ts index 8c9a475c6..e5043023a 100644 --- a/packages/taco-auth/src/providers/eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361/eip4361.ts @@ -1,23 +1,12 @@ import { ethers } from 'ethers'; import { generateNonce, SiweMessage } from 'siwe'; -import { z } from 'zod'; -import { EIP4361_AUTH_METHOD } from '../auth-provider'; -import { AuthSignature } from '../auth-sig'; -import { LocalStorage } from '../storage'; +import { AuthSignature } from '../../auth-sig'; +import { LocalStorage } from '../../storage'; -const isSiweMessage = (message: string): boolean => { - try { - new SiweMessage(message); - return true; - } catch { - return false; - } -}; +import { EIP4361_AUTH_METHOD } from './common'; -export const EIP4361TypedDataSchema = z - .string() - .refine(isSiweMessage, { message: 'Invalid SIWE message' }); +export const USER_ADDRESS_PARAM_DEFAULT = ':userAddress'; export type EIP4361AuthProviderParams = { domain: string; diff --git a/packages/taco-auth/src/providers/external-eip4361.ts b/packages/taco-auth/src/providers/eip4361/external-eip4361.ts similarity index 84% rename from packages/taco-auth/src/providers/external-eip4361.ts rename to packages/taco-auth/src/providers/eip4361/external-eip4361.ts index 9ebd60892..20885224a 100644 --- a/packages/taco-auth/src/providers/external-eip4361.ts +++ b/packages/taco-auth/src/providers/eip4361/external-eip4361.ts @@ -1,7 +1,11 @@ import { SiweMessage } from 'siwe'; -import { EIP4361_AUTH_METHOD } from '../auth-provider'; -import { AuthSignature } from '../auth-sig'; +import { AuthSignature } from '../../auth-sig'; + +import { EIP4361_AUTH_METHOD } from './common'; + +export const USER_ADDRESS_PARAM_EXTERNAL_EIP4361 = + ':userAddressExternalEIP4361'; export class SingleSignOnEIP4361AuthProvider { public static async fromExistingSiweInfo( diff --git a/packages/taco-auth/src/providers/index.ts b/packages/taco-auth/src/providers/index.ts index 14f5a1f3f..82912650d 100644 --- a/packages/taco-auth/src/providers/index.ts +++ b/packages/taco-auth/src/providers/index.ts @@ -1,2 +1,2 @@ -export * from './eip4361'; -export * from './external-eip4361'; +export * from './eip4361/eip4361'; +export * from './eip4361/external-eip4361'; diff --git a/packages/taco-auth/test/auth-provider.test.ts b/packages/taco-auth/test/auth-provider.test.ts index a457370d9..d2b11a349 100644 --- a/packages/taco-auth/test/auth-provider.test.ts +++ b/packages/taco-auth/test/auth-provider.test.ts @@ -7,7 +7,8 @@ import { import { SiweMessage } from 'siwe'; import { describe, expect, it } from 'vitest'; -import { EIP4361AuthProvider, EIP4361TypedDataSchema } from '../src'; +import { EIP4361TypedDataSchema } from '../src/providers/eip4361/common'; +import { EIP4361AuthProvider } from '../src/providers'; describe('auth provider', () => { const provider = fakeProvider(bobSecretKeyBytes); diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index da603bdda..4d7d06f43 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -1,8 +1,8 @@ import { ChainId } from '@nucypher/shared'; -import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; - -export const USER_ADDRESS_PARAM_EXTERNAL_EIP4361 = - ':userAddressExternalEIP4361'; +import { + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, +} from '@nucypher/taco-auth'; // Only allow alphanumeric characters and underscores export const CONTEXT_PARAM_REGEXP = new RegExp('^:[a-zA-Z_][a-zA-Z0-9_]*$'); diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 60aab9e8d..954ca45aa 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -6,6 +6,7 @@ import { EIP4361AuthProvider, SingleSignOnEIP4361AuthProvider, USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, } from '@nucypher/taco-auth'; import { CoreConditions, CoreContext } from '../../types'; diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 87ea85f7c..504cb2357 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -1,13 +1,11 @@ import { EthAddressSchema } from '@nucypher/shared'; -import { USER_ADDRESS_PARAM_DEFAULT } from '@nucypher/taco-auth'; -import { z } from 'zod'; - import { - CONTEXT_PARAM_PREFIX, - CONTEXT_PARAM_REGEXP, - // TODO consider moving this + USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAM_EXTERNAL_EIP4361, -} from './const'; +} from '@nucypher/taco-auth'; +import { z } from 'zod'; + +import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP } from './const'; export const contextParamSchema = z.string().regex(CONTEXT_PARAM_REGEXP); // We want to discriminate between ContextParams and plain strings diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index f007ae926..1f0b0795a 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -5,6 +5,7 @@ import { EIP4361AuthProvider, SingleSignOnEIP4361AuthProvider, USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, } from '@nucypher/taco-auth'; import { fakeAuthProviders, From f3a36c4c019309fba611ee833662889106edff8b Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 18 Jul 2024 19:20:54 -0400 Subject: [PATCH 68/75] Move RESERVED_CONTEXT_VARIABLES constant to context module since it is the only thing using it. --- packages/taco/src/conditions/const.ts | 5 ----- packages/taco/src/conditions/context/context.ts | 7 +++++-- packages/taco/test/conditions/context.test.ts | 5 +---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 4d7d06f43..4cb67d6c2 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -21,8 +21,3 @@ export const USER_ADDRESS_PARAMS = [ // Ordering matters, this should always be last USER_ADDRESS_PARAM_DEFAULT, ]; - -export const RESERVED_CONTEXT_PARAMS = [ - USER_ADDRESS_PARAM_EXTERNAL_EIP4361, - USER_ADDRESS_PARAM_DEFAULT, -]; diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 954ca45aa..3bc626005 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -16,8 +16,6 @@ import { ConditionExpression } from '../condition-expr'; import { CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, - RESERVED_CONTEXT_PARAMS, - USER_ADDRESS_PARAM_EXTERNAL_EIP4361, USER_ADDRESS_PARAMS, } from '../const'; @@ -39,6 +37,11 @@ const ERR_INVALID_AUTH_PROVIDER_TYPE = (param: string, expected: string) => const ERR_AUTH_PROVIDER_NOT_NEEDED_FOR_CONTEXT_PARAM = (param: string) => `AuthProvider not necessary for context parameter: ${param}`; +export const RESERVED_CONTEXT_PARAMS = [ + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, + USER_ADDRESS_PARAM_DEFAULT, +]; + export class ConditionContext { public requestedParameters: Set; private customParameters: Record = {}; diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 1f0b0795a..796590cb3 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -21,14 +21,11 @@ import { ContractConditionProps, } from '../../src/conditions/base/contract'; import { RpcCondition } from '../../src/conditions/base/rpc'; -import { - RESERVED_CONTEXT_PARAMS, - USER_ADDRESS_PARAM_EXTERNAL_EIP4361, -} from '../../src/conditions/const'; import { ConditionContext, CustomContextParam, } from '../../src/conditions/context'; +import { RESERVED_CONTEXT_PARAMS } from '../../src/conditions/context/context'; import { paramOrContextParamSchema, ReturnValueTestProps, From cfc9c7e7394a6adb4b2c97295aba7968f0601574 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 18 Jul 2024 19:21:19 -0400 Subject: [PATCH 69/75] Fix message to be use prefix constant. --- packages/taco/src/conditions/shared.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taco/src/conditions/shared.ts b/packages/taco/src/conditions/shared.ts index 504cb2357..1e63b0560 100644 --- a/packages/taco/src/conditions/shared.ts +++ b/packages/taco/src/conditions/shared.ts @@ -15,7 +15,7 @@ export const plainStringSchema = z.string().refine( return !str.startsWith(CONTEXT_PARAM_PREFIX); }, { - message: 'String must not be a context parameter i.e. not start with ":"', + message: `String must not be a context parameter i.e. not start with "${CONTEXT_PARAM_PREFIX}"`, }, ); From c808df12de0a00feff2337c6250f47b473ac4c7d Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 19 Jul 2024 11:07:26 -0400 Subject: [PATCH 70/75] Update nodejs example used for CI job to pass ConditionContext instead of directly passing auth provider. Expose USER_ADDRESS_PARAM* constants from taco for now. --- examples/taco/nodejs/src/index.ts | 6 +++++- packages/taco-auth/test/auth-provider.test.ts | 2 +- packages/taco/src/index.ts | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/taco/nodejs/src/index.ts b/examples/taco/nodejs/src/index.ts index bc00640ab..1a57f1ec9 100644 --- a/examples/taco/nodejs/src/index.ts +++ b/examples/taco/nodejs/src/index.ts @@ -5,6 +5,7 @@ import { decrypt, domains, EIP4361AuthProvider, + USER_ADDRESS_PARAM_DEFAULT, encrypt, fromBytes, getPorterUri, @@ -94,11 +95,14 @@ const decryptFromBytes = async (encryptedBytes: Uint8Array) => { consumerSigner, siweParams, ); + const conditionContext = + conditions.context.ConditionContext.fromMessageKit(messageKit); + conditionContext.addAuthProvider(USER_ADDRESS_PARAM_DEFAULT, authProvider); return decrypt( provider, domain, messageKit, - authProvider, + conditionContext, getPorterUri(domain), ); }; diff --git a/packages/taco-auth/test/auth-provider.test.ts b/packages/taco-auth/test/auth-provider.test.ts index d2b11a349..cf927b47b 100644 --- a/packages/taco-auth/test/auth-provider.test.ts +++ b/packages/taco-auth/test/auth-provider.test.ts @@ -7,8 +7,8 @@ import { import { SiweMessage } from 'siwe'; import { describe, expect, it } from 'vitest'; -import { EIP4361TypedDataSchema } from '../src/providers/eip4361/common'; import { EIP4361AuthProvider } from '../src/providers'; +import { EIP4361TypedDataSchema } from '../src/providers/eip4361/common'; describe('auth provider', () => { const provider = fakeProvider(bobSecretKeyBytes); diff --git a/packages/taco/src/index.ts b/packages/taco/src/index.ts index 00f86507d..3611aa6aa 100644 --- a/packages/taco/src/index.ts +++ b/packages/taco/src/index.ts @@ -14,4 +14,4 @@ export * as conditions from './conditions'; export { decrypt, encrypt, encryptWithPublicKey, isAuthorized } from './taco'; // TODO: Remove this re-export once `@nucypher/taco-auth` is mature and published -export { EIP4361AuthProvider } from '@nucypher/taco-auth'; +export { EIP4361AuthProvider, USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAM_EXTERNAL_EIP4361 } from '@nucypher/taco-auth'; From 790d9662338b205efcd1358dc3e8cb4c7ba757f0 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 19 Jul 2024 11:25:36 -0400 Subject: [PATCH 71/75] Appease linter. --- examples/taco/nodejs/src/index.ts | 6 +++--- packages/taco/src/index.ts | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/taco/nodejs/src/index.ts b/examples/taco/nodejs/src/index.ts index 1a57f1ec9..59695ad12 100644 --- a/examples/taco/nodejs/src/index.ts +++ b/examples/taco/nodejs/src/index.ts @@ -1,16 +1,16 @@ import { format } from 'node:util'; import { + EIP4361AuthProvider, + ThresholdMessageKit, + USER_ADDRESS_PARAM_DEFAULT, conditions, decrypt, domains, - EIP4361AuthProvider, - USER_ADDRESS_PARAM_DEFAULT, encrypt, fromBytes, getPorterUri, initialize, - ThresholdMessageKit, toBytes, toHexString, } from '@nucypher/taco'; diff --git a/packages/taco/src/index.ts b/packages/taco/src/index.ts index 3611aa6aa..9f15a295a 100644 --- a/packages/taco/src/index.ts +++ b/packages/taco/src/index.ts @@ -14,4 +14,8 @@ export * as conditions from './conditions'; export { decrypt, encrypt, encryptWithPublicKey, isAuthorized } from './taco'; // TODO: Remove this re-export once `@nucypher/taco-auth` is mature and published -export { EIP4361AuthProvider, USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAM_EXTERNAL_EIP4361 } from '@nucypher/taco-auth'; +export { + EIP4361AuthProvider, + USER_ADDRESS_PARAM_DEFAULT, + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, +} from '@nucypher/taco-auth'; From 6c3224bfcd922cf96842aef653a90da1c0c8434b Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 19 Jul 2024 11:26:09 -0400 Subject: [PATCH 72/75] Fix webpack-5 example to use ConditionContext instead of directly providing auth provider. --- examples/taco/webpack-5/src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/taco/webpack-5/src/index.ts b/examples/taco/webpack-5/src/index.ts index 740153f5d..9c4086a51 100644 --- a/examples/taco/webpack-5/src/index.ts +++ b/examples/taco/webpack-5/src/index.ts @@ -8,6 +8,7 @@ import { getPorterUri, initialize, toBytes, + USER_ADDRESS_PARAM_DEFAULT, } from '@nucypher/taco'; import { ethers } from 'ethers'; import { hexlify } from 'ethers/lib/utils'; @@ -62,11 +63,14 @@ const runExample = async () => { console.log('Decrypting message...'); const authProvider = new EIP4361AuthProvider(provider, signer); + const conditionContext = + conditions.context.ConditionContext.fromMessageKit(messageKit); + conditionContext.addAuthProvider(USER_ADDRESS_PARAM_DEFAULT, authProvider); const decryptedBytes = await decrypt( provider, domain, messageKit, - authProvider, + conditionContext, getPorterUri(domain), ); const decryptedMessage = fromBytes(decryptedBytes); From d9c87453b1d24974bb931df63cefa0c702b07706 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 19 Jul 2024 11:36:11 -0400 Subject: [PATCH 73/75] Fix other taco examples to use ConditionContext instead of directly providing authProvider. --- examples/taco/nextjs/src/hooks/useTaco.ts | 9 ++++++++- examples/taco/react/src/hooks/useTaco.ts | 9 ++++++++- packages/taco/examples/encrypt-decrypt.ts | 6 +++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/examples/taco/nextjs/src/hooks/useTaco.ts b/examples/taco/nextjs/src/hooks/useTaco.ts index 81ff0dc5d..18c29b3cd 100644 --- a/examples/taco/nextjs/src/hooks/useTaco.ts +++ b/examples/taco/nextjs/src/hooks/useTaco.ts @@ -7,6 +7,7 @@ import { getPorterUri, initialize, ThresholdMessageKit, + USER_ADDRESS_PARAM_DEFAULT, } from '@nucypher/taco'; import { ethers } from 'ethers'; import { useCallback, useEffect, useState } from 'react'; @@ -33,11 +34,17 @@ export default function useTaco({ } const messageKit = ThresholdMessageKit.fromBytes(encryptedBytes); const authProvider = new EIP4361AuthProvider(provider, signer); + const conditionContext = + conditions.context.ConditionContext.fromMessageKit(messageKit); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProvider, + ); return decrypt( provider, domain, messageKit, - authProvider, + conditionContext, getPorterUri(domain), ); }, diff --git a/examples/taco/react/src/hooks/useTaco.ts b/examples/taco/react/src/hooks/useTaco.ts index 81ff0dc5d..18c29b3cd 100644 --- a/examples/taco/react/src/hooks/useTaco.ts +++ b/examples/taco/react/src/hooks/useTaco.ts @@ -7,6 +7,7 @@ import { getPorterUri, initialize, ThresholdMessageKit, + USER_ADDRESS_PARAM_DEFAULT, } from '@nucypher/taco'; import { ethers } from 'ethers'; import { useCallback, useEffect, useState } from 'react'; @@ -33,11 +34,17 @@ export default function useTaco({ } const messageKit = ThresholdMessageKit.fromBytes(encryptedBytes); const authProvider = new EIP4361AuthProvider(provider, signer); + const conditionContext = + conditions.context.ConditionContext.fromMessageKit(messageKit); + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProvider, + ); return decrypt( provider, domain, messageKit, - authProvider, + conditionContext, getPorterUri(domain), ); }, diff --git a/packages/taco/examples/encrypt-decrypt.ts b/packages/taco/examples/encrypt-decrypt.ts index 8d6b7f0f6..5cd1ae1e5 100644 --- a/packages/taco/examples/encrypt-decrypt.ts +++ b/packages/taco/examples/encrypt-decrypt.ts @@ -11,6 +11,7 @@ import { initialize, ThresholdMessageKit, toBytes, + USER_ADDRESS_PARAM_DEFAULT, } from '../src'; const ritualId = 1; @@ -50,11 +51,14 @@ const run = async () => { web3Provider, web3Provider.getSigner(), ); + const conditionContext = + conditions.context.ConditionContext.fromMessageKit(messageKit); + conditionContext.addAuthProvider(USER_ADDRESS_PARAM_DEFAULT, authProvider); const decryptedMessage = await decrypt( web3Provider, domains.TESTNET, messageKit, - authProvider, + conditionContext, getPorterUri(domains.TESTNET), ); return decryptedMessage; From 9acd7729be6e4274abc0eb718e92a5f4102ac51d Mon Sep 17 00:00:00 2001 From: derekpierre Date: Mon, 22 Jul 2024 15:27:08 -0400 Subject: [PATCH 74/75] Code cleanup based on RFC for #554. --- .../taco/src/conditions/context/context.ts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 3bc626005..1d8048082 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -37,6 +37,14 @@ const ERR_INVALID_AUTH_PROVIDER_TYPE = (param: string, expected: string) => const ERR_AUTH_PROVIDER_NOT_NEEDED_FOR_CONTEXT_PARAM = (param: string) => `AuthProvider not necessary for context parameter: ${param}`; +type AuthProviderType = + | typeof EIP4361AuthProvider + | typeof SingleSignOnEIP4361AuthProvider; +const EXPECTED_AUTH_PROVIDER_TYPES: Record = { + [USER_ADDRESS_PARAM_DEFAULT]: EIP4361AuthProvider, + [USER_ADDRESS_PARAM_EXTERNAL_EIP4361]: SingleSignOnEIP4361AuthProvider, +}; + export const RESERVED_CONTEXT_PARAMS = [ USER_ADDRESS_PARAM_EXTERNAL_EIP4361, USER_ADDRESS_PARAM_DEFAULT, @@ -183,26 +191,19 @@ export class ConditionContext { } public addAuthProvider(contextParam: string, authProvider: AuthProvider) { - if (!USER_ADDRESS_PARAMS.includes(contextParam)) { + if (!(contextParam in EXPECTED_AUTH_PROVIDER_TYPES)) { throw new Error( ERR_AUTH_PROVIDER_NOT_NEEDED_FOR_CONTEXT_PARAM(contextParam), ); } - if (contextParam === USER_ADDRESS_PARAM_DEFAULT) { - if (authProvider instanceof EIP4361AuthProvider) { - this.authProviders[contextParam] = authProvider; - return; - } - } else if (contextParam === USER_ADDRESS_PARAM_EXTERNAL_EIP4361) { - if (authProvider instanceof SingleSignOnEIP4361AuthProvider) { - this.authProviders[contextParam] = authProvider; - return; - } + if (!(authProvider instanceof EXPECTED_AUTH_PROVIDER_TYPES[contextParam])) { + throw new Error( + ERR_INVALID_AUTH_PROVIDER_TYPE(contextParam, typeof authProvider), + ); } - throw new Error( - ERR_INVALID_AUTH_PROVIDER_TYPE(contextParam, typeof authProvider), - ); + + this.authProviders[contextParam] = authProvider; } public async toJson(): Promise { From 75e7a63eb02c85b66290841722c6b274181cfa76 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Mon, 22 Jul 2024 15:27:53 -0400 Subject: [PATCH 75/75] Add tests for processing addition of authProviders to ConditionContext. --- packages/taco/test/conditions/context.test.ts | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/packages/taco/test/conditions/context.test.ts b/packages/taco/test/conditions/context.test.ts index 796590cb3..a2d6f174b 100644 --- a/packages/taco/test/conditions/context.test.ts +++ b/packages/taco/test/conditions/context.test.ts @@ -354,6 +354,62 @@ describe('No authentication provider', () => { }); }); + it('rejects auth provider for not applicable context param', () => { + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: ':myParam', + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionContext = new ConditionContext(condition); + expect(() => + conditionContext.addAuthProvider( + ':myParam', + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ), + ).toThrow('AuthProvider not necessary for context parameter: :myParam'); + }); + + it('rejects invalid auth provider for :userAddress', () => { + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: USER_ADDRESS_PARAM_DEFAULT, + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionContext = new ConditionContext(condition); + expect(() => + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_DEFAULT, + authProviders[USER_ADDRESS_PARAM_EXTERNAL_EIP4361], + ), + ).toThrow(`Invalid AuthProvider type for ${USER_ADDRESS_PARAM_DEFAULT}`); + }); + + it('rejects invalid auth provider for :userAddressExternalEIP4361', () => { + const conditionObj = { + ...testContractConditionObj, + returnValueTest: { + ...testReturnValueTest, + value: USER_ADDRESS_PARAM_EXTERNAL_EIP4361, + }, + }; + const condition = new ContractCondition(conditionObj); + const conditionContext = new ConditionContext(condition); + expect(() => + conditionContext.addAuthProvider( + USER_ADDRESS_PARAM_EXTERNAL_EIP4361, + authProviders[USER_ADDRESS_PARAM_DEFAULT], + ), + ).toThrow( + `Invalid AuthProvider type for ${USER_ADDRESS_PARAM_EXTERNAL_EIP4361}`, + ); + }); + it('it supports just one provider at a time', async () => { const conditionObj = { ...testContractConditionObj,