From d9ed89be273578e2d20f3cc473a34507f54bc13a Mon Sep 17 00:00:00 2001 From: RanaBug Date: Thu, 5 Sep 2024 11:48:31 +0100 Subject: [PATCH] prettier, eslint and airbnb standards implemented --- .eslintrc.json | 101 + .prettierignore | 0 .prettierrc | 9 + CHANGELOG.md | 84 +- CONTRIBUTING.md | 3 +- README.md | 15 +- SECURITY.md | 2 +- .../@etherspot/eip1271-verification-util.js | 17 +- __mocks__/@etherspot/modular-sdk.js | 39 +- __mocks__/@etherspot/prime-sdk.js | 199 +- __tests__/hooks/useEtherspotModules.test.js | 175 +- babel.config.js | 2 +- example/.eslintignore | 1 + example/src/App.tsx | 187 +- example/src/index.tsx | 4 +- jest.config.js | 4 +- package-lock.json | 2534 ++++++++++++++++- package.json | 32 +- rollup.config.js | 11 +- .../EtherspotApprovalTransaction.tsx | 24 +- src/components/EtherspotBatch.tsx | 24 +- src/components/EtherspotBatches.tsx | 34 +- .../EtherspotContractTransaction.tsx | 42 +- .../EtherspotTokenTransferTransaction.tsx | 29 +- src/components/EtherspotTransaction.tsx | 26 +- src/components/EtherspotTransactionKit.tsx | 37 +- src/components/ProviderWalletTransaction.tsx | 22 +- src/contexts/EtherspotBatchContext.tsx | 4 +- src/contexts/EtherspotBatchesContext.tsx | 4 +- src/contexts/EtherspotContext.tsx | 14 +- .../EtherspotTransactionKitContext.tsx | 11 +- src/contexts/ProviderWalletContext.tsx | 10 +- src/global.d.ts | 3 +- src/hooks/useDeepCompare.ts | 5 +- src/hooks/useEtherspotAssets.ts | 43 +- src/hooks/useEtherspotBalances.ts | 20 +- src/hooks/useEtherspotHistory.ts | 51 +- src/hooks/useEtherspotModules.ts | 171 +- src/hooks/useEtherspotNfts.ts | 20 +- src/hooks/useEtherspotPrices.ts | 42 +- src/hooks/useEtherspotSwaps.ts | 52 +- src/hooks/useEtherspotUtils.ts | 29 +- src/hooks/useId.ts | 2 +- src/hooks/useWalletAddress.ts | 40 +- src/index.ts | 17 +- src/providers/EtherspotContextProvider.tsx | 245 +- ...EtherspotTransactionKitContextProvider.tsx | 327 ++- .../ProviderWalletContextProvider.tsx | 73 +- src/types/EtherspotTransactionKit.ts | 35 +- src/types/Helper.ts | 4 +- src/utils/common.ts | 22 +- tsconfig.json | 10 +- 52 files changed, 4022 insertions(+), 889 deletions(-) create mode 100644 .eslintrc.json create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 example/.eslintignore diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..2e08217 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,101 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:import/recommended", + "plugin:import/typescript", + "plugin:react/jsx-runtime", + "airbnb", + "airbnb-typescript", + "airbnb/hooks", + "plugin:prettier/recommended", + "prettier" + ], + "overrides": [ + { + "env": { + "node": true + }, + "files": [".eslintrc.{js,cjs}"], + "parserOptions": { + "sourceType": "script" + } + } + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module", + "project": "./tsconfig.json" + }, + "plugins": [ + "@typescript-eslint", + "react", + "react-hooks", + "import", + "prettier" + ], + "rules": { + "import/no-named-as-default-member": "off", + "import/no-named-as-default": "off", + "no-console": [ + "error", + { + "allow": ["warn", "error"] + } + ], + "quotes": ["error", "single"], + "prettier/prettier": "error", + "react/jsx-filename-extension": [ + 1, + { + "extensions": [".jsx", ".tsx"] + } + ], + "import/prefer-default-export": "off", + "react/react-in-jsx-scope": "off", + "@typescript-eslint/no-unused-vars": "error", + "import/extensions": [ + "error", + "ignorePackages", + { + "ts": "never", + "tsx": "never", + "jsx": "never", + "js": "never" + } + ], + "react/function-component-definition": [ + 2, + { + "namedComponents": ["function-declaration", "arrow-function"], + "unnamedComponents": "function-expression" + } + ], + "react/require-default-props": "off", + "react/no-array-index-key": "off", + "jsx-a11y/click-events-have-key-events": "off", + "jsx-a11y/no-static-element-interactions": "off", + "no-plusplus": "off" + }, + "ignorePatterns": [ + "node_modules/", + "build/", + "__tests__/", + "jest.config.js", + "babel.config.js", + "rollup.config.js" + ], + "settings": { + "import/resolver": { + "typescript": {} + } + } +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..e69de29 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..4a4d876 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "printWidth": 80, + "singleQuote": true, + "trailingComma": "es5", + "semi": true, + "tabWidth": 2, + "endOfLine": "auto" + } + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b277a..62a6655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,50 +1,65 @@ # Changelog +## [0.15.2] - 2024-09-05 + +### Added Changes + +- Implementation of Prettier and EsLint to the code base + ## [0.15.1] - 2024-08-09 ### Added Changes + - Remove postinstall script ## [0.15.0] - 2024-08-08 ### Breaking Changes + - Updated `@etherspot/modular-sdk` with new wallet factory contract address - `IMPORTANT`: To access previous wallet factory contract address, please use 0.14.1 or below, and move assets from wallets before updating to 0.15.0+ ## [0.14.1] - 2024-07-11 ### Added Changes + - Added `MODULE_TYPE` enum and `ModuleInfo` type from `etherspot-modular` ## [0.14.0] - 2024-07-10 ### Added Changes + - Version update of `etherspot-modular` - Added Etherspot Modular SDK `getAllModules` and `isModuleInstalled` to hook `useEtherspotModules` - Updated `uninstallModule` with Etherspot Modular SDK `generateModuleDeInitData` to hook `useEtherspotModules` which allows to install and uninstall several modules ### Breaking Changes + - Updated `getAssets` which accepts optional props `chainId` and `name` ## [0.13.0] - 2024-06-17 ### Added Changes + - `getSDK` include a param to choose to instantiate the Prime SDK instead of the Modular SDK - Added Etherspot Modular SDK `installModule` and `uninstallModule` to hook `useEtherspotModules` - Added `isModular` to context `EtherspotContextProvider` ### Breaking Changes + - Etherspot Modular SDK implemented to TransactionKit as the default `accountTemplate` - Changed the `etherspot-prime` wallet type to `etherspot` wallet type ## [0.12.1] - 2024-05-22 ### Added Changes + - Links updated on README file ## [0.12.0] - 2024-05-21 ### Added Changes + - Added Etherspot Prime SDK `getSupportedAssets` to hook `useEtherspotAssets` - Added Etherspot Prime SDK `getQuotes` to hook `useEtherspotSwaps` - Added Etherspot Prime SDK `getTransactionStatus` to hook `useEtherspotHistory` @@ -54,93 +69,111 @@ ## [0.11.0] - 2024-03-28 ### Added Changes + - Added `chainId` param to `useEtherspotNfts` hook's `getTransactions` and `getTransaction` methods - Fixed `useEtherspotNfts` hook's `getTransactions` method returned result to match back-end changes ### Breaking Changes + - Transactions returned by `useEtherspotNfts` hook's `getTransactions` method are now different type called `UserOpTransaction` ## [0.10.1] - 2024-03-20 ### Added Changes + - Fixes and optimizations on SDK initialization - Updated `@etherspot/prime-sdk` to version `1.6.4` with config changes ## [0.10.0] - 2024-03-20 ### Breaking Changes + - Etherspot project keys are now split as `dataApiKey` and `bundlerApiKey` to support separation of bundler and data services, however `TransactionKit` still carries embedded keys with low frequency usage API calls support ## [0.9.2] - 2024-03-20 ### Breaking Changes + - Cast `chainId` to number throughout the library to make it failproof for string chain IDs ## [0.9.1] - 2024-03-16 ### Breaking Changes + - Chore on Etherspot Prime project keys ## [0.9.0] - 2024-03-16 ### Breaking Changes + - Updated `@etherspot/prime-sdk` to version `1.6.2` with data service changes - Hook `useEtherspotSwaps` temporarily unavailable for `getOffers` method ## [0.8.0] - 2024-02-28 ### Breaking Changes + - Updated `useEtherspotTransactions` hook's `estimate` and `send` methods to return actual gas cost on `estimated` key and nicer error messages on `errorMessage` key - Changed return type to `JSX.Element` for `EtherspotApprovalTransaction`, `EtherspotContractTransaction` and `EtherspotTokenTransferTransaction` components ## [0.7.7] - 2024-02-22 ### Added Changes + - Added `chainId` param to `useEtherspotNfts` hook's `getAccountNfts` method ## [0.7.6] - 2024-02-21 ### Added Changes + - Added Etherspot Prime SDK computed account pull from SDK instance state ## [0.7.5] - 2024-02-21 ### Added Changes + - Added missing `tokenDecimals` param to `` and `` components ## [0.7.4] - 2024-02-20 ### Added Changes + - Added `chainId` param to `useEtherspotAssets` hook's `getAssets` method ## [0.7.3] - 2024-02-20 ### Added Changes + - Fixed `` component's used transfer method ## [0.7.2] - 2024-02-07 ### Added Changes + - Fixed `useEtherspotBalances` hook's `getAccountBalances` accepted params type ## [0.7.1] - 2024-02-06 ### Added Changes + - Added `chainId` param to `useEtherspotBalances` hook's `getAccountBalances` method ## [0.7.0] - 2024-01-30 ### Added Changes + - Added `isSending`, `isEstimating`, `containsSendingError`, `containsEstimatingError` to `useEtherspotTransactions` hook ## [0.6.12] - 2024-01-26 ### Added Changes + - Added Etherspot Prime SDK `projectKey` to ``, it allows usage of SDK data services ## [0.6.11] - 2023-11-23 ### Added Changes + - Removed `reflect-metadata` and `rxjs` dependencies - Fixed `@etherspot/eip1271-verification-util` to version `0.1.3` - Added Pull Request template @@ -148,46 +181,55 @@ ## [0.6.10] - 2023-11-23 ### Breaking Changes + - Updated `@etherspot/prime-sdk` to version `1.3.112` that removes `api_key` param from `paymaster` prop, now it's passed via `url` param ## [0.6.9] - 2023-11-06 ### Added Changes + - Updated `@etherspot/prime-sdk` to version `1.3.10` that includes better error message handling under the hood ## [0.6.8] - 2023-10-29 ### Added Changes + - Fixed `` component `paymaster.context` issues ## [0.6.7] - 2023-10-28 ### Added Changes + - Fixed `` component `paymaster` prop issues ## [0.6.6] - 2023-10-27 ### Added Changes + - Added accepted `provider` to `` component that supports most of providers by Prime SDK ## [0.6.5] - 2023-10-26 ### Added Changes + - Updated `@etherspot/prime-sdk` to version `1.3.8` with `accountTemplate` (SDK `factoryWallet`) fixes ## [0.6.4] - 2023-10-25 ### Added Changes + - Added `accountTemplate` to `` component that allows passing custom `factoryWallet` supported by Prime SDK ## [0.6.3] - 2023-10-25 ### Added Changes + - Added missing `useEtherspotTransactions` hook tests for `send` method ## [0.6.2] - 2023-10-24 ### Added Changes + - Added missing `useEtherspotTransactions` hook tests for `estimate` method - Fixed `skip` prop to ignore batch group estimations - Fixed batching for same chain ID SDK instance @@ -195,10 +237,12 @@ ## [0.6.1] - 2023-10-24 ### Added Changes + - Updated `example` React code to latest changes - Updated `@etherspot/prime-sdk` to version `1.3.4` ### Breaking Changes + - Removed `etherspot` dependency - Removed `@etherspot/react-etherspot` dependency - Updated `provider` prop as required for `` component @@ -209,44 +253,52 @@ - Removed `etherspotSessionStorage` from `` component, session is now handled internally ### Pending Changes + - Method `getOffers` for same chain swaps on `useEtherspotSwaps` hook is not working on this release - Methods `getAccountTransactions` and `getAccountTransaction` on `useEtherspotHistory` hook are not working on this release ## [0.6.0] - 2023-10-18 ### Breaking Changes + - Removed `etherspot` wallet type from `useWalletAddress` hook - Removed `via` prop from `` component -- Default `useWalletAddress` and `` provider is set to `etherspot-prime` +- Default `useWalletAddress` and `` provider is set to `etherspot-prime` - Removed `gasTokenAddress` prop from `` component due being unsupported in default `etherspot-prime` provider ### Added + - Added `gasCost` to `etherspot-prime` estimations ## [0.5.1] - 2023-10-17 ### Added + - `react` dependencies chore. ## [0.5.0] - 2023-10-17 ### Breaking Changes + - Downgraded `react` peer dependency to version `>=16.13.0` ## [0.4.9] - 2023-09-29 ### Added + - Updated `@etherspot/prime-sdk` to version `1.2.11` - Added `paymaster` prop to `` which is used for setting custom `paymaster` sent via `etherspot-prime` provider ## [0.4.8] - 2023-09-27 ### Added + - Updated `@etherspot/prime-sdk` to version `1.2.10` ## [0.4.7] - 2023-09-27 ### Fixes + - Updated `@etherspot/prime-sdk` to version `1.2.9` - Removed `ethereumjs-util` dependency - Updated address `checksum` util and tests @@ -255,89 +307,105 @@ ## [0.4.6] - 2023-08-03 ### Added + - Chore on `@etherspot/prime-sdk` version `1.1.1` ## [0.4.5] - 2023-07-27 ### Added + - Updated `@etherspot/prime-sdk` to version `1.1.1` ## [0.4.4] - 2023-07-25 ### Fixes + - Fixed transaction sending after recent `@etherspot/prime-sdk` update to version `1.1.0` ## [0.4.3] - 2023-07-25 ### Added + - Updated `@etherspot/prime-sdk` to version `1.1.0` ## [0.4.2] - 2023-07-03 ### Added + - Updated `@etherspot/react-etherspot` to version `1.2.0` with `provider` state update fixes - Added Etherspot Prime SDK saved instances fix to support `provider` change ## [0.4.1] - 2023-06-26 ### Added + - Added updated Etherspot Prime SDK that supports Arbitrum chain - Added improvements how `chainId` is handled ## [0.4.0] - 2023-06-16 ### Added + - Added updated Etherspot Prime SDK that solves multiple issues within their SDK ## [0.3.2] - 2023-06-14 ### Added + - Added fixes and improvements how Etherspot Prime SDK is created and handled - Added `userOpHash` and `via` type to `SentBatches` type to to able to tell if it is -`etherspot` `batchHash` or `etherspot-prime` `userOpHash` + `etherspot` `batchHash` or `etherspot-prime` `userOpHash` ## [0.3.1] - 2023-06-13 ### Added + - Updated `@etherspot/eip1271-verification-util` to version `0.1.2` ## [0.3.0] - 2023-06-06 ### Added + - Added `via` prop to `` component that accepts default `etherspot` provider or newly added SDK -provider `etherspot-prime` that can be used to send EIP-4337 (Account Abstraction / UserOperation) transactions -via Etherspot bundler + provider `etherspot-prime` that can be used to send EIP-4337 (Account Abstraction / UserOperation) transactions + via Etherspot bundler - Added `useWalletAddres` hook to get `etherspot`, `etherspot-prime` and connected `provider` wallet address by type - Added deprecation warning for `useEtherspotAddresses` hook, `useWalletAddress('etherspot', chainId)` should -be used instead + be used instead ### Fixes + - Fixed `batches` ordering issue that were affecting renders with few `` components rendered -at the same time + at the same time ## [0.2.5] - 2023-06-02 ### Added + - Added `useEtherspotSwaps` hook for cross chain and same chain asset swaps ## [0.2.4] - 2023-06-01 ### Added + - Added `useEtherspotPrices` hook for asset prices ## [0.2.3] - 2023-05-30 ### Added + - Updated `window` context to not be used within non-browser environments. ## [0.2.2] - 2023-05-30 ### Added -- Updated `@etherspot/eip1271-verification-util` to version `0.1.1`. + +- Updated `@etherspot/eip1271-verification-util` to version `0.1.1`. ## [0.2.1] - 2023-05-30 ### Added + - Added `rimraf` to suport developers in `Windows` environment. - Added provider wallet transaction component `` - Added `useProviderWalletTransaction` hook for provider wallet transaction management @@ -345,6 +413,7 @@ at the same time ## [0.2.0] - 2023-05-12 ### Added + - Added `useEtherspotBalances` hook for Etherspot/EVM related contract - Added `useEtherspotUtils` hook for Etherspot/EVM related utils - Added `useEtherspotHistory` hook for Etherspot account transactions history @@ -354,4 +423,5 @@ at the same time - Added missing warning logs throughout the library ### Breaking Changes + - Removed current output of `useEtherspotAssets` and added method `getAssets: () => Promise` that returns a list of assets instead of putting asseets automatically into the state diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67010ed..b8d6a44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,5 @@ + ## Contributing Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. @@ -10,4 +11,4 @@ Don't forget to give the project a star! Thanks again! 2. Create your Feature Branch (`git checkout -b feature`) 3. Commit your Changes (`git commit -m 'Add some newFeature'`) 4. Push to the Branch (`git push origin feature`) -5. Open a Pull Request \ No newline at end of file +5. Open a Pull Request diff --git a/README.md b/README.md index 04ef79c..89d6a27 100644 --- a/README.md +++ b/README.md @@ -11,19 +11,18 @@

--------------- +--- ->[!IMPORTANT] ->This repo/software is under active development. +> [!IMPORTANT] +> This repo/software is under active development. > ->[![npm](https://img.shields.io/npm/v/@etherspot/transaction-kit)](https://www.npmjs.com/package/@etherspot/transaction-kit) - +> [![npm](https://img.shields.io/npm/v/@etherspot/transaction-kit)](https://www.npmjs.com/package/@etherspot/transaction-kit) ## 🧰 TransactionKit TransactionKit is a React Library that lets developers, no matter how experienced, get going with web3 development with ease. -It simplifies working with Account Abstraction so developers can focus on building a great User Experience and easily interact with their Smart Contracts +It simplifies working with Account Abstraction so developers can focus on building a great User Experience and easily interact with their Smart Contracts on a [large number of EVM based chains](https://etherspot.fyi/prime-sdk/chains-supported). ## ⚙ Get started @@ -34,8 +33,8 @@ You can either get started by installing the packages yourself here: npm i @etherspot/transaction-kit ``` -Or follow our introductory guide on our docs [here](https://etherspot.fyi/transaction-kit/intro) which walk you through -cloning down an example repo and setting up a dapp in your own environment. +Or follow our introductory guide on our docs [here](https://etherspot.fyi/transaction-kit/intro) which walk you through +cloning down an example repo and setting up a dapp in your own environment. ## 📖 Documentation diff --git a/SECURITY.md b/SECURITY.md index 35c94ba..86331e1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,6 +1,6 @@ # Reporting security issues -If you think you have found a security vulnerability, please submit a report to our [HackerOne program](https://hackerone.com/pillarproject) for assets in scope or send an email to [security@etherspot.io](mailto:security@etherspot.io). This address can be used for all of Etherspot's open source (including but not limited to SDK, BUIDler, React Etherspot Kit). +If you think you have found a security vulnerability, please submit a report to our [HackerOne program](https://hackerone.com/pillarproject) for assets in scope or send an email to [security@etherspot.io](mailto:security@etherspot.io). This address can be used for all of Etherspot's open source (including but not limited to SDK, BUIDler, React Etherspot Kit). Etherspot will send you a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. diff --git a/__mocks__/@etherspot/eip1271-verification-util.js b/__mocks__/@etherspot/eip1271-verification-util.js index cd5c63b..dd16830 100644 --- a/__mocks__/@etherspot/eip1271-verification-util.js +++ b/__mocks__/@etherspot/eip1271-verification-util.js @@ -1,5 +1,12 @@ -export const isValidEip1271Signature = async (rpcUrls, address, hash, signature) => { - return address === '0x7F30B1960D5556929B03a0339814fE903c55a347' - && hash === '0x1' - && signature === '0x222'; -} +export const isValidEip1271Signature = async ( + rpcUrls, + address, + hash, + signature +) => { + return ( + address === '0x7F30B1960D5556929B03a0339814fE903c55a347' && + hash === '0x1' && + signature === '0x222' + ); +}; diff --git a/__mocks__/@etherspot/modular-sdk.js b/__mocks__/@etherspot/modular-sdk.js index 06c74c6..bffa08c 100644 --- a/__mocks__/@etherspot/modular-sdk.js +++ b/__mocks__/@etherspot/modular-sdk.js @@ -1,9 +1,12 @@ import * as EtherspotModular from '@etherspot/modular-sdk'; import { ethers } from 'ethers'; -export const defaultAccountAddressModular = '0x7F30B1960D5556929B03a0339814fE903c55a347'; -export const otherFactoryDefaultAccountAddressModular = '0xe383724e3bDC4753746dEC781809f8CD82010914'; -export const otherAccountAddressModular = '0xAb4C67d8D7B248B2fA6B638C645466065fE8F1F1'; +export const defaultAccountAddressModular = + '0x7F30B1960D5556929B03a0339814fE903c55a347'; +export const otherFactoryDefaultAccountAddressModular = + '0xe383724e3bDC4753746dEC781809f8CD82010914'; +export const otherAccountAddressModular = + '0xAb4C67d8D7B248B2fA6B638C645466065fE8F1F1'; export class ModularSdk { sdkChainId; @@ -78,7 +81,11 @@ export class ModularSdk { }; } - totalGasEstimated({ callGasLimit, verificationGasLimit, preVerificationGas }) { + totalGasEstimated({ + callGasLimit, + verificationGasLimit, + preVerificationGas, + }) { return callGasLimit.add(verificationGasLimit).add(preVerificationGas); } @@ -103,7 +110,7 @@ export class ModularSdk { async generateModuleDeInitData() { const deInitData = ethers.utils.defaultAbiCoder.encode( - ["address", "bytes"], + ['address', 'bytes'], ['0x0000000000000000000000000000000000000001', '0x00'] ); return deInitData; @@ -111,15 +118,15 @@ export class ModularSdk { async installModule(moduleType, module, initData, accountAddress) { if (!accountAddress && !defaultAccountAddressModular) { - throw new Error('No account address provided!') + throw new Error('No account address provided!'); } if (!moduleType || !module) { - throw new Error('installModule props missing') + throw new Error('installModule props missing'); } if (module === '0x222') { - throw new Error('module is already installed') + throw new Error('module is already installed'); } return '0x123'; @@ -127,15 +134,15 @@ export class ModularSdk { async uninstallModule(moduleType, module, deinitData, accountAddress) { if (module === '0x222') { - throw new Error('module is not installed') - } + throw new Error('module is not installed'); + } if (!accountAddress && !defaultAccountAddressModular) { - throw new Error('No account address provided!') + throw new Error('No account address provided!'); } if (!moduleType || !module || !deinitData) { - throw new Error('uninstallModule props missing') + throw new Error('uninstallModule props missing'); } return '0x456'; @@ -143,21 +150,21 @@ export class ModularSdk { async getAllModules(pageSize, accountAddress) { if (!accountAddress && !defaultAccountAddressModular) { - throw new Error('No account address provided!') + throw new Error('No account address provided!'); } return { - validators: ['0x000', '0x111', '0x222'] + validators: ['0x000', '0x111', '0x222'], }; } async isModuleInstalled(moduleType, module, accountAddress) { if (!accountAddress && !defaultAccountAddressModular) { - throw new Error('No account address provided!') + throw new Error('No account address provided!'); } if (!moduleType || !module) { - throw new Error('uninstallModule props missing') + throw new Error('uninstallModule props missing'); } if (module === '0x111') { diff --git a/__mocks__/@etherspot/prime-sdk.js b/__mocks__/@etherspot/prime-sdk.js index f9a2d26..0cca03f 100644 --- a/__mocks__/@etherspot/prime-sdk.js +++ b/__mocks__/@etherspot/prime-sdk.js @@ -1,8 +1,10 @@ import * as EtherspotPrime from '@etherspot/prime-sdk'; import { ethers } from 'ethers'; -export const defaultAccountAddress = '0x7F30B1960D5556929B03a0339814fE903c55a347'; -export const otherFactoryDefaultAccountAddress = '0xe383724e3bDC4753746dEC781809f8CD82010914'; +export const defaultAccountAddress = + '0x7F30B1960D5556929B03a0339814fE903c55a347'; +export const otherFactoryDefaultAccountAddress = + '0xe383724e3bDC4753746dEC781809f8CD82010914'; export const otherAccountAddress = '0xAb4C67d8D7B248B2fA6B638C645466065fE8F1F1'; export class PrimeSdk { @@ -78,7 +80,11 @@ export class PrimeSdk { }; } - totalGasEstimated({ callGasLimit, verificationGasLimit, preVerificationGas }) { + totalGasEstimated({ + callGasLimit, + verificationGasLimit, + preVerificationGas, + }) { return callGasLimit.add(verificationGasLimit).add(preVerificationGas); } @@ -103,65 +109,91 @@ export class PrimeSdk { } export class DataUtils { - constructor() { } - - getQuotes({ fromAddress, toAddress, fromChainId, toChainId, fromToken, fromAmount, slippage }) { - if (!fromAddress || !toAddress || !fromChainId || !toChainId || !fromToken || !fromAmount || !slippage) { + constructor() {} + + getQuotes({ + fromAddress, + toAddress, + fromChainId, + toChainId, + fromToken, + fromAmount, + slippage, + }) { + if ( + !fromAddress || + !toAddress || + !fromChainId || + !toChainId || + !fromToken || + !fromAmount || + !slippage + ) { return 'getQuotes: missing required props'; } - if (fromAddress === '0x111' && toAddress === '0x222' && fromChainId === 1 && toChainId === 56 && fromToken == '0x123456' && fromAmount === '0x10000000000' && slippage === 1) { + if ( + fromAddress === '0x111' && + toAddress === '0x222' && + fromChainId === 1 && + toChainId === 56 && + fromToken == '0x123456' && + fromAmount === '0x10000000000' && + slippage === 1 + ) { return { transactions: [ { - data: "0x111222333", - to: "0x123", - value: "0x00" + data: '0x111222333', + to: '0x123', + value: '0x00', }, { - value: "0xb2eed2c27ce6", - data: "0x444555666", - to: "0x456", - chainId: 1 - } - ] - } + value: '0xb2eed2c27ce6', + data: '0x444555666', + to: '0x456', + chainId: 1, + }, + ], + }; } return { transactions: [] }; } getSupportedAssets({ chainId, provider: bridgingProvider }) { - const allSupportedAssets = [{ - address: "0x123", - chainId: 1, - name: "USDC", - symbol: "USDC", - }, - { - address: "0x456", - chainId: 1, - name: "USDC", - symbol: "USDC", - }, - { - address: "0x789", - chainId: 137, - name: "USDC", - symbol: "USDC", - }, + const allSupportedAssets = [ + { + address: '0x123', + chainId: 1, + name: 'USDC', + symbol: 'USDC', + }, + { + address: '0x456', + chainId: 1, + name: 'USDC', + symbol: 'USDC', + }, + { + address: '0x789', + chainId: 137, + name: 'USDC', + symbol: 'USDC', + }, ]; if (!chainId) { - return { tokens: allSupportedAssets } + return { tokens: allSupportedAssets }; } - if (allSupportedAssets.some(asset => asset.chainId === chainId)) { - return { tokens: allSupportedAssets.filter((asset) => asset.chainId === chainId) } + if (allSupportedAssets.some((asset) => asset.chainId === chainId)) { + return { + tokens: allSupportedAssets.filter((asset) => asset.chainId === chainId), + }; } - return { tokens: [] } - + return { tokens: [] }; } getAccountBalances({ chainId, account }) { @@ -169,8 +201,16 @@ export class DataUtils { const tokenBalance = ethers.utils.parseEther('420'); const nativeAssetBalance = ethers.utils.parseEther('0'); - const token = { token: '0x', balance: tokenBalance, superBalance: tokenBalance }; - const nativeAsset = { token: null, balance: nativeAssetBalance, superBalance: nativeAssetBalance }; + const token = { + token: '0x', + balance: tokenBalance, + superBalance: tokenBalance, + }; + const nativeAsset = { + token: null, + balance: nativeAssetBalance, + superBalance: nativeAssetBalance, + }; if (chainId !== 1) { return { items: [nativeAsset] }; @@ -181,7 +221,12 @@ export class DataUtils { } if (account === otherAccountAddress) { - return { items: [nativeAsset, { ...token, balance: ethers.utils.parseEther('69') }] }; + return { + items: [ + nativeAsset, + { ...token, balance: ethers.utils.parseEther('69') }, + ], + }; } return { items: [] }; @@ -210,7 +255,7 @@ export class DataUtils { getTransactionStatus({ fromChainId, toChainId, transactionHash, provider }) { if (!fromChainId || !toChainId || !transactionHash) { - return 'getTransactionStatus: missing required props' + return 'getTransactionStatus: missing required props'; } if (fromChainId === 1 && toChainId === 137 && transactionHash === '0x123') { @@ -232,8 +277,16 @@ export class DataUtils { getNftList({ account, chainId }) { const accountNfts = [ - { contractName: 'Collection Alpha', contractAddress: '0x2', items: [{ tokenId: 420 }] }, - { contractName: 'Collection Beta', contractAddress: '0x1', items: [{ tokenId: 6 }, { tokenId: 9 }] }, + { + contractName: 'Collection Alpha', + contractAddress: '0x2', + items: [{ tokenId: 420 }], + }, + { + contractName: 'Collection Beta', + contractAddress: '0x1', + items: [{ tokenId: 6 }, { tokenId: 9 }], + }, ]; if (chainId !== 1) { @@ -245,22 +298,49 @@ export class DataUtils { } if (account === otherAccountAddress) { - return { items: [{ ...accountNfts[0], contractName: 'Collection Gama' }] }; + return { + items: [{ ...accountNfts[0], contractName: 'Collection Gama' }], + }; } return { items: [] }; } getTokenListTokens({ name, chainId }) { - const token1 = { address: '0x1', chainId, name: 'tk1', symbol: 'TK1', decimals: 18, logoURI: '' }; - const token2 = { address: '0x2', chainId, name: 'tk2', symbol: 'TK2', decimals: 18, logoURI: '' }; - const token3 = { address: '0x3', chainId, name: 'tk3', symbol: 'TK3', decimals: 18, logoURI: '' }; + const token1 = { + address: '0x1', + chainId, + name: 'tk1', + symbol: 'TK1', + decimals: 18, + logoURI: '', + }; + const token2 = { + address: '0x2', + chainId, + name: 'tk2', + symbol: 'TK2', + decimals: 18, + logoURI: '', + }; + const token3 = { + address: '0x3', + chainId, + name: 'tk3', + symbol: 'TK3', + decimals: 18, + logoURI: '', + }; return chainId === 1 ? [token1, token2, token3] : [token1]; } getExchangeOffers({ fromTokenAddress, toTokenAddress, fromChainId }) { - if (fromChainId !== 1 || fromTokenAddress !== '0x111' || toTokenAddress !== '0x222') { + if ( + fromChainId !== 1 || + fromTokenAddress !== '0x111' || + toTokenAddress !== '0x222' + ) { return []; } @@ -279,8 +359,19 @@ export class DataUtils { return [offer1, offer2]; } - getAdvanceRoutesLiFi({ fromAmount, fromChainId, toChainId, fromTokenAddress, toTokenAddress }) { - if (fromChainId !== 1 || toChainId !== 137 || fromTokenAddress !== '0x111' || toTokenAddress !== '0x222') { + getAdvanceRoutesLiFi({ + fromAmount, + fromChainId, + toChainId, + fromTokenAddress, + toTokenAddress, + }) { + if ( + fromChainId !== 1 || + toChainId !== 137 || + fromTokenAddress !== '0x111' || + toTokenAddress !== '0x222' + ) { return { items: [] }; } diff --git a/__tests__/hooks/useEtherspotModules.test.js b/__tests__/hooks/useEtherspotModules.test.js index e13a756..9ef4635 100644 --- a/__tests__/hooks/useEtherspotModules.test.js +++ b/__tests__/hooks/useEtherspotModules.test.js @@ -1,16 +1,22 @@ import { renderHook, waitFor } from '@testing-library/react'; import { ethers } from 'ethers'; -import { useEtherspotModules, EtherspotTransactionKit, MODULE_TYPE } from '../../src'; - - -const ethersProvider = new ethers.providers.JsonRpcProvider('http://localhost:8545', 'sepolia'); // replace with your node's RPC URL +import { + EtherspotTransactionKit, + MODULE_TYPE, + useEtherspotModules, +} from '../../src'; + +const ethersProvider = new ethers.providers.JsonRpcProvider( + 'http://localhost:8545', + 'sepolia' +); // replace with your node's RPC URL const provider = new ethers.Wallet.createRandom().connect(ethersProvider); const moduleAddress = '0x111'; const initData = ethers.utils.defaultAbiCoder.encode( - ["address", "bytes"], - ['0x0000000000000000000000000000000000000001', '0x00'] - ); + ['address', 'bytes'], + ['0x0000000000000000000000000000000000000001', '0x00'] +); describe('useEtherspotModules()', () => { it('install one module', async () => { @@ -20,31 +26,44 @@ describe('useEtherspotModules()', () => {
); - const { result } = renderHook(({ chainId }) => useEtherspotModules(chainId), { - initialProps: { chainId: 1 }, - wrapper, - }); + const { result } = renderHook( + ({ chainId }) => useEtherspotModules(chainId), + { + initialProps: { chainId: 1 }, + wrapper, + } + ); // wait for balances to be fetched for chain ID 1 await waitFor(() => expect(result.current).not.toBeNull()); - const installModuleMissingProps = await result.current.installModule(MODULE_TYPE.VALIDATOR) - .catch((e) => { - console.error(e); - return `${e}` - }) - expect(installModuleMissingProps).toBe('Error: Failed to install module: Error: installModule props missing'); + const installModuleMissingProps = await result.current + .installModule(MODULE_TYPE.VALIDATOR) + .catch((e) => { + console.error(e); + return `${e}`; + }); + expect(installModuleMissingProps).toBe( + 'Error: Failed to install module: Error: installModule props missing' + ); - const installModuleAlreadyInstalled = await result.current.installModule(MODULE_TYPE.VALIDATOR, '0x222') - .catch((e) => { - console.error(e); - return `${e}` - }) + const installModuleAlreadyInstalled = await result.current + .installModule(MODULE_TYPE.VALIDATOR, '0x222') + .catch((e) => { + console.error(e); + return `${e}`; + }); - expect(installModuleAlreadyInstalled).toBe('Error: Failed to install module: Error: module is already installed'); + expect(installModuleAlreadyInstalled).toBe( + 'Error: Failed to install module: Error: module is already installed' + ); - const installOneModule = await result.current.installModule(MODULE_TYPE.VALIDATOR, moduleAddress, initData); - expect(installOneModule).toBe('0x123') + const installOneModule = await result.current.installModule( + MODULE_TYPE.VALIDATOR, + moduleAddress, + initData + ); + expect(installOneModule).toBe('0x123'); }); it('uninstall one module', async () => { @@ -54,36 +73,50 @@ describe('useEtherspotModules()', () => {
); - const { result } = renderHook(({ chainId }) => useEtherspotModules(chainId), { - initialProps: { chainId: 1 }, - wrapper, - }); + const { result } = renderHook( + ({ chainId }) => useEtherspotModules(chainId), + { + initialProps: { chainId: 1 }, + wrapper, + } + ); // wait for balances to be fetched for chain ID 1 await waitFor(() => expect(result.current).not.toBeNull()); - const uninstallModuleNotInstalled = await result.current.uninstallModule(MODULE_TYPE.VALIDATOR, '0x222') - .catch((e) => { - console.error(e); - return `${e}` - }) + const uninstallModuleNotInstalled = await result.current + .uninstallModule(MODULE_TYPE.VALIDATOR, '0x222') + .catch((e) => { + console.error(e); + return `${e}`; + }); - expect(uninstallModuleNotInstalled).toBe('Error: Failed to uninstall module: Error: module is not installed'); + expect(uninstallModuleNotInstalled).toBe( + 'Error: Failed to uninstall module: Error: module is not installed' + ); - const installOneModule = await result.current.installModule(MODULE_TYPE.VALIDATOR, moduleAddress, initData); + const installOneModule = await result.current.installModule( + MODULE_TYPE.VALIDATOR, + moduleAddress, + initData + ); expect(installOneModule).toBe('0x123'); - const uninstallModulePropsMissing = await result.current.uninstallModule(moduleAddress) - .catch((e) => { - console.error(e); - return `${e}` - }) - expect(uninstallModulePropsMissing).toBe('Error: Failed to uninstall module: Error: uninstallModule props missing'); - - - const uninstallOneModule = await result.current.uninstallModule(MODULE_TYPE.VALIDATOR, moduleAddress); - expect(uninstallOneModule).toBe('0x456'); + const uninstallModulePropsMissing = await result.current + .uninstallModule(moduleAddress) + .catch((e) => { + console.error(e); + return `${e}`; + }); + expect(uninstallModulePropsMissing).toBe( + 'Error: Failed to uninstall module: Error: uninstallModule props missing' + ); + const uninstallOneModule = await result.current.uninstallModule( + MODULE_TYPE.VALIDATOR, + moduleAddress + ); + expect(uninstallOneModule).toBe('0x456'); }); it('list of modules for one wallet', async () => { @@ -93,16 +126,23 @@ describe('useEtherspotModules()', () => {
); - const { result } = renderHook(({ chainId }) => useEtherspotModules(chainId), { - initialProps: { chainId: 1 }, - wrapper, - }); + const { result } = renderHook( + ({ chainId }) => useEtherspotModules(chainId), + { + initialProps: { chainId: 1 }, + wrapper, + } + ); // wait for balances to be fetched for chain ID 1 await waitFor(() => expect(result.current).not.toBeNull()); - const installOneModule = await result.current.installModule(MODULE_TYPE.VALIDATOR, moduleAddress, initData); - expect(installOneModule).toBe('0x123') + const installOneModule = await result.current.installModule( + MODULE_TYPE.VALIDATOR, + moduleAddress, + initData + ); + expect(installOneModule).toBe('0x123'); const listOfModules = await result.current.listModules(); expect(listOfModules.validators).toContain('0x111'); @@ -116,21 +156,34 @@ describe('useEtherspotModules()', () => {
); - const { result } = renderHook(({ chainId }) => useEtherspotModules(chainId), { - initialProps: { chainId: 1 }, - wrapper, - }); + const { result } = renderHook( + ({ chainId }) => useEtherspotModules(chainId), + { + initialProps: { chainId: 1 }, + wrapper, + } + ); // wait for balances to be fetched for chain ID 1 await waitFor(() => expect(result.current).not.toBeNull()); - const installOneModule = await result.current.installModule(MODULE_TYPE.VALIDATOR, moduleAddress, initData); - expect(installOneModule).toBe('0x123') + const installOneModule = await result.current.installModule( + MODULE_TYPE.VALIDATOR, + moduleAddress, + initData + ); + expect(installOneModule).toBe('0x123'); - const isModuleOneInstalled = await result.current.isModuleInstalled(MODULE_TYPE.VALIDATOR, moduleAddress); + const isModuleOneInstalled = await result.current.isModuleInstalled( + MODULE_TYPE.VALIDATOR, + moduleAddress + ); expect(isModuleOneInstalled).toBe(true); - const isModuleTowInstalled = await result.current.isModuleInstalled(MODULE_TYPE.VALIDATOR, '0x222'); + const isModuleTowInstalled = await result.current.isModuleInstalled( + MODULE_TYPE.VALIDATOR, + '0x222' + ); expect(isModuleTowInstalled).toBe(false); }); -}) +}); diff --git a/babel.config.js b/babel.config.js index cb755f8..286a34c 100644 --- a/babel.config.js +++ b/babel.config.js @@ -2,6 +2,6 @@ module.exports = { presets: [ ['@babel/preset-env', { targets: { node: 'current' } }], ['@babel/preset-react', { runtime: 'automatic' }], - '@babel/preset-typescript' + '@babel/preset-typescript', ], }; diff --git a/example/.eslintignore b/example/.eslintignore new file mode 100644 index 0000000..c8740c5 --- /dev/null +++ b/example/.eslintignore @@ -0,0 +1 @@ +__tests__/ diff --git a/example/src/App.tsx b/example/src/App.tsx index fb1fca9..b28aaf0 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -5,17 +5,27 @@ import { EtherspotTransaction, IEstimatedBatches, ISentBatches, + MODULE_TYPE, + ModuleInfo, SentBatch, useEtherspot, + useEtherspotAssets, + useEtherspotModules, useEtherspotTransactions, useWalletAddress, - useEtherspotModules, - ModuleInfo, - MODULE_TYPE, } from '@etherspot/transaction-kit'; import TreeItem from '@mui/lab/TreeItem'; import TreeView from '@mui/lab/TreeView'; -import { Box, Button, Chip, Container, Paper, Tab, Tabs, Typography } from '@mui/material'; +import { + Box, + Button, + Chip, + Container, + Paper, + Tab, + Tabs, + Typography, +} from '@mui/material'; import { ethers } from 'ethers'; import React, { useEffect, useState } from 'react'; import { AiFillCaretDown, AiFillCaretRight } from 'react-icons/ai'; @@ -71,7 +81,10 @@ const exampleCode = { - + ), @@ -85,6 +98,7 @@ const App = () => { const { getDataService, chainId: etherspotChainId } = useEtherspot(); const { installModule, uninstallModule, listModules } = useEtherspotModules(); const etherspotPrimeOrModularAddress = useWalletAddress(); + const { getAssets } = useEtherspotAssets(); const [balancePerAddress, setBalancePerAddress] = useState({ [walletAddressByName.Alice]: '', [walletAddressByName.Bob]: '', @@ -109,18 +123,21 @@ const App = () => { })), })); - const batchesTreeViewExpandedIds = batchesTreeView.reduce((ids: string[], batchGroup) => { - let moreIds = [batchGroup.treeNodeId]; + const batchesTreeViewExpandedIds = batchesTreeView.reduce( + (ids: string[], batchGroup) => { + let moreIds = [batchGroup.treeNodeId]; - batchGroup?.batches?.forEach((batch) => { - moreIds = [...moreIds, batch.treeNodeId]; - batch?.transactions?.forEach((transaction) => { - moreIds = [...moreIds, transaction.treeNodeId]; + batchGroup?.batches?.forEach((batch) => { + moreIds = [...moreIds, batch.treeNodeId]; + batch?.transactions?.forEach((transaction) => { + moreIds = [...moreIds, transaction.treeNodeId]; + }); }); - }); - return [...ids, ...moreIds]; - }, []); + return [...ids, ...moreIds]; + }, + [] + ); const [expanded, setExpanded] = React.useState([]); @@ -129,7 +146,8 @@ const App = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [batches]); - const handleToggle = (event: React.SyntheticEvent, nodeIds: string[]) => setExpanded(nodeIds); + const handleToggle = (event: React.SyntheticEvent, nodeIds: string[]) => + setExpanded(nodeIds); useEffect(() => { setEstimated(null); @@ -170,7 +188,11 @@ const App = () => { }; const onUninstallModuleClick = async () => { - await uninstallModule(MODULE_TYPE.VALIDATOR, testModuleSepoliaTestnet, deInitData); + await uninstallModule( + MODULE_TYPE.VALIDATOR, + testModuleSepoliaTestnet, + deInitData + ); await listModules().then((list) => setModulesList(list)); }; @@ -196,15 +218,21 @@ const App = () => { account: address, chainId: +(process.env.REACT_APP_CHAIN_ID as string), }); - const balance = balances && balances.items.find(({ token }) => token === null); - if (balance) updatedBalances[address] = ethers.utils.formatEther(balance.balance); + const balance = + balances && balances.items.find(({ token }) => token === null); + if (balance) + updatedBalances[address] = ethers.utils.formatEther( + balance.balance + ); }) ); if (expired) return; setBalancePerAddress(updatedBalances); - await listModules().then((list) => setModulesList(list)).catch((e) => setModulesList(undefined)); + await listModules() + .then((list) => setModulesList(list)) + .catch((e) => setModulesList(undefined)); }; refreshBalances(); @@ -216,20 +244,36 @@ const App = () => { }, [etherspotPrimeOrModularAddress]); const estimationFailed = estimated?.some((estimatedGroup) => - estimatedGroup.estimatedBatches?.some((estimatedBatch) => estimatedBatch.errorMessage) + estimatedGroup.estimatedBatches?.some( + (estimatedBatch) => estimatedBatch.errorMessage + ) ); + const hey = async () => { + const prout = await getAssets(undefined, 'EtherspotPopularTokens'); + return prout; + }; + + useEffect(() => { + hey().then((x) => console.log(x)); + }, []); + return ( - + Sepolia ETH Faucet { style={{ marginRight: 10, marginTop: 10 }} /> {Object.keys(walletAddressByName).map((addressName: string) => { - const address = walletAddressByName[addressName as keyof typeof walletAddressByName]; + const address = + walletAddressByName[ + addressName as keyof typeof walletAddressByName + ]; const balancePart = `balance: ${ - balancePerAddress[address] ? `${Number(balancePerAddress[address]).toFixed(4)} ETH` : 'Loading...' + balancePerAddress[address] + ? `${Number(balancePerAddress[address]).toFixed(4)} ETH` + : 'Loading...' }`; const chipLabel = `${addressName} ${balancePart}`; return ( @@ -259,32 +308,44 @@ const App = () => { {etherspotPrimeOrModularAddress} )} - {modulesList && ( - -
- Modules installed: -
    - {modulesList.validators?.map((module, i) => ( -
  • - {module} -
  • - ))} -
-
- - -
- )} + {modulesList && ( + +
+ Modules installed: +
    + {modulesList.validators?.map((module, i) => ( +
  • + {module} +
  • + ))} +
+
+ + +
+ )}
setActiveTab(id)}> - + - {exampleCode[activeTab].code} @@ -306,24 +368,37 @@ const App = () => { > Transactions: {batchesTreeView.map((batchGroup, id1) => ( - + {batchGroup.batches?.map((batch, id2) => { let estimatedBatch: EstimatedBatch | undefined; let sentBatch: SentBatch | undefined; estimated?.forEach((estimatedGroup) => { - estimatedBatch = estimatedGroup.estimatedBatches?.find(({ id }) => id === batch.id); + estimatedBatch = estimatedGroup.estimatedBatches?.find( + ({ id }) => id === batch.id + ); }); sent?.forEach((sentGroup) => { - sentBatch = sentGroup.sentBatches?.find(({ id }) => id === batch.id); + sentBatch = sentGroup.sentBatches?.find( + ({ id }) => id === batch.id + ); }); return ( - + {!!estimatedBatch?.cost && ( - Batch estimated: {ethers.utils.formatEther(estimatedBatch.cost)} ETH + Batch estimated:{' '} + {ethers.utils.formatEther(estimatedBatch.cost)} ETH )} {!!estimatedBatch?.errorMessage && ( @@ -343,10 +418,14 @@ const App = () => { )} {batch.transactions?.map((transaction, id3) => { let transactionValue = - typeof transaction.value === 'string' ? transaction.value : '0.0'; + typeof transaction.value === 'string' + ? transaction.value + : '0.0'; if (ethers.BigNumber.isBigNumber(transaction.value)) { - transactionValue = ethers.utils.formatEther(transaction.value); + transactionValue = ethers.utils.formatEther( + transaction.value + ); } return ( @@ -356,8 +435,12 @@ const App = () => { key={transaction.treeNodeId} > To: {transaction.to} - Value: {transactionValue} ETH - Data: {transaction.data ?? 'None'} + + Value: {transactionValue} ETH + + + Data: {transaction.data ?? 'None'} + ); })} diff --git a/example/src/index.tsx b/example/src/index.tsx index 85ce27f..5f1cf2f 100644 --- a/example/src/index.tsx +++ b/example/src/index.tsx @@ -1,7 +1,7 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; import { EtherspotTransactionKit } from '@etherspot/transaction-kit'; import { ethers } from 'ethers'; +import React from 'react'; +import ReactDOM from 'react-dom/client'; // components import App from './App'; diff --git a/jest.config.js b/jest.config.js index a97467d..4931934 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,3 @@ module.exports = { - testEnvironment: 'jsdom' -} + testEnvironment: 'jsdom', +}; diff --git a/package-lock.json b/package-lock.json index 5f5bf57..344aeac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,28 @@ { "name": "@etherspot/transaction-kit", - "version": "0.15.0", + "version": "0.15.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@etherspot/transaction-kit", - "version": "0.15.0", + "version": "0.15.1", "license": "MIT", "dependencies": { "@etherspot/eip1271-verification-util": "0.1.2", "@etherspot/modular-sdk": "2.0.0", "@etherspot/prime-sdk": "1.8.1", + "@ethersproject/abi": "^5.7.0", + "@lifi/types": "^9.2.0", "buffer": "^6.0.3", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-prettier": "^9.1.0", + "eslint-config-react": "^1.1.7", + "eslint-plugin-jsx-a11y": "^6.9.0", + "eslint-plugin-prettier": "^5.2.1", "ethers": "^5.6.9", - "lodash": "^4.17.21" + "lodash": "^4.17.21", + "prettier": "^3.3.3" }, "devDependencies": { "@babel/core": "^7.18.5", @@ -22,16 +30,23 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@jest/globals": "^29.3.1", - "@lifi/types": "^9.2.0", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-typescript": "^8.3.3", "@testing-library/react": "^14.3.1", "@types/jest": "^29.2.5", "@types/lodash.uniq": "^4.5.7", "@types/react": "^18.3.2", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "@typescript-eslint/parser": "^7.18.0", "babel-jest": "^29.3.1", "babel-loader": "^8.2.5", "dotenv": "^16.0.3", + "eslint": "^8.57.0", + "eslint-config-airbnb-typescript": "^18.0.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.30.0", + "eslint-plugin-react": "^7.35.1", + "eslint-plugin-react-hooks": "^4.6.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.3.1", "react": "^18.2.0", @@ -1940,6 +1955,99 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@etherspot/eip1271-verification-util": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@etherspot/eip1271-verification-util/-/eip1271-verification-util-0.1.2.tgz", @@ -2705,6 +2813,20 @@ "tslib": "^2.6.2" } }, + "node_modules/@etherspot/modular-sdk/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@etherspot/prime-sdk": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/@etherspot/prime-sdk/-/prime-sdk-1.8.1.tgz", @@ -2728,6 +2850,20 @@ "rxjs": "6.6.7" } }, + "node_modules/@etherspot/prime-sdk/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@ethersproject/abi": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", @@ -3427,6 +3563,38 @@ "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "deprecated": "Use @eslint/config-array instead", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead" + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -4316,6 +4484,47 @@ "ethers": "^5.7.2" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true, + "engines": { + "node": ">=12.4.0" + } + }, "node_modules/@parcel/watcher": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.1.tgz", @@ -4611,6 +4820,17 @@ "node": ">=14" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@rollup/plugin-replace": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.5.tgz", @@ -4706,6 +4926,11 @@ } } }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==" + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -5052,7 +5277,7 @@ "version": "8.56.10", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, + "devOptional": true, "peer": true, "dependencies": { "@types/estree": "*", @@ -5074,7 +5299,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true + "devOptional": true }, "node_modules/@types/graceful-fs": { "version": "4.1.9", @@ -5166,7 +5391,12 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "devOptional": true + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, "node_modules/@types/lodash": { "version": "4.17.4", @@ -5248,6 +5478,232 @@ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", + "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/type-utils": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", + "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" + }, "node_modules/@walletconnect/core": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.10.0.tgz", @@ -5814,9 +6270,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "bin": { "acorn": "bin/acorn" }, @@ -5844,6 +6300,14 @@ "acorn": "^8" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", @@ -5874,7 +6338,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -5914,7 +6377,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -6044,7 +6506,6 @@ "version": "5.1.3", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", - "dev": true, "dependencies": { "deep-equal": "^2.0.5" } @@ -6053,7 +6514,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "dev": true, "dependencies": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -6065,6 +6525,147 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ast-types-flow": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==" + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -6083,7 +6684,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -6094,6 +6694,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/axe-core": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.0.tgz", + "integrity": "sha512-Mr2ZakwQ7XUAjp7pAwQWRhhK8mQQ6JAaNWSjmjxil0R8BPioMtQsTLOolGYkji1rcL++3dCqZA3zWqpT+9Ew6g==", + "engines": { + "node": ">=4" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", @@ -6322,8 +6938,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base64-js": { "version": "1.5.1", @@ -6386,7 +7001,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6500,7 +7114,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "engines": { "node": ">=6" } @@ -6848,14 +7461,18 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/confbox": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==" }, + "node_modules/confusing-browser-globals": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==" + }, "node_modules/consola": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", @@ -7043,6 +7660,11 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "dev": true }, + "node_modules/damerau-levenshtein": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", + "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==" + }, "node_modules/data-urls": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", @@ -7057,11 +7679,58 @@ "node": ">=12" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -7106,7 +7775,6 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", - "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.5", @@ -7134,6 +7802,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -7163,7 +7836,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -7229,6 +7901,29 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/dom-accessibility-api": { "version": "0.5.16", "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", @@ -7342,7 +8037,6 @@ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.1.tgz", "integrity": "sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw==", "dev": true, - "peer": true, "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -7372,6 +8066,65 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", @@ -7395,7 +8148,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -7411,6 +8163,30 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-iterator-helpers": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", + "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", @@ -7418,6 +8194,54 @@ "dev": true, "peer": true }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -7457,29 +8281,639 @@ "source-map": "~0.6.1" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "peer": true, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.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.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "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.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "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.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" }, "engines": { - "node": ">=8.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-scope/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "peer": true, + "node_modules/eslint-config-airbnb": { + "version": "19.0.4", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-19.0.4.tgz", + "integrity": "sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew==", + "dependencies": { + "eslint-config-airbnb-base": "^15.0.0", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5" + }, "engines": { - "node": ">=4.0" - } + "node": "^10.12.0 || ^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-jsx-a11y": "^6.5.1", + "eslint-plugin-react": "^7.28.0", + "eslint-plugin-react-hooks": "^4.3.0" + } + }, + "node_modules/eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dependencies": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.2" + } + }, + "node_modules/eslint-config-airbnb-typescript": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-18.0.0.tgz", + "integrity": "sha512-oc+Lxzgzsu8FQyFVa4QFaVKiitTYiiW3frB9KYW5OWdPrqFc7FzxgB20hP4cHMlr+MBzGcLl3jnCOVOydL9mIg==", + "dev": true, + "dependencies": { + "eslint-config-airbnb-base": "^15.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^7.0.0", + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-config-react": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/eslint-config-react/-/eslint-config-react-1.1.7.tgz", + "integrity": "sha512-P4Z6u68wf0BvIvZNu+U8uQsk3DcZ1CcCI1XpUkJlG6vOa+iVcSQLgE01f2DB2kXlKRcT8/3dsH+wveLgvEgbkQ==" + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.3.tgz", + "integrity": "sha512-ud9aw4szY9cCT1EWWdGv1L1XR6hh2PaRWif0j2QjQ0pgTY/69iw+W0Z4qZv5wHahOl8isEr+k/JnyAqNQkLkIA==", + "dev": true, + "dependencies": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.3.5", + "enhanced-resolve": "^5.15.0", + "eslint-module-utils": "^2.8.1", + "fast-glob": "^3.3.2", + "get-tsconfig": "^4.7.5", + "is-bun-module": "^1.0.2", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-typescript/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.9.0.tgz", + "integrity": "sha512-McVbYmwA3NEKwRQY5g4aWMdcZE5xZxV8i8l7CqJSrameuGSQJtSWaL/LxTEzSKKaCcOhlpDR8XEfYXWPrdo/ZQ==", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.30.0.tgz", + "integrity": "sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==", + "dependencies": { + "@rtsao/scc": "^1.1.0", + "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-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.9.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.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" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-jsx-a11y": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.0.tgz", + "integrity": "sha512-ySOHvXX8eSN6zz8Bywacm7CvGNhUtdjvqfQDVe6020TUK34Cywkw7m0KsCCk1Qtm9G1FayfTN1/7mMYnYO2Bhg==", + "dependencies": { + "aria-query": "~5.1.3", + "array-includes": "^3.1.8", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "^4.10.0", + "axobject-query": "^4.1.0", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "es-iterator-helpers": "^1.0.19", + "hasown": "^2.0.2", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "safe-regex-test": "^1.0.3", + "string.prototype.includes": "^2.0.0" + }, + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.35.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.35.2.tgz", + "integrity": "sha512-Rbj2R9zwP2GYNcIak4xoAMV57hrBh3hTaR0k7hVjwCQgryE/pw5px4b13EYjduOI0hfXyZhwBxaGpOTbWSGzKQ==", + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.2", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.19", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.8", + "object.fromentries": "^2.0.8", + "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", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", + "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-scope/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, "node_modules/esprima": { "version": "4.0.1", @@ -7494,12 +8928,21 @@ "node": ">=4" } }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -7511,7 +8954,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "engines": { "node": ">=4.0" } @@ -7526,7 +8968,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -7651,14 +9092,39 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + }, "node_modules/fast-redact": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", @@ -7672,6 +9138,14 @@ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -7681,6 +9155,17 @@ "bser": "2.1.1" } }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -7730,11 +9215,43 @@ "node": ">=8" } }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -7784,8 +9301,7 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.3", @@ -7808,11 +9324,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7879,11 +9411,38 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.0.tgz", + "integrity": "sha512-Pgba6TExTZ0FJAn1qkJAjIeKoDJ3CsI2ChuLohJnZl/tTU8MVrq3b+2t5UOPfRa4RMsorClBjJALkJUMjG1PAw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7926,6 +9485,41 @@ "node": ">=4" } }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -7943,6 +9537,11 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" + }, "node_modules/graphql": { "version": "15.8.0", "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", @@ -8001,7 +9600,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8052,7 +9650,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, "dependencies": { "has-symbols": "^1.0.3" }, @@ -8200,6 +9797,37 @@ } ] }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "engines": { + "node": ">=4" + } + }, "node_modules/import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -8223,7 +9851,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, "engines": { "node": ">=0.8.19" } @@ -8232,7 +9859,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -8247,7 +9873,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "dev": true, "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.0", @@ -8269,7 +9894,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8285,7 +9909,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1" @@ -8303,11 +9926,24 @@ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, "dependencies": { "has-bigints": "^1.0.1" }, @@ -8330,7 +9966,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8342,11 +9977,31 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-bun-module": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.1.0.tgz", + "integrity": "sha512-4mTAVPlrXpaN3jtF0lsnPCMGnq4+qZjVIKq0HCpfcqf8OC1SM5oATCIAPM5V5FN05qp2NNnFndphmdZS9CV3hA==", + "dev": true, + "dependencies": { + "semver": "^7.6.3" + } + }, + "node_modules/is-bun-module/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -8355,12 +10010,28 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dev": true, + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8370,7 +10041,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8403,6 +10073,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -8421,6 +10102,20 @@ "node": ">=6" } }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -8453,7 +10148,17 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", - "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "engines": { "node": ">= 0.4" }, @@ -8473,7 +10178,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8484,6 +10188,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -8494,7 +10206,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8510,7 +10221,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -8522,7 +10232,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "dev": true, "dependencies": { "call-bind": "^1.0.7" }, @@ -8549,7 +10258,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8564,7 +10272,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -8575,11 +10282,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -8587,11 +10307,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakset": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.7", "get-intrinsic": "^1.2.4" @@ -8634,8 +10364,7 @@ "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/isexe": { "version": "2.0.0", @@ -8762,6 +10491,18 @@ "integrity": "sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==", "peer": true }, + "node_modules/iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, "node_modules/jackspeak": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", @@ -10760,6 +12501,11 @@ "node": ">=4" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -10769,8 +12515,12 @@ "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" }, "node_modules/json5": { "version": "2.2.3", @@ -10784,6 +12534,28 @@ "node": ">=6" } }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/keyvaluestorage-interface": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/keyvaluestorage-interface/-/keyvaluestorage-interface-1.0.0.tgz", @@ -10798,6 +12570,22 @@ "node": ">=6" } }, + "node_modules/language-subtag-registry": { + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", + "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==" + }, + "node_modules/language-tags": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", + "dependencies": { + "language-subtag-registry": "^0.3.20" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -10807,6 +12595,18 @@ "node": ">=6" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/libphonenumber-js": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.11.1.tgz", @@ -10899,6 +12699,11 @@ "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -10977,6 +12782,15 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -11044,7 +12858,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -11052,6 +12865,14 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", @@ -11083,8 +12904,7 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multiformats": { "version": "9.9.0", @@ -11094,8 +12914,7 @@ "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, "node_modules/neo-async": { "version": "2.6.2", @@ -11221,7 +13040,6 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "dev": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1" @@ -11237,7 +13055,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "engines": { "node": ">= 0.4" } @@ -11246,7 +13063,6 @@ "version": "4.1.5", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.5", "define-properties": "^1.2.1", @@ -11260,6 +13076,65 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.entries": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ofetch": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.4.tgz", @@ -11313,11 +13188,26 @@ "tslib": "^2.3.0" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -11364,6 +13254,17 @@ "node": ">=6" } }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -11398,7 +13299,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -11407,7 +13307,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -11423,8 +13322,7 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { "version": "1.11.1", @@ -11451,6 +13349,15 @@ "node": "14 || >=16.14" } }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", @@ -11543,25 +13450,43 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "dev": true, "engines": { "node": ">= 0.4" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-format": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", @@ -11632,7 +13557,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, "engines": { "node": ">=6" } @@ -11690,6 +13614,25 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/quick-format-unescaped": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", @@ -11811,6 +13754,26 @@ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz", "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==" }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", + "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.1", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -11848,7 +13811,6 @@ "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "dev": true, "dependencies": { "call-bind": "^1.0.6", "define-properties": "^1.2.1", @@ -11919,7 +13881,6 @@ "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -11953,6 +13914,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -11970,6 +13940,15 @@ "node": ">=0.8" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.7.tgz", @@ -12083,6 +14062,28 @@ "node": ">=12" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/rxjs": { "version": "6.6.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", @@ -12099,6 +14100,23 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -12118,6 +14136,22 @@ } ] }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-stable-stringify": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", @@ -12180,7 +14214,6 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -12215,7 +14248,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -12369,7 +14401,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, "dependencies": { "internal-slot": "^1.0.4" }, @@ -12440,11 +14471,99 @@ "node": ">=8" } }, + "node_modules/string.prototype.includes": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.0.tgz", + "integrity": "sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg==", + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", + "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "regexp.prototype.flags": "^1.5.2", + "set-function-name": "^2.0.2", + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -12487,7 +14606,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "engines": { "node": ">=8" }, @@ -12537,7 +14655,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -12559,6 +14676,21 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "node_modules/synckit": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", + "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/system-architecture": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/system-architecture/-/system-architecture-0.1.0.tgz", @@ -12575,7 +14707,6 @@ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -12726,6 +14857,11 @@ "node": ">=8" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" + }, "node_modules/thread-stream": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-0.15.2.tgz", @@ -12787,6 +14923,18 @@ "node": ">=12" } }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-invariant": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", @@ -12798,11 +14946,52 @@ "node": ">=8" } }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } + }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -12824,6 +15013,75 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -12850,6 +15108,20 @@ "multiformats": "^9.4.2" } }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/uncrypto": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", @@ -13054,7 +15326,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -13269,7 +15540,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -13281,11 +15551,35 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-builtin-type": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.4.tgz", + "integrity": "sha512-bppkmBSsHFmIMSl8BO9TbsyzsvGjVoppt8xUiGzwiu/bhDCGxnpOKCxgqj6GuyHE0mINMDecBFPlOm2hzY084w==", + "dependencies": { + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-collection": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", - "dev": true, "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", @@ -13303,7 +15597,6 @@ "version": "1.1.15", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -13318,6 +15611,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -13518,7 +15819,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 75d05b9..6ab564d 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,16 @@ { "name": "@etherspot/transaction-kit", "description": "React Etherspot Transaction Kit", - "version": "0.15.1", + "version": "0.15.2", "main": "dist/cjs/index.js", "scripts": { "rollup:build": "NODE_OPTIONS=--max-old-space-size=8192 rollup -c", "rollup:watch": "rimraf ./node_modules/react ./node_modules/react-dom && rollup -c -w", "test": "jest __tests__ --silent --detectOpenHandles", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'", + "lint:fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix", + "format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'" }, "repository": { "type": "git", @@ -24,9 +27,17 @@ "@etherspot/eip1271-verification-util": "0.1.2", "@etherspot/modular-sdk": "2.0.0", "@etherspot/prime-sdk": "1.8.1", + "@ethersproject/abi": "^5.7.0", + "@lifi/types": "^9.2.0", "buffer": "^6.0.3", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-prettier": "^9.1.0", + "eslint-config-react": "^1.1.7", + "eslint-plugin-jsx-a11y": "^6.9.0", + "eslint-plugin-prettier": "^5.2.1", "ethers": "^5.6.9", - "lodash": "^4.17.21" + "lodash": "^4.17.21", + "prettier": "^3.3.3" }, "module": "dist/esm/index.js", "types": "dist/index.d.ts", @@ -40,16 +51,23 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@jest/globals": "^29.3.1", - "@lifi/types": "^9.2.0", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-typescript": "^8.3.3", "@testing-library/react": "^14.3.1", "@types/jest": "^29.2.5", "@types/lodash.uniq": "^4.5.7", "@types/react": "^18.3.2", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "@typescript-eslint/parser": "^7.18.0", "babel-jest": "^29.3.1", "babel-loader": "^8.2.5", "dotenv": "^16.0.3", + "eslint": "^8.57.0", + "eslint-config-airbnb-typescript": "^18.0.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.30.0", + "eslint-plugin-react": "^7.35.1", + "eslint-plugin-react-hooks": "^4.6.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.3.1", "react": "^18.2.0", @@ -59,6 +77,12 @@ "rollup-plugin-dts": "^4.2.3", "typescript": "^4.9.5" }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, "peerDependencies": { "react": ">=16.13.0" } diff --git a/rollup.config.js b/rollup.config.js index 09a8347..112cd5c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,7 +1,7 @@ +import replace from '@rollup/plugin-replace'; import typescript from '@rollup/plugin-typescript'; -import dts from 'rollup-plugin-dts'; import dotenv from 'dotenv'; -import replace from '@rollup/plugin-replace'; +import dts from 'rollup-plugin-dts'; dotenv.config(); @@ -30,16 +30,17 @@ export default [ file: packageJson.module, format: 'esm', sourcemap: true, - } + }, ], plugins: [ typescript({ tsconfig: './tsconfig.json', - exclude: ['./example/**', './src/test/**'] + exclude: ['./example/**', './src/test/**'], }), replace({ __ETHERSPOT_DATA_API_KEY__: process.env.ETHERSPOT_DATA_API_KEY ?? '', - __ETHERSPOT_BUNDLER_API_KEY__: process.env.ETHERSPOT_BUNDLER_API_KEY ?? '', + __ETHERSPOT_BUNDLER_API_KEY__: + process.env.ETHERSPOT_BUNDLER_API_KEY ?? '', preventAssignment: true, }), ], diff --git a/src/components/EtherspotApprovalTransaction.tsx b/src/components/EtherspotApprovalTransaction.tsx index 7a9fd32..d0f783c 100644 --- a/src/components/EtherspotApprovalTransaction.tsx +++ b/src/components/EtherspotApprovalTransaction.tsx @@ -1,5 +1,5 @@ -import React, { useContext } from 'react'; import { ethers } from 'ethers'; +import React, { useContext } from 'react'; // contexts import EtherspotBatchContext from '../contexts/EtherspotBatchContext'; @@ -13,7 +13,8 @@ import useId from '../hooks/useId'; // components import EtherspotContractTransaction from './EtherspotContractTransaction'; -interface EtherspotApprovalTransactionProps extends IEtherspotApprovalTransaction { +interface EtherspotApprovalTransactionProps + extends IEtherspotApprovalTransaction { children?: React.ReactNode; } @@ -40,30 +41,35 @@ const EtherspotApprovalTransaction = ({ let valueBN; try { - valueBN = typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) - ? ethers.utils.parseUnits(value, tokenDecimals) - : value; + valueBN = + typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) + ? ethers.utils.parseUnits(value, tokenDecimals) + : value; } catch (e) { if (e instanceof Error && e?.message) { - throw new Error(`Failed to parse provided value, please make sure value is wei: ${e.message}`); + throw new Error( + `Failed to parse provided value, please make sure value is wei: ${e.message}` + ); } } if (!valueBN) { - throw new Error(`Failed to parse provided value, please make sure value is wei.`); + throw new Error( + 'Failed to parse provided value, please make sure value is wei.' + ); } return ( {children} - ) + ); }; export default EtherspotApprovalTransaction; diff --git a/src/components/EtherspotBatch.tsx b/src/components/EtherspotBatch.tsx index df5e977..6f9b41f 100644 --- a/src/components/EtherspotBatch.tsx +++ b/src/components/EtherspotBatch.tsx @@ -1,8 +1,9 @@ +/* eslint-disable react/jsx-no-constructed-context-values */ import React, { useContext, useEffect, useState } from 'react'; // contexts -import EtherspotBatchesContext from '../contexts/EtherspotBatchesContext'; import EtherspotBatchContext from '../contexts/EtherspotBatchContext'; +import EtherspotBatchesContext from '../contexts/EtherspotBatchesContext'; // types import { IBatch, ITransaction } from '../types/EtherspotTransactionKit'; @@ -18,11 +19,17 @@ interface EtherspotBatchProps extends IBatch { children?: React.ReactNode; } -const EtherspotBatch = ({ children, chainId, id: batchId }: EtherspotBatchProps) => { +const EtherspotBatch = ({ + children, + chainId, + id: batchId, +}: EtherspotBatchProps) => { const context = useContext(EtherspotBatchesContext); const existingBatchContext = useContext(EtherspotBatchContext); const componentId = useId(); - const [transactionsPerId, setTransactionsPerId] = useState>({}); + const [transactionsPerId, setTransactionsPerId] = useState< + TypePerId + >({}); if (existingBatchContext !== null) { throw new Error(' cannot be inside '); @@ -39,14 +46,19 @@ const EtherspotBatch = ({ children, chainId, id: batchId }: EtherspotBatchProps) transactions: getObjectSortedByKeys(transactionsPerId), }; - context.setBatchesPerId((current) => ({ ...current, [componentId]: batch })); + context.setBatchesPerId((current) => ({ + ...current, + [componentId]: batch, + })); return () => { context.setBatchesPerId((current) => { + // eslint-disable-next-line no-param-reassign delete current[componentId]; return current; }); - } + }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [componentId, transactionsPerId, chainId, batchId]); return ( @@ -54,6 +66,6 @@ const EtherspotBatch = ({ children, chainId, id: batchId }: EtherspotBatchProps) {children} ); -} +}; export default EtherspotBatch; diff --git a/src/components/EtherspotBatches.tsx b/src/components/EtherspotBatches.tsx index 0f632f6..a8fb2a0 100644 --- a/src/components/EtherspotBatches.tsx +++ b/src/components/EtherspotBatches.tsx @@ -1,9 +1,10 @@ +/* eslint-disable react/jsx-no-constructed-context-values */ import React, { useContext, useEffect, useState } from 'react'; // contexts -import EtherspotTransactionKitContext from '../contexts/EtherspotTransactionKitContext'; -import EtherspotBatchesContext from '../contexts/EtherspotBatchesContext'; import EtherspotBatchContext from '../contexts/EtherspotBatchContext'; +import EtherspotBatchesContext from '../contexts/EtherspotBatchesContext'; +import EtherspotTransactionKitContext from '../contexts/EtherspotTransactionKitContext'; // types import { IBatch, IBatches } from '../types/EtherspotTransactionKit'; @@ -13,12 +14,12 @@ import { TypePerId } from '../types/Helper'; import { getObjectSortedByKeys } from '../utils/common'; // hooks -import useId from '../hooks/useId'; import useDeepCompare from '../hooks/useDeepCompare'; +import useId from '../hooks/useId'; type EtherspotBatchesProps = IBatches & { children?: React.ReactNode; -} +}; const EtherspotBatches = (props: EtherspotBatchesProps) => { const { @@ -39,7 +40,9 @@ const EtherspotBatches = (props: EtherspotBatchesProps) => { const paymaster = useDeepCompare(paymasterObject); if (existingBatchesContext !== null) { - throw new Error(' cannot be inside '); + throw new Error( + ' cannot be inside ' + ); } if (existingBatchContext !== null) { @@ -51,7 +54,7 @@ const EtherspotBatches = (props: EtherspotBatchesProps) => { } useEffect(() => { - let groupedBatch: IBatches = { + const groupedBatch: IBatches = { id: batchesId ?? componentId, skip, batches: getObjectSortedByKeys(batchesPerId), @@ -60,27 +63,26 @@ const EtherspotBatches = (props: EtherspotBatchesProps) => { paymaster, }; - context.setGroupedBatchesPerId((current) => ({ ...current, [componentId]: groupedBatch })); + context.setGroupedBatchesPerId((current) => ({ + ...current, + [componentId]: groupedBatch, + })); return () => { context.setGroupedBatchesPerId((current) => { + // eslint-disable-next-line no-param-reassign delete current[componentId]; return current; }); - } - }, [ - componentId, - batchesPerId, - skip, - batchesId, - paymaster, - ]); + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [componentId, batchesPerId, skip, batchesId, paymaster]); return ( {children} ); -} +}; export default EtherspotBatches; diff --git a/src/components/EtherspotContractTransaction.tsx b/src/components/EtherspotContractTransaction.tsx index 0512f33..c6751fe 100644 --- a/src/components/EtherspotContractTransaction.tsx +++ b/src/components/EtherspotContractTransaction.tsx @@ -1,5 +1,5 @@ -import React, { useContext, useEffect } from 'react'; import { ethers } from 'ethers'; +import React, { useContext, useEffect } from 'react'; // contexts import EtherspotBatchContext from '../contexts/EtherspotBatchContext'; @@ -10,7 +10,8 @@ import { IEtherspotContractTransaction } from '../types/EtherspotTransactionKit' // hooks import useId from '../hooks/useId'; -interface EtherspotContractTransactionProps extends IEtherspotContractTransaction { +interface EtherspotContractTransactionProps + extends IEtherspotContractTransaction { children?: React.ReactNode; } @@ -27,7 +28,7 @@ const EtherspotContractTransaction = ({ params, methodName, abi, - id: transactionId + id: transactionId, }: EtherspotContractTransactionProps): JSX.Element => { const context = useContext(EtherspotBatchContext); const componentId = useId(); @@ -41,12 +42,16 @@ const EtherspotContractTransaction = ({ contractInterface = new ethers.utils.Interface(abi); } catch (e) { if (e instanceof Error && e?.message) { - throw new Error(`Failed to build contract interface from provided ABI, please check ABI formatting: ${e.message}`); + throw new Error( + `Failed to build contract interface from provided ABI, please check ABI formatting: ${e.message}` + ); } } if (!contractInterface) { - throw new Error(`Failed to build contract interface from provided ABI, please check ABI formatting.`); + throw new Error( + 'Failed to build contract interface from provided ABI, please check ABI formatting.' + ); } let data: string | undefined; @@ -54,39 +59,50 @@ const EtherspotContractTransaction = ({ data = contractInterface.encodeFunctionData(methodName, params); } catch (e) { if (e instanceof Error && e?.message) { - throw new Error(`Failed to build transaction data, please check data/method formatting: ${e.message}`); + throw new Error( + `Failed to build transaction data, please check data/method formatting: ${e.message}` + ); } } if (!data) { - throw new Error(`Failed to build transaction data, please check data/method formatting.`); + throw new Error( + 'Failed to build transaction data, please check data/method formatting.' + ); } useEffect(() => { let valueBN; if (value) { - valueBN = typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) - ? ethers.utils.parseEther(value) - : value; + valueBN = + typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) + ? ethers.utils.parseEther(value) + : value; } const transaction = { id: transactionId ?? componentId, to: contractAddress, data, - value: valueBN + value: valueBN, }; - context.setTransactionsPerId((current) => ({ ...current, [componentId]: transaction })); + context.setTransactionsPerId((current) => ({ + ...current, + [componentId]: transaction, + })); return () => { context.setTransactionsPerId((current) => { + // eslint-disable-next-line no-param-reassign delete current[componentId]; return current; }); - } + }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [componentId, value, transactionId]); + // eslint-disable-next-line react/jsx-no-useless-fragment return <>{children}; }; diff --git a/src/components/EtherspotTokenTransferTransaction.tsx b/src/components/EtherspotTokenTransferTransaction.tsx index abc1a26..8867d32 100644 --- a/src/components/EtherspotTokenTransferTransaction.tsx +++ b/src/components/EtherspotTokenTransferTransaction.tsx @@ -1,5 +1,5 @@ -import React, { useContext } from 'react'; import { ethers } from 'ethers'; +import React, { useContext } from 'react'; // contexts import EtherspotBatchContext from '../contexts/EtherspotBatchContext'; @@ -14,7 +14,8 @@ import useWalletAddress from '../hooks/useWalletAddress'; // components import EtherspotContractTransaction from './EtherspotContractTransaction'; -interface EtherspotTokenTransferTransactionProps extends IEtherspotTokenTransferTransaction { +interface EtherspotTokenTransferTransactionProps + extends IEtherspotTokenTransferTransaction { children?: React.ReactNode; } @@ -42,37 +43,41 @@ const EtherspotTokenTransferTransaction = ({ let valueBN; try { - valueBN = typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) - ? ethers.utils.parseUnits(value, tokenDecimals) - : value; + valueBN = + typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) + ? ethers.utils.parseUnits(value, tokenDecimals) + : value; } catch (e) { if (e instanceof Error && e?.message) { - throw new Error(`Failed to parse provided value, please make sure value is wei: ${e.message}`); + throw new Error( + `Failed to parse provided value, please make sure value is wei: ${e.message}` + ); } } if (!valueBN) { - throw new Error(`Failed to parse provided value, please make sure value is wei.`); + throw new Error( + 'Failed to parse provided value, please make sure value is wei.' + ); } // wait for sender address to be available if (!senderAddress) { - return ( - <>{children} - ) + // eslint-disable-next-line react/jsx-no-useless-fragment + return <>{children}; } return ( {children} - ) + ); }; export default EtherspotTokenTransferTransaction; diff --git a/src/components/EtherspotTransaction.tsx b/src/components/EtherspotTransaction.tsx index 064f4f2..7814d68 100644 --- a/src/components/EtherspotTransaction.tsx +++ b/src/components/EtherspotTransaction.tsx @@ -1,5 +1,5 @@ -import React, { useContext, useEffect } from 'react'; import { ethers } from 'ethers'; +import React, { useContext, useEffect } from 'react'; // contexts import EtherspotBatchContext from '../contexts/EtherspotBatchContext'; @@ -31,23 +31,35 @@ const EtherspotTransaction = ({ useEffect(() => { let valueBN; if (value) { - valueBN = typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) - ? ethers.utils.parseEther(value) - : value; + valueBN = + typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) + ? ethers.utils.parseEther(value) + : value; } - const transaction = { id: transactionId ?? componentId, to, data, value: valueBN }; + const transaction = { + id: transactionId ?? componentId, + to, + data, + value: valueBN, + }; - context.setTransactionsPerId((current) => ({ ...current, [componentId]: transaction })); + context.setTransactionsPerId((current) => ({ + ...current, + [componentId]: transaction, + })); return () => { context.setTransactionsPerId((current) => { + // eslint-disable-next-line no-param-reassign delete current[componentId]; return current; }); - } + }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [componentId, to, data, value, transactionId]); + // eslint-disable-next-line react/jsx-no-useless-fragment return <>{children}; }; diff --git a/src/components/EtherspotTransactionKit.tsx b/src/components/EtherspotTransactionKit.tsx index 3bd9db2..c5458bd 100644 --- a/src/components/EtherspotTransactionKit.tsx +++ b/src/components/EtherspotTransactionKit.tsx @@ -1,14 +1,15 @@ -import React from 'react'; +import { WalletProviderLike as WalletProviderLikeModular } from '@etherspot/modular-sdk'; import { WalletProviderLike } from '@etherspot/prime-sdk'; -import { WalletProviderLike as WalletProviderLikeModular} from '@etherspot/modular-sdk'; +import React from 'react'; // types import { AccountTemplate } from '../types/EtherspotTransactionKit'; // providers +import EtherspotContextProvider from '../providers/EtherspotContextProvider'; import EtherspotTransactionKitContextProvider from '../providers/EtherspotTransactionKitContextProvider'; import ProviderWalletContextProvider from '../providers/ProviderWalletContextProvider'; -import EtherspotContextProvider from '../providers/EtherspotContextProvider'; + interface EtherspotTransactionKitProps extends React.PropsWithChildren { provider: WalletProviderLike | WalletProviderLikeModular; chainId?: number; @@ -46,21 +47,21 @@ const EtherspotTransactionKit = ({ } return ( - - - - {children} - - - - ) + + + + {children} + + + + ); }; export default EtherspotTransactionKit; diff --git a/src/components/ProviderWalletTransaction.tsx b/src/components/ProviderWalletTransaction.tsx index cb8a953..1350985 100644 --- a/src/components/ProviderWalletTransaction.tsx +++ b/src/components/ProviderWalletTransaction.tsx @@ -1,5 +1,5 @@ -import React, { useContext, useEffect } from 'react'; import { ethers } from 'ethers'; +import React, { useContext, useEffect } from 'react'; // contexts import ProviderWalletContext from '../contexts/ProviderWalletContext'; @@ -44,15 +44,18 @@ const ProviderWalletTransaction = ({ throw new Error('Multiple not allowed'); } - return () => { instances--; } + return () => { + instances--; + }; }, []); useEffect(() => { let valueBN; if (value) { - valueBN = typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) - ? ethers.utils.parseEther(value) - : value; + valueBN = + typeof value === 'string' && !ethers.BigNumber.isBigNumber(value) + ? ethers.utils.parseEther(value) + : value; } const transaction = { @@ -64,7 +67,10 @@ const ProviderWalletTransaction = ({ chainId, }; - context.setTransactionById((current) => ({ ...current, [componentId]: transaction })); + context.setTransactionById((current) => ({ + ...current, + [componentId]: transaction, + })); return () => { context.setTransactionById((current) => { @@ -72,9 +78,11 @@ const ProviderWalletTransaction = ({ delete updated[componentId]; return updated; }); - } + }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [to, data, value, chainId, componentId, providerWalletAddress]); + // eslint-disable-next-line react/jsx-no-useless-fragment return <>{children}; }; diff --git a/src/contexts/EtherspotBatchContext.tsx b/src/contexts/EtherspotBatchContext.tsx index 1b3506f..d5a3e5a 100644 --- a/src/contexts/EtherspotBatchContext.tsx +++ b/src/contexts/EtherspotBatchContext.tsx @@ -9,6 +9,8 @@ interface IEtherspotBatchContext { chainId?: number; } -const EtherspotBatchContext = createContext(null); +const EtherspotBatchContext = createContext( + null +); export default EtherspotBatchContext; diff --git a/src/contexts/EtherspotBatchesContext.tsx b/src/contexts/EtherspotBatchesContext.tsx index c49957c..85ca0da 100644 --- a/src/contexts/EtherspotBatchesContext.tsx +++ b/src/contexts/EtherspotBatchesContext.tsx @@ -8,6 +8,8 @@ interface IEtherspotBatchesContext { setBatchesPerId: Dispatch>>; } -const EtherspotBatchesContext = createContext(null); +const EtherspotBatchesContext = createContext( + null +); export default EtherspotBatchesContext; diff --git a/src/contexts/EtherspotContext.tsx b/src/contexts/EtherspotContext.tsx index 8137213..e4c88ad 100644 --- a/src/contexts/EtherspotContext.tsx +++ b/src/contexts/EtherspotContext.tsx @@ -1,15 +1,21 @@ -import { createContext } from 'react'; +import { + ModularSdk, + WalletProviderLike as WalletProviderLikeModular, +} from '@etherspot/modular-sdk'; import { DataUtils, PrimeSdk, WalletProviderLike } from '@etherspot/prime-sdk'; -import { ModularSdk, WalletProviderLike as WalletProviderLikeModular } from '@etherspot/modular-sdk'; +import { createContext } from 'react'; export interface EtherspotContextData { data: { - getSdk: (chainId?: number, forceNewInstance?: boolean) => Promise; + getSdk: ( + chainId?: number, + forceNewInstance?: boolean + ) => Promise; getDataService: () => DataUtils; provider: WalletProviderLike | WalletProviderLikeModular | null | undefined; chainId: number; isModular: boolean; - } + }; } const EtherspotContext = createContext(null); diff --git a/src/contexts/EtherspotTransactionKitContext.tsx b/src/contexts/EtherspotTransactionKitContext.tsx index af1c941..bf2355d 100644 --- a/src/contexts/EtherspotTransactionKitContext.tsx +++ b/src/contexts/EtherspotTransactionKitContext.tsx @@ -1,7 +1,11 @@ import { createContext, Dispatch, SetStateAction } from 'react'; // types -import { IBatches, IEstimatedBatches, ISentBatches } from '../types/EtherspotTransactionKit'; +import { + IBatches, + IEstimatedBatches, + ISentBatches, +} from '../types/EtherspotTransactionKit'; import { TypePerId } from '../types/Helper'; export interface IEtherspotTransactionKitContext { @@ -14,10 +18,11 @@ export interface IEtherspotTransactionKitContext { isSending: boolean; containsSendingError: boolean; containsEstimatingError: boolean; - }, + }; setGroupedBatchesPerId: Dispatch>>; } -const EtherspotTransactionKitContext = createContext(null); +const EtherspotTransactionKitContext = + createContext(null); export default EtherspotTransactionKitContext; diff --git a/src/contexts/ProviderWalletContext.tsx b/src/contexts/ProviderWalletContext.tsx index 560b00b..739bd8c 100644 --- a/src/contexts/ProviderWalletContext.tsx +++ b/src/contexts/ProviderWalletContext.tsx @@ -12,10 +12,14 @@ interface IProviderWalletContext { transaction: undefined | IProviderWalletTransaction; estimate: () => Promise; send: () => Promise; - }, - setTransactionById: Dispatch>; + }; + setTransactionById: Dispatch< + SetStateAction<{ [id: string]: IProviderWalletTransaction | undefined }> + >; } -const ProviderWalletContext = createContext(null); +const ProviderWalletContext = createContext( + null +); export default ProviderWalletContext; diff --git a/src/global.d.ts b/src/global.d.ts index 24feb0b..cdaf63c 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ interface Window { - ethereum: any + ethereum: any; } diff --git a/src/hooks/useDeepCompare.ts b/src/hooks/useDeepCompare.ts index 8e03ebd..a0a7e75 100644 --- a/src/hooks/useDeepCompare.ts +++ b/src/hooks/useDeepCompare.ts @@ -1,5 +1,6 @@ -import { useRef } from 'react'; +/* eslint-disable @typescript-eslint/no-explicit-any */ import isEqual from 'lodash/isEqual'; +import { useRef } from 'react'; const useDeepCompare = (value: any) => { const ref = useRef(value); @@ -9,6 +10,6 @@ const useDeepCompare = (value: any) => { } return ref.current; -} +}; export default useDeepCompare; diff --git a/src/hooks/useEtherspotAssets.ts b/src/hooks/useEtherspotAssets.ts index 22b6b21..fe4bc81 100644 --- a/src/hooks/useEtherspotAssets.ts +++ b/src/hooks/useEtherspotAssets.ts @@ -1,12 +1,19 @@ +import { + BridgingProvider, + Token, + TokenListToken, +} from '@etherspot/prime-sdk/dist/sdk/data'; import { useMemo } from 'react'; -import { BridgingProvider, Token, TokenListToken } from '@etherspot/prime-sdk/dist/sdk/data'; // hooks import useEtherspot from './useEtherspot'; interface IEtherspotAssetsHook { getAssets: (chainId?: number, name?: string) => Promise; - getSupportedAssets: (chainId?: number, bridgingProvider?: BridgingProvider) => Promise + getSupportedAssets: ( + chainId?: number, + bridgingProvider?: BridgingProvider + ) => Promise; } /** @@ -23,12 +30,12 @@ const useEtherspotAssets = (chainId?: number): IEtherspotAssetsHook => { }, [chainId, etherspotChainId]); const getAssets = async ( - chainId?: number, - name?: string, + assetBlockchainId?: number, + name?: string ): Promise => { let assets: TokenListToken[] = []; - const assetsChainId = chainId ?? defaultChainId; + const assetsChainId = assetBlockchainId ?? defaultChainId; try { const dataService = getDataService(); @@ -38,36 +45,42 @@ const useEtherspotAssets = (chainId?: number): IEtherspotAssetsHook => { }); } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch Etherspot assets.` - + ` Please try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to fetch Etherspot assets.' + + ' Please try again. Error:', + e ); } return assets; }; - const getSupportedAssets = async (chainId?: number, bridgingProvider?: BridgingProvider): Promise => { + const getSupportedAssets = async ( + supportedAssetBlockchainId?: number, + bridgingProvider?: BridgingProvider + ): Promise => { let supportedAssets: Token[] = []; try { const dataService = getDataService(); - supportedAssets = await dataService.getSupportedAssets({ chainId, provider: bridgingProvider }); + supportedAssets = await dataService.getSupportedAssets({ + chainId: supportedAssetBlockchainId, + provider: bridgingProvider, + }); } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch supported Etherspot assets.` - + ` Please try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to fetch supported Etherspot assets.' + + ' Please try again. Error:', + e ); } return supportedAssets; }; - return ({ + return { getAssets, getSupportedAssets, - }); + }; }; export default useEtherspotAssets; diff --git a/src/hooks/useEtherspotBalances.ts b/src/hooks/useEtherspotBalances.ts index de947e2..2f5a557 100644 --- a/src/hooks/useEtherspotBalances.ts +++ b/src/hooks/useEtherspotBalances.ts @@ -5,7 +5,10 @@ import { useMemo } from 'react'; import useEtherspot from './useEtherspot'; interface IEtherspotBalancesHook { - getAccountBalances: (accountAddress?: string, chainId?: number) => Promise; + getAccountBalances: ( + accountAddress?: string, + chainId?: number + ) => Promise; } /** @@ -23,13 +26,14 @@ const useEtherspotBalances = (chainId?: number): IEtherspotBalancesHook => { const getAccountBalances = async ( accountAddress?: string, - balancesChainId: number = defaultChainId, + balancesChainId: number = defaultChainId ) => { const sdkForChainId = await getSdk(balancesChainId); - const balancesForAccount = accountAddress ?? await sdkForChainId.getCounterFactualAddress(); + const balancesForAccount = + accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!balancesForAccount) { - console.warn(`No account address provided!`); + console.warn('No account address provided!'); return []; } @@ -43,14 +47,14 @@ const useEtherspotBalances = (chainId?: number): IEtherspotBalancesHook => { return items; } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch the balances` - + ` for ${balancesForAccount}. Please try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to fetch the balances' + + ` for ${balancesForAccount}. Please try again. Error:`, + e ); } return []; - } + }; return { getAccountBalances }; }; diff --git a/src/hooks/useEtherspotHistory.ts b/src/hooks/useEtherspotHistory.ts index d689acf..7391722 100644 --- a/src/hooks/useEtherspotHistory.ts +++ b/src/hooks/useEtherspotHistory.ts @@ -1,4 +1,8 @@ -import { BridgingProvider, Transaction, TransactionStatus } from '@etherspot/prime-sdk/dist/sdk/data'; +import { + BridgingProvider, + Transaction, + TransactionStatus, +} from '@etherspot/prime-sdk/dist/sdk/data'; import { useMemo } from 'react'; // hooks @@ -8,8 +12,14 @@ import useEtherspot from './useEtherspot'; import { UserOpTransaction } from '../types/EtherspotTransactionKit'; interface IEtherspotHistoryHook { - getAccountTransactions: (accountAddress?: string, chainId?: number) => Promise; - getAccountTransaction: (hash: string, chainId?: number) => Promise; + getAccountTransactions: ( + accountAddress?: string, + chainId?: number + ) => Promise; + getAccountTransaction: ( + hash: string, + chainId?: number + ) => Promise; getAccountTransactionStatus: ( fromChainId: number, toChainId: number, @@ -39,9 +49,10 @@ const useEtherspotHistory = (chainId?: number): IEtherspotHistoryHook => { let transactions: UserOpTransaction[] = []; - const transactionsForAccount = accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); + const transactionsForAccount = + accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!transactionsForAccount) { - console.warn(`No account address provided!`); + console.warn('No account address provided!'); return []; } @@ -53,8 +64,8 @@ const useEtherspotHistory = (chainId?: number): IEtherspotHistoryHook => { })); } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch the transactions` + - ` for account ${transactionsForAccount}. Please try again. Error:`, + 'Sorry, an error occurred whilst trying to fetch the transactions' + + ` for account ${transactionsForAccount}. Please try again. Error:`, e ); } @@ -68,13 +79,17 @@ const useEtherspotHistory = (chainId?: number): IEtherspotHistoryHook => { ): Promise => { try { const dataService = getDataService(); - return dataService.getTransaction({ hash, chainId: +historyChainId }); + return await dataService.getTransaction({ + hash, + chainId: +historyChainId, + }); } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch the transaction` + - ` for hash ${hash}. Please try again. Error:`, + 'Sorry, an error occurred whilst trying to fetch the transaction' + + ` for hash ${hash}. Please try again. Error:`, e ); + return undefined; } }; @@ -86,15 +101,21 @@ const useEtherspotHistory = (chainId?: number): IEtherspotHistoryHook => { ): Promise => { try { const dataService = getDataService(); - return dataService.getTransactionStatus({ fromChainId, toChainId, transactionHash: hash, provider }); + return await dataService.getTransactionStatus({ + fromChainId, + toChainId, + transactionHash: hash, + provider, + }); } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch the transaction status` + - ` from chain id ${fromChainId}` + - ` to chain id ${toChainId}` + - ` for hash ${hash}. Please try again. Error:`, + 'Sorry, an error occurred whilst trying to fetch the transaction status' + + ` from chain id ${fromChainId}` + + ` to chain id ${toChainId}` + + ` for hash ${hash}. Please try again. Error:`, e ); + return undefined; } }; diff --git a/src/hooks/useEtherspotModules.ts b/src/hooks/useEtherspotModules.ts index abc91af..14fcfcf 100644 --- a/src/hooks/useEtherspotModules.ts +++ b/src/hooks/useEtherspotModules.ts @@ -1,5 +1,5 @@ -import { useMemo } from 'react'; import { ModularSdk } from '@etherspot/modular-sdk'; +import { useMemo } from 'react'; // hooks import useEtherspot from './useEtherspot'; @@ -8,10 +8,31 @@ import useEtherspot from './useEtherspot'; import { MODULE_TYPE, ModuleInfo } from '../types/EtherspotTransactionKit'; interface IEtherspotModulesHook { - installModule: (moduleType: MODULE_TYPE, module: string, initData?: string, accountAddress?: string, modulesChainId?: number) => Promise; - uninstallModule: (moduleType: MODULE_TYPE, module: string, deinitData?: string, accountAddress?: string, modulesChainId?: number) => Promise; - isModuleInstalled: (moduleType: MODULE_TYPE, module: string, accountAddress?: string, modulesChainId?: number) => Promise; - listModules: (pageSize?: number, accountAddress?: string, modulesChainId?: number) => Promise; + installModule: ( + moduleType: MODULE_TYPE, + module: string, + initData?: string, + accountAddress?: string, + modulesChainId?: number + ) => Promise; + uninstallModule: ( + moduleType: MODULE_TYPE, + module: string, + deinitData?: string, + accountAddress?: string, + modulesChainId?: number + ) => Promise; + isModuleInstalled: ( + moduleType: MODULE_TYPE, + module: string, + accountAddress?: string, + modulesChainId?: number + ) => Promise; + listModules: ( + pageSize?: number, + accountAddress?: string, + modulesChainId?: number + ) => Promise; } /** @@ -32,142 +53,170 @@ const useEtherspotModules = (chainId?: number): IEtherspotModulesHook => { module: string, initData?: string, accountAddress?: string, - modulesChainId: number = defaultChainId, + modulesChainId: number = defaultChainId ) => { // this hook can only be used is the sdk is using the modular functionality if (!isModular) { - throw new Error(`The component is not using the modular functionality. Please make sure to use the modular functionality to install and uninstall modules.`); + throw new Error( + 'The component is not using the modular functionality. Please make sure to use the modular functionality to install and uninstall modules.' + ); } - const sdkForChainId = await getSdk(modulesChainId) as ModularSdk; + const sdkForChainId = (await getSdk(modulesChainId)) as ModularSdk; - const modulesForAccount = accountAddress ?? await sdkForChainId.getCounterFactualAddress(); + const modulesForAccount = + accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!modulesForAccount) { - throw new Error(`No account address provided!`); + throw new Error('No account address provided!'); } try { - const getInstallModule = await sdkForChainId.installModule(moduleType, module, initData) - return getInstallModule; + const getInstallModule = await sdkForChainId.installModule( + moduleType, + module, + initData + ); + return getInstallModule; } catch (e) { console.error( - `Sorry, an error occurred whilst trying to install the new module` - + ` ${module}` - + ` for ${modulesForAccount}. Please try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to install the new module' + + ` ${module}` + + ` for ${modulesForAccount}. Please try again. Error:`, + e ); - throw new Error(`Failed to install module: ${e}`) + throw new Error(`Failed to install module: ${e}`); } - } + }; const uninstallModule = async ( moduleType: MODULE_TYPE, module: string, deinitData?: string, accountAddress?: string, - modulesChainId: number = defaultChainId, + modulesChainId: number = defaultChainId ) => { // this hook can only be used is the sdk is using the modular functionality if (!isModular) { - throw new Error(`The component is not using the modular functionality. Please make sure to use the modular functionality to install and uninstall modules.`); + throw new Error( + 'The component is not using the modular functionality. Please make sure to use the modular functionality to install and uninstall modules.' + ); } - const sdkForChainId = await getSdk(modulesChainId) as ModularSdk; + const sdkForChainId = (await getSdk(modulesChainId)) as ModularSdk; - const modulesForAccount = accountAddress ?? await sdkForChainId.getCounterFactualAddress(); + const modulesForAccount = + accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!modulesForAccount) { - throw new Error(`No account address provided!`); + throw new Error('No account address provided!'); } // If no deInitData is passed as an arg, the default should be '0x00' const moduleDeInitData = deinitData ?? '0x00'; try { - // We need to get the deInitData which is mandatory to be able to uninstall a module - const generateDeInitData = await sdkForChainId.generateModuleDeInitData(moduleType, module, moduleDeInitData); + // We need to get the deInitData which is mandatory to be able to uninstall a module + const generateDeInitData = await sdkForChainId.generateModuleDeInitData( + moduleType, + module, + moduleDeInitData + ); - // Once the deInitData has been generated, we can proceed to uninstall the module - const getUninstallModule = await sdkForChainId.uninstallModule(moduleType, module, generateDeInitData); - return getUninstallModule; + // Once the deInitData has been generated, we can proceed to uninstall the module + const getUninstallModule = await sdkForChainId.uninstallModule( + moduleType, + module, + generateDeInitData + ); + return getUninstallModule; } catch (e) { console.error( - `Sorry, an error occurred whilst trying to uninstall the module` - + ` ${module}` - + ` for ${modulesForAccount}. Please try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to uninstall the module' + + ` ${module}` + + ` for ${modulesForAccount}. Please try again. Error:`, + e ); - throw new Error(`Failed to uninstall module: ${e}`) + throw new Error(`Failed to uninstall module: ${e}`); } - } - + }; const listModules = async ( pageSize?: number, accountAddress?: string, - modulesChainId: number = defaultChainId, + modulesChainId: number = defaultChainId ) => { // this hook can only be used is the sdk is using the modular functionality if (!isModular) { - throw new Error(`The component is not using the modular functionality. Please make sure to use the modular functionality to install and uninstall modules.`); + throw new Error( + 'The component is not using the modular functionality. Please make sure to use the modular functionality to install and uninstall modules.' + ); } - const sdkForChainId = await getSdk(modulesChainId) as ModularSdk; + const sdkForChainId = (await getSdk(modulesChainId)) as ModularSdk; - const modulesForAccount = accountAddress ?? await sdkForChainId.getCounterFactualAddress(); + const modulesForAccount = + accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!modulesForAccount) { - throw new Error(`No account address provided!`); + throw new Error('No account address provided!'); } // If no pageSize is passed as an arg, the default should be 50 const modulesListPageSize = pageSize ?? 50; try { - const getAllModules = await sdkForChainId.getAllModules(modulesListPageSize); - return getAllModules; + const getAllModules = + await sdkForChainId.getAllModules(modulesListPageSize); + return getAllModules; } catch (e) { console.error( - `Sorry, an error occurred whilst trying to list all your wallet modules on` - + ` ${modulesForAccount}. Please make sure your account is deployed and try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to list all your wallet modules on' + + ` ${modulesForAccount}. Please make sure your account is deployed and try again. Error:`, + e ); - throw new Error(`Failed to list all modules: ${e}`) + throw new Error(`Failed to list all modules: ${e}`); } - } + }; const isModuleInstalled = async ( moduleType: MODULE_TYPE, module: string, accountAddress?: string, - modulesChainId: number = defaultChainId, + modulesChainId: number = defaultChainId ) => { // this hook can only be used is the sdk is using the modular functionality if (!isModular) { - throw new Error(`The component is not using the modular functionality. Please make sure to use the modular functionality to install and uninstall modules.`); + throw new Error( + 'The component is not using the modular functionality. Please make sure to use the modular functionality to install and uninstall modules.' + ); } - const sdkForChainId = await getSdk(modulesChainId) as ModularSdk; + const sdkForChainId = (await getSdk(modulesChainId)) as ModularSdk; - const modulesForAccount = accountAddress ?? await sdkForChainId.getCounterFactualAddress(); + const modulesForAccount = + accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!modulesForAccount) { - throw new Error(`No account address provided!`); + throw new Error('No account address provided!'); } try { - const getIsModuleInstalled = await sdkForChainId.isModuleInstalled(moduleType, module) - return getIsModuleInstalled; + const getIsModuleInstalled = await sdkForChainId.isModuleInstalled( + moduleType, + module + ); + return getIsModuleInstalled; } catch (e) { console.error( - `Sorry, an error occurred whilst trying to verify if the module` - + ` ${module}` - + ` for ${modulesForAccount} is already installed. Please try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to verify if the module' + + ` ${module}` + + ` for ${modulesForAccount} is already installed. Please try again. Error:`, + e + ); + throw new Error( + `Failed to verify if the module is already installed: ${e}` ); - throw new Error(`Failed to verify if the module is already installed: ${e}`) } - } + }; return { installModule, uninstallModule, isModuleInstalled, listModules }; }; export default useEtherspotModules; - diff --git a/src/hooks/useEtherspotNfts.ts b/src/hooks/useEtherspotNfts.ts index 9b3c7ca..d1ef435 100644 --- a/src/hooks/useEtherspotNfts.ts +++ b/src/hooks/useEtherspotNfts.ts @@ -5,7 +5,10 @@ import { useMemo } from 'react'; import useEtherspot from './useEtherspot'; interface IEtherspotNftsHook { - getAccountNfts: (accountAddress?: string, chainId?: number) => Promise; + getAccountNfts: ( + accountAddress?: string, + chainId?: number + ) => Promise; } /** @@ -23,13 +26,14 @@ const useEtherspotNfts = (chainId?: number): IEtherspotNftsHook => { const getAccountNfts = async ( accountAddress?: string, - nftsChainId: number = defaultChainId, + nftsChainId: number = defaultChainId ) => { const sdkForChainId = await getSdk(nftsChainId); - const nftsForAccount = accountAddress ?? await sdkForChainId.getCounterFactualAddress(); + const nftsForAccount = + accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!nftsForAccount) { - console.warn(`No account address provided!`); + console.warn('No account address provided!'); return []; } @@ -43,14 +47,14 @@ const useEtherspotNfts = (chainId?: number): IEtherspotNftsHook => { return items; } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch account NFTs` - + ` for ${nftsForAccount}. Please try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to fetch account NFTs' + + ` for ${nftsForAccount}. Please try again. Error:`, + e ); } return []; - } + }; return { getAccountNfts }; }; diff --git a/src/hooks/useEtherspotPrices.ts b/src/hooks/useEtherspotPrices.ts index fa8bae1..0cfe9cf 100644 --- a/src/hooks/useEtherspotPrices.ts +++ b/src/hooks/useEtherspotPrices.ts @@ -1,5 +1,5 @@ -import { useMemo } from 'react'; import { RateInfo } from '@etherspot/prime-sdk/dist/sdk/data'; +import { useMemo } from 'react'; // hooks import useEtherspot from './useEtherspot'; @@ -10,8 +10,14 @@ import useEtherspot from './useEtherspot'; * @property getPrice {function} - fetches single asset price from Etherspot */ interface IEtherspotPricesHook { - getPrice: (assetAddress: string, assetChainId?: number) => Promise; - getPrices: (assetAddresses: string[], assetsChainId?: number) => Promise; + getPrice: ( + assetAddress: string, + assetChainId?: number + ) => Promise; + getPrices: ( + assetAddresses: string[], + assetsChainId?: number + ) => Promise; } /** @@ -27,12 +33,10 @@ const useEtherspotPrices = (chainId?: number): IEtherspotPricesHook => { return etherspotChainId; }, [chainId, etherspotChainId]); - const getPrice = async (assetAddress: string, assetChainId: number = defaultChainId) => { - const [price] = await getPrices([assetAddress], +assetChainId); - return price; - } - - const getPrices = async (assetAddresses: string[], assetsChainId: number = defaultChainId) => { + const getPrices = async ( + assetAddresses: string[], + assetsChainId: number = defaultChainId + ) => { try { const dataService = getDataService(); const result = await dataService.fetchExchangeRates({ @@ -42,8 +46,8 @@ const useEtherspotPrices = (chainId?: number): IEtherspotPricesHook => { if (result.errored && result.error) { console.warn( - `Sorry, an error occurred whilst trying to fetch prices from Etherspot.` - + ` Please try again. Error: ${result.error}.` + 'Sorry, an error occurred whilst trying to fetch prices from Etherspot.' + + ` Please try again. Error: ${result.error}.` ); return []; } @@ -51,14 +55,22 @@ const useEtherspotPrices = (chainId?: number): IEtherspotPricesHook => { return result.items; } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch prices from Etherspot.` - + ` Please try again. Error:`, - e, + 'Sorry, an error occurred whilst trying to fetch prices from Etherspot.' + + ' Please try again. Error:', + e ); } return []; - } + }; + + const getPrice = async ( + assetAddress: string, + assetChainId: number = defaultChainId + ) => { + const [price] = await getPrices([assetAddress], +assetChainId); + return price; + }; return { getPrice, getPrices }; }; diff --git a/src/hooks/useEtherspotSwaps.ts b/src/hooks/useEtherspotSwaps.ts index d5b2ecb..ff04f0d 100644 --- a/src/hooks/useEtherspotSwaps.ts +++ b/src/hooks/useEtherspotSwaps.ts @@ -1,10 +1,17 @@ -import { BridgingProvider, Quote, StepTransaction } from '@etherspot/prime-sdk/dist/sdk/data'; +import { + BridgingProvider, + Quote, + StepTransaction, +} from '@etherspot/prime-sdk/dist/sdk/data'; import { Route } from '@lifi/types'; import { BigNumber } from 'ethers'; import { useMemo } from 'react'; // types -import { ICrossChainSwapOffers, ISameChainSwapOffers } from '../types/EtherspotTransactionKit'; +import { + ICrossChainSwapOffers, + ISameChainSwapOffers, +} from '../types/EtherspotTransactionKit'; // hooks import useEtherspot from './useEtherspot'; @@ -22,7 +29,10 @@ interface IEtherspotSwapsHook { toChainId?: number, fromAccountAddress?: string ) => Promise; - prepareCrossChainOfferTransactions: (offer: Route, accountAddress?: string) => Promise; + prepareCrossChainOfferTransactions: ( + offer: Route, + accountAddress?: string + ) => Promise; getQuotes: ( toAddress: string, toChainId: number, @@ -53,9 +63,10 @@ const useEtherspotSwaps = (chainId?: number): IEtherspotSwapsHook => { ): Promise => { const sdkForChainId = await getSdk(swapsChainId); - const forAccount = accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); + const forAccount = + accountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!forAccount) { - console.warn(`No account address provided!`); + console.warn('No account address provided!'); return []; } @@ -68,9 +79,11 @@ const useEtherspotSwaps = (chainId?: number): IEtherspotSwapsHook => { return items; } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch cross-chain offer transactions.` + ` Please try again. Error:`, + 'Sorry, an error occurred whilst trying to fetch cross-chain offer transactions.' + + ' Please try again. Error:', e ); + return []; } }; @@ -84,10 +97,11 @@ const useEtherspotSwaps = (chainId?: number): IEtherspotSwapsHook => { ): Promise => { const sdkForChainId = await getSdk(swapsChainId); - const fromAccount = fromAccountAddress ?? (await sdkForChainId.getCounterFactualAddress()); + const fromAccount = + fromAccountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!fromAccount) { - console.warn(`No account address provided!`); - return; + console.warn('No account address provided!'); + return undefined; } const dataService = getDataService(); @@ -105,15 +119,15 @@ const useEtherspotSwaps = (chainId?: number): IEtherspotSwapsHook => { return { type: 'cross-chain', offers }; } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch cross-chain offers.` + ` Please try again. Error:`, + 'Sorry, an error occurred whilst trying to fetch cross-chain offers.' + + ' Please try again. Error:', e ); } - return; + return undefined; } try { - // @ts-ignore const offers = await dataService.getExchangeOffers({ fromAmount, fromTokenAddress, @@ -124,9 +138,11 @@ const useEtherspotSwaps = (chainId?: number): IEtherspotSwapsHook => { return { type: 'same-chain', offers }; } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch same-chain offers.` + ` Please try again. Error:`, + 'Sorry, an error occurred whilst trying to fetch same-chain offers.' + + ' Please try again. Error:', e ); + return undefined; } }; @@ -142,10 +158,11 @@ const useEtherspotSwaps = (chainId?: number): IEtherspotSwapsHook => { ): Promise => { const sdkForChainId = await getSdk(swapsChainId); - const fromAccount = fromAccountAddress ?? (await sdkForChainId.getCounterFactualAddress()); + const fromAccount = + fromAccountAddress ?? (await sdkForChainId.getCounterFactualAddress()); if (!fromAccount) { - console.warn(`No account address provided!`); - return; + console.warn('No account address provided!'); + return undefined; } const dataService = getDataService(); @@ -165,7 +182,8 @@ const useEtherspotSwaps = (chainId?: number): IEtherspotSwapsHook => { return quotes; } catch (e) { console.warn( - `Sorry, an error occurred whilst trying to fetch cross-chain quotes.` + ` Please try again. Error:`, + 'Sorry, an error occurred whilst trying to fetch cross-chain quotes.' + + ' Please try again. Error:', e ); return []; diff --git a/src/hooks/useEtherspotUtils.ts b/src/hooks/useEtherspotUtils.ts index 2c1c145..62decca 100644 --- a/src/hooks/useEtherspotUtils.ts +++ b/src/hooks/useEtherspotUtils.ts @@ -1,5 +1,5 @@ -import { ethers } from 'ethers'; import { isValidEip1271Signature } from '@etherspot/eip1271-verification-util'; +import { ethers } from 'ethers'; // utils import { addressesEqual } from '../utils/common'; @@ -23,13 +23,12 @@ interface IEtherspotUtilsHook { * @returns {IEtherspotUtilsHook} - utils related to Etherspot and EVM */ const useEtherspotUtils = (): IEtherspotUtilsHook => { - const checksumAddress = (address: string) => { if (!ethers.utils.isAddress(address)) { throw new Error('Invalid address'); } return ethers.utils.getAddress(address.toLowerCase()); - } + }; const verifyEip1271Message = async ( address: string, @@ -37,21 +36,19 @@ const useEtherspotUtils = (): IEtherspotUtilsHook => { signature: string, rpcUrls: string[] ) => { - return isValidEip1271Signature( - rpcUrls, - address, - hash, - signature - ); - } + return isValidEip1271Signature(rpcUrls, address, hash, signature); + }; const toBigNumber = (number: string | number, decimals: number = 18) => { return ethers.utils.parseUnits(`${number}`, decimals); - } + }; - const parseBigNumber = (number: ethers.BigNumberish, decimals: number = 18) => { + const parseBigNumber = ( + number: ethers.BigNumberish, + decimals: number = 18 + ) => { return ethers.utils.formatUnits(number, decimals); - } + }; const isZeroAddress = (address: string) => { const zeroAddresses = [ @@ -62,8 +59,10 @@ const useEtherspotUtils = (): IEtherspotUtilsHook => { '0xDDdDddDdDdddDDddDDddDDDDdDdDDdDDdDDDDDDd', '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF', ]; - return zeroAddresses.some((zeroAddress) => addressesEqual(zeroAddress, address)); - } + return zeroAddresses.some((zeroAddress) => + addressesEqual(zeroAddress, address) + ); + }; return { checksumAddress, diff --git a/src/hooks/useId.ts b/src/hooks/useId.ts index f0bebe1..aeea8fa 100644 --- a/src/hooks/useId.ts +++ b/src/hooks/useId.ts @@ -1,5 +1,5 @@ -import { useMemo } from 'react'; import uniqueId from 'lodash/uniqueId'; +import { useMemo } from 'react'; const useId = () => { return useMemo(() => uniqueId(), []); diff --git a/src/hooks/useWalletAddress.ts b/src/hooks/useWalletAddress.ts index 485d3bf..e4f566d 100644 --- a/src/hooks/useWalletAddress.ts +++ b/src/hooks/useWalletAddress.ts @@ -12,8 +12,13 @@ import useEtherspot from './useEtherspot'; * @param chainId {number} - Chain ID * @returns {string | undefined} - wallet address by its type */ -const useWalletAddress = (walletType: IWalletType = 'etherspot', chainId?: number): string | undefined => { - const [accountAddress, setAccountAddress] = useState<(string | undefined)>(undefined); +const useWalletAddress = ( + walletType: IWalletType = 'etherspot', + chainId?: number +): string | undefined => { + const [accountAddress, setAccountAddress] = useState( + undefined + ); const { getSdk, chainId: defaultChainId, provider } = useEtherspot(); const walletAddressChainId = useMemo(() => { @@ -34,29 +39,40 @@ const useWalletAddress = (walletType: IWalletType = 'etherspot', chainId?: numbe * Currently `etherspotWallet` is marked as private on SDK, let's ignore until SDK team fixes it * Reference – https://github.com/etherspot/etherspot-prime-sdk/blob/master/src/sdk/sdk.ts#L31 */ - // @ts-ignore - newAccountAddress = etherspotModularOrPrimeSdk?.etherspotWallet?.accountAddress; + newAccountAddress = + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + etherspotModularOrPrimeSdk?.etherspotWallet?.accountAddress; } catch (e) { - console.warn(`Unable to get wallet address from SDK state for etherspot type for chainId ID ${walletAddressChainId}.`, e); + console.warn( + `Unable to get wallet address from SDK state for etherspot type for chainId ID ${walletAddressChainId}.`, + e + ); } // if were unable to get wallet address from SDK state, try to get using getCounterFactualAddress if (!newAccountAddress) { try { - newAccountAddress = await etherspotModularOrPrimeSdk.getCounterFactualAddress(); + newAccountAddress = + await etherspotModularOrPrimeSdk.getCounterFactualAddress(); } catch (e) { - console.warn(`Unable to get wallet address for etherspot type for chainId ID ${walletAddressChainId}.`, e); + console.warn( + `Unable to get wallet address for etherspot type for chainId ID ${walletAddressChainId}.`, + e + ); } } if (!newAccountAddress || !shouldUpdate) return; setAccountAddress(newAccountAddress); - } + }; updateAccountAddress(); - return () => { shouldUpdate = false; } + return () => { + shouldUpdate = false; + }; }, [getSdk, walletAddressChainId]); return useMemo(() => { @@ -65,13 +81,15 @@ const useWalletAddress = (walletType: IWalletType = 'etherspot', chainId?: numbe } if (walletType === 'provider') { - // @ts-ignore + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error const providerAddress = provider?.address || provider?.accounts?.[0]; if (providerAddress) return providerAddress; - console.warn(`Unable to get wallet address for provider type`); + console.warn('Unable to get wallet address for provider type'); } return undefined; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [accountAddress, walletType]); }; diff --git a/src/index.ts b/src/index.ts index dd1df53..95cb704 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ import { Buffer as ImportedBuffer } from 'buffer'; -if (typeof window !== 'undefined') window.Buffer = window.Buffer ?? ImportedBuffer; +if (typeof window !== 'undefined') + window.Buffer = window.Buffer ?? ImportedBuffer; export { default as EtherspotApprovalTransaction } from './components/EtherspotApprovalTransaction'; export { default as EtherspotBatch } from './components/EtherspotBatch'; @@ -10,18 +11,16 @@ export { default as EtherspotTokenTransferTransaction } from './components/Ether export { default as EtherspotTransaction } from './components/EtherspotTransaction'; export { default as EtherspotTransactionKit } from './components/EtherspotTransactionKit'; export { default as ProviderWalletTransaction } from './components/ProviderWalletTransaction'; -export { default as useEtherspotBalances } from './hooks/useEtherspotBalances'; +export { default as useEtherspot } from './hooks/useEtherspot'; export { default as useEtherspotAssets } from './hooks/useEtherspotAssets'; +export { default as useEtherspotBalances } from './hooks/useEtherspotBalances'; export { default as useEtherspotHistory } from './hooks/useEtherspotHistory'; -export { default as useEtherspotTransactions } from './hooks/useEtherspotTransactions'; +export { default as useEtherspotModules } from './hooks/useEtherspotModules'; export { default as useEtherspotNfts } from './hooks/useEtherspotNfts'; -export { default as useEtherspotUtils } from './hooks/useEtherspotUtils'; -export { default as useProviderWalletTransaction } from './hooks/useProviderWalletTransaction'; export { default as useEtherspotPrices } from './hooks/useEtherspotPrices'; export { default as useEtherspotSwaps } from './hooks/useEtherspotSwaps'; +export { default as useEtherspotTransactions } from './hooks/useEtherspotTransactions'; +export { default as useEtherspotUtils } from './hooks/useEtherspotUtils'; +export { default as useProviderWalletTransaction } from './hooks/useProviderWalletTransaction'; export { default as useWalletAddress } from './hooks/useWalletAddress'; -export { default as useEtherspot } from './hooks/useEtherspot'; -export { default as useEtherspotModules } from './hooks/useEtherspotModules'; export * from './types/EtherspotTransactionKit'; - - diff --git a/src/providers/EtherspotContextProvider.tsx b/src/providers/EtherspotContextProvider.tsx index 2c441bf..7fa0323 100644 --- a/src/providers/EtherspotContextProvider.tsx +++ b/src/providers/EtherspotContextProvider.tsx @@ -1,12 +1,22 @@ +/* eslint-disable react/jsx-no-constructed-context-values */ import { + EtherspotBundler as EtherspotBundlerModular, + Factory as ModularFactory, + ModularSdk, + WalletProviderLike as WalletProviderLikeModular, + Web3WalletProvider as Web3WalletModularProvider, + isWalletProvider as isWalletProviderModular, +} from '@etherspot/modular-sdk'; +import { + DataUtils, + EtherspotBundler, + Factory, PrimeSdk, WalletProviderLike, - isWalletProvider, - Factory, Web3WalletProvider, - DataUtils, - EtherspotBundler, + isWalletProvider, } from '@etherspot/prime-sdk'; +import isEqual from 'lodash/isEqual'; import React, { ReactNode, useCallback, @@ -14,8 +24,6 @@ import React, { useEffect, useMemo, } from 'react'; -import isEqual from 'lodash/isEqual'; -import { ModularSdk, WalletProviderLike as WalletProviderLikeModular, isWalletProvider as isWalletProviderModular, Web3WalletProvider as Web3WalletModularProvider, EtherspotBundler as EtherspotBundlerModular, Factory as ModularFactory } from '@etherspot/modular-sdk'; // contexts import EtherspotContext from '../contexts/EtherspotContext'; @@ -29,7 +37,9 @@ let prevAccountTemplate: AccountTemplate | undefined; let dataService: DataUtils; -let sdkPerChainModular: { [chainId: number]: ModularSdk | Promise } = {}; +let sdkPerChainModular: { + [chainId: number]: ModularSdk | Promise; +} = {}; let prevProviderModular: WalletProviderLikeModular; const EtherspotContextProvider = ({ @@ -52,7 +62,7 @@ const EtherspotContextProvider = ({ const context = useContext(EtherspotContext); if (context !== null) { - throw new Error(' has already been declared.') + throw new Error(' has already been declared.'); } useEffect(() => { @@ -60,117 +70,152 @@ const EtherspotContextProvider = ({ // reset on unmount sdkPerChain = {}; sdkPerChainModular = {}; - } + }; }, []); - const getSdk = useCallback(async (sdkChainId: number = chainId, forceNewInstance: boolean = false) => { - if (isModular) { - - const accountTemplateOrProviderChanged = (prevProvider && !isEqual(prevProviderModular, provider as WalletProviderLikeModular)) - || (prevAccountTemplate && prevAccountTemplate !== accountTemplate); - - if (sdkPerChainModular[sdkChainId] && !forceNewInstance && !accountTemplateOrProviderChanged) { - return sdkPerChainModular[sdkChainId]; - } - - sdkPerChainModular[sdkChainId] = (async () => { - let mappedProvider; - - if (!isWalletProviderModular(provider as WalletProviderLikeModular)) { - try { - // @ts-ignore - mappedProvider = new Web3WalletModularProvider(provider as WalletProviderLikeModular); - await mappedProvider.refresh(); - } catch (e) { - // no need to log, this is an attempt - } - - if (!mappedProvider) { - throw new Error('Invalid provider!'); + const getSdk = useCallback( + async (sdkChainId: number = chainId, forceNewInstance: boolean = false) => { + if (isModular) { + const accountTemplateOrProviderChanged = + (prevProvider && + !isEqual( + prevProviderModular, + provider as WalletProviderLikeModular + )) || + (prevAccountTemplate && prevAccountTemplate !== accountTemplate); + + if ( + sdkPerChainModular[sdkChainId] && + !forceNewInstance && + !accountTemplateOrProviderChanged + ) { + return sdkPerChainModular[sdkChainId]; } - } - - const etherspotModularSdk = new ModularSdk(mappedProvider as Web3WalletModularProvider ?? provider as WalletProviderLikeModular, { - chainId: +sdkChainId, - bundlerProvider: new EtherspotBundlerModular(+sdkChainId, bundlerApiKey ?? ('__ETHERSPOT_BUNDLER_API_KEY__' || undefined)), - factoryWallet: accountTemplate as ModularFactory, - }); - - // load the address into SDK state - await etherspotModularSdk.getCounterFactualAddress(); - - prevProviderModular = provider as WalletProviderLikeModular; - prevAccountTemplate = accountTemplate; - return etherspotModularSdk; - })(); + sdkPerChainModular[sdkChainId] = (async () => { + let mappedProvider; + + if (!isWalletProviderModular(provider as WalletProviderLikeModular)) { + try { + mappedProvider = new Web3WalletModularProvider( + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + provider as WalletProviderLikeModular + ); + await mappedProvider.refresh(); + } catch (e) { + // no need to log, this is an attempt + } + + if (!mappedProvider) { + throw new Error('Invalid provider!'); + } + } + + const etherspotModularSdk = new ModularSdk( + (mappedProvider as Web3WalletModularProvider) ?? + (provider as WalletProviderLikeModular), + { + chainId: +sdkChainId, + bundlerProvider: new EtherspotBundlerModular( + +sdkChainId, + bundlerApiKey ?? ('__ETHERSPOT_BUNDLER_API_KEY__' || undefined) + ), + factoryWallet: accountTemplate as ModularFactory, + } + ); + + // load the address into SDK state + await etherspotModularSdk.getCounterFactualAddress(); + + prevProviderModular = provider as WalletProviderLikeModular; + prevAccountTemplate = accountTemplate; + + return etherspotModularSdk; + })(); - return sdkPerChainModular[sdkChainId]; - - } else { + return sdkPerChainModular[sdkChainId]; + } - const accountTemplateOrProviderChanged = (prevProvider && !isEqual(prevProvider, provider as WalletProviderLike)) - || (prevAccountTemplate && prevAccountTemplate !== accountTemplate); + const accountTemplateOrProviderChanged = + (prevProvider && + !isEqual(prevProvider, provider as WalletProviderLike)) || + (prevAccountTemplate && prevAccountTemplate !== accountTemplate); - if (sdkPerChain[sdkChainId] && !forceNewInstance && !accountTemplateOrProviderChanged) { + if ( + sdkPerChain[sdkChainId] && + !forceNewInstance && + !accountTemplateOrProviderChanged + ) { return sdkPerChain[sdkChainId]; } sdkPerChain[sdkChainId] = (async () => { - let mappedProvider; - - if (!isWalletProvider(provider as WalletProviderLike)) { - try { - // @ts-ignore - mappedProvider = new Web3WalletProvider(provider as WalletProviderLike); - await mappedProvider.refresh(); - } catch (e) { - // no need to log, this is an attempt + let mappedProvider; + + if (!isWalletProvider(provider as WalletProviderLike)) { + try { + mappedProvider = new Web3WalletProvider( + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + provider as WalletProviderLike + ); + await mappedProvider.refresh(); + } catch (e) { + // no need to log, this is an attempt + } + + if (!mappedProvider) { + throw new Error('Invalid provider!'); + } } - if (!mappedProvider) { - throw new Error('Invalid provider!'); - } - } - - const etherspotPrimeSdk = new PrimeSdk(mappedProvider as Web3WalletProvider ?? provider as WalletProviderLike, { - chainId: +sdkChainId, - bundlerProvider: new EtherspotBundler(+sdkChainId, bundlerApiKey ?? ('__ETHERSPOT_BUNDLER_API_KEY__' || undefined)), - factoryWallet: accountTemplate as Factory, - }); - - // load the address into SDK state - await etherspotPrimeSdk.getCounterFactualAddress(); - - prevProvider = provider as WalletProviderLike; - prevAccountTemplate = accountTemplate; - - return etherspotPrimeSdk; - })(); - - return sdkPerChain[sdkChainId]; - } - }, [provider, chainId, accountTemplate, bundlerApiKey]); + const etherspotPrimeSdk = new PrimeSdk( + (mappedProvider as Web3WalletProvider) ?? + (provider as WalletProviderLike), + { + chainId: +sdkChainId, + bundlerProvider: new EtherspotBundler( + +sdkChainId, + bundlerApiKey ?? ('__ETHERSPOT_BUNDLER_API_KEY__' || undefined) + ), + factoryWallet: accountTemplate as Factory, + } + ); + + // load the address into SDK state + await etherspotPrimeSdk.getCounterFactualAddress(); + + prevProvider = provider as WalletProviderLike; + prevAccountTemplate = accountTemplate; + + return etherspotPrimeSdk; + })(); + + return sdkPerChain[sdkChainId]; + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [provider, chainId, accountTemplate, bundlerApiKey] + ); const getDataService = useCallback(() => { if (dataService) return dataService; - dataService = new DataUtils(dataApiKey ?? ('__ETHERSPOT_DATA_API_KEY__' || undefined)); + dataService = new DataUtils( + dataApiKey ?? ('__ETHERSPOT_DATA_API_KEY__' || undefined) + ); return dataService; }, [dataApiKey]); - const contextData = useMemo(() => ({ - getSdk, - getDataService, - provider, - chainId, - isModular, - }), [ - getSdk, - getDataService, - provider, - chainId, - isModular, - ]); + const contextData = useMemo( + () => ({ + getSdk, + getDataService, + provider, + chainId, + isModular, + }), + [getSdk, getDataService, provider, chainId, isModular] + ); return ( diff --git a/src/providers/EtherspotTransactionKitContextProvider.tsx b/src/providers/EtherspotTransactionKitContextProvider.tsx index b1012c7..e14c9cf 100644 --- a/src/providers/EtherspotTransactionKitContextProvider.tsx +++ b/src/providers/EtherspotTransactionKitContextProvider.tsx @@ -1,5 +1,9 @@ -import React, { useMemo, useState } from 'react'; +/* eslint-disable react/jsx-no-constructed-context-values */ +/* eslint-disable no-continue */ +/* eslint-disable no-await-in-loop */ +/* eslint-disable no-restricted-syntax */ import { BigNumber } from 'ethers'; +import React, { useMemo, useState } from 'react'; // contexts import EtherspotTransactionKitContext from '../contexts/EtherspotTransactionKitContext'; @@ -11,180 +15,261 @@ import { getObjectSortedByKeys } from '../utils/common'; import useEtherspot from '../hooks/useEtherspot'; // types -import { EstimatedBatch, IBatch, IBatches, IEstimatedBatches, ISentBatches, SentBatch } from '../types/EtherspotTransactionKit'; +import { + EstimatedBatch, + IBatch, + IBatches, + IEstimatedBatches, + ISentBatches, + SentBatch, +} from '../types/EtherspotTransactionKit'; import { TypePerId } from '../types/Helper'; interface EtherspotTransactionKitContextProviderProps { children?: React.ReactNode; } -const parseEtherspotErrorMessage = (e: Error | unknown, defaultMessage: string ): string => { - return (e instanceof Error && e.message) - || defaultMessage; -} +const parseEtherspotErrorMessage = ( + e: Error | unknown, + defaultMessage: string +): string => { + return (e instanceof Error && e.message) || defaultMessage; +}; -const EtherspotTransactionKitContextProvider = ({ children }: EtherspotTransactionKitContextProviderProps) => { +const EtherspotTransactionKitContextProvider = ({ + children, +}: EtherspotTransactionKitContextProviderProps) => { const { provider, chainId, getSdk } = useEtherspot(); - const [groupedBatchesPerId, setGroupedBatchesPerId] = useState>({}); + const [groupedBatchesPerId, setGroupedBatchesPerId] = useState< + TypePerId + >({}); const [isEstimating, setIsEstimating] = useState(false); const [isSending, setIsSending] = useState(false); - const [containsSendingError, setContainsSendingError] = useState(false); - const [containsEstimatingError, setContainsEstimatingError] = useState(false); + const [containsSendingError, setContainsSendingError] = + useState(false); + const [containsEstimatingError, setContainsEstimatingError] = + useState(false); const estimate = async ( batchesIds?: string[], - forSending: boolean = false, + forSending: boolean = false ): Promise => { if (!forSending) { setIsEstimating(true); setContainsSendingError(false); } - const groupedBatchesToEstimate = Object.values(groupedBatchesPerId) - .filter((groupedBatch) => (!batchesIds?.length|| batchesIds.some((batchesId) => batchesId === groupedBatch.id))); - - const result = await Promise.all(groupedBatchesToEstimate.map(async (groupedBatch): Promise => { - const batches = (groupedBatch.batches ?? []) as IBatch[]; - - if (groupedBatch.skip) return { ...groupedBatch, estimatedBatches: [] }; - - const estimatedBatches: EstimatedBatch[] = []; - - // push estimations in same order - for (const batch of batches) { - if (!provider) { - estimatedBatches.push({ ...batch, errorMessage: 'Failed to get Web3 provider!' }); - continue; - } - - const batchChainId = batch.chainId ?? chainId; - - if (!batch.transactions) { - estimatedBatches.push({ ...batch, errorMessage: 'No transactions to estimate!' }); - continue; - } - - // force new instance for each batch to not mix up user ops added to SDK state batch - const etherspotModularOrPrimeSdk = await getSdk(batchChainId, true); - - try { - if (!forSending) await etherspotModularOrPrimeSdk.clearUserOpsFromBatch(); - - await Promise.all(batch.transactions.map(async ({ to, value, data }) => { - await etherspotModularOrPrimeSdk.addUserOpsToBatch(({ to, value, data })); - })); - - const userOp = await etherspotModularOrPrimeSdk.estimate({ paymasterDetails: groupedBatch.paymaster }); - const totalGas = await etherspotModularOrPrimeSdk.totalGasEstimated(userOp); - estimatedBatches.push({ ...batch, cost: totalGas.mul(userOp.maxFeePerGas as BigNumber), userOp }); - } catch (e) { - const errorMessage = parseEtherspotErrorMessage(e, 'Failed to estimate!'); - estimatedBatches.push({ ...batch, errorMessage }); + const groupedBatchesToEstimate = Object.values( + groupedBatchesPerId + ).filter( + (groupedBatch) => + !batchesIds?.length || + batchesIds.some((batchesId) => batchesId === groupedBatch.id) + ); + + const result = await Promise.all( + groupedBatchesToEstimate.map( + async (groupedBatch): Promise => { + const batches = (groupedBatch.batches ?? []) as IBatch[]; + + if (groupedBatch.skip) + return { ...groupedBatch, estimatedBatches: [] }; + + const estimatedBatches: EstimatedBatch[] = []; + + // push estimations in same order + for (const batch of batches) { + if (!provider) { + estimatedBatches.push({ + ...batch, + errorMessage: 'Failed to get Web3 provider!', + }); + continue; + } + + const batchChainId = batch.chainId ?? chainId; + + if (!batch.transactions) { + estimatedBatches.push({ + ...batch, + errorMessage: 'No transactions to estimate!', + }); + continue; + } + + // force new instance for each batch to not mix up user ops added to SDK state batch + const etherspotModularOrPrimeSdk = await getSdk(batchChainId, true); + + try { + if (!forSending) + await etherspotModularOrPrimeSdk.clearUserOpsFromBatch(); + + await Promise.all( + batch.transactions.map(async ({ to, value, data }) => { + await etherspotModularOrPrimeSdk.addUserOpsToBatch({ + to, + value, + data, + }); + }) + ); + + const userOp = await etherspotModularOrPrimeSdk.estimate({ + paymasterDetails: groupedBatch.paymaster, + }); + const totalGas = + await etherspotModularOrPrimeSdk.totalGasEstimated(userOp); + estimatedBatches.push({ + ...batch, + cost: totalGas.mul(userOp.maxFeePerGas as BigNumber), + userOp, + }); + } catch (e) { + const errorMessage = parseEtherspotErrorMessage( + e, + 'Failed to estimate!' + ); + estimatedBatches.push({ ...batch, errorMessage }); + } + } + + if (groupedBatch.onEstimated && !forSending) + groupedBatch.onEstimated(estimatedBatches); + + return { ...groupedBatch, estimatedBatches }; } - } - - if (groupedBatch.onEstimated && !forSending) groupedBatch.onEstimated(estimatedBatches); - - return { ...groupedBatch, estimatedBatches }; - })); + ) + ); if (!forSending) { - const containsError = result.some((group) => group.estimatedBatches.some((batch) => !!batch.errorMessage)); + const containsError = result.some((group) => + group.estimatedBatches.some((batch) => !!batch.errorMessage) + ); setContainsEstimatingError(containsError); setIsEstimating(false); } return result; - } + }; const send = async (batchesIds?: string[]): Promise => { setIsSending(true); setContainsSendingError(false); - const groupedBatchesToClean = Object.values(groupedBatchesPerId) - .filter((groupedBatch) => (!batchesIds?.length|| batchesIds.some((batchesId) => batchesId === groupedBatch.id))); + const groupedBatchesToClean = Object.values( + groupedBatchesPerId + ).filter( + (groupedBatch) => + !batchesIds?.length || + batchesIds.some((batchesId) => batchesId === groupedBatch.id) + ); // clear any existing batches before new estimate & send - await Promise.all(groupedBatchesToClean.map(async ({ - batches = [], - }) => Promise.all(batches.map(async (batch) => { - const batchChainId = batch.chainId ?? chainId; + await Promise.all( + groupedBatchesToClean.map(async ({ batches = [] }) => + Promise.all( + batches.map(async (batch) => { + const batchChainId = batch.chainId ?? chainId; - const etherspotModularOrPrimeSdk = await getSdk(batchChainId); + const etherspotModularOrPrimeSdk = await getSdk(batchChainId); - await etherspotModularOrPrimeSdk.clearUserOpsFromBatch(); - })))); + await etherspotModularOrPrimeSdk.clearUserOpsFromBatch(); + }) + ) + ) + ); const estimated = await estimate(batchesIds, true); - const result = await Promise.all(estimated.map(async (estimatedBatches): Promise => { - const sentBatches: SentBatch[] = []; - - // send in same order as estimated - for (const estimatedBatch of estimatedBatches.estimatedBatches) { - const batchChainId = estimatedBatch.chainId ?? chainId - - // return error message as provided by estimate - if (estimatedBatch.errorMessage) { - sentBatches.push({ ...estimatedBatch, errorMessage: estimatedBatch.errorMessage }); - continue; + const result = await Promise.all( + estimated.map(async (estimatedBatches): Promise => { + const sentBatches: SentBatch[] = []; + + // send in same order as estimated + for (const estimatedBatch of estimatedBatches.estimatedBatches) { + const batchChainId = estimatedBatch.chainId ?? chainId; + + // return error message as provided by estimate + if (estimatedBatch.errorMessage) { + sentBatches.push({ + ...estimatedBatch, + errorMessage: estimatedBatch.errorMessage, + }); + continue; + } + + const etherspotModularOrPrimeSdk = await getSdk(batchChainId); + + if (!estimatedBatch.userOp) { + sentBatches.push({ + ...estimatedBatch, + errorMessage: 'Failed to get estimated UserOp!', + }); + continue; + } + + try { + const userOpHash = await etherspotModularOrPrimeSdk.send( + estimatedBatch.userOp + ); + sentBatches.push({ ...estimatedBatch, userOpHash }); + } catch (e) { + const errorMessage = parseEtherspotErrorMessage( + e, + 'Failed to send!' + ); + sentBatches.push({ ...estimatedBatch, errorMessage }); + } } - const etherspotModularOrPrimeSdk = await getSdk(batchChainId); + if (estimatedBatches.onSent) estimatedBatches.onSent(sentBatches); - if (!estimatedBatch.userOp) { - sentBatches.push({ ...estimatedBatch, errorMessage: 'Failed to get estimated UserOp!' }); - continue; - } - - try { - const userOpHash = await etherspotModularOrPrimeSdk.send(estimatedBatch.userOp); - sentBatches.push({ ...estimatedBatch, userOpHash }); - } catch (e) { - const errorMessage = parseEtherspotErrorMessage(e, 'Failed to send!'); - sentBatches.push({ ...estimatedBatch, errorMessage }); - } - } - - if (estimatedBatches.onSent) estimatedBatches.onSent(sentBatches); - - return { ...estimatedBatches, sentBatches }; - })); + return { ...estimatedBatches, sentBatches }; + }) + ); const containsError = result.some((group) => { - return group.estimatedBatches.some((batch) => !!batch.errorMessage) // estimate error during sending - || group.sentBatches.some((batch) => !!batch.errorMessage); + return ( + group.estimatedBatches.some((batch) => !!batch.errorMessage) || // estimate error during sending + group.sentBatches.some((batch) => !!batch.errorMessage) + ); }); setContainsSendingError(containsError); setIsSending(false); return result; - } - - const contextData = useMemo(() => ({ - batches: getObjectSortedByKeys(groupedBatchesPerId), - estimate, - send, - chainId, - isEstimating, - isSending, - containsEstimatingError, - containsSendingError, - }), [ - chainId, - groupedBatchesPerId, - isEstimating, - isSending, - containsEstimatingError, - containsSendingError, - ]); + }; + + const contextData = useMemo( + () => ({ + batches: getObjectSortedByKeys(groupedBatchesPerId), + estimate, + send, + chainId, + isEstimating, + isSending, + containsEstimatingError, + containsSendingError, + }), + // eslint-disable-next-line react-hooks/exhaustive-deps + [ + chainId, + groupedBatchesPerId, + isEstimating, + isSending, + containsEstimatingError, + containsSendingError, + ] + ); return ( - + {children} ); -} +}; export default EtherspotTransactionKitContextProvider; diff --git a/src/providers/ProviderWalletContextProvider.tsx b/src/providers/ProviderWalletContextProvider.tsx index cf0e1ea..7e6686e 100644 --- a/src/providers/ProviderWalletContextProvider.tsx +++ b/src/providers/ProviderWalletContextProvider.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/jsx-no-constructed-context-values */ import React, { useMemo, useState } from 'react'; // contexts @@ -20,11 +21,18 @@ interface ProviderWalletContextProviderProps { children?: React.ReactNode; } -const ProviderWalletContextProvider = ({ children }: ProviderWalletContextProviderProps) => { - const [transactionById, setTransactionById] = useState<{ [id: string]: IProviderWalletTransaction | undefined }>({}); +const ProviderWalletContextProvider = ({ + children, +}: ProviderWalletContextProviderProps) => { + const [transactionById, setTransactionById] = useState<{ + [id: string]: IProviderWalletTransaction | undefined; + }>({}); const { provider, chainId } = useEtherspot(); - const transaction = useMemo(() => Object.values(transactionById)[0], [transactionById]); + const transaction = useMemo( + () => Object.values(transactionById)[0], + [transactionById] + ); const estimate = async (): Promise => { if (!provider) { @@ -35,57 +43,72 @@ const ProviderWalletContextProvider = ({ children }: ProviderWalletContextProvid return { errorMessage: 'No transaction' }; } - const result = await switchWalletProviderToChain(transaction.chainId ?? chainId); + const result = await switchWalletProviderToChain( + transaction.chainId ?? chainId + ); if (result?.errorMessage) { return { errorMessage: result.errorMessage }; } try { - // @ts-ignore - const gasCost = await web3Provider.sendRequest('eth_estimateGas', [transaction]); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + const gasCost = await web3Provider.sendRequest('eth_estimateGas', [ + transaction, + ]); return { gasCost }; } catch (e) { console.warn('Failed to estimate gas', transaction, e); - const errorMessage = e instanceof Error && e?.message ? e.message : 'Unknown reason'; - return { errorMessage } + const errorMessage = + e instanceof Error && e?.message ? e.message : 'Unknown reason'; + return { errorMessage }; } - } + }; const send = async (): Promise => { if (!transaction) { return { errorMessage: 'No transaction' }; } - const result = await switchWalletProviderToChain(transaction.chainId ?? chainId); + const result = await switchWalletProviderToChain( + transaction.chainId ?? chainId + ); if (result?.errorMessage) { return { errorMessage: result.errorMessage }; } try { - // @ts-ignore + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error const signer = web3Provider.getSigner(); - const { hash: transactionHash } = await signer.sendTransaction(transaction); + const { hash: transactionHash } = + await signer.sendTransaction(transaction); return { transactionHash }; } catch (e) { console.warn('Failed to send transaction', transaction, e); - const errorMessage = e instanceof Error && e?.message ? e.message : 'Unknown reason'; - return { errorMessage } + const errorMessage = + e instanceof Error && e?.message ? e.message : 'Unknown reason'; + return { errorMessage }; } - } - - const contextData = useMemo(() => ({ - transaction, - estimate, - send, - }), [ - transaction, - ]); + }; + + const contextData = useMemo( + () => ({ + transaction, + estimate, + send, + }), + // eslint-disable-next-line react-hooks/exhaustive-deps + [transaction] + ); return ( - + {children} ); -} +}; export default ProviderWalletContextProvider; diff --git a/src/types/EtherspotTransactionKit.ts b/src/types/EtherspotTransactionKit.ts index 390d939..fc08280 100644 --- a/src/types/EtherspotTransactionKit.ts +++ b/src/types/EtherspotTransactionKit.ts @@ -1,10 +1,10 @@ -import { Fragment, JsonFragment } from '@ethersproject/abi'; -import { BigNumber, BigNumberish, BytesLike } from 'ethers'; -import { Route } from '@lifi/types'; +import { PaymasterApi as PaymasterApiModular } from '@etherspot/modular-sdk'; import { PaymasterApi } from '@etherspot/prime-sdk'; import { ExchangeOffer } from '@etherspot/prime-sdk/dist/sdk/data'; import { TransactionStatuses } from '@etherspot/prime-sdk/dist/sdk/data/constants'; -import { PaymasterApi as PaymasterApiModular } from '@etherspot/modular-sdk'; +import { Fragment, JsonFragment } from '@ethersproject/abi'; +import { Route } from '@lifi/types'; +import { BigNumber, BigNumberish, BytesLike } from 'ethers'; export interface ITransaction { id?: string; @@ -44,16 +44,16 @@ export interface IBatches { onEstimated?: (estimated: EstimatedBatch[]) => void; onSent?: (sent: SentBatch[]) => void; skip?: boolean; - paymaster?: PaymasterApi | PaymasterApiModular, + paymaster?: PaymasterApi | PaymasterApiModular; } export type IEstimatedBatches = IBatches & { estimatedBatches: EstimatedBatch[]; -} +}; export type ISentBatches = IEstimatedBatches & { sentBatches: SentBatch[]; -} +}; export interface IEtherspotContractTransaction { id?: string; @@ -82,12 +82,12 @@ export interface IEtherspotApprovalTransaction { export interface ISameChainSwapOffers { type: 'same-chain'; - offers: ExchangeOffer[], + offers: ExchangeOffer[]; } export interface ICrossChainSwapOffers { type: 'cross-chain'; - offers: Route[], + offers: Route[]; } export interface IProviderWalletTransactionEstimated { @@ -183,13 +183,18 @@ export interface UserOpTransaction { nftTransfers?: EtherspotNftTransfersEntity[]; } -export type AccountTemplate = 'etherspot' | 'etherspotModular' | 'zeroDev' | 'simpleAccount'; +export type AccountTemplate = + | 'etherspot' + | 'etherspotModular' + | 'zeroDev' + | 'simpleAccount'; +// eslint-disable-next-line @typescript-eslint/naming-convention export enum MODULE_TYPE { - VALIDATOR = "0x01", - EXECUTOR = "0x02", - FALLBACK = "0x03", - HOOK = "0x04" + VALIDATOR = '0x01', + EXECUTOR = '0x02', + FALLBACK = '0x03', + HOOK = '0x04', } export type ModuleInfo = { @@ -202,4 +207,4 @@ export type ModuleInfo = { export type FallbackInfo = { selector: string; handlerAddress: string; -}; \ No newline at end of file +}; diff --git a/src/types/Helper.ts b/src/types/Helper.ts index 29c2547..02276b0 100644 --- a/src/types/Helper.ts +++ b/src/types/Helper.ts @@ -1 +1,3 @@ -export interface TypePerId { [id: string]: T } +export interface TypePerId { + [id: string]: T; +} diff --git a/src/utils/common.ts b/src/utils/common.ts index 4a77cec..5ec0267 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -1,28 +1,35 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { ethers } from 'ethers'; import sortBy from 'lodash/sortBy'; // types import { TypePerId } from '../types/Helper'; -export const getObjectSortedByKeys = ( - object: TypePerId, -) => sortBy(Object.keys(object).map((key) => +key)).map((key) => object[key]); +export const getObjectSortedByKeys = (object: TypePerId) => + sortBy(Object.keys(object).map((key) => +key)).map((key) => object[key]); -export const isCaseInsensitiveMatch = (a: string | undefined, b: string | undefined): boolean => { +export const isCaseInsensitiveMatch = ( + a: string | undefined, + b: string | undefined +): boolean => { if (a === b) return true; if (!a || !b) return false; return a.toLowerCase() === b.toLowerCase(); }; -export const addressesEqual = (address1: string | undefined | null, address2: string | undefined | null): boolean => { +export const addressesEqual = ( + address1: string | undefined | null, + address2: string | undefined | null +): boolean => { if (address1 === address2) return true; if (!address1 || !address2) return false; return isCaseInsensitiveMatch(address1, address2); }; -export const switchWalletProviderToChain = async (chainId: number): Promise<{ errorMessage?: string }> => { - // @ts-ignore +export const switchWalletProviderToChain = async ( + chainId: number +): Promise<{ errorMessage?: string }> => { if (!window?.ethereum) { console.warn('Unsupported browser!'); return { errorMessage: 'Unsupported browser!' }; @@ -39,4 +46,3 @@ export const switchWalletProviderToChain = async (chainId: number): Promise<{ er return { errorMessage: 'Failed to switch chain!' }; }; - diff --git a/tsconfig.json b/tsconfig.json index 6915791..a673a5e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ @@ -25,7 +25,7 @@ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ -// "module": "commonjs", /* Specify what module code is generated. */ + // "module": "commonjs", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ @@ -71,12 +71,12 @@ /* Interop Constraints */ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ // "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ @@ -98,7 +98,7 @@ /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true, /* Skip type checking all .d.ts files. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */, /* Added */ "jsx": "react",