INNER CODE UNIT · TypeScript

Option

Deezzir/solana-bot · src/bot.ts:74

    return new Option('-f, --from <number>', 'Starting from the provided index').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_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))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…