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.22 to 0.2.23-beta1

dist/t.d.ts

20

dist/abi.d.ts
import { AbstractContract, TxContext, VerifyResult, AsmVarValues } from './contract';
import { SingletonParamType, SupportedParamType } from './scryptTypes';
export declare enum ABIEntityType {
FUNCTION = "function",
CONSTRUCTOR = "constructor"
}
export interface ABIEntity {
type: ABIEntityType;
name?: string;
params: Array<{
name: string;
type: string;
}>;
index?: number;
}
import { SingletonParamType, SupportedParamType, Struct } from './scryptTypes';
import { ABIEntity, StructEntity } from './compilerWrapper';
export interface Script {

@@ -42,3 +30,4 @@ toASM(): string;

abi: ABIEntity[];
constructor(abi: ABIEntity[]);
structs: StructEntity[];
constructor(abi: ABIEntity[], structs: StructEntity[]);
encodeConstructorCall(contract: AbstractContract, asmTemplate: string, ...args: SupportedParamType[]): FunctionCall;

@@ -48,3 +37,4 @@ encodePubFunctionCall(contract: AbstractContract, name: string, args: SupportedParamType[]): FunctionCall;

encodeParamArray(args: SingletonParamType[], arrayTypeName: string): string;
encodeParamStruct(arg: Struct, structTypeName: string): string;
encodeParam(arg: SupportedParamType, scryptTypeName: string): string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ABICoder = exports.FunctionCall = exports.ABIEntityType = void 0;
exports.ABICoder = exports.FunctionCall = void 0;
const ts_optchain_1 = require("ts-optchain");
const utils_1 = require("./utils");
const scryptTypes_1 = require("./scryptTypes");
var ABIEntityType;
(function (ABIEntityType) {
ABIEntityType["FUNCTION"] = "function";
ABIEntityType["CONSTRUCTOR"] = "constructor";
})(ABIEntityType = exports.ABIEntityType || (exports.ABIEntityType = {}));
const compilerWrapper_1 = require("./compilerWrapper");
function escapeRegExp(stringToGoIntoTheRegex) {

@@ -78,7 +74,8 @@ return stringToGoIntoTheRegex.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');

class ABICoder {
constructor(abi) {
constructor(abi, structs) {
this.abi = abi;
this.structs = structs;
}
encodeConstructorCall(contract, asmTemplate, ...args) {
const constructorABI = this.abi.filter(entity => entity.type === ABIEntityType.CONSTRUCTOR)[0];
const constructorABI = this.abi.filter(entity => entity.type === compilerWrapper_1.ABIEntityType.CONSTRUCTOR)[0];
const cParams = ts_optchain_1.oc(constructorABI).params([]);

@@ -104,2 +101,16 @@ if (args.length !== cParams.length) {

}
else if (scryptTypes_1.Struct.isStruct(arg)) {
const s = utils_1.findStructByType(param.type, this.structs);
if (s) {
const argS = arg;
argS.bind(s);
s.params.forEach(e => {
cParams_.push({ name: `${param.name}.${e.name}`, type: e.type });
args_.push(arg.value[e.name]);
});
}
else {
throw new Error(`constructor does not accept struct at ${index}-th parameter`);
}
}
else {

@@ -154,2 +165,11 @@ cParams_.push(param);

}
encodeParamStruct(arg, structTypeName) {
const s = utils_1.findStructByType(structTypeName, this.structs);
if (s) {
return s.params.map(e => this.encodeParam(arg.value[e.name], e.type)).join(' ');
}
else {
throw new Error(`struct ${structTypeName} does not exist`);
}
}
encodeParam(arg, scryptTypeName) {

@@ -159,2 +179,12 @@ if (Array.isArray(arg)) {

}
if (scryptTypes_1.Struct.isStruct(arg)) {
const s = utils_1.findStructByType(scryptTypeName, this.structs);
if (s) {
const argS = arg;
argS.bind(s);
}
else {
throw new Error(`findStructByType failed for type ${scryptTypeName}`);
}
}
const typeofArg = typeof arg;

@@ -161,0 +191,0 @@ if (typeofArg === 'boolean') {

@@ -1,2 +0,1 @@

import { ABIEntity } from './abi';
export declare enum CompileErrorType {

@@ -10,6 +9,9 @@ SyntaxError = "SyntaxError",

filePath: string;
position: {
position: [{
line: number;
column: number;
};
}, {
line: number;
column: number;
}?];
message: string;

@@ -40,2 +42,3 @@ }

md5?: string;
structs?: any;
}

@@ -57,2 +60,26 @@ export declare enum DebugModeTag {

}
export interface ABI {
contract: string;
abi: Array<ABIEntity>;
}
export declare enum ABIEntityType {
FUNCTION = "function",
CONSTRUCTOR = "constructor"
}
export interface ABIEntity {
type: ABIEntityType;
name?: string;
params: Array<{
name: string;
type: string;
}>;
index?: number;
}
export interface StructEntity {
name: string;
params: Array<{
name: string;
type: string;
}>;
}
export declare function compile(source: {

@@ -75,3 +102,5 @@ path: string;

export declare function compilerVersion(cwd?: string): string;
export declare function getABIDeclaration(astRoot: any): ABI;
export declare function getStructDeclaration(astRoot: any): Array<StructEntity>;
export declare function getPlatformScryptc(): string;
export declare function getDefaultScryptc(): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultScryptc = exports.getPlatformScryptc = exports.compilerVersion = exports.compile = exports.DebugModeTag = exports.CompileErrorType = void 0;
exports.getDefaultScryptc = exports.getPlatformScryptc = exports.getStructDeclaration = exports.getABIDeclaration = exports.compilerVersion = exports.compile = exports.ABIEntityType = exports.DebugModeTag = exports.CompileErrorType = void 0;
const path_1 = require("path");

@@ -8,3 +8,2 @@ const child_process_1 = require("child_process");

const ts_optchain_1 = require("ts-optchain");
const abi_1 = require("./abi");
const os = require("os");

@@ -29,2 +28,7 @@ const md5 = require("md5");

})(DebugModeTag = exports.DebugModeTag || (exports.DebugModeTag = {}));
var ABIEntityType;
(function (ABIEntityType) {
ABIEntityType["FUNCTION"] = "function";
ABIEntityType["CONSTRUCTOR"] = "constructor";
})(ABIEntityType = exports.ABIEntityType || (exports.ABIEntityType = {}));
function compile(source, settings = {

@@ -57,6 +61,6 @@ asm: true,

message: `Imported file ${ts_optchain_1.oc(match.groups).fileName()} does not exist`,
position: {
line: parseInt(ts_optchain_1.oc(match.groups).line('-1')),
column: parseInt(ts_optchain_1.oc(match.groups).column('-1')),
},
position: [{
line: parseInt(ts_optchain_1.oc(match.groups).line('-1')),
column: parseInt(ts_optchain_1.oc(match.groups).column('-1')),
}],
file: ts_optchain_1.oc(match.groups).fileName('')

@@ -77,6 +81,6 @@ };

filePath: getFullFilePath(filePath, srcDir, sourceFileName),
position: {
line: parseInt(ts_optchain_1.oc(match.groups).line('-1')),
column: parseInt(ts_optchain_1.oc(match.groups).column('-1')),
},
position: [{
line: parseInt(ts_optchain_1.oc(match.groups).line('-1')),
column: parseInt(ts_optchain_1.oc(match.groups).column('-1')),
}],
message: ts_optchain_1.oc(match.groups).message(`unexpected ${unexpected}\nexpecting ${expecting}`),

@@ -97,6 +101,9 @@ unexpected,

filePath: getFullFilePath(filePath, srcDir, sourceFileName),
position: {
line: parseInt(ts_optchain_1.oc(match.groups).line('-1')),
column: parseInt(ts_optchain_1.oc(match.groups).column('-1')),
},
position: [{
line: parseInt(ts_optchain_1.oc(match.groups).line('-1')),
column: parseInt(ts_optchain_1.oc(match.groups).column('-1')),
}, {
line: parseInt(ts_optchain_1.oc(match.groups).line1('-1')),
column: parseInt(ts_optchain_1.oc(match.groups).column1('-1')),
}],
message: ts_optchain_1.oc(match.groups).message('')

@@ -169,2 +176,3 @@ };

md5: md5(sourceContent),
structs: getStructDeclaration(result.ast),
abi,

@@ -178,2 +186,3 @@ asm: result.asm

result.abi = abi;
result.structs = description.structs;
}

@@ -189,3 +198,3 @@ return result;

// rename all output files
fs_1.rename(file, file.replace('stdin', path_1.basename(sourcePath, '.scrypt')), () => { return; });
fs_1.renameSync(file, file.replace('stdin', path_1.basename(sourcePath, '.scrypt')));
}

@@ -264,4 +273,21 @@ else {

}
function getABIDeclaration(astRoot) {
const mainContract = astRoot["contracts"][astRoot["contracts"].length - 1];
function getConstructorDeclaration(mainContract) {
// explict constructor
if (mainContract['constructor']) {
return {
type: ABIEntityType.CONSTRUCTOR,
params: mainContract['constructor']['params'].map(p => { return { name: p['name'], type: p['type'] }; }),
};
}
else {
// implicit constructor
if (mainContract['properties']) {
return {
type: ABIEntityType.CONSTRUCTOR,
params: mainContract['properties'].map(p => { return { name: p['name'].replace('this.', ''), type: p['type'] }; }),
};
}
}
}
function getPublicFunctionDeclaration(mainContract) {
let pubIndex = 0;

@@ -272,3 +298,3 @@ const interfaces = mainContract['functions']

const entity = {
type: abi_1.ABIEntityType.FUNCTION,
type: ABIEntityType.FUNCTION,
name: f['name'],

@@ -280,18 +306,9 @@ index: f['nodeType'] === 'Constructor' ? undefined : pubIndex++,

});
// explict constructor
if (mainContract['constructor']) {
interfaces.push({
type: abi_1.ABIEntityType.CONSTRUCTOR,
params: mainContract['constructor']['params'].map(p => { return { name: p['name'], type: p['type'] }; }),
});
}
else {
// implicit constructor
if (mainContract['properties']) {
interfaces.push({
type: abi_1.ABIEntityType.CONSTRUCTOR,
params: mainContract['properties'].map(p => { return { name: p['name'].replace('this.', ''), type: p['type'] }; }),
});
}
}
return interfaces;
}
function getABIDeclaration(astRoot) {
const mainContract = astRoot["contracts"][astRoot["contracts"].length - 1];
const interfaces = getPublicFunctionDeclaration(mainContract);
const constructorABI = getConstructorDeclaration(mainContract);
interfaces.push(constructorABI);
return {

@@ -302,2 +319,10 @@ contract: mainContract['name'],

}
exports.getABIDeclaration = getABIDeclaration;
function getStructDeclaration(astRoot) {
return ts_optchain_1.oc(astRoot).structs([]).map(s => ({
name: s['name'],
params: s['fields'].map(p => { return { name: p['name'], type: p['type'] }; }),
}));
}
exports.getStructDeclaration = getStructDeclaration;
function getPlatformScryptc() {

@@ -304,0 +329,0 @@ switch (os.platform()) {

@@ -1,3 +0,4 @@

import { ABICoder, ABIEntity, FunctionCall, Script } from "./abi";
import { ABICoder, FunctionCall, Script } from "./abi";
import { State } from "./serializer";
import { StructEntity, ABIEntity } from "./compilerWrapper";
export interface TxContext {

@@ -16,2 +17,3 @@ tx?: any;

md5: string;
structs: Array<StructEntity>;
abi: Array<ABIEntity>;

@@ -40,3 +42,4 @@ asm: string;

get codePart(): Script;
static getAsmVars(contractAsm: any, instAsm: any): AsmVarValues | null;
}
export declare function buildContractClass(desc: ContractDescription): any;

@@ -59,2 +59,20 @@ "use strict";

}
static getAsmVars(contractAsm, instAsm) {
const regex = /(\$\S+)/g;
const vars = contractAsm.match(regex);
if (vars === null) {
return null;
}
const asmArray = contractAsm.split(/\s/g);
const lsASMArray = instAsm.split(/\s/g);
const result = {};
for (let i = 0; i < asmArray.length; i++) {
for (let j = 0; j < vars.length; j++) {
if (vars[j] === asmArray[i]) {
result[vars[j].replace('$', '')] = lsASMArray[i];
}
}
}
return result;
}
}

@@ -78,18 +96,3 @@ exports.AbstractContract = AbstractContract;

get asmVars() {
const regex = /(\$\S+)/g;
const vars = Contract.asm.match(regex);
if (vars === null) {
return null;
}
const asmArray = Contract.asm.split(/\s/g);
const lsASMArray = this.scriptedConstructor.toASM().split(/\s/g);
const result = {};
for (let i = 0; i < asmArray.length; i++) {
for (let j = 0; j < vars.length; j++) {
if (vars[j] === asmArray[i]) {
result[vars[j].replace('$', '')] = lsASMArray[i];
}
}
}
return result;
return AbstractContract.getAsmVars(Contract.asm, this.scriptedConstructor.toASM());
}

@@ -100,3 +103,3 @@ };

ContractClass.asm = desc.asm;
ContractClass.abiCoder = new abi_1.ABICoder(desc.abi);
ContractClass.abiCoder = new abi_1.ABICoder(desc.abi, desc.structs);
ContractClass.abi.forEach(entity => {

@@ -103,0 +106,0 @@ ContractClass.prototype[entity.name] = function (...args) {

export { buildContractClass, VerifyResult } from './contract';
export { compile } from './compilerWrapper';
export { bsv, signTx, toHex, getPreimage, num2bin, bin2num, bool2Asm, int2Asm, parseLiteral, bytes2Literal, bytesToHexString, getValidatedHexString, literal2ScryptType, VariableType, literal2Asm } from './utils';
export { compile, StructEntity, getStructDeclaration, getABIDeclaration, ABIEntity, ABIEntityType, ABI } from './compilerWrapper';
export { bsv, signTx, toHex, getPreimage, num2bin, bin2num, bool2Asm, int2Asm, parseLiteral, bytes2Literal, bytesToHexString, getValidatedHexString, literal2ScryptType, VariableType, literal2Asm, findStructByType, findStructByName, checkStruct, isStructType, isArrayType } from './utils';
export { serializeState, deserializeState, State, STATE_LEN_2BYTES, STATE_LEN_4BYTES } from './serializer';
export { Int, Bool, Bytes, PrivKey, PubKey, Sig, Ripemd160, Sha1, Sha256, SigHashType, SigHashPreimage, OpCodeType, SingletonParamType, SupportedParamType, ScryptType, ValueType } from './scryptTypes';
export { Int, Bool, Bytes, PrivKey, PubKey, Sig, Ripemd160, Sha1, Sha256, SigHashType, SigHashPreimage, OpCodeType, SingletonParamType, SupportedParamType, ScryptType, ValueType, Struct, StructObject } from './scryptTypes';

@@ -7,2 +7,5 @@ "use strict";

Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return compilerWrapper_1.compile; } });
Object.defineProperty(exports, "getStructDeclaration", { enumerable: true, get: function () { return compilerWrapper_1.getStructDeclaration; } });
Object.defineProperty(exports, "getABIDeclaration", { enumerable: true, get: function () { return compilerWrapper_1.getABIDeclaration; } });
Object.defineProperty(exports, "ABIEntityType", { enumerable: true, get: function () { return compilerWrapper_1.ABIEntityType; } });
var utils_1 = require("./utils");

@@ -24,2 +27,7 @@ Object.defineProperty(exports, "bsv", { enumerable: true, get: function () { return utils_1.bsv; } });

Object.defineProperty(exports, "literal2Asm", { enumerable: true, get: function () { return utils_1.literal2Asm; } });
Object.defineProperty(exports, "findStructByType", { enumerable: true, get: function () { return utils_1.findStructByType; } });
Object.defineProperty(exports, "findStructByName", { enumerable: true, get: function () { return utils_1.findStructByName; } });
Object.defineProperty(exports, "checkStruct", { enumerable: true, get: function () { return utils_1.checkStruct; } });
Object.defineProperty(exports, "isStructType", { enumerable: true, get: function () { return utils_1.isStructType; } });
Object.defineProperty(exports, "isArrayType", { enumerable: true, get: function () { return utils_1.isArrayType; } });
var serializer_1 = require("./serializer");

@@ -44,2 +52,3 @@ Object.defineProperty(exports, "serializeState", { enumerable: true, get: function () { return serializer_1.serializeState; } });

Object.defineProperty(exports, "ScryptType", { enumerable: true, get: function () { return scryptTypes_1.ScryptType; } });
Object.defineProperty(exports, "Struct", { enumerable: true, get: function () { return scryptTypes_1.Struct; } });
//# sourceMappingURL=index.js.map

@@ -1,7 +0,8 @@

export declare type ValueType = number | bigint | boolean | string;
import { StructEntity } from "./compilerWrapper";
export declare type ValueType = number | bigint | boolean | string | StructObject;
export declare abstract class ScryptType {
protected _value: ValueType;
protected _literal: string;
private _asm;
private _type;
protected _asm: string;
protected _type: string;
constructor(value: ValueType);

@@ -101,3 +102,14 @@ get value(): ValueType;

export declare type SingletonParamType = ScryptType | boolean | number | bigint;
export declare type StructObject = Record<string, SingletonParamType>;
export declare class Struct extends ScryptType {
sorted: boolean;
constructor(o: StructObject);
bind(structAst: StructEntity): void;
toASM(): string;
toArray(): ScryptType[];
memberByIndex(index: number): string;
toLiteral(): string;
static isStruct(arg: SupportedParamType): boolean;
}
export declare type SupportedParamType = SingletonParamType | SingletonParamType[];
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpCodeType = exports.SigHashPreimage = exports.SigHashType = exports.SigHash = exports.Sha256 = exports.Sha1 = exports.Ripemd160 = exports.Sig = exports.PubKey = exports.PrivKey = exports.Bytes = exports.Bool = exports.Int = exports.ScryptType = void 0;
exports.Struct = exports.OpCodeType = exports.SigHashPreimage = exports.SigHashType = exports.SigHash = exports.Sha256 = exports.Sha1 = exports.Ripemd160 = exports.Sig = exports.PubKey = exports.PrivKey = exports.Bytes = exports.Bool = exports.Int = exports.ScryptType = void 0;
const utils_1 = require("./utils");

@@ -250,2 +250,81 @@ class ScryptType {

exports.OpCodeType = OpCodeType;
class Struct extends ScryptType {
constructor(o) {
super(o);
this.sorted = false;
}
bind(structAst) {
utils_1.checkStruct(structAst, this);
const ordered = {};
const unordered = this.value;
Object.keys(this.value).sort((a, b) => {
return (structAst.params.findIndex(e => {
return e.name === a;
}) - structAst.params.findIndex(e => {
return e.name === b;
}));
}).forEach(function (key) {
ordered[key] = unordered[key];
});
this.sorted = true;
this._type = `struct ${structAst.name} {}`;
this._value = ordered;
}
toASM() {
if (!this.sorted) {
throw `unbinded Struct can't call toASM`;
}
this._asm = this.toArray().map(v => v.toASM()).join(' ');
return this._asm;
}
toArray() {
if (!this.sorted) {
throw `unbinded Struct can't call toArray`;
}
const v = this.value;
return Object.keys(v).map((key) => {
if (v[key] instanceof ScryptType) {
return v[key];
}
else if (typeof v[key] === "boolean") {
return new Bool(v[key]);
}
else if (typeof v[key] === "number") {
return new Int(v[key]);
}
else if (typeof v[key] === "bigint") {
return new Int(v[key]);
}
});
}
memberByIndex(index) {
if (!this.sorted) {
throw `unbinded Struct can't call memberByIndex`;
}
const v = this.value;
return Object.keys(v)[index];
}
toLiteral() {
const v = this.value;
const l = Object.keys(v).map((key) => {
if (v[key] instanceof ScryptType) {
return `${key}=${v[key].toLiteral()}`;
}
else if (typeof v[key] === "boolean") {
return `${key}=${new Bool(v[key]).toLiteral()}`;
}
else if (typeof v[key] === "number") {
return `${key}=${new Int(v[key]).toLiteral()}`;
}
else if (typeof v[key] === "bigint") {
return `${key}=${new Int(v[key]).toLiteral()}`;
}
});
return `Struct(${l})`;
}
static isStruct(arg) {
return arg instanceof Struct;
}
}
exports.Struct = Struct;
//# sourceMappingURL=scryptTypes.js.map
/// <reference types="node" />
import { SigHashPreimage, ScryptType, ValueType } from "./scryptTypes";
import { SigHashPreimage, ScryptType, ValueType, Struct } from "./scryptTypes";
import { StructEntity } from './compilerWrapper';
import bsv = require('bsv');

@@ -29,3 +30,4 @@ export { bsv };

SIGHASHPREIMAGE = "SigHashPreimage",
OPCODETYPE = "OpCodeType"
OPCODETYPE = "OpCodeType",
STRUCT = "Struct"
}

@@ -55,1 +57,6 @@ export declare function parseLiteral(l: string): [string, ValueType, VariableType];

export declare function literal2Asm(l: string): [string, string];
export declare function findStructByName(name: string, s: StructEntity[]): StructEntity;
export declare function isStructType(type: string): boolean;
export declare function isArrayType(type: string): boolean;
export declare function findStructByType(type: string, s: StructEntity[]): StructEntity | undefined;
export declare function checkStruct(s: StructEntity, arg: Struct): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.literal2Asm = exports.uri2path = exports.path2uri = exports.bin2num = exports.num2bin = exports.getPreimage = exports.toHex = exports.signTx = exports.getValidatedHexString = exports.hexStringToBytes = exports.bytesToHexString = exports.bytes2Literal = exports.literal2ScryptType = exports.parseLiteral = exports.VariableType = exports.intValue2hex = exports.int2Value = exports.int2Asm = exports.bool2Asm = exports.DEFAULT_SIGHASH_TYPE = exports.DEFAULT_FLAGS = exports.bsv = void 0;
exports.checkStruct = exports.findStructByType = exports.isArrayType = exports.isStructType = exports.findStructByName = exports.literal2Asm = exports.uri2path = exports.path2uri = exports.bin2num = exports.num2bin = exports.getPreimage = exports.toHex = exports.signTx = exports.getValidatedHexString = exports.hexStringToBytes = exports.bytesToHexString = exports.bytes2Literal = exports.literal2ScryptType = exports.parseLiteral = exports.VariableType = exports.intValue2hex = exports.int2Value = exports.int2Asm = exports.bool2Asm = exports.DEFAULT_SIGHASH_TYPE = exports.DEFAULT_FLAGS = exports.bsv = void 0;
const url_1 = require("url");

@@ -90,2 +90,3 @@ const scryptTypes_1 = require("./scryptTypes");

VariableType["OPCODETYPE"] = "OpCodeType";
VariableType["STRUCT"] = "Struct";
})(VariableType = exports.VariableType || (exports.VariableType = {}));

@@ -177,2 +178,8 @@ function parseLiteral(l) {

}
// Struct
m = /^Struct\((.*)\)$/.exec(l);
if (m) {
const value = m[1];
return [value, value, VariableType.STRUCT];
}
throw new Error(`<${l}> cannot be cast to ASM format, only sCrypt native types supported`);

@@ -356,2 +363,40 @@ }

exports.literal2Asm = literal2Asm;
function findStructByName(name, s) {
return s.find(s => {
return s.name == name;
});
}
exports.findStructByName = findStructByName;
function isStructType(type) {
return /struct\s(\w+)\s\{\}/.test(type);
}
exports.isStructType = isStructType;
function isArrayType(type) {
return /\w\[\d+\]/.test(type);
}
exports.isArrayType = isArrayType;
function findStructByType(type, s) {
const m = /struct\s(\w+)\s\{\}/.exec(type.trim());
if (m) {
return findStructByName(m[1], s);
}
return undefined;
}
exports.findStructByType = findStructByType;
function checkStruct(s, arg) {
const members = s.params.map(p => p.name);
const props = [];
for (const p in arg.value) {
if (!members.includes(p)) {
throw new Error(`${p} is not a member of struct ${s.name}`);
}
props.push(p);
}
members.forEach(key => {
if (!props.includes(key)) {
throw new Error(`argument of type struct ${s.name} missing member ${key}`);
}
});
}
exports.checkStruct = checkStruct;
//# sourceMappingURL=utils.js.map
{
"name": "scryptlib",
"version": "0.2.22",
"version": "0.2.23-beta1",
"description": "Javascript SDK for integration of Bitcoin SV Smart Contracts written in sCrypt language.",

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

Sorry, the diff of this file is not supported yet

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