New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tokel/cryptoconditions-js

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tokel/cryptoconditions-js - npm Package Compare versions

Comparing version 0.1.1 to 0.1.3

40

cryptoconditions.d.ts
/* tslint:disable */
/* eslint-disable */
/**
* serialise condition into asn.1
* @param {any} js_cond

@@ -9,2 +10,3 @@ * @returns {Uint8ClampedArray}

/**
* serialise fulfillment into asn1
* @param {any} js_cond

@@ -15,2 +17,3 @@ * @returns {Uint8ClampedArray}

/**
* serialise fulfillment into asn1 with adding special preimage cond containing the threshold value
* @param {any} js_cond

@@ -21,2 +24,3 @@ * @returns {Uint8ClampedArray}

/**
* sign secp256k1 condition
* @param {any} js_cond

@@ -27,12 +31,41 @@ * @param {Uint8ClampedArray} uca_secret_key

*/
export function js_cc_sign_secp256k1(js_cond: any, uca_secret_key: Uint8ClampedArray, uca_msg: Uint8ClampedArray): any;
/**
* old name call
* @param {any} js_cond
* @param {Uint8ClampedArray} uca_secret_key
* @param {Uint8ClampedArray} uca_msg
* @returns {any}
*/
export function js_sign_secp256k1(js_cond: any, uca_secret_key: Uint8ClampedArray, uca_msg: Uint8ClampedArray): any;
/**
* sign secp256k1hash conditions
* @param {any} js_cond
* @param {Uint8ClampedArray} uca_secret_key
* @param {Uint8ClampedArray} uca_msg
* @returns {any}
*/
export function js_cc_sign_secp256k1hash(js_cond: any, uca_secret_key: Uint8ClampedArray, uca_msg: Uint8ClampedArray): any;
/**
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
export function js_cc_read_condition_binary(js_bin: Uint8ClampedArray): any;
/**
* old name call forward
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
export function js_read_ccondition_binary(js_bin: Uint8ClampedArray): any;
/**
* read mixed mode fulfilment (with special preimage conds containing threshold value)
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
export function js_cc_read_fulfillment_binary_mixed(js_bin: Uint8ClampedArray): any;
/**
* old name call forward
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
export function js_read_fulfillment_binary_mixed(js_bin: Uint8ClampedArray): any;

@@ -43,4 +76,11 @@ /**

*/
export function js_cc_read_fulfillment_binary(js_bin: Uint8ClampedArray): any;
/**
* old name call forward
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
export function js_read_fulfillment_binary(js_bin: Uint8ClampedArray): any;
/**
* convert first level threshold to anon (for cc spk mixed mode)
* @param {any} js_cond

@@ -47,0 +87,0 @@ * @returns {any}

513

cryptoconditions.js
let imports = {};
imports['__wbindgen_placeholder__'] = module.exports;
let wasm;
const { TextDecoder, TextEncoder } = require(`util`);
const { TextEncoder, TextDecoder } = require(`util`);
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
cachedTextDecoder.decode();
let cachegetUint8Memory0 = null;
function getUint8Memory0() {
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
}
return cachegetUint8Memory0;
}
function getStringFromWasm0(ptr, len) {
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}
const heap = new Array(32).fill(undefined);

@@ -26,15 +10,6 @@

function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
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;
}
function getObject(idx) { return heap[idx]; }
function dropObject(idx) {

@@ -52,24 +27,12 @@ if (idx < 36) return;

function isLikeNone(x) {
return x === undefined || x === null;
}
let WASM_VECTOR_LEN = 0;
let cachegetFloat64Memory0 = null;
function getFloat64Memory0() {
if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
let cachedUint8Memory0;
function getUint8Memory0() {
if (cachedUint8Memory0.byteLength === 0) {
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
}
return cachegetFloat64Memory0;
return cachedUint8Memory0;
}
let cachegetInt32Memory0 = null;
function getInt32Memory0() {
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachegetInt32Memory0;
}
let WASM_VECTOR_LEN = 0;
let cachedTextEncoder = new TextEncoder('utf-8');

@@ -128,2 +91,104 @@

function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedInt32Memory0;
function getInt32Memory0() {
if (cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
cachedTextDecoder.decode();
function getStringFromWasm0(ptr, len) {
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 cachedFloat64Memory0;
function getFloat64Memory0() {
if (cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}
function debugString(val) {
// primitive types
const type = typeof val;
if (type == 'number' || type == 'boolean' || val == null) {
return `${val}`;
}
if (type == 'string') {
return `"${val}"`;
}
if (type == 'symbol') {
const description = val.description;
if (description == null) {
return 'Symbol';
} else {
return `Symbol(${description})`;
}
}
if (type == 'function') {
const name = val.name;
if (typeof name == 'string' && name.length > 0) {
return `Function(${name})`;
} else {
return 'Function';
}
}
// objects
if (Array.isArray(val)) {
const length = val.length;
let debug = '[';
if (length > 0) {
debug += debugString(val[0]);
}
for(let i = 1; i < length; i++) {
debug += ', ' + debugString(val[i]);
}
debug += ']';
return debug;
}
// Test for built-in
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
let className;
if (builtInMatches.length > 1) {
className = builtInMatches[1];
} else {
// Failed to match the standard '[object ClassName]'
return toString.call(val);
}
if (className == 'Object') {
// we're a user defined class or Object
// JSON.stringify avoids problems with cycles, and is generally much
// easier than looping through ownProperties of `val`.
try {
return 'Object(' + JSON.stringify(val) + ')';
} catch (_) {
return 'Object';
}
}
// errors
if (val instanceof Error) {
return `${val.name}: ${val.message}\n${val.stack}`;
}
// TODO we could test for more things here, like `Set`s and `Map`s.
return className;
}
let stack_pointer = 32;

@@ -137,2 +202,3 @@

/**
* serialise condition into asn.1
* @param {any} js_cond

@@ -143,5 +209,13 @@ * @returns {Uint8ClampedArray}

try {
var ret = wasm.js_cc_condition_binary(addBorrowedObject(js_cond));
return takeObject(ret);
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_condition_binary(retptr, addBorrowedObject(js_cond));
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);
heap[stack_pointer++] = undefined;

@@ -152,2 +226,3 @@ }

/**
* serialise fulfillment into asn1
* @param {any} js_cond

@@ -158,5 +233,13 @@ * @returns {Uint8ClampedArray}

try {
var ret = wasm.js_cc_fulfillment_binary(addBorrowedObject(js_cond));
return takeObject(ret);
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_fulfillment_binary(retptr, addBorrowedObject(js_cond));
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);
heap[stack_pointer++] = undefined;

@@ -167,2 +250,3 @@ }

/**
* serialise fulfillment into asn1 with adding special preimage cond containing the threshold value
* @param {any} js_cond

@@ -173,5 +257,13 @@ * @returns {Uint8ClampedArray}

try {
var ret = wasm.js_cc_fulfillment_binary_mixed(addBorrowedObject(js_cond));
return takeObject(ret);
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_fulfillment_binary_mixed(retptr, addBorrowedObject(js_cond));
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);
heap[stack_pointer++] = undefined;

@@ -182,2 +274,3 @@ }

/**
* sign secp256k1 condition
* @param {any} js_cond

@@ -188,7 +281,41 @@ * @param {Uint8ClampedArray} uca_secret_key

*/
module.exports.js_cc_sign_secp256k1 = function(js_cond, uca_secret_key, uca_msg) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_sign_secp256k1(retptr, addBorrowedObject(js_cond), addBorrowedObject(uca_secret_key), addBorrowedObject(uca_msg));
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);
heap[stack_pointer++] = undefined;
heap[stack_pointer++] = undefined;
heap[stack_pointer++] = undefined;
}
};
/**
* old name call
* @param {any} js_cond
* @param {Uint8ClampedArray} uca_secret_key
* @param {Uint8ClampedArray} uca_msg
* @returns {any}
*/
module.exports.js_sign_secp256k1 = function(js_cond, uca_secret_key, uca_msg) {
try {
var ret = wasm.js_sign_secp256k1(addBorrowedObject(js_cond), addBorrowedObject(uca_secret_key), addBorrowedObject(uca_msg));
return takeObject(ret);
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_sign_secp256k1(retptr, addBorrowedObject(js_cond), addBorrowedObject(uca_secret_key), addBorrowedObject(uca_msg));
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);
heap[stack_pointer++] = undefined;

@@ -201,10 +328,66 @@ heap[stack_pointer++] = undefined;

/**
* sign secp256k1hash conditions
* @param {any} js_cond
* @param {Uint8ClampedArray} uca_secret_key
* @param {Uint8ClampedArray} uca_msg
* @returns {any}
*/
module.exports.js_cc_sign_secp256k1hash = function(js_cond, uca_secret_key, uca_msg) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_sign_secp256k1hash(retptr, addBorrowedObject(js_cond), addBorrowedObject(uca_secret_key), addBorrowedObject(uca_msg));
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);
heap[stack_pointer++] = undefined;
heap[stack_pointer++] = undefined;
heap[stack_pointer++] = undefined;
}
};
/**
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
module.exports.js_cc_read_condition_binary = function(js_bin) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_read_condition_binary(retptr, addBorrowedObject(js_bin));
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);
heap[stack_pointer++] = undefined;
}
};
/**
* old name call forward
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
module.exports.js_read_ccondition_binary = function(js_bin) {
try {
var ret = wasm.js_read_ccondition_binary(addBorrowedObject(js_bin));
return takeObject(ret);
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_read_condition_binary(retptr, addBorrowedObject(js_bin));
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);
heap[stack_pointer++] = undefined;

@@ -215,10 +398,41 @@ }

/**
* read mixed mode fulfilment (with special preimage conds containing threshold value)
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
module.exports.js_cc_read_fulfillment_binary_mixed = function(js_bin) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_read_fulfillment_binary_mixed(retptr, addBorrowedObject(js_bin));
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);
heap[stack_pointer++] = undefined;
}
};
/**
* old name call forward
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
module.exports.js_read_fulfillment_binary_mixed = function(js_bin) {
try {
var ret = wasm.js_read_fulfillment_binary_mixed(addBorrowedObject(js_bin));
return takeObject(ret);
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_read_fulfillment_binary_mixed(retptr, addBorrowedObject(js_bin));
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);
heap[stack_pointer++] = undefined;

@@ -232,7 +446,37 @@ }

*/
module.exports.js_cc_read_fulfillment_binary = function(js_bin) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_read_fulfillment_binary(retptr, addBorrowedObject(js_bin));
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);
heap[stack_pointer++] = undefined;
}
};
/**
* old name call forward
* @param {Uint8ClampedArray} js_bin
* @returns {any}
*/
module.exports.js_read_fulfillment_binary = function(js_bin) {
try {
var ret = wasm.js_read_fulfillment_binary(addBorrowedObject(js_bin));
return takeObject(ret);
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_read_fulfillment_binary(retptr, addBorrowedObject(js_bin));
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);
heap[stack_pointer++] = undefined;

@@ -243,2 +487,3 @@ }

/**
* convert first level threshold to anon (for cc spk mixed mode)
* @param {any} js_cond

@@ -249,5 +494,13 @@ * @returns {any}

try {
var ret = wasm.js_cc_threshold_to_anon(addBorrowedObject(js_cond));
return takeObject(ret);
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.js_cc_threshold_to_anon(retptr, addBorrowedObject(js_cond));
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);
heap[stack_pointer++] = undefined;

@@ -265,7 +518,2 @@ }

module.exports.__wbindgen_string_new = function(arg0, arg1) {
var ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};
module.exports.__wbindgen_object_drop_ref = function(arg0) {

@@ -275,113 +523,122 @@ takeObject(arg0);

module.exports.__wbindgen_is_null = function(arg0) {
var ret = getObject(arg0) === null;
module.exports.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
module.exports.__wbg_debug_104e10fa490af5d4 = function(arg0) {
console.debug(getObject(arg0));
module.exports.__wbindgen_string_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
};
module.exports.__wbg_error_009e67eab9c16665 = function(arg0) {
console.error(getObject(arg0));
module.exports.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};
module.exports.__wbg_info_44b510682aa2cf74 = function(arg0) {
console.info(getObject(arg0));
module.exports.__wbindgen_is_undefined = function(arg0) {
const ret = getObject(arg0) === undefined;
return ret;
};
module.exports.__wbg_log_4989d5b00a0cc297 = function(arg0) {
console.log(getObject(arg0));
module.exports.__wbindgen_number_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'number' ? obj : undefined;
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
};
module.exports.__wbg_warn_f9b80af3c73d7193 = function(arg0) {
console.warn(getObject(arg0));
module.exports.__wbindgen_number_new = function(arg0) {
const ret = arg0;
return addHeapObject(ret);
};
module.exports.__wbg_get_73c087db0a496c21 = function(arg0, arg1) {
var ret = getObject(arg0)[arg1 >>> 0];
module.exports.__wbindgen_is_object = function(arg0) {
const val = getObject(arg0);
const ret = typeof(val) === 'object' && val !== null;
return ret;
};
module.exports.__wbindgen_error_new = function(arg0, arg1) {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};
module.exports.__wbg_length_c5fa152b8c3f311f = function(arg0) {
var ret = getObject(arg0).length;
module.exports.__wbg_get_f0f4f1608ebf633e = function(arg0, arg1) {
const ret = getObject(arg0)[arg1 >>> 0];
return addHeapObject(ret);
};
module.exports.__wbg_length_93debb0e2e184ab6 = function(arg0) {
const ret = getObject(arg0).length;
return ret;
};
module.exports.__wbg_new_ec75d0d5815be736 = function() {
var ret = new Array();
module.exports.__wbg_new_2ab697f1555e0dbc = function() {
const ret = new Array();
return addHeapObject(ret);
};
module.exports.__wbg_get_6d26c712aa73c8b2 = function() { return handleError(function (arg0, arg1) {
var ret = Reflect.get(getObject(arg0), getObject(arg1));
module.exports.__wbg_get_89247d3aeaa38cc5 = function() { return handleError(function (arg0, arg1) {
const ret = Reflect.get(getObject(arg0), getObject(arg1));
return addHeapObject(ret);
}, arguments) };
module.exports.__wbg_new_4b48f9f8159fea77 = function() {
var ret = new Object();
module.exports.__wbg_new_306ce8d57919e6ae = function() {
const ret = new Object();
return addHeapObject(ret);
};
module.exports.__wbg_from_28631399e1e647cb = function(arg0) {
var ret = Array.from(getObject(arg0));
module.exports.__wbg_from_7ff9036e9b5c3ccb = function(arg0) {
const ret = Array.from(getObject(arg0));
return addHeapObject(ret);
};
module.exports.__wbg_isArray_8c5958cbfaf9bb48 = function(arg0) {
var ret = Array.isArray(getObject(arg0));
module.exports.__wbg_isArray_628aca8c24017cde = function(arg0) {
const ret = Array.isArray(getObject(arg0));
return ret;
};
module.exports.__wbg_push_0daae9343162dbe7 = function(arg0, arg1) {
var ret = getObject(arg0).push(getObject(arg1));
module.exports.__wbg_push_811c8b08bf4ff9d5 = function(arg0, arg1) {
const ret = getObject(arg0).push(getObject(arg1));
return ret;
};
module.exports.__wbg_buffer_79a3294266d4e783 = function(arg0) {
var ret = getObject(arg0).buffer;
module.exports.__wbg_buffer_de1150f91b23aa89 = function(arg0) {
const ret = getObject(arg0).buffer;
return addHeapObject(ret);
};
module.exports.__wbg_newwithbyteoffsetandlength_e40f37241c53e407 = function(arg0, arg1, arg2) {
var ret = new Uint8ClampedArray(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
module.exports.__wbg_newwithbyteoffsetandlength_0d500f69779331df = function(arg0, arg1, arg2) {
const ret = new Uint8ClampedArray(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
module.exports.__wbg_new_b32e59639f2b2f18 = function(arg0) {
var ret = new Uint8ClampedArray(getObject(arg0));
module.exports.__wbg_new_9bfb70adb89108d7 = function(arg0) {
const ret = new Uint8ClampedArray(getObject(arg0));
return addHeapObject(ret);
};
module.exports.__wbg_set_40dc363553f3d95d = function(arg0, arg1, arg2) {
module.exports.__wbg_set_7fd764d5efb40384 = function(arg0, arg1, arg2) {
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
};
module.exports.__wbg_length_7ad20c9cba08b274 = function(arg0) {
var ret = getObject(arg0).length;
module.exports.__wbg_length_0b70cb06609feb56 = function(arg0) {
const ret = getObject(arg0).length;
return ret;
};
module.exports.__wbg_set_d29a397c9cc5d746 = function() { return handleError(function (arg0, arg1, arg2) {
var ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
module.exports.__wbg_set_b12cd0ab82903c2f = function() { return handleError(function (arg0, arg1, arg2) {
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
return ret;
}, arguments) };
module.exports.__wbindgen_number_get = function(arg0, arg1) {
const obj = getObject(arg1);
var ret = typeof(obj) === 'number' ? obj : undefined;
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
};
module.exports.__wbindgen_is_string = function(arg0) {
var ret = typeof(getObject(arg0)) === 'string';
return ret;
};
module.exports.__wbindgen_string_get = function(arg0, arg1) {
const obj = getObject(arg1);
var ret = typeof(obj) === 'string' ? obj : undefined;
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
const ret = debugString(getObject(arg1));
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;

@@ -395,8 +652,4 @@ getInt32Memory0()[arg0 / 4 + 0] = ptr0;

module.exports.__wbindgen_rethrow = function(arg0) {
throw takeObject(arg0);
};
module.exports.__wbindgen_memory = function() {
var ret = wasm.memory;
const ret = wasm.memory;
return addHeapObject(ret);

@@ -413,1 +666,5 @@ };

cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
{
"name": "@tokel/cryptoconditions-js",
"collaborators": [
"Scott Sadler <me@scottsadler.de>"
"Scott Sadler <me@scottsadler.de>",
"dimxy <dimxy@komodoplatform.com>"
],
"version": "0.1.1",
"version": "0.1.3",
"license": "MIT",
"files": [

@@ -8,0 +10,0 @@ "cryptoconditions_bg.wasm",

@@ -5,5 +5,5 @@ ### Notes on 'cryptoconditions' library

Dev language: rust
Dev language: rust, with wasm support
It also could be compiled as a wasm with wasm-pack, use this cmd to build a wasm:
For use in a js app this lib could be compiled as a wasm module with the wasm-pack, use this cmd to build a wasm:

@@ -14,5 +14,6 @@ `wasm-pack build --target nodejs`

### Use as a global module
To add the wasm to your nodejs project first make it as a global node module:
```
cd ~/pycc/cryptoconditions/pkg
cd ~/your-repo-dir/cryptoconditions-js/cryptoconditions/pkg
npm link -g

@@ -26,5 +27,17 @@ ```

To use the cryptoconditions wasm in browser use browserify tool
### Use as a local module
Add a link to this repo into your package.json:
```
"dependencies": {
"cryptoconditions-js": "git+https://github.com/dimxy/cryptoconditions-js.git#master",
...
}
```
### Use in browser
To use the cryptoconditions wasm in browser:
* Build a wasm with `wasm-pack build` cmd
* Use browserify tool to create a js module usable in a web app
## Publish new npm version

@@ -37,4 +50,4 @@

$ cd pkg
$ #check the version of the library in package.json
$ #check the version and package name of the library in package.json
$ npm publish --access=public
```

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