diff --git a/README.md b/README.md index 81013095..8468dbc7 100644 --- a/README.md +++ b/README.md @@ -661,7 +661,7 @@ Usage: turbo [options] [command] - `-t, --token ` - Token type for the command or connected wallet (default: "arweave") - `-w, --wallet-file ` - Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array -- `-m, --mnemonic ` - Mnemonic to use with the action +- `-m, --mnemonic ` - Mnemonic to use with the action (KYVE only) - `-p, --private-key ` - Private key to use with the action #### Commands diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 2277f559..ed230627 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -62,7 +62,7 @@ applyOptions( applyOptions( program.command('crypto-fund').description('Top up a wallet with crypto'), - [...walletOptions, optionMap.token, optionMap.value], + [...walletOptions, optionMap.value], ).action(async (_commandOptions, command: Command) => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const options: any = command.optsWithGlobals(); @@ -88,7 +88,7 @@ applyOptions( }); if ( - process.argv[1].includes('.bin/turbo') || // Running from global .bin + process.argv[1].includes('bin/turbo') || // Running from global .bin process.argv[1].includes('cli/cli') // Running from source ) { program.parse(process.argv); diff --git a/src/cli/utils.ts b/src/cli/utils.ts index 508a335a..5efb41eb 100644 --- a/src/cli/utils.ts +++ b/src/cli/utils.ts @@ -101,6 +101,7 @@ export const globalOptions = [ optionMap.gateway, optionMap.debug, optionMap.quiet, + optionMap.token, ]; export function applyOptions( @@ -149,6 +150,7 @@ export async function privateKeyFromOptions( if (token === 'kyve') { return privateKeyFromKyveMnemonic(mnemonic); } else { + // TODO: Implement other token types mnemonic to wallet throw new Error( 'mnemonic provided but this token type mnemonic to wallet is not supported', ); @@ -160,8 +162,10 @@ export async function privateKeyFromOptions( } else if (privateKey !== undefined) { return privateKey; } + // TODO: Get TURBO_WALLET_FILE, TURBO_MNEMONIC, TURBO_PRIVATE_KEY or similar from ENV variables + // TODO: Add prompts for selecting wallet type and secure input - throw new Error('mnemonic or wallet file required'); + throw new Error('mnemonic or wallet file or private key is required'); } const tokenToDevGatewayMap: Record = {