diff --git a/packages/keyring/src/index.ts b/packages/keyring/src/index.ts index 2d9569f95..6a138a2f5 100644 --- a/packages/keyring/src/index.ts +++ b/packages/keyring/src/index.ts @@ -31,7 +31,7 @@ export default class Keyring implements KeyringInstance { private _pairs: Pairs; private _type: KeyringPairType; - constructor (options: KeyringOptions) { + constructor (options: KeyringOptions = { type: 'ed25519' }) { assert(options && ['ed25519', 'sr25519'].includes(options.type || 'undefined'), `Expected a keyring type of either 'ed25519' or 'sr25519', found '${options.type}`); this._pairs = new Pairs(); diff --git a/packages/keyring/src/testing.ts b/packages/keyring/src/testing.ts index 8f8fd857b..3a82b5277 100644 --- a/packages/keyring/src/testing.ts +++ b/packages/keyring/src/testing.ts @@ -38,7 +38,7 @@ const SEEDS: { [index: string ]: Uint8Array } = { * @description The test accounts (i.e. alice, bob, dave, eve, ferdie) * are available on the dev chain and each test account is initialised with DOT funds. */ -export default function testKeyring (options: KeyringOptions): KeyringInstance { +export default function testKeyring (options?: KeyringOptions): KeyringInstance { const keyring = new Keyring(options); Object diff --git a/packages/keyring/src/testingPairs.ts b/packages/keyring/src/testingPairs.ts index 82773b108..4a23afa87 100644 --- a/packages/keyring/src/testingPairs.ts +++ b/packages/keyring/src/testingPairs.ts @@ -11,7 +11,7 @@ type TestKeyringMap = { [index: string]: KeyringPair }; -export default function testKeyringPairs (options: KeyringOptions): TestKeyringMap { +export default function testKeyringPairs (options?: KeyringOptions): TestKeyringMap { const keyring = createKeyring(options); const pairs = keyring.getPairs();