@lucid-evolution/uplc 0.2.15 → 0.2.16

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,3 +1,4 @@
1
+
1
2
  import * as wasm from "./uplc_tx_bg.wasm";
2
3
  import { __wbg_set_wasm } from "./uplc_tx_bg.js";
3
4
  __wbg_set_wasm(wasm);
@@ -30,18 +30,18 @@ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true
30
30
 
31
31
  cachedTextDecoder.decode();
32
32
 
33
- let cachedUint8Memory0 = null;
33
+ let cachedUint8ArrayMemory0 = null;
34
34
 
35
- function getUint8Memory0() {
36
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
37
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
35
+ function getUint8ArrayMemory0() {
36
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
37
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
38
38
  }
39
- return cachedUint8Memory0;
39
+ return cachedUint8ArrayMemory0;
40
40
  }
41
41
 
42
42
  function getStringFromWasm0(ptr, len) {
43
43
  ptr = ptr >>> 0;
44
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
44
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
45
45
  }
46
46
 
47
47
  function addHeapObject(obj) {
@@ -57,46 +57,36 @@ let WASM_VECTOR_LEN = 0;
57
57
 
58
58
  function passArray8ToWasm0(arg, malloc) {
59
59
  const ptr = malloc(arg.length * 1, 1) >>> 0;
60
- getUint8Memory0().set(arg, ptr / 1);
60
+ getUint8ArrayMemory0().set(arg, ptr / 1);
61
61
  WASM_VECTOR_LEN = arg.length;
62
62
  return ptr;
63
63
  }
64
64
 
65
- let cachedUint32Memory0 = null;
65
+ let cachedDataViewMemory0 = null;
66
66
 
67
- function getUint32Memory0() {
68
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
69
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
67
+ function getDataViewMemory0() {
68
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
69
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
70
70
  }
71
- return cachedUint32Memory0;
71
+ return cachedDataViewMemory0;
72
72
  }
73
73
 
74
74
  function passArrayJsValueToWasm0(array, malloc) {
75
75
  const ptr = malloc(array.length * 4, 4) >>> 0;
76
- const mem = getUint32Memory0();
76
+ const mem = getDataViewMemory0();
77
77
  for (let i = 0; i < array.length; i++) {
78
- mem[ptr / 4 + i] = addHeapObject(array[i]);
78
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
79
79
  }
80
80
  WASM_VECTOR_LEN = array.length;
81
81
  return ptr;
82
82
  }
83
83
 
84
- let cachedInt32Memory0 = null;
85
-
86
- function getInt32Memory0() {
87
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
88
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
89
- }
90
- return cachedInt32Memory0;
91
- }
92
-
93
84
  function getArrayJsValueFromWasm0(ptr, len) {
94
85
  ptr = ptr >>> 0;
95
- const mem = getUint32Memory0();
96
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
86
+ const mem = getDataViewMemory0();
97
87
  const result = [];
98
- for (let i = 0; i < slice.length; i++) {
99
- result.push(takeObject(slice[i]));
88
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
89
+ result.push(takeObject(mem.getUint32(i, true)));
100
90
  }
101
91
  return result;
102
92
  }
@@ -124,10 +114,10 @@ export function eval_phase_two_raw(tx_bytes, utxos_bytes_x, utxos_bytes_y, cost_
124
114
  const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
125
115
  const len3 = WASM_VECTOR_LEN;
126
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);
127
- var r0 = getInt32Memory0()[retptr / 4 + 0];
128
- var r1 = getInt32Memory0()[retptr / 4 + 1];
129
- var r2 = getInt32Memory0()[retptr / 4 + 2];
130
- var r3 = getInt32Memory0()[retptr / 4 + 3];
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);
131
121
  if (r3) {
132
122
  throw takeObject(r2);
133
123
  }
@@ -141,7 +131,7 @@ export function eval_phase_two_raw(tx_bytes, utxos_bytes_x, utxos_bytes_y, cost_
141
131
 
142
132
  function getArrayU8FromWasm0(ptr, len) {
143
133
  ptr = ptr >>> 0;
144
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
134
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
145
135
  }
146
136
  /**
147
137
  * @param {Uint8Array} params_bytes
@@ -156,10 +146,10 @@ export function apply_params_to_script(params_bytes, plutus_script_bytes) {
156
146
  const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
157
147
  const len1 = WASM_VECTOR_LEN;
158
148
  wasm.apply_params_to_script(retptr, ptr0, len0, ptr1, len1);
159
- var r0 = getInt32Memory0()[retptr / 4 + 0];
160
- var r1 = getInt32Memory0()[retptr / 4 + 1];
161
- var r2 = getInt32Memory0()[retptr / 4 + 2];
162
- var r3 = getInt32Memory0()[retptr / 4 + 3];
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);
163
153
  if (r3) {
164
154
  throw takeObject(r2);
165
155
  }
@@ -180,36 +170,36 @@ export function __wbindgen_string_new(arg0, arg1) {
180
170
  return addHeapObject(ret);
181
171
  };
182
172
 
183
- export function __wbg_buffer_12d079cc21e14bdb(arg0) {
173
+ export function __wbindgen_memory() {
174
+ const ret = wasm.memory;
175
+ return addHeapObject(ret);
176
+ };
177
+
178
+ export function __wbg_buffer_b7b08af79b0b0974(arg0) {
184
179
  const ret = getObject(arg0).buffer;
185
180
  return addHeapObject(ret);
186
181
  };
187
182
 
188
- export function __wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb(arg0, arg1, arg2) {
183
+ export function __wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9(arg0, arg1, arg2) {
189
184
  const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
190
185
  return addHeapObject(ret);
191
186
  };
192
187
 
193
- export function __wbg_new_63b92bc8671ed464(arg0) {
188
+ export function __wbg_new_ea1883e1e5e86686(arg0) {
194
189
  const ret = new Uint8Array(getObject(arg0));
195
190
  return addHeapObject(ret);
196
191
  };
197
192
 
198
- export function __wbg_set_a47bac70306a19a7(arg0, arg1, arg2) {
199
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
200
- };
201
-
202
- export function __wbg_length_c20a40f15020d68a(arg0) {
193
+ export function __wbg_length_8339fcf5d8ecd12e(arg0) {
203
194
  const ret = getObject(arg0).length;
204
195
  return ret;
205
196
  };
206
197
 
207
- export function __wbindgen_throw(arg0, arg1) {
208
- throw new Error(getStringFromWasm0(arg0, arg1));
198
+ export function __wbg_set_d1e79e2388520f18(arg0, arg1, arg2) {
199
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
209
200
  };
210
201
 
211
- export function __wbindgen_memory() {
212
- const ret = wasm.memory;
213
- return addHeapObject(ret);
202
+ export function __wbindgen_throw(arg0, arg1) {
203
+ throw new Error(getStringFromWasm0(arg0, arg1));
214
204
  };
215
205
 
Binary file
@@ -1,3 +1,4 @@
1
+
1
2
  let imports = {};
2
3
  imports['__wbindgen_placeholder__'] = module.exports;
3
4
  let wasm;
@@ -27,18 +28,18 @@ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true
27
28
 
28
29
  cachedTextDecoder.decode();
29
30
 
30
- let cachedUint8Memory0 = null;
31
+ let cachedUint8ArrayMemory0 = null;
31
32
 
32
- function getUint8Memory0() {
33
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
34
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
33
+ function getUint8ArrayMemory0() {
34
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
35
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
35
36
  }
36
- return cachedUint8Memory0;
37
+ return cachedUint8ArrayMemory0;
37
38
  }
38
39
 
39
40
  function getStringFromWasm0(ptr, len) {
40
41
  ptr = ptr >>> 0;
41
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
42
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
42
43
  }
43
44
 
44
45
  function addHeapObject(obj) {
@@ -54,46 +55,36 @@ let WASM_VECTOR_LEN = 0;
54
55
 
55
56
  function passArray8ToWasm0(arg, malloc) {
56
57
  const ptr = malloc(arg.length * 1, 1) >>> 0;
57
- getUint8Memory0().set(arg, ptr / 1);
58
+ getUint8ArrayMemory0().set(arg, ptr / 1);
58
59
  WASM_VECTOR_LEN = arg.length;
59
60
  return ptr;
60
61
  }
61
62
 
62
- let cachedUint32Memory0 = null;
63
+ let cachedDataViewMemory0 = null;
63
64
 
64
- function getUint32Memory0() {
65
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
66
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
65
+ function getDataViewMemory0() {
66
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
67
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
67
68
  }
68
- return cachedUint32Memory0;
69
+ return cachedDataViewMemory0;
69
70
  }
70
71
 
71
72
  function passArrayJsValueToWasm0(array, malloc) {
72
73
  const ptr = malloc(array.length * 4, 4) >>> 0;
73
- const mem = getUint32Memory0();
74
+ const mem = getDataViewMemory0();
74
75
  for (let i = 0; i < array.length; i++) {
75
- mem[ptr / 4 + i] = addHeapObject(array[i]);
76
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
76
77
  }
77
78
  WASM_VECTOR_LEN = array.length;
78
79
  return ptr;
79
80
  }
80
81
 
81
- let cachedInt32Memory0 = null;
82
-
83
- function getInt32Memory0() {
84
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
85
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
86
- }
87
- return cachedInt32Memory0;
88
- }
89
-
90
82
  function getArrayJsValueFromWasm0(ptr, len) {
91
83
  ptr = ptr >>> 0;
92
- const mem = getUint32Memory0();
93
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
84
+ const mem = getDataViewMemory0();
94
85
  const result = [];
95
- for (let i = 0; i < slice.length; i++) {
96
- result.push(takeObject(slice[i]));
86
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
87
+ result.push(takeObject(mem.getUint32(i, true)));
97
88
  }
98
89
  return result;
99
90
  }
@@ -121,10 +112,10 @@ module.exports.eval_phase_two_raw = function(tx_bytes, utxos_bytes_x, utxos_byte
121
112
  const ptr3 = passArray8ToWasm0(cost_mdls_bytes, wasm.__wbindgen_malloc);
122
113
  const len3 = WASM_VECTOR_LEN;
123
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);
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];
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);
128
119
  if (r3) {
129
120
  throw takeObject(r2);
130
121
  }
@@ -138,7 +129,7 @@ module.exports.eval_phase_two_raw = function(tx_bytes, utxos_bytes_x, utxos_byte
138
129
 
139
130
  function getArrayU8FromWasm0(ptr, len) {
140
131
  ptr = ptr >>> 0;
141
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
132
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
142
133
  }
143
134
  /**
144
135
  * @param {Uint8Array} params_bytes
@@ -153,10 +144,10 @@ module.exports.apply_params_to_script = function(params_bytes, plutus_script_byt
153
144
  const ptr1 = passArray8ToWasm0(plutus_script_bytes, wasm.__wbindgen_malloc);
154
145
  const len1 = WASM_VECTOR_LEN;
155
146
  wasm.apply_params_to_script(retptr, ptr0, len0, ptr1, len1);
156
- var r0 = getInt32Memory0()[retptr / 4 + 0];
157
- var r1 = getInt32Memory0()[retptr / 4 + 1];
158
- var r2 = getInt32Memory0()[retptr / 4 + 2];
159
- var r3 = getInt32Memory0()[retptr / 4 + 3];
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);
160
151
  if (r3) {
161
152
  throw takeObject(r2);
162
153
  }
@@ -177,37 +168,37 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
177
168
  return addHeapObject(ret);
178
169
  };
179
170
 
180
- module.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
171
+ module.exports.__wbindgen_memory = function() {
172
+ const ret = wasm.memory;
173
+ return addHeapObject(ret);
174
+ };
175
+
176
+ module.exports.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
181
177
  const ret = getObject(arg0).buffer;
182
178
  return addHeapObject(ret);
183
179
  };
184
180
 
185
- module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
181
+ module.exports.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function(arg0, arg1, arg2) {
186
182
  const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
187
183
  return addHeapObject(ret);
188
184
  };
189
185
 
190
- module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
186
+ module.exports.__wbg_new_ea1883e1e5e86686 = function(arg0) {
191
187
  const ret = new Uint8Array(getObject(arg0));
192
188
  return addHeapObject(ret);
193
189
  };
194
190
 
195
- module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
196
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
197
- };
198
-
199
- module.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
191
+ module.exports.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
200
192
  const ret = getObject(arg0).length;
201
193
  return ret;
202
194
  };
203
195
 
204
- module.exports.__wbindgen_throw = function(arg0, arg1) {
205
- throw new Error(getStringFromWasm0(arg0, arg1));
196
+ module.exports.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
197
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
206
198
  };
207
199
 
208
- module.exports.__wbindgen_memory = function() {
209
- const ret = wasm.memory;
210
- return addHeapObject(ret);
200
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
201
+ throw new Error(getStringFromWasm0(arg0, arg1));
211
202
  };
212
203
 
213
204
  const path = require('path').join(__dirname, 'uplc_tx_bg.wasm');
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-evolution/uplc",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
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",