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

@noir-lang/noir_wasm

Package Overview
Dependencies
Maintainers
1
Versions
394
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noir-lang/noir_wasm - npm Package Compare versions

Comparing version 0.12.0 to 0.16.0-10eae15.nightly

CHANGELOG.md

9

nodejs/noir_wasm_bg.wasm.d.ts
/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export function __wbg_compileerror_free(a: number): void;
export function __wbg_get_compileerror_message(a: number): number;
export function __wbg_set_compileerror_message(a: number, b: number): void;
export function __wbg_get_compileerror_diagnostics(a: number): number;
export function __wbg_set_compileerror_diagnostics(a: number, b: number): void;
export function init_log_level(a: number, b: number): void;

@@ -8,5 +13,3 @@ export function build_info(): number;

export function acir_write_bytes(a: number, b: number): void;
export function compile(a: number): number;
export function __wbg_trap_free(a: number): void;
export function trap___wbgd_downcast_token(): number;
export function compile(a: number, b: number, c: number, d: number, e: number): void;
export function __wbindgen_export_0(a: number): number;

@@ -13,0 +16,0 @@ export function __wbindgen_export_1(a: number, b: number, c: number): number;

@@ -22,15 +22,34 @@ /* tslint:disable */

/**
* @param {any} args
* @param {string} entry_point
* @param {boolean | undefined} contracts
* @param {string[] | undefined} dependencies
* @returns {any}
*/
export function compile(args: any): any;
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any;
export type Diagnostic = {
message: string;
file_path: string;
secondaries: ReadonlyArray<{
message: string;
start: number;
end: number;
}>;
}
interface CompileError {
diagnostics: ReadonlyArray<Diagnostic>;
}
/**
* A struct representing a Trap
*/
export class Trap {
export class CompileError {
free(): void;
/**
* @returns {Symbol}
*/
static __wbgd_downcast_token(): Symbol;
diagnostics: any;
/**
*/
message: string;
}

@@ -5,3 +5,3 @@ let imports = {};

const { read_file } = require(`@noir-lang/source-resolver`);
const { TextDecoder, TextEncoder } = require(`util`);
const { TextEncoder, TextDecoder } = require(`util`);

@@ -28,6 +28,13 @@ const heap = new Array(128).fill(undefined);

let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
cachedTextDecoder.decode();
heap[idx] = obj;
return idx;
}
let WASM_VECTOR_LEN = 0;
let cachedUint8Memory0 = null;

@@ -42,18 +49,2 @@

function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
return idx;
}
let WASM_VECTOR_LEN = 0;
let cachedTextEncoder = new TextEncoder('utf-8');

@@ -124,2 +115,11 @@

}
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
cachedTextDecoder.decode();
function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}
/**

@@ -182,8 +182,23 @@ * @param {string} level

/**
* @param {any} args
* @param {string} entry_point
* @param {boolean | undefined} contracts
* @param {string[] | undefined} dependencies
* @returns {any}
*/
module.exports.compile = function(args) {
const ret = wasm.compile(addHeapObject(args));
return takeObject(ret);
module.exports.compile = function(entry_point, contracts, dependencies) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
const len0 = WASM_VECTOR_LEN;
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
};

@@ -199,6 +214,13 @@

/**
* A struct representing a Trap
*/
class Trap {
class CompileError {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(CompileError.prototype);
obj.__wbg_ptr = ptr;
return obj;
}
__destroy_into_raw() {

@@ -213,14 +235,38 @@ const ptr = this.__wbg_ptr;

const ptr = this.__destroy_into_raw();
wasm.__wbg_trap_free(ptr);
wasm.__wbg_compileerror_free(ptr);
}
/**
* @returns {Symbol}
* @returns {string}
*/
static __wbgd_downcast_token() {
const ret = wasm.trap___wbgd_downcast_token();
get message() {
const ret = wasm.__wbg_get_compileerror_message(this.__wbg_ptr);
return takeObject(ret);
}
/**
* @param {string} arg0
*/
set message(arg0) {
wasm.__wbg_set_compileerror_message(this.__wbg_ptr, addHeapObject(arg0));
}
/**
* @returns {any}
*/
get diagnostics() {
const ret = wasm.__wbg_get_compileerror_diagnostics(this.__wbg_ptr);
return takeObject(ret);
}
/**
* @param {any} arg0
*/
set diagnostics(arg0) {
wasm.__wbg_set_compileerror_diagnostics(this.__wbg_ptr, addHeapObject(arg0));
}
}
module.exports.Trap = Trap;
module.exports.CompileError = CompileError;
module.exports.__wbg_compileerror_new = function(arg0) {
const ret = CompileError.__wrap(arg0);
return addHeapObject(ret);
};
module.exports.__wbindgen_object_drop_ref = function(arg0) {

@@ -230,2 +276,16 @@ takeObject(arg0);

module.exports.__wbindgen_object_clone_ref = function(arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
};
module.exports.__wbindgen_string_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};
module.exports.__wbindgen_is_undefined = function(arg0) {

@@ -236,6 +296,9 @@ const ret = getObject(arg0) === undefined;

module.exports.__wbindgen_is_null = function(arg0) {
const ret = getObject(arg0) === null;
return ret;
};
module.exports.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = read_file(getStringFromWasm0(arg1, arg2));
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
}, arguments) };

@@ -272,34 +335,2 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {

module.exports.__wbg_readfile_8efacfffd6a3a749 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = read_file(getStringFromWasm0(arg1, arg2));
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
}, arguments) };
module.exports.__wbindgen_object_clone_ref = function(arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
};
module.exports.__wbindgen_string_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};
module.exports.__wbg_static_accessor_SYMBOL_45d4d15e3c4aeb33 = function() {
const ret = Symbol;
return addHeapObject(ret);
};
module.exports.__wbindgen_is_symbol = function(arg0) {
const ret = typeof(getObject(arg0)) === 'symbol';
return ret;
};
module.exports.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {

@@ -329,7 +360,12 @@ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));

module.exports.__wbg_call_557a2f2deacc4912 = function() { return handleError(function (arg0, arg1) {
const ret = getObject(arg0).call(getObject(arg1));
module.exports.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
const ret = getObject(arg0)[arg1 >>> 0];
return addHeapObject(ret);
}, arguments) };
};
module.exports.__wbg_length_820c786973abdd8a = function(arg0) {
const ret = getObject(arg0).length;
return ret;
};
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {

@@ -336,0 +372,0 @@ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));

@@ -6,3 +6,3 @@ {

],
"version": "0.12.0",
"version": "0.16.0-10eae15.nightly",
"license": "(MIT OR Apache-2.0)",

@@ -24,8 +24,14 @@ "main": "./nodejs/noir_wasm.js",

"build": "bash ./build.sh",
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
"test:node": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
"test:browser": "web-test-runner"
"test": "yarn test:node && yarn test:browser",
"test:node": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha",
"test:browser": "web-test-runner",
"clean": "chmod u+w web nodejs || true && rm -rf ./nodejs ./web ./target ./result",
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
"build:nix": "nix build -L .#noir_wasm",
"install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/noir_wasm/nodejs ./ && cp -rL ./result/noir_wasm/web ./"
},
"peerDependencies": {
"@noir-lang/source-resolver": "workspace:*"
"@noir-lang/source-resolver": "0.16.0-10eae15.nightly"
},

@@ -37,5 +43,4 @@ "devDependencies": {

"@web/test-runner-playwright": "^0.10.0",
"@web/test-runner-webdriver": "^0.7.0",
"mocha": "^10.2.0"
}
}
}

@@ -12,3 +12,3 @@ # Noir Lang WASM JavaScript Package

```bash
nix build -L github:noir-lang/noir/master#wasm
nix build -L github:noir-lang/noir/master#noir_wasm
```

@@ -19,3 +19,3 @@

```bash
nix build -L #wasm
nix build -L #noir_wasm
```
/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export function __wbg_compileerror_free(a: number): void;
export function __wbg_get_compileerror_message(a: number): number;
export function __wbg_set_compileerror_message(a: number, b: number): void;
export function __wbg_get_compileerror_diagnostics(a: number): number;
export function __wbg_set_compileerror_diagnostics(a: number, b: number): void;
export function init_log_level(a: number, b: number): void;

@@ -8,5 +13,3 @@ export function build_info(): number;

export function acir_write_bytes(a: number, b: number): void;
export function compile(a: number): number;
export function __wbg_trap_free(a: number): void;
export function trap___wbgd_downcast_token(): number;
export function compile(a: number, b: number, c: number, d: number, e: number): void;
export function __wbindgen_export_0(a: number): number;

@@ -13,0 +16,0 @@ export function __wbindgen_export_1(a: number, b: number, c: number): number;

@@ -22,15 +22,34 @@ /* tslint:disable */

/**
* @param {any} args
* @param {string} entry_point
* @param {boolean | undefined} contracts
* @param {string[] | undefined} dependencies
* @returns {any}
*/
export function compile(args: any): any;
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any;
export type Diagnostic = {
message: string;
file_path: string;
secondaries: ReadonlyArray<{
message: string;
start: number;
end: number;
}>;
}
interface CompileError {
diagnostics: ReadonlyArray<Diagnostic>;
}
/**
* A struct representing a Trap
*/
export class Trap {
export class CompileError {
free(): void;
/**
* @returns {Symbol}
*/
static __wbgd_downcast_token(): Symbol;
diagnostics: any;
/**
*/
message: string;
}

@@ -42,2 +61,7 @@

readonly memory: WebAssembly.Memory;
readonly __wbg_compileerror_free: (a: number) => void;
readonly __wbg_get_compileerror_message: (a: number) => number;
readonly __wbg_set_compileerror_message: (a: number, b: number) => void;
readonly __wbg_get_compileerror_diagnostics: (a: number) => number;
readonly __wbg_set_compileerror_diagnostics: (a: number, b: number) => void;
readonly init_log_level: (a: number, b: number) => void;

@@ -47,5 +71,3 @@ readonly build_info: () => number;

readonly acir_write_bytes: (a: number, b: number) => void;
readonly compile: (a: number) => number;
readonly __wbg_trap_free: (a: number) => void;
readonly trap___wbgd_downcast_token: () => number;
readonly compile: (a: number, b: number, c: number, d: number, e: number) => void;
readonly __wbindgen_export_0: (a: number) => number;

@@ -52,0 +74,0 @@ readonly __wbindgen_export_1: (a: number, b: number, c: number) => number;

@@ -25,6 +25,13 @@ import { read_file } from '@noir-lang/source-resolver';

const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
heap[idx] = obj;
return idx;
}
let WASM_VECTOR_LEN = 0;
let cachedUint8Memory0 = null;

@@ -39,18 +46,2 @@

function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
return idx;
}
let WASM_VECTOR_LEN = 0;
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );

@@ -121,2 +112,11 @@

}
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}
/**

@@ -179,8 +179,23 @@ * @param {string} level

/**
* @param {any} args
* @param {string} entry_point
* @param {boolean | undefined} contracts
* @param {string[] | undefined} dependencies
* @returns {any}
*/
export function compile(args) {
const ret = wasm.compile(addHeapObject(args));
return takeObject(ret);
export function compile(entry_point, contracts, dependencies) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
const len0 = WASM_VECTOR_LEN;
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
}

@@ -196,6 +211,13 @@

/**
* A struct representing a Trap
*/
export class Trap {
export class CompileError {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(CompileError.prototype);
obj.__wbg_ptr = ptr;
return obj;
}
__destroy_into_raw() {

@@ -210,11 +232,30 @@ const ptr = this.__wbg_ptr;

const ptr = this.__destroy_into_raw();
wasm.__wbg_trap_free(ptr);
wasm.__wbg_compileerror_free(ptr);
}
/**
* @returns {Symbol}
* @returns {string}
*/
static __wbgd_downcast_token() {
const ret = wasm.trap___wbgd_downcast_token();
get message() {
const ret = wasm.__wbg_get_compileerror_message(this.__wbg_ptr);
return takeObject(ret);
}
/**
* @param {string} arg0
*/
set message(arg0) {
wasm.__wbg_set_compileerror_message(this.__wbg_ptr, addHeapObject(arg0));
}
/**
* @returns {any}
*/
get diagnostics() {
const ret = wasm.__wbg_get_compileerror_diagnostics(this.__wbg_ptr);
return takeObject(ret);
}
/**
* @param {any} arg0
*/
set diagnostics(arg0) {
wasm.__wbg_set_compileerror_diagnostics(this.__wbg_ptr, addHeapObject(arg0));
}
}

@@ -256,5 +297,21 @@

imports.wbg = {};
imports.wbg.__wbg_compileerror_new = function(arg0) {
const ret = CompileError.__wrap(arg0);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
};
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};
imports.wbg.__wbindgen_is_undefined = function(arg0) {

@@ -264,6 +321,9 @@ const ret = getObject(arg0) === undefined;

};
imports.wbg.__wbindgen_is_null = function(arg0) {
const ret = getObject(arg0) === null;
return ret;
};
imports.wbg.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = read_file(getStringFromWasm0(arg1, arg2));
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
}, arguments) };
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {

@@ -295,29 +355,2 @@ const ret = getStringFromWasm0(arg0, arg1);

};
imports.wbg.__wbg_readfile_8efacfffd6a3a749 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = read_file(getStringFromWasm0(arg1, arg2));
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
}, arguments) };
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};
imports.wbg.__wbg_static_accessor_SYMBOL_45d4d15e3c4aeb33 = function() {
const ret = Symbol;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_is_symbol = function(arg0) {
const ret = typeof(getObject(arg0)) === 'symbol';
return ret;
};
imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {

@@ -341,6 +374,10 @@ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));

};
imports.wbg.__wbg_call_557a2f2deacc4912 = function() { return handleError(function (arg0, arg1) {
const ret = getObject(arg0).call(getObject(arg1));
imports.wbg.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
const ret = getObject(arg0)[arg1 >>> 0];
return addHeapObject(ret);
}, arguments) };
};
imports.wbg.__wbg_length_820c786973abdd8a = function(arg0) {
const ret = getObject(arg0).length;
return ret;
};
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {

@@ -347,0 +384,0 @@ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc