Socket
Socket
Sign inDemoInstall

@hyperionbt/helios-cli

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperionbt/helios-cli - npm Package Compare versions

Comparing version 0.16.5 to 0.16.6-1

dist/addressInfo.js

16

dist/bundle.js
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { resolve } from "node:path";
import { Writer, parseFlag, parseOption, assertNoMoreOptions } from "./common/utils.js";

@@ -14,12 +15,15 @@ import { Bundle } from "./common/Bundle.js";

const options = parseOptions(args);
const heliosConfigPath = resolve("./helios.config.js");
const config = existsSync("./helios.config.json") ?
JSON.parse(readFileSync("./helios.config.json").toString()) :
{ stages: { main: {} } };
const bundle = await Bundle.initHere(config, options);
JSON.parse(readFileSync("./helios.config.json").toString()) : (existsSync(heliosConfigPath) ?
await eval(`import("${heliosConfigPath}")`) :
{ stages: { main: {} } });
for (let key in config.stages) {
const include = new Set(config.stages[key].include ?? []);
const exclude = new Set(config.stages[key].exclude ?? []);
const stageConfig = config.stages[key];
const include = new Set(stageConfig.include ?? []);
const exclude = new Set(stageConfig.exclude ?? []);
if (include.size > 0 && exclude.size > 0) {
throw new Error(`can't defined both include and exclude (see config for stage ${name})`);
}
const bundle = await Bundle.initHere(stageConfig?.define ?? {}, options);
const isIncluded = (name) => {

@@ -43,3 +47,3 @@ if (include.size > 0) {

const w = new Writer();
bundle.writeDefs(w, isIncluded);
bundle.writeDefs(w, isIncluded, !(stageConfig.isMainnet ?? false), config.extraDatumTypes ?? {});
writeFileSync(`dist/${key}/index.js`, w.toString());

@@ -46,0 +50,0 @@ }

@@ -12,3 +12,2 @@ import process from "node:process";

import { ModuleScript } from "./ModuleScript.js";
import { DEFAULT_CONFIG } from "./Config.js";
const RESERVED_ENDPOINTS = new Set([

@@ -27,6 +26,5 @@ "agent",

#endpoints;
#config;
#options;
#lock; // TODO: per-stage
constructor(sources, validators, modules, endpoints, config, options) {
constructor(sources, validators, modules, endpoints, options) {
this.#sources = sources;

@@ -36,10 +34,9 @@ this.#validators = validators;

this.#endpoints = endpoints;
this.#config = config;
this.#options = options;
this.#lock = existsSync("./helios-lock.json") ? JSON.parse(readFileSync("./helios-lock.json").toString()) : {};
}
static async initHere(config = DEFAULT_CONFIG, options = { dumpIR: [] }) {
return Bundle.init(process.cwd(), config, options);
static async initHere(define = {}, options = { dumpIR: [] }) {
return Bundle.init(process.cwd(), define, options);
}
static async init(dir, config, options) {
static async init(dir, define, options) {
heliosConfig.set({

@@ -73,3 +70,3 @@ CHECK_CASTS: true,

case "staking":
validators.add(new ValidatorScript(path, src, name, purpose));
validators.add(new ValidatorScript(path, src, name, purpose, define));
break;

@@ -80,3 +77,3 @@ case "endpoint":

}
endpoints.add(new EndpointScript(path, src, name));
endpoints.add(new EndpointScript(path, src, name, define));
break;

@@ -135,3 +132,3 @@ case "module":

});
return new Bundle(sources, validators, modules, endpoints, config, options);
return new Bundle(sources, validators, modules, endpoints, options);
}

@@ -173,3 +170,3 @@ generateDag() {

}
writePreamble(w) {
writePreamble(w, isTestnet) {
w.write(`import * as helios from "@hyperionbt/helios";

@@ -179,3 +176,3 @@

helios.config.set({AUTO_SET_VALIDITY_RANGE: true});
helios.config.set({AUTO_SET_VALIDITY_RANGE: true, IS_TESTNET: ${isTestnet ? "true" : "false"}});

@@ -200,3 +197,3 @@ const site = helios.Site.dummy();

}
writeValidatorDefs(w, isIncluded) {
writeValidatorDefs(w, isIncluded, extraDatumTypes) {
w.write(`\nconst validators = {`);

@@ -240,6 +237,4 @@ w.indent();

// add others
if (this.#config.extraDatumTypes) {
for (let datumType of (this.#config?.extraDatumTypes[v.name] ?? [])) {
datumChecks.push(this.compileExtraDatumCheck(datumType));
}
for (let datumType of (extraDatumTypes[v.name] ?? [])) {
datumChecks.push(this.compileExtraDatumCheck(datumType));
}

@@ -676,5 +671,5 @@ w.write(`

}
writeDefs(w, isIncluded) {
this.writePreamble(w);
this.writeValidatorDefs(w, isIncluded);
writeDefs(w, isIncluded, isTestnet, extraDatumTypes) {
this.writePreamble(w, isTestnet);
this.writeValidatorDefs(w, isIncluded, extraDatumTypes);
this.writeUnsimplifiedValidatorDefs(w, isIncluded);

@@ -681,0 +676,0 @@ this.writeCodeMapSource(w, isIncluded);

@@ -6,5 +6,7 @@ import { IR, IRProgram, Program, ToIRContext, bytesToHex } from "helios";

#program;
constructor(path, src, name) {
#define;
constructor(path, src, name, define) {
super(path, src, name);
this.#program = null;
this.#define = define;
}

@@ -14,2 +16,3 @@ get program() {

this.#program = Program.newInternal(this.src, this.moduleSrcs, this.scriptTypes);
this.#program.parameters = this.#define;
}

@@ -16,0 +19,0 @@ return this.#program;

@@ -6,8 +6,10 @@ import { DatumRedeemerProgram, Program, ToIRContext, bytesToHex, IR, IRProgram, IRParametricProgram, MintingPolicyHashType, StakingValidatorHashType, ValidatorHashType } from "helios";

#program;
#define;
#validators;
#dagDependencies;
constructor(path, src, name, purpose) {
constructor(path, src, name, purpose, define) {
super(path, src, name);
this.#purpose = purpose;
this.#program = null;
this.#define = define;
this.#validators = null;

@@ -32,2 +34,3 @@ this.#dagDependencies = new Set();

});
this.#program.parameters = this.#define;
}

@@ -34,0 +37,0 @@ return this.#program;

@@ -6,2 +6,3 @@ #!/usr/bin/env node

import addressCmd from "./address.js";
import addressInfo from "./addressInfo.js";
import bundleCmd from "./bundle.js";

@@ -16,3 +17,4 @@ import compileCmd from "./compile.js";

import genWalletPhrase from "./genWalletPhrase.js";
const VERSION = "0.16.5";
import printWalletInfo from "./walletInfo.js";
const VERSION = "0.16.6";
const USAGE = `Usage:

@@ -26,2 +28,4 @@ helios [-h|--help] <command> <command-options>

address-info <address>
bundle

@@ -55,2 +59,4 @@ -l, --lock

version
wallet-info <phrase> | <private-key-key>
`;

@@ -77,2 +83,5 @@ function printVersion() {

break;
case "address-info":
await addressInfo(args);
break;
case "bundle":

@@ -108,2 +117,5 @@ await bundleCmd(args);

break;
case "wallet-info":
printWalletInfo(args);
break;
default:

@@ -110,0 +122,0 @@ throw new UsageError(`unrecognized command "${command}"`);

{
"name": "@hyperionbt/helios-cli",
"version": "0.16.5",
"version": "0.16.6-1",
"description": "CLI tool for compiling Cardano smart contracts written in Helios, and building Cardano transactions.",

@@ -22,3 +22,3 @@ "main": "./dist/index.js",

"dependencies": {
"helios": "npm:@hyperionbt/helios@^0.16.5"
"helios": "npm:@hyperionbt/helios@^0.16.6"
},

@@ -25,0 +25,0 @@ "keywords": [],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc