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
8 changes: 8 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ export enum BtcAccountType {
P2wpkh = 'bip122:p2wpkh',
}

/**
* Supported account types.
*/
export type KeyringAccountType =
| `${EthAccountType.Eoa}`
| `${EthAccountType.Erc4337}`
| `${BtcAccountType.P2wpkh}`;

/**
* A struct which represents a Keyring account object. It is abstract enough to
* be used with any blockchain. Specific blockchain account types should extend
Expand Down
5 changes: 3 additions & 2 deletions src/eth/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { KeyringAccountType } from '../api';
import { EthAccountType } from '../api';
import type { InternalAccountType } from '../internal';

/**
* Checks if the given type is an EVM account type.
*
* @param type - The type to check.
* @returns Returns true if the type is an EVM account type, false otherwise.
*/
export function isEvmAccountType(type: InternalAccountType | string): boolean {
export function isEvmAccountType(type: KeyringAccountType): boolean {
return type === EthAccountType.Eoa || type === EthAccountType.Erc4337;
}