Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scryptlib

Package Overview
Dependencies
Maintainers
3
Versions
296
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scryptlib - npm Package Compare versions

Comparing version 0.2.28 to 0.2.29-beta1

0

dist/abi.d.ts

@@ -0,0 +0,0 @@ import { AbstractContract, TxContext, VerifyResult, AsmVarValues } from './contract';

@@ -0,0 +0,0 @@ "use strict";

3

dist/compilerWrapper.d.ts

@@ -58,3 +58,3 @@ import { ContractDescription } from './contract';

opcode: string;
stack: string[];
stack?: string[];
pos?: Pos;

@@ -103,2 +103,3 @@ debugTag?: DebugModeTag;

sourceMap?: boolean;
optimize?: boolean;
}): CompileResult;

@@ -105,0 +106,0 @@ export declare function compilerVersion(cwd?: string): string;

@@ -37,3 +37,4 @@ "use strict";

asm: true,
debug: true
debug: true,
optimize: false,
}) {

@@ -51,3 +52,3 @@ const st = Date.now();

const cmdPrefix = settings.cmdPrefix || getDefaultScryptc();
const cmd = `${cmdPrefix} compile ${settings.asm || settings.desc ? '--asm' : ''} ${settings.ast || settings.desc ? '--ast' : ''} ${settings.debug == false ? '' : '--debug'} -r -o "${outputDir}" ${settings.cmdArgs ? settings.cmdArgs : ''}`;
const cmd = `${cmdPrefix} compile ${settings.asm || settings.desc ? '--asm' : ''} ${settings.ast || settings.desc ? '--ast' : ''} ${settings.debug == false ? '' : '--debug'} ${settings.optimize ? '--opt' : ''} -r -o "${outputDir}" ${settings.cmdArgs ? settings.cmdArgs : ''}`;
let output = child_process_1.execSync(cmd, { input: sourceContent, cwd: curWorkingDir }).toString();

@@ -132,40 +133,40 @@ // Because the output of the compiler on the win32 platform uses crlf as a newline, here we change \r\n to \n. make SYNTAX_ERR_REG、SEMANTIC_ERR_REG、IMPORT_ERR_REG work.

outputFiles['asm'] = outputFilePath;
if (settings.debug == false) {
result.asm = JSON.parse(fs_1.readFileSync(outputFilePath, 'utf8')).join(' ');
}
else {
asmObj = JSON.parse(fs_1.readFileSync(outputFilePath, 'utf8'));
const sources = asmObj.sources;
result.asm = asmObj.output.map(item => {
const match = SOURCE_REG.exec(item.src);
if (match && match.groups) {
const fileIndex = parseInt(match.groups.fileIndex);
let debugTag;
const tagStr = match.groups.tagStr;
if (/\w+\.\w+:0/.test(tagStr)) {
debugTag = DebugModeTag.FuncStart;
}
if (/\w+\.\w+:1/.test(tagStr)) {
debugTag = DebugModeTag.FuncEnd;
}
if (/loop:0/.test(tagStr)) {
debugTag = DebugModeTag.LoopStart;
}
const pos = sources[fileIndex] ? {
file: sources[fileIndex] ? getFullFilePath(sources[fileIndex], srcDir, sourceFileName) : undefined,
line: sources[fileIndex] ? parseInt(match.groups.line) : undefined,
endLine: sources[fileIndex] ? parseInt(match.groups.endLine) : undefined,
column: sources[fileIndex] ? parseInt(match.groups.col) : undefined,
endColumn: sources[fileIndex] ? parseInt(match.groups.endCol) : undefined,
} : undefined;
return {
opcode: item.opcode,
stack: item.stack,
pos: pos,
debugTag
};
asmObj = JSON.parse(fs_1.readFileSync(outputFilePath, 'utf8'));
const sources = asmObj.sources;
result.asm = asmObj.output.map(item => {
if (!settings.debug) {
return {
opcode: item.opcode
};
}
const match = SOURCE_REG.exec(item.src);
if (match && match.groups) {
const fileIndex = parseInt(match.groups.fileIndex);
let debugTag;
const tagStr = match.groups.tagStr;
if (/\w+\.\w+:0/.test(tagStr)) {
debugTag = DebugModeTag.FuncStart;
}
throw new Error('Compile Failed: Asm output parsing Error!');
});
}
if (/\w+\.\w+:1/.test(tagStr)) {
debugTag = DebugModeTag.FuncEnd;
}
if (/loop:0/.test(tagStr)) {
debugTag = DebugModeTag.LoopStart;
}
const pos = sources[fileIndex] ? {
file: sources[fileIndex] ? getFullFilePath(sources[fileIndex], srcDir, sourceFileName) : undefined,
line: sources[fileIndex] ? parseInt(match.groups.line) : undefined,
endLine: sources[fileIndex] ? parseInt(match.groups.endLine) : undefined,
column: sources[fileIndex] ? parseInt(match.groups.col) : undefined,
endColumn: sources[fileIndex] ? parseInt(match.groups.endCol) : undefined,
} : undefined;
return {
opcode: item.opcode,
stack: item.stack,
pos: pos,
debugTag
};
}
throw new Error('Compile Failed: Asm output parsing Error!');
});
}

@@ -189,7 +190,7 @@ if (settings.desc) {

};
if (settings.sourceMap && asmObj) {
if (settings.debug && settings.sourceMap && asmObj) {
Object.assign(description, {
file: result.file,
sources: asmObj.sources.map(source => getFullFilePath(source, srcDir, sourceFileName)),
sourceMap: asmObj.output.map(item => item.src)
sourceMap: asmObj.output.map(item => item.src),
});

@@ -196,0 +197,0 @@ }

@@ -0,0 +0,0 @@ import { ABICoder, Arguments, FunctionCall, Script } from "./abi";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export { buildContractClass, VerifyResult } from './contract';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { StructEntity } from "./compilerWrapper";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { bsv } from './utils';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

{
"name": "scryptlib",
"version": "0.2.28",
"version": "0.2.29-beta1",
"description": "Javascript SDK for integration of Bitcoin SV Smart Contracts written in sCrypt language.",

@@ -5,0 +5,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc