INNER CODE UNIT · TypeScript
get_to_option
Deezzir/solana-bot · src/bot.ts:81
function get_to_option(wallet_cnt: number): Option {
return new Option('-t, --to <number>', 'Ending at the provided index (exclusive)').argParser((value) => {
if (!common.validate_int(value, 0, wallet_cnt))
throw new InvalidOptionArgumentError(`Not a valid range(0 - ${wallet_cnt}).`);
return parseInt(value, 10);
});
}
function get_list_option(wallet_cnt: number): Option {
return new Option('-l, --list <wallets...>', 'Specify the list of wallet files').argParser((value, prev: any) => {
if (!common.validate_int(value, 0, wallet_cnt))
throw new InvalidOptionArgumentError(`Not a valid range(0 - ${wallet_cnt}).`);
return prev ? prev?.concat(parseInt(value, 10)) : [parseInt(value, 10)];
});
}
function get_bundle_tip_option(): Option {
return new Option('-b, --bundle <tip>', 'Enable bundles by providing tip amount').argParser((value) => {