@lucid-evolution/uplc 0.2.18 → 0.2.20

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Anastasia Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,17 +1,5 @@
1
1
  /* tslint:disable */
2
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
3
  export function eval_phase_two_raw(
16
4
  tx_bytes: Uint8Array,
17
5
  utxos_bytes_x: Uint8Array[],
@@ -23,11 +11,6 @@ export function eval_phase_two_raw(
23
11
  slot_config_y: bigint,
24
12
  slot_config_z: number,
25
13
  ): Uint8Array[];
26
- /**
27
- * @param {Uint8Array} params_bytes
28
- * @param {Uint8Array} plutus_script_bytes
29
- * @returns {Uint8Array}
30
- */
31
14
  export function apply_params_to_script(
32
15
  params_bytes: Uint8Array,
33
16
  plutus_script_bytes: Uint8Array,
@@ -1,5 +1,5 @@
1
-
2
1
  import * as wasm from "./uplc_tx_bg.wasm";
2
+ export * from "./uplc_tx_bg.js";
3
3
  import { __wbg_set_wasm } from "./uplc_tx_bg.js";
4
4
  __wbg_set_wasm(wasm);
5
- export * from "./uplc_tx_bg.js";
5
+ wasm.__wbindgen_start();
@@ -4,26 +4,6 @@ export function __wbg_set_wasm(val) {
4
4
  }
5
5
 
6
6
 
7
- const heap = new Array(128).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
12
-
13
- let heap_next = heap.length;
14
-
15
- function dropObject(idx) {
16
- if (idx < 132) return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
19
- }
20
-
21
- function takeObject(idx) {
22
- const ret = getObject(idx);
23
- dropObject(idx);
24
- return ret;
25
- }
26
-
27
7
  const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
28
8
 
29
9
  let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
@@ -44,15 +24,6 @@ function getStringFromWasm0(ptr, len) {
44
24
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
45
25
  }
46
26
 
47
- function addHeapObject(obj) {
48
- if (heap_next === heap.length) heap.push(heap.length + 1);
49
- const idx = heap_next;
50
- heap_next = heap[idx];
51
-
52
- heap[idx] = obj;
53
- return idx;
54
- }
55
-
56
27
  let WASM_VECTOR_LEN = 0;
57
28
 
58
29
  function passArray8ToWasm0(arg, malloc) {
@@ -71,62 +42,66 @@ function getDataViewMemory0() {
71
42
  return cachedDataViewMemory0;
72
43
  }
73
44
 
45
+ function addToExternrefTable0(obj) {
46
+ const idx = wasm.__externref_table_alloc();
47
+ wasm.__wbindgen_export_0.set(idx, obj);
48
+ return idx;
49
+ }
50
+
74
51
  function passArrayJsValueToWasm0(array, malloc) {
75
52
  const ptr = malloc(array.length * 4, 4) >>> 0;
76
- const mem = getDataViewMemory0();
77
53
  for (let i = 0; i < array.length; i++) {
78
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
54
+ const add = addToExternrefTable0(array[i]);
55
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
79
56
  }
80
57
  WASM_VECTOR_LEN = array.length;
81
58
  return ptr;
82
59
  }
83
60
 
61
+ function takeFromExternrefTable0(idx) {
62
+ const value = wasm.__wbindgen_export_0.get(idx);
63
+ wasm.__externref_table_dealloc(idx);
64
+ return value;
65
+ }
66
+
84
67
  function getArrayJsValueFromWasm0(ptr, len) {
85
68
  ptr = ptr >>> 0;
86
69
  const mem = getDataViewMemory0();
87
70
  const result = [];
88
71
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
89
- result.push(takeObject(mem.getUint32(i, true)));
72
+ result.push(wasm.__wbindgen_export_0.get(mem.getUint32(i, true)));
90
73
  }
74
+ wasm.__externref_drop_slice(ptr, len);
91
75
  return result;
92
76
  }
93
77
  /**
94
- * @param {Uint8Array} tx_bytes
95
- * @param {(Uint8Array)[]} utxos_bytes_x
96
- * @param {(Uint8Array)[]} utxos_bytes_y
97
- * @param {Uint8Array} cost_mdls_bytes
98
- * @param {bigint} initial_budget_n
99
- * @param {bigint} initial_budget_d
100
- * @param {bigint} slot_config_x
101
- * @param {bigint} slot_config_y
102
- * @param {number} slot_config_z
103
- * @returns {(Uint8Array)[]}
104
- */
78
+ * @param {Uint8Array} tx_bytes
79
+ * @param {Uint8Array[]} utxos_bytes_x
80
+ * @param {Uint8Array[]} utxos_bytes_y
81
+ * @param {Uint8Array} cost_mdls_bytes
82
+ * @param {bigint} initial_budget_n
83
+ * @param {bigint} initial_budget_d
84
+ * @param {bigint} slot_config_x
85
+ * @param {bigint} slot_config_y
86
+ * @param {number} slot_config_z
87
+ * @returns {Uint8Array[]}
88
+ */
105
89
  export 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) {
106
- try {
107
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
108
- const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
109
- const len0 = WASM_VECTOR_LEN;
110
- const ptr1 = passArrayJsValueToWasm0(utxos_bytes_x, wasm.__wbindgen_malloc);
111
- const len1 = WASM_VECTOR_LEN;
112
- const ptr2 = passArrayJsValueToWasm0(utxos_bytes_y, wasm.__wbindgen_malloc);
113
- const len2 = WASM_VECTOR_LEN;
114
- const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
115
- const len3 = WASM_VECTOR_LEN;
116
- 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);
117
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
118
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
119
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
120
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
121
- if (r3) {
122
- throw takeObject(r2);
123
- }
124
- var v5 = getArrayJsValueFromWasm0(r0, r1).slice();
125
- wasm.__wbindgen_free(r0, r1 * 4, 4);
126
- return v5;
127
- } finally {
128
- wasm.__wbindgen_add_to_stack_pointer(16);
90
+ const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
91
+ const len0 = WASM_VECTOR_LEN;
92
+ const ptr1 = passArrayJsValueToWasm0(utxos_bytes_x, wasm.__wbindgen_malloc);
93
+ const len1 = WASM_VECTOR_LEN;
94
+ const ptr2 = passArrayJsValueToWasm0(utxos_bytes_y, wasm.__wbindgen_malloc);
95
+ const len2 = WASM_VECTOR_LEN;
96
+ const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
97
+ const len3 = WASM_VECTOR_LEN;
98
+ const ret = wasm.eval_phase_two_raw(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, initial_budget_n, initial_budget_d, slot_config_x, slot_config_y, slot_config_z);
99
+ if (ret[3]) {
100
+ throw takeFromExternrefTable0(ret[2]);
129
101
  }
102
+ var v5 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
103
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
104
+ return v5;
130
105
  }
131
106
 
132
107
  function getArrayU8FromWasm0(ptr, len) {
@@ -134,69 +109,67 @@ function getArrayU8FromWasm0(ptr, len) {
134
109
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
135
110
  }
136
111
  /**
137
- * @param {Uint8Array} params_bytes
138
- * @param {Uint8Array} plutus_script_bytes
139
- * @returns {Uint8Array}
140
- */
112
+ * @param {Uint8Array} params_bytes
113
+ * @param {Uint8Array} plutus_script_bytes
114
+ * @returns {Uint8Array}
115
+ */
141
116
  export function apply_params_to_script(params_bytes, plutus_script_bytes) {
142
- try {
143
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
144
- const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
145
- const len0 = WASM_VECTOR_LEN;
146
- const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
147
- const len1 = WASM_VECTOR_LEN;
148
- wasm.apply_params_to_script(retptr, ptr0, len0, ptr1, len1);
149
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
150
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
151
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
152
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
153
- if (r3) {
154
- throw takeObject(r2);
155
- }
156
- var v3 = getArrayU8FromWasm0(r0, r1).slice();
157
- wasm.__wbindgen_free(r0, r1 * 1, 1);
158
- return v3;
159
- } finally {
160
- wasm.__wbindgen_add_to_stack_pointer(16);
117
+ const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
118
+ const len0 = WASM_VECTOR_LEN;
119
+ const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
120
+ const len1 = WASM_VECTOR_LEN;
121
+ const ret = wasm.apply_params_to_script(ptr0, len0, ptr1, len1);
122
+ if (ret[3]) {
123
+ throw takeFromExternrefTable0(ret[2]);
161
124
  }
125
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
126
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
127
+ return v3;
162
128
  }
163
129
 
164
- export function __wbindgen_object_drop_ref(arg0) {
165
- takeObject(arg0);
130
+ export function __wbg_buffer_609cc3eee51ed158(arg0) {
131
+ const ret = arg0.buffer;
132
+ return ret;
166
133
  };
167
134
 
168
- export function __wbindgen_string_new(arg0, arg1) {
169
- const ret = getStringFromWasm0(arg0, arg1);
170
- return addHeapObject(ret);
135
+ export function __wbg_length_a446193dc22c12f8(arg0) {
136
+ const ret = arg0.length;
137
+ return ret;
171
138
  };
172
139
 
173
- export function __wbindgen_memory() {
174
- const ret = wasm.memory;
175
- return addHeapObject(ret);
140
+ export function __wbg_new_a12002a7f91c75be(arg0) {
141
+ const ret = new Uint8Array(arg0);
142
+ return ret;
176
143
  };
177
144
 
178
- export function __wbg_buffer_b7b08af79b0b0974(arg0) {
179
- const ret = getObject(arg0).buffer;
180
- return addHeapObject(ret);
145
+ export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) {
146
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
147
+ return ret;
181
148
  };
182
149
 
183
- export function __wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9(arg0, arg1, arg2) {
184
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
185
- return addHeapObject(ret);
150
+ export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
151
+ arg0.set(arg1, arg2 >>> 0);
186
152
  };
187
153
 
188
- export function __wbg_new_ea1883e1e5e86686(arg0) {
189
- const ret = new Uint8Array(getObject(arg0));
190
- return addHeapObject(ret);
154
+ export function __wbindgen_init_externref_table() {
155
+ const table = wasm.__wbindgen_export_0;
156
+ const offset = table.grow(4);
157
+ table.set(0, undefined);
158
+ table.set(offset + 0, undefined);
159
+ table.set(offset + 1, null);
160
+ table.set(offset + 2, true);
161
+ table.set(offset + 3, false);
162
+ ;
191
163
  };
192
164
 
193
- export function __wbg_length_8339fcf5d8ecd12e(arg0) {
194
- const ret = getObject(arg0).length;
165
+ export function __wbindgen_memory() {
166
+ const ret = wasm.memory;
195
167
  return ret;
196
168
  };
197
169
 
198
- export function __wbg_set_d1e79e2388520f18(arg0, arg1, arg2) {
199
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
170
+ export function __wbindgen_string_new(arg0, arg1) {
171
+ const ret = getStringFromWasm0(arg0, arg1);
172
+ return ret;
200
173
  };
201
174
 
202
175
  export function __wbindgen_throw(arg0, arg1) {
Binary file
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function eval_phase_two_raw(
4
+ export const eval_phase_two_raw: (
5
5
  a: number,
6
6
  b: number,
7
7
  c: number,
@@ -10,20 +10,22 @@ export function eval_phase_two_raw(
10
10
  f: number,
11
11
  g: number,
12
12
  h: number,
13
- i: number,
14
- j: number,
15
- k: number,
16
- l: number,
13
+ i: bigint,
14
+ j: bigint,
15
+ k: bigint,
16
+ l: bigint,
17
17
  m: number,
18
- n: number,
19
- ): void;
20
- export function apply_params_to_script(
18
+ ) => [number, number, number, number];
19
+ export const apply_params_to_script: (
21
20
  a: number,
22
21
  b: number,
23
22
  c: number,
24
23
  d: number,
25
- e: number,
26
- ): void;
27
- export function __wbindgen_add_to_stack_pointer(a: number): number;
28
- export function __wbindgen_malloc(a: number, b: number): number;
29
- export function __wbindgen_free(a: number, b: number, c: number): void;
24
+ ) => [number, number, number, number];
25
+ export const __wbindgen_export_0: WebAssembly.Table;
26
+ export const __wbindgen_malloc: (a: number, b: number) => number;
27
+ export const __externref_table_alloc: () => number;
28
+ export const __externref_table_dealloc: (a: number) => void;
29
+ export const __externref_drop_slice: (a: number, b: number) => void;
30
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
31
+ export const __wbindgen_start: () => void;
@@ -1,17 +1,5 @@
1
1
  /* tslint:disable */
2
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
3
  export function eval_phase_two_raw(
16
4
  tx_bytes: Uint8Array,
17
5
  utxos_bytes_x: Uint8Array[],
@@ -23,11 +11,6 @@ export function eval_phase_two_raw(
23
11
  slot_config_y: bigint,
24
12
  slot_config_z: number,
25
13
  ): Uint8Array[];
26
- /**
27
- * @param {Uint8Array} params_bytes
28
- * @param {Uint8Array} plutus_script_bytes
29
- * @returns {Uint8Array}
30
- */
31
14
  export function apply_params_to_script(
32
15
  params_bytes: Uint8Array,
33
16
  plutus_script_bytes: Uint8Array,
@@ -4,26 +4,6 @@ imports['__wbindgen_placeholder__'] = module.exports;
4
4
  let wasm;
5
5
  const { TextDecoder } = require(`util`);
6
6
 
7
- const heap = new Array(128).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
12
-
13
- let heap_next = heap.length;
14
-
15
- function dropObject(idx) {
16
- if (idx < 132) return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
19
- }
20
-
21
- function takeObject(idx) {
22
- const ret = getObject(idx);
23
- dropObject(idx);
24
- return ret;
25
- }
26
-
27
7
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
28
8
 
29
9
  cachedTextDecoder.decode();
@@ -42,15 +22,6 @@ function getStringFromWasm0(ptr, len) {
42
22
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
43
23
  }
44
24
 
45
- function addHeapObject(obj) {
46
- if (heap_next === heap.length) heap.push(heap.length + 1);
47
- const idx = heap_next;
48
- heap_next = heap[idx];
49
-
50
- heap[idx] = obj;
51
- return idx;
52
- }
53
-
54
25
  let WASM_VECTOR_LEN = 0;
55
26
 
56
27
  function passArray8ToWasm0(arg, malloc) {
@@ -69,62 +40,66 @@ function getDataViewMemory0() {
69
40
  return cachedDataViewMemory0;
70
41
  }
71
42
 
43
+ function addToExternrefTable0(obj) {
44
+ const idx = wasm.__externref_table_alloc();
45
+ wasm.__wbindgen_export_0.set(idx, obj);
46
+ return idx;
47
+ }
48
+
72
49
  function passArrayJsValueToWasm0(array, malloc) {
73
50
  const ptr = malloc(array.length * 4, 4) >>> 0;
74
- const mem = getDataViewMemory0();
75
51
  for (let i = 0; i < array.length; i++) {
76
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
52
+ const add = addToExternrefTable0(array[i]);
53
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
77
54
  }
78
55
  WASM_VECTOR_LEN = array.length;
79
56
  return ptr;
80
57
  }
81
58
 
59
+ function takeFromExternrefTable0(idx) {
60
+ const value = wasm.__wbindgen_export_0.get(idx);
61
+ wasm.__externref_table_dealloc(idx);
62
+ return value;
63
+ }
64
+
82
65
  function getArrayJsValueFromWasm0(ptr, len) {
83
66
  ptr = ptr >>> 0;
84
67
  const mem = getDataViewMemory0();
85
68
  const result = [];
86
69
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
87
- result.push(takeObject(mem.getUint32(i, true)));
70
+ result.push(wasm.__wbindgen_export_0.get(mem.getUint32(i, true)));
88
71
  }
72
+ wasm.__externref_drop_slice(ptr, len);
89
73
  return result;
90
74
  }
91
75
  /**
92
- * @param {Uint8Array} tx_bytes
93
- * @param {(Uint8Array)[]} utxos_bytes_x
94
- * @param {(Uint8Array)[]} utxos_bytes_y
95
- * @param {Uint8Array} cost_mdls_bytes
96
- * @param {bigint} initial_budget_n
97
- * @param {bigint} initial_budget_d
98
- * @param {bigint} slot_config_x
99
- * @param {bigint} slot_config_y
100
- * @param {number} slot_config_z
101
- * @returns {(Uint8Array)[]}
102
- */
76
+ * @param {Uint8Array} tx_bytes
77
+ * @param {Uint8Array[]} utxos_bytes_x
78
+ * @param {Uint8Array[]} utxos_bytes_y
79
+ * @param {Uint8Array} cost_mdls_bytes
80
+ * @param {bigint} initial_budget_n
81
+ * @param {bigint} initial_budget_d
82
+ * @param {bigint} slot_config_x
83
+ * @param {bigint} slot_config_y
84
+ * @param {number} slot_config_z
85
+ * @returns {Uint8Array[]}
86
+ */
103
87
  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) {
104
- try {
105
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
106
- const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
107
- const len0 = WASM_VECTOR_LEN;
108
- const ptr1 = passArrayJsValueToWasm0(utxos_bytes_x, wasm.__wbindgen_malloc);
109
- const len1 = WASM_VECTOR_LEN;
110
- const ptr2 = passArrayJsValueToWasm0(utxos_bytes_y, wasm.__wbindgen_malloc);
111
- const len2 = WASM_VECTOR_LEN;
112
- const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
113
- const len3 = WASM_VECTOR_LEN;
114
- 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);
115
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
116
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
117
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
118
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
119
- if (r3) {
120
- throw takeObject(r2);
121
- }
122
- var v5 = getArrayJsValueFromWasm0(r0, r1).slice();
123
- wasm.__wbindgen_free(r0, r1 * 4, 4);
124
- return v5;
125
- } finally {
126
- wasm.__wbindgen_add_to_stack_pointer(16);
88
+ const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
89
+ const len0 = WASM_VECTOR_LEN;
90
+ const ptr1 = passArrayJsValueToWasm0(utxos_bytes_x, wasm.__wbindgen_malloc);
91
+ const len1 = WASM_VECTOR_LEN;
92
+ const ptr2 = passArrayJsValueToWasm0(utxos_bytes_y, wasm.__wbindgen_malloc);
93
+ const len2 = WASM_VECTOR_LEN;
94
+ const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
95
+ const len3 = WASM_VECTOR_LEN;
96
+ const ret = wasm.eval_phase_two_raw(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, initial_budget_n, initial_budget_d, slot_config_x, slot_config_y, slot_config_z);
97
+ if (ret[3]) {
98
+ throw takeFromExternrefTable0(ret[2]);
127
99
  }
100
+ var v5 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
101
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
102
+ return v5;
128
103
  };
129
104
 
130
105
  function getArrayU8FromWasm0(ptr, len) {
@@ -132,69 +107,67 @@ function getArrayU8FromWasm0(ptr, len) {
132
107
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
133
108
  }
134
109
  /**
135
- * @param {Uint8Array} params_bytes
136
- * @param {Uint8Array} plutus_script_bytes
137
- * @returns {Uint8Array}
138
- */
110
+ * @param {Uint8Array} params_bytes
111
+ * @param {Uint8Array} plutus_script_bytes
112
+ * @returns {Uint8Array}
113
+ */
139
114
  module.exports.apply_params_to_script = function(params_bytes, plutus_script_bytes) {
140
- try {
141
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
142
- const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
143
- const len0 = WASM_VECTOR_LEN;
144
- const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
145
- const len1 = WASM_VECTOR_LEN;
146
- wasm.apply_params_to_script(retptr, ptr0, len0, ptr1, len1);
147
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
148
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
149
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
150
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
151
- if (r3) {
152
- throw takeObject(r2);
153
- }
154
- var v3 = getArrayU8FromWasm0(r0, r1).slice();
155
- wasm.__wbindgen_free(r0, r1 * 1, 1);
156
- return v3;
157
- } finally {
158
- wasm.__wbindgen_add_to_stack_pointer(16);
115
+ const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
116
+ const len0 = WASM_VECTOR_LEN;
117
+ const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
118
+ const len1 = WASM_VECTOR_LEN;
119
+ const ret = wasm.apply_params_to_script(ptr0, len0, ptr1, len1);
120
+ if (ret[3]) {
121
+ throw takeFromExternrefTable0(ret[2]);
159
122
  }
123
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
124
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
125
+ return v3;
160
126
  };
161
127
 
162
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
163
- takeObject(arg0);
128
+ module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
129
+ const ret = arg0.buffer;
130
+ return ret;
164
131
  };
165
132
 
166
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
167
- const ret = getStringFromWasm0(arg0, arg1);
168
- return addHeapObject(ret);
133
+ module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
134
+ const ret = arg0.length;
135
+ return ret;
169
136
  };
170
137
 
171
- module.exports.__wbindgen_memory = function() {
172
- const ret = wasm.memory;
173
- return addHeapObject(ret);
138
+ module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
139
+ const ret = new Uint8Array(arg0);
140
+ return ret;
174
141
  };
175
142
 
176
- module.exports.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
177
- const ret = getObject(arg0).buffer;
178
- return addHeapObject(ret);
143
+ module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
144
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
145
+ return ret;
179
146
  };
180
147
 
181
- module.exports.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function(arg0, arg1, arg2) {
182
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
183
- return addHeapObject(ret);
148
+ module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
149
+ arg0.set(arg1, arg2 >>> 0);
184
150
  };
185
151
 
186
- module.exports.__wbg_new_ea1883e1e5e86686 = function(arg0) {
187
- const ret = new Uint8Array(getObject(arg0));
188
- return addHeapObject(ret);
152
+ module.exports.__wbindgen_init_externref_table = function() {
153
+ const table = wasm.__wbindgen_export_0;
154
+ const offset = table.grow(4);
155
+ table.set(0, undefined);
156
+ table.set(offset + 0, undefined);
157
+ table.set(offset + 1, null);
158
+ table.set(offset + 2, true);
159
+ table.set(offset + 3, false);
160
+ ;
189
161
  };
190
162
 
191
- module.exports.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
192
- const ret = getObject(arg0).length;
163
+ module.exports.__wbindgen_memory = function() {
164
+ const ret = wasm.memory;
193
165
  return ret;
194
166
  };
195
167
 
196
- module.exports.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
197
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
168
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
169
+ const ret = getStringFromWasm0(arg0, arg1);
170
+ return ret;
198
171
  };
199
172
 
200
173
  module.exports.__wbindgen_throw = function(arg0, arg1) {
@@ -209,3 +182,5 @@ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
209
182
  wasm = wasmInstance.exports;
210
183
  module.exports.__wasm = wasm;
211
184
 
185
+ wasm.__wbindgen_start();
186
+
Binary file
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function eval_phase_two_raw(
4
+ export const eval_phase_two_raw: (
5
5
  a: number,
6
6
  b: number,
7
7
  c: number,
@@ -10,20 +10,22 @@ export function eval_phase_two_raw(
10
10
  f: number,
11
11
  g: number,
12
12
  h: number,
13
- i: number,
14
- j: number,
15
- k: number,
16
- l: number,
13
+ i: bigint,
14
+ j: bigint,
15
+ k: bigint,
16
+ l: bigint,
17
17
  m: number,
18
- n: number,
19
- ): void;
20
- export function apply_params_to_script(
18
+ ) => [number, number, number, number];
19
+ export const apply_params_to_script: (
21
20
  a: number,
22
21
  b: number,
23
22
  c: number,
24
23
  d: number,
25
- e: number,
26
- ): void;
27
- export function __wbindgen_add_to_stack_pointer(a: number): number;
28
- export function __wbindgen_malloc(a: number, b: number): number;
29
- export function __wbindgen_free(a: number, b: number, c: number): void;
24
+ ) => [number, number, number, number];
25
+ export const __wbindgen_export_0: WebAssembly.Table;
26
+ export const __wbindgen_malloc: (a: number, b: number) => number;
27
+ export const __externref_table_alloc: () => number;
28
+ export const __externref_table_dealloc: (a: number) => void;
29
+ export const __externref_drop_slice: (a: number, b: number) => void;
30
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
31
+ export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-evolution/uplc",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "main": "./dist/node/uplc_tx.js",
5
5
  "browser": "./dist/browser/uplc_tx.js",
6
6
  "types": "./dist/node/uplc_tx.d.ts",