@harmoniclabs/cardanocli-pluts
Advanced tools
Comparing version 0.1.3-dev4 to 0.1.3-dev5
import { CliCmd, ICliCmdConfig } from "../CliCmd.js"; | ||
import { Address, AddressStr, ProtocolParamters, Script, TxOutRef, UTxO } from "@harmoniclabs/plu-ts"; | ||
import { WithPath } from "../../../utils/path/withPath.js"; | ||
import { CliQueryTipResult } from "./CliQueryTipResult.js"; | ||
export * from "./CliQueryTipResult.js"; | ||
export type QueryByTxOutRefFilter = (TxOutRef | `${string}#${number}`); | ||
@@ -25,2 +27,4 @@ export type QueryByAddressFilter = (Address | AddressStr); | ||
constructor(cfg: ICliCmdConfig); | ||
tipSync(): CliQueryTipResult; | ||
tip(): Promise<CliQueryTipResult>; | ||
protocolParametersSync(): ProtocolParamters; | ||
@@ -27,0 +31,0 @@ protocolParameters(): Promise<WithPath<ProtocolParamters>>; |
@@ -17,2 +17,16 @@ "use strict"; | ||
})(); | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -70,2 +84,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
var node_crypto_1 = require("node:crypto"); | ||
__exportStar(require("./CliQueryTipResult.js"), exports); | ||
var CliQueryCmd = /** @class */ (function (_super) { | ||
@@ -76,2 +91,35 @@ __extends(CliQueryCmd, _super); | ||
} | ||
CliQueryCmd.prototype.tipSync = function () { | ||
var json = JSON.parse((0, node_child_process_1.execSync)("".concat(this.cfg.cliPath, " query tip --").concat(this.cfg.network, " "), { env: { "CARDANO_NODE_SOCKET_PATH": this.cfg.socketPath } }).toString()); | ||
return { | ||
block: Number(json.block), | ||
epoch: Number(json.epoch), | ||
era: json.era, | ||
hash: new plu_ts_1.Hash32(json.hash), | ||
slot: Number(json.slot), | ||
syncProgress: Number(json.syncProgress) | ||
}; | ||
}; | ||
CliQueryCmd.prototype.tip = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var json, _a, _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
_b = (_a = JSON).parse; | ||
return [4 /*yield*/, (0, node_promises_1.exec)("".concat(this.cfg.cliPath, " query tip --").concat(this.cfg.network, " "), { env: { "CARDANO_NODE_SOCKET_PATH": this.cfg.socketPath } })]; | ||
case 1: | ||
json = _b.apply(_a, [(_c.sent()).toString()]); | ||
return [2 /*return*/, { | ||
block: Number(json.block), | ||
epoch: Number(json.epoch), | ||
era: json.era, | ||
hash: new plu_ts_1.Hash32(json.hash), | ||
slot: Number(json.slot), | ||
syncProgress: Number(json.syncProgress) | ||
}]; | ||
} | ||
}); | ||
}); | ||
}; | ||
CliQueryCmd.prototype.protocolParametersSync = function () { | ||
@@ -78,0 +126,0 @@ return JSON.parse((0, node_child_process_1.execSync)("".concat(this.cfg.cliPath, " query protocol-parameters --").concat(this.cfg.network, " "), { env: { "CARDANO_NODE_SOCKET_PATH": this.cfg.socketPath } }).toString()); |
{ | ||
"name": "@harmoniclabs/cardanocli-pluts", | ||
"version": "0.1.3-dev4", | ||
"version": "0.1.3-dev5", | ||
"description": "typescript wrapper on top of the cardano-cli tool", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
166192
66
3252