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

Function command

packages/bitcore-cli/src/commands/export.ts:9–24  ·  view source on GitHub ↗
(args: CommonArgs)

Source from the content-addressed store, hash-verified

7import type { CommonArgs } from '../../types/cli';
8
9export function command(args: CommonArgs) {
10 const { wallet, program } = args;
11 program
12 .description('Export wallet to a file')
13 .usage('<walletName> --command export [options]')
14 .optionsGroup('Export Options')
15 .option('--filename <filename>', 'Filename to export to', `~/${wallet.name}-export.json`)
16 .option('--readonly', 'Export as read-only (cannot send funds)')
17 .parse(process.argv);
18
19 const opts = program.opts();
20 if (opts.help) {
21 program.help();
22 }
23 return opts;
24}
25
26export async function exportWallet(args: CommonArgs<{ filename?: string; readonly?: boolean }>) {
27 const { wallet, opts } = args;

Callers 1

exportWalletFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected