get
- wallet.get()
- wallet.get(name)
- wallet.get(options)
Examines its arguments and the environment to select a Keystore File, load it, and return a Keystore object. Throws if it cannot do so.
- Arguments:
name (string) – Form 2. Equivalent to
wallet.get({ name }).options (object) – Form 3.
options.name (string) – The keystore name. Defaults to
'default'.options.contextId (string) – An optional, user-defined identifier used for caching keystores.
options.jobName (string) – An optional name for the job that the keystore is being requested for.
options.checkEmpty (boolean) – Try an empty password before prompting user. Defaults to
true.options.KeystoreConstructor (function) – The constructor to use for the keystore. Defaults to
wallet.BankAccountKeystore.
- Return type:
Promise<BankAccountKeystore>
Note
The default KeystoreConstructor – and so the default resolved type – is BankAccountKeystore, not AuthKeystore.
Note
On Node.js, this loads a Keystore File via load(). In a browser, it does not call load() at all – it instead checks browser storage, then falls back to an OAuth popup flow or an upload modal, depending on configuration.
Two Array-argument forms (wallet.get(argv) and wallet.get(argv, options|name)), intended for Node.js command-line programs, also exist – they parse an array formatted like process.argv for --private-key/-k/-p flags. See get, under API Functions - NodeJS, in the Wallet API spec for the full six-form description.