MCPcopy Create free account
hub / github.com/bitpay/bitcore / getPasswordWithRetry

Method getPasswordWithRetry

packages/bitcore-cli/src/wallet.ts:502–517  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

500 }
501
502 async getPasswordWithRetry(): Promise<string> {
503 let password;
504 if (this.isWalletEncrypted()) {
505 password = await getPassword('Wallet password:', {
506 hidden: true,
507 validate: (input) => {
508 try {
509 this.#walletData.key.get(input);
510 } catch {
511 return 'Invalid password. Please try again.';
512 }
513 }
514 });
515 }
516 return password;
517 }
518
519 async signTxp(args: {
520 txp: Txp;

Callers 2

signTxpMethod · 0.95
signMessageMethod · 0.95

Calls 3

isWalletEncryptedMethod · 0.95
getPasswordFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected