UNPKG

@acurast/cli

Version:

A cli to interact with the Acurast Cloud.

66 lines 2.88 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import { select } from '@inquirer/prompts'; import open from 'open'; import { RPC } from '../config.js'; // TODO: Move to config const acurastHub = 'https://hub.acurast.com'; const website = 'https://docs.acurast.com/'; const explorer = `https://polkadot.js.org/apps/?rpc=${RPC}#/explorer`; const telegramBot = 'https://t.me/AcurastBot'; const telegramGroup = 'https://t.me/acurastnetwork'; const discordGroup = 'https://discord.gg/wqgC6b6aKe'; const faucet = 'https://faucet.acurast.com/'; export const addCommandOpen = (program) => { program .command('open') .description('Open Acurast websites in your browser') .action(() => __awaiter(void 0, void 0, void 0, function* () { const answer = yield select({ message: 'Which website do you want to open?', choices: [ { name: 'Hub', description: 'Acurast Hub', value: acurastHub }, { name: 'Docs', description: 'Acurast Documentation', value: website, }, { name: 'Faucet', description: 'Get some cACU to get started', value: faucet, }, { name: 'Explorer', description: 'Acurast Explorer', value: explorer, }, { name: 'Telegram Bot', description: 'Telegram Bot to get notified about processor and balance changes', value: telegramBot, }, { name: 'Telegram Group', description: 'Telegram Group for the latest updates and community', value: telegramGroup, }, { name: 'Discord Group', description: 'Discord Group for the latest updates and community', value: discordGroup, }, ], }); console.log(`Opening ${answer} in browser...`); yield open(answer); })); }; //# sourceMappingURL=open.js.map