mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 23:58:06 +01:00
18 lines
564 B
JavaScript
18 lines
564 B
JavaScript
|
/**
|
||
|
* 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;
|
||
|
}
|