@lucid-evolution/uplc 0.2.19 → 0.2.21
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 +21 -0
- package/dist/browser/uplc_tx.d.ts +0 -17
- package/dist/browser/uplc_tx.js +2 -2
- package/dist/browser/uplc_tx_bg.js +83 -110
- package/dist/browser/uplc_tx_bg.wasm +0 -0
- package/dist/browser/uplc_tx_bg.wasm.d.ts +15 -13
- package/dist/node/uplc_tx.d.ts +0 -17
- package/dist/node/uplc_tx.js +85 -110
- package/dist/node/uplc_tx_bg.wasm +0 -0
- package/dist/node/uplc_tx_bg.wasm.d.ts +15 -13
- package/package.json +1 -1
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,
|
package/dist/browser/uplc_tx.js
CHANGED
|
@@ -24,35 +24,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
24
24
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const heap = new Array(128).fill(undefined);
|
|
28
|
-
|
|
29
|
-
heap.push(undefined, null, true, false);
|
|
30
|
-
|
|
31
|
-
let heap_next = heap.length;
|
|
32
|
-
|
|
33
|
-
function addHeapObject(obj) {
|
|
34
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
35
|
-
const idx = heap_next;
|
|
36
|
-
heap_next = heap[idx];
|
|
37
|
-
|
|
38
|
-
heap[idx] = obj;
|
|
39
|
-
return idx;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function getObject(idx) { return heap[idx]; }
|
|
43
|
-
|
|
44
|
-
function dropObject(idx) {
|
|
45
|
-
if (idx < 132) return;
|
|
46
|
-
heap[idx] = heap_next;
|
|
47
|
-
heap_next = idx;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function takeObject(idx) {
|
|
51
|
-
const ret = getObject(idx);
|
|
52
|
-
dropObject(idx);
|
|
53
|
-
return ret;
|
|
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
|
-
|
|
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(
|
|
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 {
|
|
96
|
-
* @param {
|
|
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 {
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
|
165
|
-
const ret =
|
|
166
|
-
return
|
|
130
|
+
export function __wbg_buffer_609cc3eee51ed158(arg0) {
|
|
131
|
+
const ret = arg0.buffer;
|
|
132
|
+
return ret;
|
|
167
133
|
};
|
|
168
134
|
|
|
169
|
-
export function
|
|
170
|
-
const ret =
|
|
171
|
-
return
|
|
135
|
+
export function __wbg_length_a446193dc22c12f8(arg0) {
|
|
136
|
+
const ret = arg0.length;
|
|
137
|
+
return ret;
|
|
172
138
|
};
|
|
173
139
|
|
|
174
|
-
export function
|
|
175
|
-
const ret =
|
|
176
|
-
return
|
|
140
|
+
export function __wbg_new_a12002a7f91c75be(arg0) {
|
|
141
|
+
const ret = new Uint8Array(arg0);
|
|
142
|
+
return ret;
|
|
177
143
|
};
|
|
178
144
|
|
|
179
|
-
export function
|
|
180
|
-
const ret = new Uint8Array(
|
|
181
|
-
return
|
|
145
|
+
export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) {
|
|
146
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
147
|
+
return ret;
|
|
182
148
|
};
|
|
183
149
|
|
|
184
|
-
export function
|
|
185
|
-
|
|
186
|
-
return addHeapObject(ret);
|
|
150
|
+
export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
|
151
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
187
152
|
};
|
|
188
153
|
|
|
189
|
-
export function
|
|
190
|
-
|
|
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
|
|
194
|
-
const ret =
|
|
165
|
+
export function __wbindgen_memory() {
|
|
166
|
+
const ret = wasm.memory;
|
|
195
167
|
return ret;
|
|
196
168
|
};
|
|
197
169
|
|
|
198
|
-
export function
|
|
199
|
-
|
|
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
|
|
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:
|
|
14
|
-
j:
|
|
15
|
-
k:
|
|
16
|
-
l:
|
|
13
|
+
i: bigint,
|
|
14
|
+
j: bigint,
|
|
15
|
+
k: bigint,
|
|
16
|
+
l: bigint,
|
|
17
17
|
m: number,
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
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/dist/node/uplc_tx.d.ts
CHANGED
|
@@ -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,
|
package/dist/node/uplc_tx.js
CHANGED
|
@@ -22,35 +22,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
22
22
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const heap = new Array(128).fill(undefined);
|
|
26
|
-
|
|
27
|
-
heap.push(undefined, null, true, false);
|
|
28
|
-
|
|
29
|
-
let heap_next = heap.length;
|
|
30
|
-
|
|
31
|
-
function addHeapObject(obj) {
|
|
32
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
33
|
-
const idx = heap_next;
|
|
34
|
-
heap_next = heap[idx];
|
|
35
|
-
|
|
36
|
-
heap[idx] = obj;
|
|
37
|
-
return idx;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function getObject(idx) { return heap[idx]; }
|
|
41
|
-
|
|
42
|
-
function dropObject(idx) {
|
|
43
|
-
if (idx < 132) return;
|
|
44
|
-
heap[idx] = heap_next;
|
|
45
|
-
heap_next = idx;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function takeObject(idx) {
|
|
49
|
-
const ret = getObject(idx);
|
|
50
|
-
dropObject(idx);
|
|
51
|
-
return ret;
|
|
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
|
-
|
|
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(
|
|
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 {
|
|
94
|
-
* @param {
|
|
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 {
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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.
|
|
163
|
-
const ret =
|
|
164
|
-
return
|
|
128
|
+
module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
129
|
+
const ret = arg0.buffer;
|
|
130
|
+
return ret;
|
|
165
131
|
};
|
|
166
132
|
|
|
167
|
-
module.exports.
|
|
168
|
-
const ret =
|
|
169
|
-
return
|
|
133
|
+
module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
134
|
+
const ret = arg0.length;
|
|
135
|
+
return ret;
|
|
170
136
|
};
|
|
171
137
|
|
|
172
|
-
module.exports.
|
|
173
|
-
const ret =
|
|
174
|
-
return
|
|
138
|
+
module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
139
|
+
const ret = new Uint8Array(arg0);
|
|
140
|
+
return ret;
|
|
175
141
|
};
|
|
176
142
|
|
|
177
|
-
module.exports.
|
|
178
|
-
const ret = new Uint8Array(
|
|
179
|
-
return
|
|
143
|
+
module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
144
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
145
|
+
return ret;
|
|
180
146
|
};
|
|
181
147
|
|
|
182
|
-
module.exports.
|
|
183
|
-
|
|
184
|
-
return addHeapObject(ret);
|
|
148
|
+
module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
149
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
185
150
|
};
|
|
186
151
|
|
|
187
|
-
module.exports.
|
|
188
|
-
|
|
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.
|
|
192
|
-
const ret =
|
|
163
|
+
module.exports.__wbindgen_memory = function() {
|
|
164
|
+
const ret = wasm.memory;
|
|
193
165
|
return ret;
|
|
194
166
|
};
|
|
195
167
|
|
|
196
|
-
module.exports.
|
|
197
|
-
|
|
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
|
|
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:
|
|
14
|
-
j:
|
|
15
|
-
k:
|
|
16
|
-
l:
|
|
13
|
+
i: bigint,
|
|
14
|
+
j: bigint,
|
|
15
|
+
k: bigint,
|
|
16
|
+
l: bigint,
|
|
17
17
|
m: number,
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
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;
|