Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/eth/types.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -42,9 +42,9 @@ expectNotAssignable<EthEoaAccount>({
address,
options: {},
methods: [
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand All @@ -55,9 +55,9 @@ expectNotAssignable<EthEoaAccount>({
address,
options: {},
methods: [
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand All @@ -82,9 +82,9 @@ expectAssignable<EthErc4337Account>({
`${EthMethod.SignTypedDataV1}`,
`${EthMethod.SignTypedDataV3}`,
`${EthMethod.SignTypedDataV4}`,
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand All @@ -95,9 +95,9 @@ expectNotAssignable<EthErc4337Account>({
address,
options: {},
methods: [
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand All @@ -108,9 +108,9 @@ expectNotAssignable<EthErc4337Account>({
address,
options: {},
methods: [
`${EthErc4337Method.PrepareUserOperation}`,
`${EthErc4337Method.PatchUserOperation}`,
`${EthErc4337Method.SignUserOperation}`,
`${EthMethod.PrepareUserOperation}`,
`${EthMethod.PatchUserOperation}`,
`${EthMethod.SignUserOperation}`,
],
});

Expand Down
12 changes: 3 additions & 9 deletions src/eth/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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}`,
]),
),
});
Expand Down