From 80d136e4fee72e92d88edaadeda6d67c6d89536d Mon Sep 17 00:00:00 2001 From: Daniel Rocha <68558152+danroc@users.noreply.github.com> Date: Wed, 22 May 2024 22:05:14 +0200 Subject: [PATCH] Revert "chore: move fix `EthErc4337Method` -> `EthMethod` to a different PR" This reverts commit e5453e77c09ce078db77019a9e4c2b181071525f. --- src/eth/types.test-d.ts | 32 ++++++++++++++++---------------- src/eth/types.ts | 12 +++--------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/eth/types.test-d.ts b/src/eth/types.test-d.ts index bec12c935..d413ffc2a 100644 --- a/src/eth/types.test-d.ts +++ b/src/eth/types.test-d.ts @@ -5,7 +5,7 @@ import { EthAccountType } from '../api'; import type { Extends } from '../utils'; import { expectTrue } from '../utils'; import type { EthEoaAccount, EthErc4337Account } from './types'; -import { EthMethod, EthErc4337Method } from './types'; +import { EthMethod } from './types'; const id = '606a7759-b0fb-48e4-9874-bab62ff8e7eb'; const address = '0x000'; @@ -42,9 +42,9 @@ expectNotAssignable({ address, options: {}, methods: [ - `${EthErc4337Method.PrepareUserOperation}`, - `${EthErc4337Method.PatchUserOperation}`, - `${EthErc4337Method.SignUserOperation}`, + `${EthMethod.PrepareUserOperation}`, + `${EthMethod.PatchUserOperation}`, + `${EthMethod.SignUserOperation}`, ], }); @@ -55,9 +55,9 @@ expectNotAssignable({ address, options: {}, methods: [ - `${EthErc4337Method.PrepareUserOperation}`, - `${EthErc4337Method.PatchUserOperation}`, - `${EthErc4337Method.SignUserOperation}`, + `${EthMethod.PrepareUserOperation}`, + `${EthMethod.PatchUserOperation}`, + `${EthMethod.SignUserOperation}`, ], }); @@ -82,9 +82,9 @@ expectAssignable({ `${EthMethod.SignTypedDataV1}`, `${EthMethod.SignTypedDataV3}`, `${EthMethod.SignTypedDataV4}`, - `${EthErc4337Method.PrepareUserOperation}`, - `${EthErc4337Method.PatchUserOperation}`, - `${EthErc4337Method.SignUserOperation}`, + `${EthMethod.PrepareUserOperation}`, + `${EthMethod.PatchUserOperation}`, + `${EthMethod.SignUserOperation}`, ], }); @@ -95,9 +95,9 @@ expectNotAssignable({ address, options: {}, methods: [ - `${EthErc4337Method.PrepareUserOperation}`, - `${EthErc4337Method.PatchUserOperation}`, - `${EthErc4337Method.SignUserOperation}`, + `${EthMethod.PrepareUserOperation}`, + `${EthMethod.PatchUserOperation}`, + `${EthMethod.SignUserOperation}`, ], }); @@ -108,9 +108,9 @@ expectNotAssignable({ address, options: {}, methods: [ - `${EthErc4337Method.PrepareUserOperation}`, - `${EthErc4337Method.PatchUserOperation}`, - `${EthErc4337Method.SignUserOperation}`, + `${EthMethod.PrepareUserOperation}`, + `${EthMethod.PatchUserOperation}`, + `${EthMethod.SignUserOperation}`, ], }); diff --git a/src/eth/types.ts b/src/eth/types.ts index 4dd2f6a27..f1ffce954 100644 --- a/src/eth/types.ts +++ b/src/eth/types.ts @@ -27,12 +27,6 @@ export enum EthMethod { SignTypedDataV1 = 'eth_signTypedData_v1', SignTypedDataV3 = 'eth_signTypedData_v3', SignTypedDataV4 = 'eth_signTypedData_v4', -} - -/** - * Supported Ethereum methods for ERC-4337 (Account Abstraction) accounts. - */ -export enum EthErc4337Method { // ERC-4337 methods PrepareUserOperation = 'eth_prepareUserOperation', PatchUserOperation = 'eth_patchUserOperation', @@ -92,9 +86,9 @@ export const EthErc4337AccountStruct = object({ `${EthMethod.SignTypedDataV1}`, `${EthMethod.SignTypedDataV3}`, `${EthMethod.SignTypedDataV4}`, - `${EthErc4337Method.PrepareUserOperation}`, - `${EthErc4337Method.PatchUserOperation}`, - `${EthErc4337Method.SignUserOperation}`, + `${EthMethod.PrepareUserOperation}`, + `${EthMethod.PatchUserOperation}`, + `${EthMethod.SignUserOperation}`, ]), ), });