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

Function getCommands

packages/bitcore-cli/src/cli-commands.ts:5–39  ·  view source on GitHub ↗
(args: { wallet: IWallet; opts?: ICliOptions })

Source from the content-addressed store, hash-verified

3import { Utils } from './utils';
4
5export function getCommands(args: { wallet: IWallet; opts?: ICliOptions }) {
6 const { wallet } = args;
7
8 const COMMANDS = {
9 EXIT: { label: 'Exit', value: 'exit', hint: 'Exit the wallet CLI' },
10 NEW: [
11 { label: 'Create Wallet', value: 'create', hint: 'Create a fresh, new wallet (multi or single sig)' },
12 { label: 'Join Wallet', value: 'join', hint: 'Join an existing multi-sig wallet session' },
13 { label: 'Import Seed', value: 'import-seed', hint: 'Import using a 12-24 word mnemonic phrase' },
14 { label: 'Import File', value: 'import-file', hint: 'Import using a file' },
15 ],
16 BASIC: [
17 { label: ({ token }) => `Token${token ? ` (${Utils.colorText(token, 'orange')})` : ''}`, value: 'token', hint: 'Manage the token context for this session', show: () => wallet.isTokenChain(), noCmd: true },
18 { label: ({ ppNum }) => `Proposals${ppNum}`, value: 'txproposals', hint: 'Get pending transaction proposals' },
19 { label: 'Send', value: 'transaction', hint: 'Create a transaction to send funds' },
20 { label: 'Receive', value: 'address', hint: 'Get an address to receive funds to' },
21 { label: 'History', value: 'history', hint: 'Get the transaction history of your wallet' },
22 { label: 'Balance', value: 'balance', hint: 'Get the balance of your wallet' },
23 { label: 'Status', value: 'status', hint: 'Get the status of your wallet' },
24 ],
25 SHOW_ADVANCED: { label: 'Show Advanced...', value: 'advanced', hint: 'Show advanced actions' },
26 ADVANCED: [
27 { label: 'Message', value: 'sign', hint: 'Sign an arbitrary message with your wallet\'s private key' },
28 { label: 'Addresses', value: 'addresses', hint: 'List all of your wallet\'s addresses' },
29 { label: 'UTXOs', value: 'utxos', hint: 'Get the unspent transaction outputs of your wallet' },
30 { label: 'Preferences', value: 'preferences', hint: 'Get or set wallet preferences' },
31 { label: 'Derive', value: 'derive', hint: 'Derive a key along a path you will specify' },
32 { label: 'Export', value: 'export', hint: 'Export the wallet to a file' },
33 { label: 'Scan', value: 'scan', hint: 'Scan the wallet for funds' },
34 { label: 'Register', value: 'register', hint: 'Register the wallet with the Bitcore Wallet Service' },
35 { label: 'Clear Cache', value: 'clearcache', hint: 'Clear the wallet cache' }
36 ]
37 } as const;
38 return COMMANDS;
39}

Callers 2

commands.test.tsFile · 0.90
cli.tsFile · 0.90

Calls 2

colorTextMethod · 0.80
isTokenChainMethod · 0.65

Tested by

no test coverage detected