forked from bitpay/bitcore
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): Adds check wallet endpoint
Provides last imported address and hash of all wallet addresses
- Loading branch information
1 parent
84d7a69
commit a606095
Showing
7 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env node | ||
|
||
const program = require('../ts_build/program'); | ||
const { Wallet } = require('../ts_build/wallet'); | ||
|
||
program | ||
.version(require('../package.json').version) | ||
.option('--name <name>', 'REQUIRED - Wallet name') | ||
.option('--path [path]', 'optional - Custom wallet storage path') | ||
.parse(process.argv); | ||
|
||
const main = async () => { | ||
const { name, path } = program; | ||
try { | ||
const wallet = await Wallet.loadWallet({ name, path }); | ||
const registered = await wallet.checkWallet(); | ||
// TODO compare with local addresses | ||
console.log(registered); | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
}; | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters