(args: { wallet: IWallet; opts?: ICliOptions })
| 3 | import { Utils } from './utils'; |
| 4 | |
| 5 | export 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 | } |
no test coverage detected