@lucid-evolution/uplc 0.2.2 → 0.2.4

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.
@@ -1,176 +0,0 @@
1
- "use strict";
2
-
3
- // src/uplc_tx.js
4
- var imports = {};
5
- imports["__wbindgen_placeholder__"] = module.exports;
6
- var wasm;
7
- var { TextDecoder } = require("util");
8
- var heap = new Array(128).fill(void 0);
9
- heap.push(void 0, null, true, false);
10
- function getObject(idx) {
11
- return heap[idx];
12
- }
13
- var heap_next = heap.length;
14
- function dropObject(idx) {
15
- if (idx < 132)
16
- return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
19
- }
20
- function takeObject(idx) {
21
- const ret = getObject(idx);
22
- dropObject(idx);
23
- return ret;
24
- }
25
- var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
26
- cachedTextDecoder.decode();
27
- var cachedUint8Memory0 = null;
28
- function getUint8Memory0() {
29
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
30
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
31
- }
32
- return cachedUint8Memory0;
33
- }
34
- function getStringFromWasm0(ptr, len) {
35
- ptr = ptr >>> 0;
36
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
37
- }
38
- function addHeapObject(obj) {
39
- if (heap_next === heap.length)
40
- heap.push(heap.length + 1);
41
- const idx = heap_next;
42
- heap_next = heap[idx];
43
- heap[idx] = obj;
44
- return idx;
45
- }
46
- var WASM_VECTOR_LEN = 0;
47
- function passArray8ToWasm0(arg, malloc) {
48
- const ptr = malloc(arg.length * 1, 1) >>> 0;
49
- getUint8Memory0().set(arg, ptr / 1);
50
- WASM_VECTOR_LEN = arg.length;
51
- return ptr;
52
- }
53
- var cachedUint32Memory0 = null;
54
- function getUint32Memory0() {
55
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
56
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
57
- }
58
- return cachedUint32Memory0;
59
- }
60
- function passArrayJsValueToWasm0(array, malloc) {
61
- const ptr = malloc(array.length * 4, 4) >>> 0;
62
- const mem = getUint32Memory0();
63
- for (let i = 0; i < array.length; i++) {
64
- mem[ptr / 4 + i] = addHeapObject(array[i]);
65
- }
66
- WASM_VECTOR_LEN = array.length;
67
- return ptr;
68
- }
69
- var cachedInt32Memory0 = null;
70
- function getInt32Memory0() {
71
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
72
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
73
- }
74
- return cachedInt32Memory0;
75
- }
76
- function getArrayJsValueFromWasm0(ptr, len) {
77
- ptr = ptr >>> 0;
78
- const mem = getUint32Memory0();
79
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
80
- const result = [];
81
- for (let i = 0; i < slice.length; i++) {
82
- result.push(takeObject(slice[i]));
83
- }
84
- return result;
85
- }
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) {
87
- try {
88
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
89
- const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
90
- const len0 = WASM_VECTOR_LEN;
91
- const ptr1 = passArrayJsValueToWasm0(utxos_bytes_x, wasm.__wbindgen_malloc);
92
- const len1 = WASM_VECTOR_LEN;
93
- const ptr2 = passArrayJsValueToWasm0(utxos_bytes_y, wasm.__wbindgen_malloc);
94
- const len2 = WASM_VECTOR_LEN;
95
- const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
96
- const len3 = WASM_VECTOR_LEN;
97
- 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);
98
- var r0 = getInt32Memory0()[retptr / 4 + 0];
99
- var r1 = getInt32Memory0()[retptr / 4 + 1];
100
- var r2 = getInt32Memory0()[retptr / 4 + 2];
101
- var r3 = getInt32Memory0()[retptr / 4 + 3];
102
- if (r3) {
103
- throw takeObject(r2);
104
- }
105
- var v5 = getArrayJsValueFromWasm0(r0, r1).slice();
106
- wasm.__wbindgen_free(r0, r1 * 4, 4);
107
- return v5;
108
- } finally {
109
- wasm.__wbindgen_add_to_stack_pointer(16);
110
- }
111
- };
112
- function getArrayU8FromWasm0(ptr, len) {
113
- ptr = ptr >>> 0;
114
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
115
- }
116
- module.exports.apply_params_to_script = function(params_bytes, plutus_script_bytes) {
117
- try {
118
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
119
- const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
120
- const len0 = WASM_VECTOR_LEN;
121
- const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
122
- const len1 = WASM_VECTOR_LEN;
123
- wasm.apply_params_to_script(retptr, ptr0, len0, ptr1, len1);
124
- var r0 = getInt32Memory0()[retptr / 4 + 0];
125
- var r1 = getInt32Memory0()[retptr / 4 + 1];
126
- var r2 = getInt32Memory0()[retptr / 4 + 2];
127
- var r3 = getInt32Memory0()[retptr / 4 + 3];
128
- if (r3) {
129
- throw takeObject(r2);
130
- }
131
- var v3 = getArrayU8FromWasm0(r0, r1).slice();
132
- wasm.__wbindgen_free(r0, r1 * 1, 1);
133
- return v3;
134
- } finally {
135
- wasm.__wbindgen_add_to_stack_pointer(16);
136
- }
137
- };
138
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
139
- takeObject(arg0);
140
- };
141
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
142
- const ret = getStringFromWasm0(arg0, arg1);
143
- return addHeapObject(ret);
144
- };
145
- module.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
146
- const ret = getObject(arg0).buffer;
147
- return addHeapObject(ret);
148
- };
149
- module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
150
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
151
- return addHeapObject(ret);
152
- };
153
- module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
154
- const ret = new Uint8Array(getObject(arg0));
155
- return addHeapObject(ret);
156
- };
157
- module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
158
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
159
- };
160
- module.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
161
- const ret = getObject(arg0).length;
162
- return ret;
163
- };
164
- module.exports.__wbindgen_throw = function(arg0, arg1) {
165
- throw new Error(getStringFromWasm0(arg0, arg1));
166
- };
167
- module.exports.__wbindgen_memory = function() {
168
- const ret = wasm.memory;
169
- return addHeapObject(ret);
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;
File without changes
File without changes
File without changes