ghost-keychain/packages/extension-base/src/utils/canDerive.ts
Thibaut Sardan 57635016a6
Prevent eth accounts to be selected for derivation (#595)
* prevent eth accounts to be selected

* stray log

* use type && [ed25519, sr25519, ecdsa].includes(type)

* use utils

* fix test

* proper testing for eth

* fix derive test (will change these soon anyway)
2020-12-18 15:18:06 +01:00

9 lines
306 B
TypeScript

// Copyright 2019-2020 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KeypairType } from '@polkadot/util-crypto/types';
export default function canDerive (type?: KeypairType): boolean {
return !!type && ['ed25519', 'sr25519', 'ecdsa'].includes(type);
}