UNPKG

@bioneisme/greenfield-cli

Version:
68 lines (67 loc) 2.97 kB
"use strict"; 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()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const getModuleAccounts_1 = require("../commands/account/getModuleAccounts"); const getAccount_1 = require("../commands/account/getAccount"); const createWeb3Account_1 = require("../commands/account/createWeb3Account"); const getAccountBalance_1 = require("../commands/account/getAccountBalance"); const getModuleAccountByName_1 = require("../commands/account/getModuleAccountByName"); const config_1 = require("../utils/config"); const commander_1 = require("commander"); const account = commander_1.program.command("account").description("account operations"); account .command("my-info") .description("get account info") .action(() => __awaiter(void 0, void 0, void 0, function* () { yield (0, getAccount_1.getAccount)(); })); account .command("info <address>") .description("get account info by address") .action((address) => __awaiter(void 0, void 0, void 0, function* () { yield (0, getAccount_1.getAccount)(address); })); account .command("create") .description("create web3 account") .action(() => __awaiter(void 0, void 0, void 0, function* () { yield (0, createWeb3Account_1.createWeb3Account)(); })); account .command("my-balance") .description("get my account balance") .action(() => __awaiter(void 0, void 0, void 0, function* () { const req = { address: String(config_1.config.get("publicKey")), denom: "BNB", }; yield (0, getAccountBalance_1.getAccountBalance)(req); })); account .command("balance <address>") .description("get account balance") .action((address) => __awaiter(void 0, void 0, void 0, function* () { const req = { address, denom: "BNB", }; yield (0, getAccountBalance_1.getAccountBalance)(req); })); account .command("mls") .description("module accounts") .option("-n, --name <name>", "get module account by name", (name) => __awaiter(void 0, void 0, void 0, function* () { yield (0, getModuleAccountByName_1.getModuleAccountByName)(name); })) .option("-a, -all", "get all module accounts", () => __awaiter(void 0, void 0, void 0, function* () { yield (0, getModuleAccounts_1.getModuleAccounts)(); })); exports.default = account;