UNPKG

@polkadot/keyring

Version:
26 lines (25 loc) 1.09 kB
import type { KeypairType } from '@polkadot/util-crypto/types'; import type { KeyringOptions, KeyringPair } from './types.js'; export interface TestKeyringMap { nobody: KeyringPair; [index: string]: KeyringPair; } export interface TestKeyringMapSubstrate extends TestKeyringMap { alice: KeyringPair; bob: KeyringPair; charlie: KeyringPair; dave: KeyringPair; eve: KeyringPair; ferdie: KeyringPair; } export interface TestKeyringMapEthereum extends TestKeyringMap { Alith: KeyringPair; Baltathar: KeyringPair; Charleth: KeyringPair; Dorothy: KeyringPair; Ethan: KeyringPair; Faith: KeyringPair; } export type DetectMap<O extends KeyringOptions | undefined> = DetectPairType<O> extends 'ethereum' ? TestKeyringMapEthereum : TestKeyringMapSubstrate; export type DetectPairType<O extends KeyringOptions | undefined> = O extends KeyringOptions ? O['type'] extends KeypairType ? O['type'] : 'sr25519' : 'sr25519'; export declare function createTestPairs<O extends KeyringOptions, M = DetectMap<O>>(options?: O, isDerived?: boolean): M;