1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00
metamask-extension/app/scripts/mmi-keyring-builder-factory.js

18 lines
564 B
JavaScript
Raw Normal View History

/**
* Get builder function for MMI keyrings which require an additional `opts`
* parameter, used to pass MMI configuration.
*
* Returns a builder function for `Keyring` with a `type` property.
*
* @param {Keyring} Keyring - The Keyring class for the builder.
* @param {Keyring} opts - Optional parameters to be passed to the builder.
* @returns {Function} A builder function for the given Keyring.
*/
export function mmiKeyringBuilderFactory(Keyring, opts) {
const builder = () => new Keyring(opts);
builder.type = Keyring.type;
return builder;
}