@bioneisme/greenfield-cli
Version:
CLI For BNB Greenfield SDK
39 lines (38 loc) • 2.14 kB
JavaScript
;
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 commander_1 = require("commander");
const getStorageProviders_1 = require("../commands/sp/getStorageProviders");
const getSecondarySpStorePrice_1 = require("../commands/sp/getSecondarySpStorePrice");
const getStorageProviderInfo_1 = require("../commands/sp/getStorageProviderInfo");
const getStoragePriceByTime_1 = require("../commands/sp/getStoragePriceByTime");
const sp = commander_1.program.command("sp").description("storage providers");
sp.command("ls")
.description("list all storage providers")
.action(() => __awaiter(void 0, void 0, void 0, function* () {
yield (0, getStorageProviders_1.getStorageProviders)();
}));
sp.command("secondary")
.description("secondary storage price, including update time and store price")
.action(() => __awaiter(void 0, void 0, void 0, function* () {
yield (0, getSecondarySpStorePrice_1.getSecondarySpStorePrice)();
}));
sp.command("info <address>")
.description("info with the sp chain address")
.action((address) => __awaiter(void 0, void 0, void 0, function* () {
yield (0, getStorageProviderInfo_1.getStorageProviderInfo)(address);
}));
sp.command("price <address>")
.description("price with the sp chain address")
.action((address) => __awaiter(void 0, void 0, void 0, function* () {
yield (0, getStoragePriceByTime_1.getStoragePriceByTime)(address);
}));
exports.default = sp;