-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:bitpay/bitcore into taproot
- Loading branch information
Showing
345 changed files
with
62,130 additions
and
14,569 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"lerna": "2.9.1", | ||
"version": "10.0.11", | ||
"version": "10.0.32", | ||
"packages": [ | ||
"packages/*" | ||
"packages/[^insight]*" | ||
] | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
#!/usr/bin/env node | ||
|
||
const program = require('../ts_build/program'); | ||
const { Wallet } = require('../ts_build/wallet'); | ||
const program = require('commander'); | ||
const { Wallet } = require('../ts_build/src/wallet'); | ||
|
||
try { | ||
program | ||
.version(require('../package.json').version) | ||
.option('--name <name>', 'REQUIRED - Wallet name') | ||
.option('--time [time]', 'optional - Get balance at specific time') | ||
.option('--path [path]', 'optional - Custom wallet storage path') | ||
.option('--storageType [storageType]', 'optional - name of the database to use (default level)') | ||
.option('--token [token]', 'optional - Get balance of an ERC20 token') | ||
.requiredOption('--name <name>', 'REQUIRED - Wallet name') | ||
.option('--time <time>', 'optional - Get balance at specific time') | ||
.option('--path <path>', 'optional - Custom wallet storage path') | ||
.option('--storageType <storageType>', 'optional - name of the database to use (default level)') | ||
.option('--token <token>', 'optional - Get balance of an ERC20 token') | ||
.option('--tokenName <tokenName>', 'optional - Get balance of an ERC20 token using custom token name') | ||
.parse(process.argv); | ||
} catch (e) { | ||
console.log(e.message); | ||
return program.help(); | ||
} | ||
|
||
let wallet; | ||
|
||
async function main() { | ||
const { name, path, time, storageType, token } = program; | ||
const wallet = await Wallet.loadWallet({ name, path, storageType }); | ||
const balance = await wallet.getBalance(time, token); | ||
const { name, path, time, storageType, token, tokenName } = program.opts(); | ||
wallet = await Wallet.loadWallet({ name, path, storageType }); | ||
const balance = await wallet.getBalance(time, token, tokenName); | ||
return Object.assign(balance, { | ||
currency: token || wallet.chain, | ||
currency: tokenName || token || wallet.chain, | ||
network: wallet.network | ||
}); | ||
} | ||
|
||
main() | ||
.then(res => console.log(res)) | ||
.catch(err => console.error(err)); | ||
.catch(err => console.error(err)) | ||
.finally(() => wallet?.storage?.close()); |
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
Oops, something went wrong.