UNPKG

@sangaman/xud

Version:
27 lines 1.06 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const grpc_1 = __importDefault(require("grpc")); const xudrpc_grpc_pb_1 = require("../proto/xudrpc_grpc_pb"); exports.loadXudClient = (argv) => { // TODO load saved cert from disk const credentials = grpc_1.default.credentials.createInsecure(); return new xudrpc_grpc_pb_1.XudClient(`${argv.rpc.host}:${argv.rpc.port}`, credentials); }; /** * A generic function to instantiate an XU client, perform a command, and output the result to the * console. * @param argv the command line arguments * @param callback the callback function to perform a command */ exports.callback = (error, response) => { if (error) { console.error(`${error.name}: ${error.message}`); } else { console.log(JSON.stringify(response.toObject(), undefined, 2)); } }; //# sourceMappingURL=command.js.map