@lucid-evolution/uplc 0.2.2 → 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.
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __esm = (fn, res) => function __init() {
6
8
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
@@ -20,6 +22,14 @@ var __copyProps = (to, from2, except, desc) => {
20
22
  }
21
23
  return to;
22
24
  };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
23
33
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
34
 
25
35
  // <define:process.argv>
@@ -8372,6 +8382,7 @@ var init_fs = __esm({
8372
8382
  // src/uplc_tx.js
8373
8383
  var require_uplc_tx = __commonJS({
8374
8384
  "src/uplc_tx.js"(exports, module) {
8385
+ "use strict";
8375
8386
  init_define_process_argv();
8376
8387
  init_global();
8377
8388
  var imports = {};
@@ -8549,7 +8560,17 @@ var require_uplc_tx = __commonJS({
8549
8560
  module.exports.__wasm = wasm;
8550
8561
  }
8551
8562
  });
8552
- export default require_uplc_tx();
8563
+
8564
+ // src/index.ts
8565
+ init_define_process_argv();
8566
+ init_global();
8567
+ var import_uplc_tx = __toESM(require_uplc_tx());
8568
+ var export_apply_params_to_script = import_uplc_tx.apply_params_to_script;
8569
+ var export_eval_phase_two_raw = import_uplc_tx.eval_phase_two_raw;
8570
+ export {
8571
+ export_apply_params_to_script as apply_params_to_script,
8572
+ export_eval_phase_two_raw as eval_phase_two_raw
8573
+ };
8553
8574
  /*! Bundled license information:
8554
8575
 
8555
8576
  @geut/browser-node-core/src/esm/buffer-browserify.js:
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+
33
+ // src/uplc_tx.js
34
+ var require_uplc_tx = __commonJS({
35
+ "src/uplc_tx.js"(exports2, module2) {
36
+ "use strict";
37
+ var imports = {};
38
+ imports["__wbindgen_placeholder__"] = module2.exports;
39
+ var wasm;
40
+ var { TextDecoder } = require("util");
41
+ var heap = new Array(128).fill(void 0);
42
+ heap.push(void 0, null, true, false);
43
+ function getObject(idx) {
44
+ return heap[idx];
45
+ }
46
+ var heap_next = heap.length;
47
+ function dropObject(idx) {
48
+ if (idx < 132)
49
+ return;
50
+ heap[idx] = heap_next;
51
+ heap_next = idx;
52
+ }
53
+ function takeObject(idx) {
54
+ const ret = getObject(idx);
55
+ dropObject(idx);
56
+ return ret;
57
+ }
58
+ var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
59
+ cachedTextDecoder.decode();
60
+ var cachedUint8Memory0 = null;
61
+ function getUint8Memory0() {
62
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
63
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
64
+ }
65
+ return cachedUint8Memory0;
66
+ }
67
+ function getStringFromWasm0(ptr, len) {
68
+ ptr = ptr >>> 0;
69
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
70
+ }
71
+ function addHeapObject(obj) {
72
+ if (heap_next === heap.length)
73
+ heap.push(heap.length + 1);
74
+ const idx = heap_next;
75
+ heap_next = heap[idx];
76
+ heap[idx] = obj;
77
+ return idx;
78
+ }
79
+ var WASM_VECTOR_LEN = 0;
80
+ function passArray8ToWasm0(arg, malloc) {
81
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
82
+ getUint8Memory0().set(arg, ptr / 1);
83
+ WASM_VECTOR_LEN = arg.length;
84
+ return ptr;
85
+ }
86
+ var cachedUint32Memory0 = null;
87
+ function getUint32Memory0() {
88
+ if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
89
+ cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
90
+ }
91
+ return cachedUint32Memory0;
92
+ }
93
+ function passArrayJsValueToWasm0(array, malloc) {
94
+ const ptr = malloc(array.length * 4, 4) >>> 0;
95
+ const mem = getUint32Memory0();
96
+ for (let i = 0; i < array.length; i++) {
97
+ mem[ptr / 4 + i] = addHeapObject(array[i]);
98
+ }
99
+ WASM_VECTOR_LEN = array.length;
100
+ return ptr;
101
+ }
102
+ var cachedInt32Memory0 = null;
103
+ function getInt32Memory0() {
104
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
105
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
106
+ }
107
+ return cachedInt32Memory0;
108
+ }
109
+ function getArrayJsValueFromWasm0(ptr, len) {
110
+ ptr = ptr >>> 0;
111
+ const mem = getUint32Memory0();
112
+ const slice = mem.subarray(ptr / 4, ptr / 4 + len);
113
+ const result = [];
114
+ for (let i = 0; i < slice.length; i++) {
115
+ result.push(takeObject(slice[i]));
116
+ }
117
+ return result;
118
+ }
119
+ module2.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) {
120
+ try {
121
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
122
+ const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
123
+ const len0 = WASM_VECTOR_LEN;
124
+ const ptr1 = passArrayJsValueToWasm0(utxos_bytes_x, wasm.__wbindgen_malloc);
125
+ const len1 = WASM_VECTOR_LEN;
126
+ const ptr2 = passArrayJsValueToWasm0(utxos_bytes_y, wasm.__wbindgen_malloc);
127
+ const len2 = WASM_VECTOR_LEN;
128
+ const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
129
+ const len3 = WASM_VECTOR_LEN;
130
+ 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);
131
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
132
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
133
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
134
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
135
+ if (r3) {
136
+ throw takeObject(r2);
137
+ }
138
+ var v5 = getArrayJsValueFromWasm0(r0, r1).slice();
139
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
140
+ return v5;
141
+ } finally {
142
+ wasm.__wbindgen_add_to_stack_pointer(16);
143
+ }
144
+ };
145
+ function getArrayU8FromWasm0(ptr, len) {
146
+ ptr = ptr >>> 0;
147
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
148
+ }
149
+ module2.exports.apply_params_to_script = function(params_bytes, plutus_script_bytes) {
150
+ try {
151
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
152
+ const ptr0 = passArray8ToWasm0(params_bytes, wasm.__wbindgen_malloc);
153
+ const len0 = WASM_VECTOR_LEN;
154
+ const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
155
+ const len1 = WASM_VECTOR_LEN;
156
+ wasm.apply_params_to_script(retptr, ptr0, len0, ptr1, len1);
157
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
158
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
159
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
160
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
161
+ if (r3) {
162
+ throw takeObject(r2);
163
+ }
164
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
165
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
166
+ return v3;
167
+ } finally {
168
+ wasm.__wbindgen_add_to_stack_pointer(16);
169
+ }
170
+ };
171
+ module2.exports.__wbindgen_object_drop_ref = function(arg0) {
172
+ takeObject(arg0);
173
+ };
174
+ module2.exports.__wbindgen_string_new = function(arg0, arg1) {
175
+ const ret = getStringFromWasm0(arg0, arg1);
176
+ return addHeapObject(ret);
177
+ };
178
+ module2.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
179
+ const ret = getObject(arg0).buffer;
180
+ return addHeapObject(ret);
181
+ };
182
+ module2.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
183
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
184
+ return addHeapObject(ret);
185
+ };
186
+ module2.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
187
+ const ret = new Uint8Array(getObject(arg0));
188
+ return addHeapObject(ret);
189
+ };
190
+ module2.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
191
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
192
+ };
193
+ module2.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
194
+ const ret = getObject(arg0).length;
195
+ return ret;
196
+ };
197
+ module2.exports.__wbindgen_throw = function(arg0, arg1) {
198
+ throw new Error(getStringFromWasm0(arg0, arg1));
199
+ };
200
+ module2.exports.__wbindgen_memory = function() {
201
+ const ret = wasm.memory;
202
+ return addHeapObject(ret);
203
+ };
204
+ var path = require("path").join(__dirname, "uplc_tx_bg.wasm");
205
+ var bytes = require("fs").readFileSync(path);
206
+ var wasmModule = new WebAssembly.Module(bytes);
207
+ var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
208
+ wasm = wasmInstance.exports;
209
+ module2.exports.__wasm = wasm;
210
+ }
211
+ });
212
+
213
+ // src/index.ts
214
+ var src_exports = {};
215
+ __export(src_exports, {
216
+ apply_params_to_script: () => import_uplc_tx.apply_params_to_script,
217
+ eval_phase_two_raw: () => import_uplc_tx.eval_phase_two_raw
218
+ });
219
+ module.exports = __toCommonJS(src_exports);
220
+ var import_uplc_tx = __toESM(require_uplc_tx());
221
+ // Annotate the CommonJS export names for ESM import in node:
222
+ 0 && (module.exports = {
223
+ apply_params_to_script,
224
+ eval_phase_two_raw
225
+ });
@@ -1,4 +1,9 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2
7
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
8
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
9
  }) : x)(function(x) {
@@ -9,10 +14,27 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
9
14
  var __commonJS = (cb, mod) => function __require2() {
10
15
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
16
  };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
12
33
 
13
34
  // src/uplc_tx.js
14
35
  var require_uplc_tx = __commonJS({
15
36
  "src/uplc_tx.js"(exports, module) {
37
+ "use strict";
16
38
  var imports = {};
17
39
  imports["__wbindgen_placeholder__"] = module.exports;
18
40
  var wasm;
@@ -188,4 +210,12 @@ var require_uplc_tx = __commonJS({
188
210
  module.exports.__wasm = wasm;
189
211
  }
190
212
  });
191
- export default require_uplc_tx();
213
+
214
+ // src/index.ts
215
+ var import_uplc_tx = __toESM(require_uplc_tx());
216
+ var export_apply_params_to_script = import_uplc_tx.apply_params_to_script;
217
+ var export_eval_phase_two_raw = import_uplc_tx.eval_phase_two_raw;
218
+ export {
219
+ export_apply_params_to_script as apply_params_to_script,
220
+ export_eval_phase_two_raw as eval_phase_two_raw
221
+ };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@lucid-evolution/uplc",
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",
3
+ "version": "0.2.3",
4
+ "main": "./dist/node/index.js",
5
+ "module": "./dist/node/index.mjs",
6
+ "browser": "./dist/browser/index.mjs",
7
+ "types": "./dist/node/index.d.ts",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
@@ -17,11 +17,11 @@
17
17
  ],
18
18
  "devDependencies": {
19
19
  "@geut/esbuild-plugin-brode": "^2.0.14",
20
- "esbuild-plugin-wasm": "^1.1.0",
21
20
  "esbuild-copy-files-plugin": "^1.2.0",
21
+ "esbuild-plugin-polyfill-node": "^0.3.0",
22
+ "esbuild-plugin-wasm": "^1.1.0",
22
23
  "tsup": "^8.0.2"
23
24
  },
24
- "dependencies": {},
25
25
  "scripts": {
26
26
  "build": "tsup"
27
27
  }
@@ -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