@lucid-evolution/uplc 0.2.1 → 0.2.3
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/index.mjs +8578 -0
- package/dist/browser/uplc_tx_bg.wasm +0 -0
- package/dist/node/index.d.mts +36 -0
- package/dist/node/index.d.ts +36 -0
- package/dist/node/index.js +225 -0
- package/dist/node/index.mjs +221 -0
- package/dist/node/uplc_tx_bg.wasm +0 -0
- package/package.json +9 -5
- package/dist/uplc_tx.js +0 -256
- package/dist/uplc_tx_bg-2ZM6JWAH.wasm +0 -0
- /package/dist/{uplc_tx.d.ts → browser/index.d.mts} +0 -0
package/dist/uplc_tx.js
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
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";
|
|
22
|
-
|
|
23
|
-
// src/uplc_tx_bg.js
|
|
24
|
-
var wasm;
|
|
25
|
-
function __wbg_set_wasm(val) {
|
|
26
|
-
wasm = val;
|
|
27
|
-
}
|
|
28
|
-
var heap = new Array(128).fill(void 0);
|
|
29
|
-
heap.push(void 0, null, true, false);
|
|
30
|
-
function getObject(idx) {
|
|
31
|
-
return heap[idx];
|
|
32
|
-
}
|
|
33
|
-
var heap_next = heap.length;
|
|
34
|
-
function dropObject(idx) {
|
|
35
|
-
if (idx < 132)
|
|
36
|
-
return;
|
|
37
|
-
heap[idx] = heap_next;
|
|
38
|
-
heap_next = idx;
|
|
39
|
-
}
|
|
40
|
-
function takeObject(idx) {
|
|
41
|
-
const ret = getObject(idx);
|
|
42
|
-
dropObject(idx);
|
|
43
|
-
return ret;
|
|
44
|
-
}
|
|
45
|
-
var lTextDecoder = typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
|
|
46
|
-
var cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
47
|
-
cachedTextDecoder.decode();
|
|
48
|
-
var cachedUint8Memory0 = null;
|
|
49
|
-
function getUint8Memory0() {
|
|
50
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
51
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
52
|
-
}
|
|
53
|
-
return cachedUint8Memory0;
|
|
54
|
-
}
|
|
55
|
-
function getStringFromWasm0(ptr, len) {
|
|
56
|
-
ptr = ptr >>> 0;
|
|
57
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
58
|
-
}
|
|
59
|
-
function addHeapObject(obj) {
|
|
60
|
-
if (heap_next === heap.length)
|
|
61
|
-
heap.push(heap.length + 1);
|
|
62
|
-
const idx = heap_next;
|
|
63
|
-
heap_next = heap[idx];
|
|
64
|
-
heap[idx] = obj;
|
|
65
|
-
return idx;
|
|
66
|
-
}
|
|
67
|
-
var WASM_VECTOR_LEN = 0;
|
|
68
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
69
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
70
|
-
getUint8Memory0().set(arg, ptr / 1);
|
|
71
|
-
WASM_VECTOR_LEN = arg.length;
|
|
72
|
-
return ptr;
|
|
73
|
-
}
|
|
74
|
-
var cachedUint32Memory0 = null;
|
|
75
|
-
function getUint32Memory0() {
|
|
76
|
-
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
|
77
|
-
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
78
|
-
}
|
|
79
|
-
return cachedUint32Memory0;
|
|
80
|
-
}
|
|
81
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
82
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
83
|
-
const mem = getUint32Memory0();
|
|
84
|
-
for (let i = 0; i < array.length; i++) {
|
|
85
|
-
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
|
86
|
-
}
|
|
87
|
-
WASM_VECTOR_LEN = array.length;
|
|
88
|
-
return ptr;
|
|
89
|
-
}
|
|
90
|
-
var cachedInt32Memory0 = null;
|
|
91
|
-
function getInt32Memory0() {
|
|
92
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
93
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
94
|
-
}
|
|
95
|
-
return cachedInt32Memory0;
|
|
96
|
-
}
|
|
97
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
98
|
-
ptr = ptr >>> 0;
|
|
99
|
-
const mem = getUint32Memory0();
|
|
100
|
-
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
101
|
-
const result = [];
|
|
102
|
-
for (let i = 0; i < slice.length; i++) {
|
|
103
|
-
result.push(takeObject(slice[i]));
|
|
104
|
-
}
|
|
105
|
-
return result;
|
|
106
|
-
}
|
|
107
|
-
function eval_phase_two_raw(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
|
-
try {
|
|
109
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
110
|
-
const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
|
|
111
|
-
const len0 = WASM_VECTOR_LEN;
|
|
112
|
-
const ptr1 = passArrayJsValueToWasm0(utxos_bytes_x, wasm.__wbindgen_malloc);
|
|
113
|
-
const len1 = WASM_VECTOR_LEN;
|
|
114
|
-
const ptr2 = passArrayJsValueToWasm0(utxos_bytes_y, wasm.__wbindgen_malloc);
|
|
115
|
-
const len2 = WASM_VECTOR_LEN;
|
|
116
|
-
const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
|
|
117
|
-
const len3 = WASM_VECTOR_LEN;
|
|
118
|
-
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);
|
|
119
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
120
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
121
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
122
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
123
|
-
if (r3) {
|
|
124
|
-
throw takeObject(r2);
|
|
125
|
-
}
|
|
126
|
-
var v5 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
127
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
128
|
-
return v5;
|
|
129
|
-
} finally {
|
|
130
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
134
|
-
ptr = ptr >>> 0;
|
|
135
|
-
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
136
|
-
}
|
|
137
|
-
function apply_params_to_script(params_bytes, plutus_script_bytes) {
|
|
138
|
-
try {
|
|
139
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
140
|
-
const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
|
|
141
|
-
const len0 = WASM_VECTOR_LEN;
|
|
142
|
-
const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
|
|
143
|
-
const len1 = WASM_VECTOR_LEN;
|
|
144
|
-
wasm.apply_params_to_script(retptr, ptr0, len0, ptr1, len1);
|
|
145
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
146
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
147
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
148
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
149
|
-
if (r3) {
|
|
150
|
-
throw takeObject(r2);
|
|
151
|
-
}
|
|
152
|
-
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
153
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
154
|
-
return v3;
|
|
155
|
-
} finally {
|
|
156
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function __wbindgen_object_drop_ref(arg0) {
|
|
160
|
-
takeObject(arg0);
|
|
161
|
-
}
|
|
162
|
-
function __wbindgen_string_new(arg0, arg1) {
|
|
163
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
164
|
-
return addHeapObject(ret);
|
|
165
|
-
}
|
|
166
|
-
function __wbg_buffer_a448f833075b71ba(arg0) {
|
|
167
|
-
const ret = getObject(arg0).buffer;
|
|
168
|
-
return addHeapObject(ret);
|
|
169
|
-
}
|
|
170
|
-
function __wbg_newwithbyteoffsetandlength_d0482f893617af71(arg0, arg1, arg2) {
|
|
171
|
-
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
172
|
-
return addHeapObject(ret);
|
|
173
|
-
}
|
|
174
|
-
function __wbg_new_8f67e318f15d7254(arg0) {
|
|
175
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
176
|
-
return addHeapObject(ret);
|
|
177
|
-
}
|
|
178
|
-
function __wbg_set_2357bf09366ee480(arg0, arg1, arg2) {
|
|
179
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
180
|
-
}
|
|
181
|
-
function __wbg_length_1d25fa9e4ac21ce7(arg0) {
|
|
182
|
-
const ret = getObject(arg0).length;
|
|
183
|
-
return ret;
|
|
184
|
-
}
|
|
185
|
-
function __wbindgen_throw(arg0, arg1) {
|
|
186
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
187
|
-
}
|
|
188
|
-
function __wbindgen_memory() {
|
|
189
|
-
const ret = wasm.memory;
|
|
190
|
-
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
|
-
};
|
|
Binary file
|
|
File without changes
|