@lucid-evolution/uplc 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/browser/uplc_tx.mjs +8557 -0
- package/dist/browser/uplc_tx_bg.wasm +0 -0
- package/dist/node/uplc_tx.d.mts +36 -0
- package/dist/node/uplc_tx.d.ts +36 -0
- package/dist/{uplc_tx.js → node/uplc_tx.js} +33 -113
- package/dist/node/uplc_tx.mjs +191 -0
- package/dist/node/uplc_tx_bg.wasm +0 -0
- package/package.json +9 -5
- package/dist/uplc_tx_bg-2ZM6JWAH.wasm +0 -0
- /package/dist/{uplc_tx.d.ts → browser/uplc_tx.d.mts} +0 -0
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {Uint8Array} tx_bytes
|
|
5
|
+
* @param {(Uint8Array)[]} utxos_bytes_x
|
|
6
|
+
* @param {(Uint8Array)[]} utxos_bytes_y
|
|
7
|
+
* @param {Uint8Array} cost_mdls_bytes
|
|
8
|
+
* @param {bigint} initial_budget_n
|
|
9
|
+
* @param {bigint} initial_budget_d
|
|
10
|
+
* @param {bigint} slot_config_x
|
|
11
|
+
* @param {bigint} slot_config_y
|
|
12
|
+
* @param {number} slot_config_z
|
|
13
|
+
* @returns {(Uint8Array)[]}
|
|
14
|
+
*/
|
|
15
|
+
declare function eval_phase_two_raw(
|
|
16
|
+
tx_bytes: Uint8Array,
|
|
17
|
+
utxos_bytes_x: Uint8Array[],
|
|
18
|
+
utxos_bytes_y: Uint8Array[],
|
|
19
|
+
cost_mdls_bytes: Uint8Array,
|
|
20
|
+
initial_budget_n: bigint,
|
|
21
|
+
initial_budget_d: bigint,
|
|
22
|
+
slot_config_x: bigint,
|
|
23
|
+
slot_config_y: bigint,
|
|
24
|
+
slot_config_z: number,
|
|
25
|
+
): Uint8Array[];
|
|
26
|
+
/**
|
|
27
|
+
* @param {Uint8Array} params_bytes
|
|
28
|
+
* @param {Uint8Array} plutus_script_bytes
|
|
29
|
+
* @returns {Uint8Array}
|
|
30
|
+
*/
|
|
31
|
+
declare function apply_params_to_script(
|
|
32
|
+
params_bytes: Uint8Array,
|
|
33
|
+
plutus_script_bytes: Uint8Array,
|
|
34
|
+
): Uint8Array;
|
|
35
|
+
|
|
36
|
+
export { apply_params_to_script, eval_phase_two_raw };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {Uint8Array} tx_bytes
|
|
5
|
+
* @param {(Uint8Array)[]} utxos_bytes_x
|
|
6
|
+
* @param {(Uint8Array)[]} utxos_bytes_y
|
|
7
|
+
* @param {Uint8Array} cost_mdls_bytes
|
|
8
|
+
* @param {bigint} initial_budget_n
|
|
9
|
+
* @param {bigint} initial_budget_d
|
|
10
|
+
* @param {bigint} slot_config_x
|
|
11
|
+
* @param {bigint} slot_config_y
|
|
12
|
+
* @param {number} slot_config_z
|
|
13
|
+
* @returns {(Uint8Array)[]}
|
|
14
|
+
*/
|
|
15
|
+
declare function eval_phase_two_raw(
|
|
16
|
+
tx_bytes: Uint8Array,
|
|
17
|
+
utxos_bytes_x: Uint8Array[],
|
|
18
|
+
utxos_bytes_y: Uint8Array[],
|
|
19
|
+
cost_mdls_bytes: Uint8Array,
|
|
20
|
+
initial_budget_n: bigint,
|
|
21
|
+
initial_budget_d: bigint,
|
|
22
|
+
slot_config_x: bigint,
|
|
23
|
+
slot_config_y: bigint,
|
|
24
|
+
slot_config_z: number,
|
|
25
|
+
): Uint8Array[];
|
|
26
|
+
/**
|
|
27
|
+
* @param {Uint8Array} params_bytes
|
|
28
|
+
* @param {Uint8Array} plutus_script_bytes
|
|
29
|
+
* @returns {Uint8Array}
|
|
30
|
+
*/
|
|
31
|
+
declare function apply_params_to_script(
|
|
32
|
+
params_bytes: Uint8Array,
|
|
33
|
+
plutus_script_bytes: Uint8Array,
|
|
34
|
+
): Uint8Array;
|
|
35
|
+
|
|
36
|
+
export { apply_params_to_script, eval_phase_two_raw };
|
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// wasm-module:/home/runner/work/lucid-evolution/lucid-evolution/packages/uplc/src/uplc_tx_bg.wasm
|
|
8
|
-
var uplc_tx_bg_exports = {};
|
|
9
|
-
__export(uplc_tx_bg_exports, {
|
|
10
|
-
__wbindgen_add_to_stack_pointer: () => __wbindgen_add_to_stack_pointer,
|
|
11
|
-
__wbindgen_free: () => __wbindgen_free,
|
|
12
|
-
__wbindgen_malloc: () => __wbindgen_malloc,
|
|
13
|
-
apply_params_to_script: () => apply_params_to_script2,
|
|
14
|
-
eval_phase_two_raw: () => eval_phase_two_raw2,
|
|
15
|
-
instance: () => instance,
|
|
16
|
-
memory: () => memory,
|
|
17
|
-
module: () => module2
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// wasm-deferred:/home/runner/work/lucid-evolution/lucid-evolution/packages/uplc/src/uplc_tx_bg.wasm
|
|
21
|
-
var uplc_tx_bg_default = "./uplc_tx_bg-2ZM6JWAH.wasm";
|
|
1
|
+
"use strict";
|
|
22
2
|
|
|
23
|
-
// src/
|
|
3
|
+
// src/uplc_tx.js
|
|
4
|
+
var imports = {};
|
|
5
|
+
imports["__wbindgen_placeholder__"] = module.exports;
|
|
24
6
|
var wasm;
|
|
25
|
-
|
|
26
|
-
wasm = val;
|
|
27
|
-
}
|
|
7
|
+
var { TextDecoder } = require("util");
|
|
28
8
|
var heap = new Array(128).fill(void 0);
|
|
29
9
|
heap.push(void 0, null, true, false);
|
|
30
10
|
function getObject(idx) {
|
|
@@ -42,8 +22,7 @@ function takeObject(idx) {
|
|
|
42
22
|
dropObject(idx);
|
|
43
23
|
return ret;
|
|
44
24
|
}
|
|
45
|
-
var
|
|
46
|
-
var cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
25
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
47
26
|
cachedTextDecoder.decode();
|
|
48
27
|
var cachedUint8Memory0 = null;
|
|
49
28
|
function getUint8Memory0() {
|
|
@@ -104,7 +83,7 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
104
83
|
}
|
|
105
84
|
return result;
|
|
106
85
|
}
|
|
107
|
-
function
|
|
86
|
+
module.exports.eval_phase_two_raw = function(tx_bytes, utxos_bytes_x, utxos_bytes_y, cost_mdls_bytes, initial_budget_n, initial_budget_d, slot_config_x, slot_config_y, slot_config_z) {
|
|
108
87
|
try {
|
|
109
88
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
110
89
|
const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
|
|
@@ -129,12 +108,12 @@ function eval_phase_two_raw(tx_bytes, utxos_bytes_x, utxos_bytes_y, cost_mdls_by
|
|
|
129
108
|
} finally {
|
|
130
109
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
131
110
|
}
|
|
132
|
-
}
|
|
111
|
+
};
|
|
133
112
|
function getArrayU8FromWasm0(ptr, len) {
|
|
134
113
|
ptr = ptr >>> 0;
|
|
135
114
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
136
115
|
}
|
|
137
|
-
function
|
|
116
|
+
module.exports.apply_params_to_script = function(params_bytes, plutus_script_bytes) {
|
|
138
117
|
try {
|
|
139
118
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
140
119
|
const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
|
|
@@ -155,102 +134,43 @@ function apply_params_to_script(params_bytes, plutus_script_bytes) {
|
|
|
155
134
|
} finally {
|
|
156
135
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
157
136
|
}
|
|
158
|
-
}
|
|
159
|
-
function
|
|
137
|
+
};
|
|
138
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
160
139
|
takeObject(arg0);
|
|
161
|
-
}
|
|
162
|
-
function
|
|
140
|
+
};
|
|
141
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
163
142
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
164
143
|
return addHeapObject(ret);
|
|
165
|
-
}
|
|
166
|
-
function
|
|
144
|
+
};
|
|
145
|
+
module.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
167
146
|
const ret = getObject(arg0).buffer;
|
|
168
147
|
return addHeapObject(ret);
|
|
169
|
-
}
|
|
170
|
-
function
|
|
148
|
+
};
|
|
149
|
+
module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
171
150
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
172
151
|
return addHeapObject(ret);
|
|
173
|
-
}
|
|
174
|
-
function
|
|
152
|
+
};
|
|
153
|
+
module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
175
154
|
const ret = new Uint8Array(getObject(arg0));
|
|
176
155
|
return addHeapObject(ret);
|
|
177
|
-
}
|
|
178
|
-
function
|
|
156
|
+
};
|
|
157
|
+
module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
179
158
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
180
|
-
}
|
|
181
|
-
function
|
|
159
|
+
};
|
|
160
|
+
module.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
|
|
182
161
|
const ret = getObject(arg0).length;
|
|
183
162
|
return ret;
|
|
184
|
-
}
|
|
185
|
-
function
|
|
163
|
+
};
|
|
164
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
186
165
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
187
|
-
}
|
|
188
|
-
function
|
|
166
|
+
};
|
|
167
|
+
module.exports.__wbindgen_memory = function() {
|
|
189
168
|
const ret = wasm.memory;
|
|
190
169
|
return addHeapObject(ret);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// wasm-module:/home/runner/work/lucid-evolution/lucid-evolution/packages/uplc/src/uplc_tx_bg.wasm
|
|
194
|
-
var imports = {
|
|
195
|
-
["./uplc_tx_bg.js"]: {
|
|
196
|
-
__wbindgen_object_drop_ref,
|
|
197
|
-
__wbindgen_string_new,
|
|
198
|
-
__wbg_buffer_a448f833075b71ba,
|
|
199
|
-
__wbg_newwithbyteoffsetandlength_d0482f893617af71,
|
|
200
|
-
__wbg_new_8f67e318f15d7254,
|
|
201
|
-
__wbg_set_2357bf09366ee480,
|
|
202
|
-
__wbg_length_1d25fa9e4ac21ce7,
|
|
203
|
-
__wbindgen_throw,
|
|
204
|
-
__wbindgen_memory
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
async function loadWasm(module3, imports2) {
|
|
208
|
-
if (typeof module3 === "string") {
|
|
209
|
-
if (module3.startsWith("./")) {
|
|
210
|
-
module3 = new URL(module3, import.meta.url).href;
|
|
211
|
-
}
|
|
212
|
-
if (module3.startsWith("file://")) {
|
|
213
|
-
const fs = await import("fs");
|
|
214
|
-
module3 = await fs.promises.readFile(new URL(module3));
|
|
215
|
-
} else {
|
|
216
|
-
const moduleRequest = await fetch(module3);
|
|
217
|
-
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
218
|
-
try {
|
|
219
|
-
return await WebAssembly.instantiateStreaming(moduleRequest, imports2);
|
|
220
|
-
} catch (e) {
|
|
221
|
-
if (moduleRequest.headers.get("Content-Type") != "application/wasm") {
|
|
222
|
-
console.warn(e);
|
|
223
|
-
} else {
|
|
224
|
-
throw e;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
module3 = await moduleRequest.arrayBuffer();
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return await WebAssembly.instantiate(module3, imports2);
|
|
232
|
-
}
|
|
233
|
-
var { instance, module: module2 } = await loadWasm(uplc_tx_bg_default, imports);
|
|
234
|
-
var memory = instance.exports.memory;
|
|
235
|
-
var eval_phase_two_raw2 = instance.exports.eval_phase_two_raw;
|
|
236
|
-
var apply_params_to_script2 = instance.exports.apply_params_to_script;
|
|
237
|
-
var __wbindgen_add_to_stack_pointer = instance.exports.__wbindgen_add_to_stack_pointer;
|
|
238
|
-
var __wbindgen_malloc = instance.exports.__wbindgen_malloc;
|
|
239
|
-
var __wbindgen_free = instance.exports.__wbindgen_free;
|
|
240
|
-
|
|
241
|
-
// src/uplc_tx.js
|
|
242
|
-
__wbg_set_wasm(uplc_tx_bg_exports);
|
|
243
|
-
export {
|
|
244
|
-
__wbg_buffer_a448f833075b71ba,
|
|
245
|
-
__wbg_length_1d25fa9e4ac21ce7,
|
|
246
|
-
__wbg_new_8f67e318f15d7254,
|
|
247
|
-
__wbg_newwithbyteoffsetandlength_d0482f893617af71,
|
|
248
|
-
__wbg_set_2357bf09366ee480,
|
|
249
|
-
__wbg_set_wasm,
|
|
250
|
-
__wbindgen_memory,
|
|
251
|
-
__wbindgen_object_drop_ref,
|
|
252
|
-
__wbindgen_string_new,
|
|
253
|
-
__wbindgen_throw,
|
|
254
|
-
apply_params_to_script,
|
|
255
|
-
eval_phase_two_raw
|
|
256
170
|
};
|
|
171
|
+
var path = require("path").join(__dirname, "uplc_tx_bg.wasm");
|
|
172
|
+
var bytes = require("fs").readFileSync(path);
|
|
173
|
+
var wasmModule = new WebAssembly.Module(bytes);
|
|
174
|
+
var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
175
|
+
wasm = wasmInstance.exports;
|
|
176
|
+
module.exports.__wasm = wasm;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
+
}) : x)(function(x) {
|
|
5
|
+
if (typeof require !== "undefined")
|
|
6
|
+
return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
9
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// src/uplc_tx.js
|
|
14
|
+
var require_uplc_tx = __commonJS({
|
|
15
|
+
"src/uplc_tx.js"(exports, module) {
|
|
16
|
+
var imports = {};
|
|
17
|
+
imports["__wbindgen_placeholder__"] = module.exports;
|
|
18
|
+
var wasm;
|
|
19
|
+
var { TextDecoder } = __require("util");
|
|
20
|
+
var heap = new Array(128).fill(void 0);
|
|
21
|
+
heap.push(void 0, null, true, false);
|
|
22
|
+
function getObject(idx) {
|
|
23
|
+
return heap[idx];
|
|
24
|
+
}
|
|
25
|
+
var heap_next = heap.length;
|
|
26
|
+
function dropObject(idx) {
|
|
27
|
+
if (idx < 132)
|
|
28
|
+
return;
|
|
29
|
+
heap[idx] = heap_next;
|
|
30
|
+
heap_next = idx;
|
|
31
|
+
}
|
|
32
|
+
function takeObject(idx) {
|
|
33
|
+
const ret = getObject(idx);
|
|
34
|
+
dropObject(idx);
|
|
35
|
+
return ret;
|
|
36
|
+
}
|
|
37
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
38
|
+
cachedTextDecoder.decode();
|
|
39
|
+
var cachedUint8Memory0 = null;
|
|
40
|
+
function getUint8Memory0() {
|
|
41
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
42
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
43
|
+
}
|
|
44
|
+
return cachedUint8Memory0;
|
|
45
|
+
}
|
|
46
|
+
function getStringFromWasm0(ptr, len) {
|
|
47
|
+
ptr = ptr >>> 0;
|
|
48
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
49
|
+
}
|
|
50
|
+
function addHeapObject(obj) {
|
|
51
|
+
if (heap_next === heap.length)
|
|
52
|
+
heap.push(heap.length + 1);
|
|
53
|
+
const idx = heap_next;
|
|
54
|
+
heap_next = heap[idx];
|
|
55
|
+
heap[idx] = obj;
|
|
56
|
+
return idx;
|
|
57
|
+
}
|
|
58
|
+
var WASM_VECTOR_LEN = 0;
|
|
59
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
60
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
61
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
62
|
+
WASM_VECTOR_LEN = arg.length;
|
|
63
|
+
return ptr;
|
|
64
|
+
}
|
|
65
|
+
var cachedUint32Memory0 = null;
|
|
66
|
+
function getUint32Memory0() {
|
|
67
|
+
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
|
68
|
+
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
69
|
+
}
|
|
70
|
+
return cachedUint32Memory0;
|
|
71
|
+
}
|
|
72
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
73
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
74
|
+
const mem = getUint32Memory0();
|
|
75
|
+
for (let i = 0; i < array.length; i++) {
|
|
76
|
+
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
|
77
|
+
}
|
|
78
|
+
WASM_VECTOR_LEN = array.length;
|
|
79
|
+
return ptr;
|
|
80
|
+
}
|
|
81
|
+
var cachedInt32Memory0 = null;
|
|
82
|
+
function getInt32Memory0() {
|
|
83
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
84
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
85
|
+
}
|
|
86
|
+
return cachedInt32Memory0;
|
|
87
|
+
}
|
|
88
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
89
|
+
ptr = ptr >>> 0;
|
|
90
|
+
const mem = getUint32Memory0();
|
|
91
|
+
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
92
|
+
const result = [];
|
|
93
|
+
for (let i = 0; i < slice.length; i++) {
|
|
94
|
+
result.push(takeObject(slice[i]));
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
module.exports.eval_phase_two_raw = function(tx_bytes, utxos_bytes_x, utxos_bytes_y, cost_mdls_bytes, initial_budget_n, initial_budget_d, slot_config_x, slot_config_y, slot_config_z) {
|
|
99
|
+
try {
|
|
100
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
101
|
+
const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
|
|
102
|
+
const len0 = WASM_VECTOR_LEN;
|
|
103
|
+
const ptr1 = passArrayJsValueToWasm0(utxos_bytes_x, wasm.__wbindgen_malloc);
|
|
104
|
+
const len1 = WASM_VECTOR_LEN;
|
|
105
|
+
const ptr2 = passArrayJsValueToWasm0(utxos_bytes_y, wasm.__wbindgen_malloc);
|
|
106
|
+
const len2 = WASM_VECTOR_LEN;
|
|
107
|
+
const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
|
|
108
|
+
const len3 = WASM_VECTOR_LEN;
|
|
109
|
+
wasm.eval_phase_two_raw(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, initial_budget_n, initial_budget_d, slot_config_x, slot_config_y, slot_config_z);
|
|
110
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
111
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
112
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
113
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
114
|
+
if (r3) {
|
|
115
|
+
throw takeObject(r2);
|
|
116
|
+
}
|
|
117
|
+
var v5 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
118
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
119
|
+
return v5;
|
|
120
|
+
} finally {
|
|
121
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
125
|
+
ptr = ptr >>> 0;
|
|
126
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
127
|
+
}
|
|
128
|
+
module.exports.apply_params_to_script = function(params_bytes, plutus_script_bytes) {
|
|
129
|
+
try {
|
|
130
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
131
|
+
const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
|
|
132
|
+
const len0 = WASM_VECTOR_LEN;
|
|
133
|
+
const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
|
|
134
|
+
const len1 = WASM_VECTOR_LEN;
|
|
135
|
+
wasm.apply_params_to_script(retptr, ptr0, len0, ptr1, len1);
|
|
136
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
137
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
138
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
139
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
140
|
+
if (r3) {
|
|
141
|
+
throw takeObject(r2);
|
|
142
|
+
}
|
|
143
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
144
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
145
|
+
return v3;
|
|
146
|
+
} finally {
|
|
147
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
151
|
+
takeObject(arg0);
|
|
152
|
+
};
|
|
153
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
154
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
155
|
+
return addHeapObject(ret);
|
|
156
|
+
};
|
|
157
|
+
module.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
158
|
+
const ret = getObject(arg0).buffer;
|
|
159
|
+
return addHeapObject(ret);
|
|
160
|
+
};
|
|
161
|
+
module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
162
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
163
|
+
return addHeapObject(ret);
|
|
164
|
+
};
|
|
165
|
+
module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
166
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
167
|
+
return addHeapObject(ret);
|
|
168
|
+
};
|
|
169
|
+
module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
170
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
171
|
+
};
|
|
172
|
+
module.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
|
|
173
|
+
const ret = getObject(arg0).length;
|
|
174
|
+
return ret;
|
|
175
|
+
};
|
|
176
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
177
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
178
|
+
};
|
|
179
|
+
module.exports.__wbindgen_memory = function() {
|
|
180
|
+
const ret = wasm.memory;
|
|
181
|
+
return addHeapObject(ret);
|
|
182
|
+
};
|
|
183
|
+
var path = __require("path").join(__dirname, "uplc_tx_bg.wasm");
|
|
184
|
+
var bytes = __require("fs").readFileSync(path);
|
|
185
|
+
var wasmModule = new WebAssembly.Module(bytes);
|
|
186
|
+
var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
187
|
+
wasm = wasmInstance.exports;
|
|
188
|
+
module.exports.__wasm = wasm;
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
export default require_uplc_tx();
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucid-evolution/uplc",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"main": "./dist/uplc_tx.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"main": "./dist/node/uplc_tx.js",
|
|
5
|
+
"module": "./dist/node/uplc_tx.mjs",
|
|
6
|
+
"browser": "./dist/browser/uplc_tx.mjs",
|
|
7
|
+
"types": "./dist/node/uplc_tx.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"dist"
|
|
9
10
|
],
|
|
@@ -15,10 +16,13 @@
|
|
|
15
16
|
"./snippets/*"
|
|
16
17
|
],
|
|
17
18
|
"devDependencies": {
|
|
19
|
+
"@geut/esbuild-plugin-brode": "^2.0.14",
|
|
18
20
|
"esbuild-plugin-wasm": "^1.1.0",
|
|
21
|
+
"esbuild-copy-files-plugin": "^1.2.0",
|
|
19
22
|
"tsup": "^8.0.2"
|
|
20
23
|
},
|
|
24
|
+
"dependencies": {},
|
|
21
25
|
"scripts": {
|
|
22
|
-
"build": "tsup
|
|
26
|
+
"build": "tsup"
|
|
23
27
|
}
|
|
24
28
|
}
|
|
Binary file
|
|
File without changes
|