diff --git a/packages/core/package.json b/packages/core/package.json index c2fb4c0a66..a529ac11fd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -59,6 +59,7 @@ ] }, "dependencies": { + "@airgap/beacon-wallet": "^4.2.2", "@taquito/rpc": "^20.0.1", "@taquito/signer": "^20.0.1", "@taquito/taquito": "^20.0.1", diff --git a/packages/core/src/beaconUtils.test.ts b/packages/core/src/beaconUtils.test.ts new file mode 100644 index 0000000000..a0b3ee3dce --- /dev/null +++ b/packages/core/src/beaconUtils.test.ts @@ -0,0 +1,176 @@ +import { type PartialTezosOperation, TezosOperationType } from "@airgap/beacon-wallet"; +import { mockContractAddress, mockImplicitAddress } from "@umami/tezos"; +import { without } from "lodash"; + +import { makeAccountOperations } from "./AccountOperations"; +import { partialOperationToOperation, toAccountOperations } from "./beaconUtils"; +import { mockImplicitAccount, mockTezOperation } from "./testUtils"; + +const account = mockImplicitAccount(1); + +describe("toAccountOperations", () => { + it("throws if the list is empty", () => { + expect(() => toAccountOperations([], account)).toThrow("Empty operation details!"); + }); + + it("converts a list of partial operations to ImplicitOperations", () => { + const operationDetails: PartialTezosOperation[] = [ + { + kind: TezosOperationType.TRANSACTION, + amount: "1", + destination: mockImplicitAddress(2).pkh, + }, + { + kind: TezosOperationType.TRANSACTION, + amount: "2", + destination: mockImplicitAddress(2).pkh, + }, + ]; + + const operations = toAccountOperations(operationDetails, account); + + expect(operations).toEqual( + makeAccountOperations(account, account, [ + { type: "tez", amount: "1", recipient: mockImplicitAddress(2) }, + { type: "tez", amount: "2", recipient: mockImplicitAddress(2) }, + ]) + ); + }); +}); + +describe("partialOperationToOperation", () => { + describe.each( + without( + Object.values(TezosOperationType), + TezosOperationType.TRANSACTION, + TezosOperationType.DELEGATION, + TezosOperationType.ORIGINATION + ) + )("for %s", kind => { + it("throws an error", () => { + const operation: PartialTezosOperation = { kind } as PartialTezosOperation; + + expect(() => partialOperationToOperation(operation, account)).toThrow( + `Unsupported operation kind: ${kind}` + ); + }); + }); + + test("tez transaction", () => { + const operation: PartialTezosOperation = { + kind: TezosOperationType.TRANSACTION, + amount: "1", + destination: mockImplicitAddress(2).pkh, + }; + + const result = partialOperationToOperation(operation, account); + + expect(result).toEqual(mockTezOperation(1)); + }); + + test("stake", () => { + const operation: PartialTezosOperation = { + kind: TezosOperationType.TRANSACTION, + amount: "1", + destination: mockImplicitAddress(2).pkh, + parameters: { + entrypoint: "stake", + value: [{ prim: "UNIT" }], + }, + }; + + const result = partialOperationToOperation(operation, account); + + expect(result).toEqual({ + type: "stake", + amount: "1", + sender: mockImplicitAddress(2), + }); + }); + + test("unstake", () => { + const operation: PartialTezosOperation = { + kind: TezosOperationType.TRANSACTION, + amount: "12", + destination: mockImplicitAddress(2).pkh, + parameters: { + entrypoint: "unstake", + value: [{ prim: "UNIT" }], + }, + }; + + const result = partialOperationToOperation(operation, account); + + expect(result).toEqual({ + type: "unstake", + amount: "12", + sender: mockImplicitAddress(2), + }); + }); + + test("finalize unstake", () => { + const operation: PartialTezosOperation = { + kind: TezosOperationType.TRANSACTION, + destination: mockImplicitAddress(2).pkh, + amount: "0", + parameters: { + entrypoint: "finalize_unstake", + value: [{ prim: "UNIT" }], + }, + }; + + const result = partialOperationToOperation(operation, account); + + expect(result).toEqual({ + type: "finalize_unstake", + sender: mockImplicitAddress(2), + }); + }); + + test("contract call", () => { + const operation: PartialTezosOperation = { + kind: TezosOperationType.TRANSACTION, + amount: "1", + destination: mockContractAddress(2).pkh, + parameters: { + entrypoint: "mockEntrypoint", + value: [{ prim: "UNIT" }], + }, + }; + + const result = partialOperationToOperation(operation, account); + + expect(result).toEqual({ + type: "contract_call", + amount: "1", + contract: mockContractAddress(2), + entrypoint: "mockEntrypoint", + args: [{ prim: "UNIT" }], + }); + }); + + test("delegate", () => { + const operation: PartialTezosOperation = { + kind: TezosOperationType.DELEGATION, + delegate: mockImplicitAddress(2).pkh, + }; + + const result = partialOperationToOperation(operation, account); + + expect(result).toEqual({ + type: "delegation", + sender: account.address, + recipient: mockImplicitAddress(2), + }); + }); + + test("undelegate", () => { + const operation: PartialTezosOperation = { + kind: TezosOperationType.DELEGATION, + }; + + const result = partialOperationToOperation(operation, account); + + expect(result).toEqual({ type: "undelegation", sender: account.address }); + }); +}); diff --git a/packages/core/src/beaconUtils.ts b/packages/core/src/beaconUtils.ts new file mode 100644 index 0000000000..7dd63331f2 --- /dev/null +++ b/packages/core/src/beaconUtils.ts @@ -0,0 +1,109 @@ +import { type PartialTezosOperation, TezosOperationType } from "@airgap/beacon-wallet"; +import { isValidImplicitPkh, parseImplicitPkh, parsePkh } from "@umami/tezos"; + +import { type ImplicitAccount } from "./Account"; +import { type ImplicitOperations } from "./AccountOperations"; +import { type ContractOrigination, type Operation } from "./Operation"; + +/** + * takes a list of {@link PartialTezosOperation} which come from Beacon + * and converts them to {@link ImplicitOperations} + * + * @param operationDetails - the list of operations to convert + * @param signer - the {@link Account} that's going to sign the operation + * @returns + */ +export const toAccountOperations = ( + operationDetails: PartialTezosOperation[], + signer: ImplicitAccount +): ImplicitOperations => { + if (operationDetails.length === 0) { + throw new Error("Empty operation details!"); + } + + const operations = operationDetails.map(operation => + partialOperationToOperation(operation, signer) + ); + + return { + type: "implicit", + sender: signer, + operations, + signer, + }; +}; + +/** + * Converts a {@link PartialTezosOperation} which comes from Beacon to a {@link Operation} + * + * Note: it doesn't supported all of the possible operation types, but only a subset of them. + * + * @param partialOperation - the operation to convert + * @param signer - the {@link Account} that's going to sign the operation + * @returns a parsed {@link Operation} + */ +export const partialOperationToOperation = ( + partialOperation: PartialTezosOperation, + signer: ImplicitAccount +): Operation => { + switch (partialOperation.kind) { + case TezosOperationType.TRANSACTION: { + const { destination, amount, parameters } = partialOperation; + if (parameters) { + // if the destination is an implicit account then it's a pseudo operation + if (isValidImplicitPkh(destination)) { + switch (parameters.entrypoint) { + case "stake": + return { type: "stake", amount, sender: parseImplicitPkh(destination) }; + case "unstake": + return { type: "unstake", amount, sender: parseImplicitPkh(destination) }; + case "finalize_unstake": + return { type: "finalize_unstake", sender: parseImplicitPkh(destination) }; + } + } + + return { + type: "contract_call", + amount, + contract: parsePkh(destination), + entrypoint: parameters.entrypoint, + args: parameters.value, + }; + } + + return { + type: "tez", + amount, + recipient: parseImplicitPkh(partialOperation.destination), + }; + } + case TezosOperationType.DELEGATION: { + const { delegate } = partialOperation; + + if (delegate) { + return { + type: "delegation", + sender: signer.address, + recipient: parseImplicitPkh(delegate), + }; + } + return { type: "undelegation", sender: signer.address }; + } + case TezosOperationType.ORIGINATION: { + const { script } = partialOperation; + const { code, storage } = script as unknown as { + code: ContractOrigination["code"]; + storage: ContractOrigination["storage"]; + }; + + return { + type: "contract_origination", + sender: signer.address, + code, + storage, + }; + } + default: + throw new Error(`Unsupported operation kind: ${partialOperation.kind}`); + } +}; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 62fbafab04..9c4d35bcef 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -10,3 +10,4 @@ export * from "./Operation"; export * from "./testUtils"; export * from "./Token"; export * from "./TokenBalance"; +export * from "./beaconUtils"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a349e3f216..930318517e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -781,7 +781,7 @@ importers: version: 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) '@storybook/addon-interactions': specifier: ^8.2.9 - version: 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) + version: 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) '@storybook/addon-links': specifier: ^8.2.9 version: 8.2.9(react@18.3.1)(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) @@ -811,7 +811,7 @@ importers: version: 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.21.0)(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2)))(typescript@5.5.4)(vite@5.4.2(@types/node@20.14.11)(sass@1.77.8)) '@storybook/test': specifier: ^8.2.9 - version: 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) + version: 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) '@storybook/types': specifier: ^8.2.9 version: 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) @@ -883,7 +883,7 @@ importers: version: 2.5.2 jest-transformer-svg: specifier: ^2.0.2 - version: 2.0.2(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0))(react@18.3.1) + version: 2.0.2(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)))(react@18.3.1) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1013,7 +1013,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -1038,6 +1038,9 @@ importers: packages/core: dependencies: + '@airgap/beacon-wallet': + specifier: ^4.2.2 + version: 4.2.2 '@taquito/rpc': specifier: ^20.0.1 version: 20.0.1 @@ -1104,7 +1107,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1162,7 +1165,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1277,7 +1280,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1328,13 +1331,13 @@ importers: version: 2.29.1(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-jest: specifier: ^28.8.0 - version: 28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(babel-plugin-macros@3.1.0))(typescript@5.5.4) + version: 28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)))(typescript@5.5.4) eslint-plugin-jest-dom: specifier: ^5.4.0 version: 5.4.0(@testing-library/dom@10.4.0)(eslint@8.57.0) eslint-plugin-playwright: specifier: ^1.6.2 - version: 1.6.2(eslint-plugin-jest@28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(babel-plugin-macros@3.1.0))(typescript@5.5.4))(eslint@8.57.0) + version: 1.6.2(eslint-plugin-jest@28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)))(typescript@5.5.4))(eslint@8.57.0) eslint-plugin-react: specifier: ^7.35.0 version: 7.35.0(eslint@8.57.0) @@ -1361,7 +1364,7 @@ importers: devDependencies: jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) rimraf: specifier: ^6.0.1 version: 6.0.1 @@ -1437,7 +1440,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1495,7 +1498,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1646,7 +1649,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1701,7 +1704,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1783,7 +1786,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -1864,7 +1867,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + version: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) madge: specifier: ^8.0.0 version: 8.0.0(typescript@5.5.4) @@ -12499,6 +12502,41 @@ snapshots: - supports-color - ts-node + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.11 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.7 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + '@jest/environment@29.7.0': dependencies: '@jest/fake-timers': 29.7.0 @@ -13095,11 +13133,11 @@ snapshots: '@storybook/global': 5.0.0 storybook: 8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2)) - '@storybook/addon-interactions@8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2)))': + '@storybook/addon-interactions@8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2)))': dependencies: '@storybook/global': 5.0.0 '@storybook/instrumenter': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) - '@storybook/test': 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) + '@storybook/test': 8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) polished: 4.3.1 storybook: 8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2)) ts-dedent: 2.2.0 @@ -13325,12 +13363,12 @@ snapshots: optionalDependencies: typescript: 5.5.4 - '@storybook/test@8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2)))': + '@storybook/test@8.2.9(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)))(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2)))': dependencies: '@storybook/csf': 0.1.11 '@storybook/instrumenter': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.3(@babel/core@7.25.2))) '@testing-library/dom': 10.1.0 - '@testing-library/jest-dom': 6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)) + '@testing-library/jest-dom': 6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4))) '@testing-library/user-event': 14.5.2(@testing-library/dom@10.1.0) '@vitest/expect': 1.6.0 '@vitest/spy': 1.6.0 @@ -13659,7 +13697,7 @@ snapshots: lz-string: 1.5.0 pretty-format: 27.5.1 - '@testing-library/jest-dom@6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0))': + '@testing-library/jest-dom@6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)))': dependencies: '@adobe/css-tools': 4.4.0 '@babel/runtime': 7.25.0 @@ -15550,6 +15588,21 @@ snapshots: - supports-color - ts-node + create-jest@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + create-require@1.1.1: {} cross-env@7.0.3: @@ -16338,23 +16391,23 @@ snapshots: optionalDependencies: '@testing-library/dom': 10.4.0 - eslint-plugin-jest@28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(babel-plugin-macros@3.1.0))(typescript@5.5.4): + eslint-plugin-jest@28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)))(typescript@5.5.4): dependencies: '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 optionalDependencies: '@typescript-eslint/eslint-plugin': 8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) - jest: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) + jest: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) transitivePeerDependencies: - supports-color - typescript - eslint-plugin-playwright@1.6.2(eslint-plugin-jest@28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(babel-plugin-macros@3.1.0))(typescript@5.5.4))(eslint@8.57.0): + eslint-plugin-playwright@1.6.2(eslint-plugin-jest@28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)))(typescript@5.5.4))(eslint@8.57.0): dependencies: eslint: 8.57.0 globals: 13.24.0 optionalDependencies: - eslint-plugin-jest: 28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(babel-plugin-macros@3.1.0))(typescript@5.5.4) + eslint-plugin-jest: 28.8.0(@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)))(typescript@5.5.4) eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): dependencies: @@ -17538,6 +17591,25 @@ snapshots: - supports-color - ts-node + jest-cli@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)): + dependencies: + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + jest-config@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)): dependencies: '@babel/core': 7.25.2 @@ -17569,6 +17641,68 @@ snapshots: - babel-plugin-macros - supports-color + jest-config@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)): + dependencies: + '@babel/core': 7.25.2 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.25.2) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0(babel-plugin-macros@3.1.0) + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.7 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 20.14.11 + ts-node: 10.9.2(@types/node@22.1.0)(typescript@5.5.4) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-config@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)): + dependencies: + '@babel/core': 7.25.2 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.25.2) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0(babel-plugin-macros@3.1.0) + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.7 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 22.1.0 + ts-node: 10.9.2(@types/node@22.1.0)(typescript@5.5.4) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + jest-diff@29.7.0: dependencies: chalk: 4.1.2 @@ -17765,7 +17899,7 @@ snapshots: transitivePeerDependencies: - supports-color - jest-transformer-svg@2.0.2(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0))(react@18.3.1): + jest-transformer-svg@2.0.2(jest@29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)))(react@18.3.1): dependencies: jest: 29.7.0(@types/node@20.14.11)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.4)) react: 18.3.1 @@ -17829,6 +17963,18 @@ snapshots: - supports-color - ts-node + jest@29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)): + dependencies: + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@22.1.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + jiti@1.21.6: {} jju@1.4.0: {} @@ -20093,6 +20239,25 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 22.1.0 + acorn: 8.12.1 + acorn-walk: 8.3.3 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.5.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + optional: true + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29