@wgb5445/aptos-intent-npm 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/entry.js CHANGED
@@ -213,7 +213,14 @@ function makeMutClosure(arg0, arg1, dtor, f) {
213
213
  return real;
214
214
  }
215
215
  function __wbg_adapter_24(arg0, arg1, arg2) {
216
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09acdaa8b02601d5(arg0, arg1, addHeapObject(arg2));
216
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8273ed02fd8578ca(arg0, arg1, addHeapObject(arg2));
217
+ }
218
+
219
+ function passArray8ToWasm0(arg, malloc) {
220
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
221
+ getUint8Memory0().set(arg, ptr / 1);
222
+ WASM_VECTOR_LEN = arg.length;
223
+ return ptr;
217
224
  }
218
225
 
219
226
  let cachedUint32Memory0 = null;
@@ -225,16 +232,6 @@ function getUint32Memory0() {
225
232
  return cachedUint32Memory0;
226
233
  }
227
234
 
228
- function passArrayJsValueToWasm0(array, malloc) {
229
- const ptr = malloc(array.length * 4, 4) >>> 0;
230
- const mem = getUint32Memory0();
231
- for (let i = 0; i < array.length; i++) {
232
- mem[ptr / 4 + i] = addHeapObject(array[i]);
233
- }
234
- WASM_VECTOR_LEN = array.length;
235
- return ptr;
236
- }
237
-
238
235
  function getArrayJsValueFromWasm0(ptr, len) {
239
236
  ptr = ptr >>> 0;
240
237
  const mem = getUint32Memory0();
@@ -245,19 +242,46 @@ function getArrayJsValueFromWasm0(ptr, len) {
245
242
  }
246
243
  return result;
247
244
  }
245
+ /**
246
+ * @param {Uint8Array} script
247
+ * @returns {(BatchedFunctionCall)[]}
248
+ */
249
+ function generate_intent_payload_wasm(script) {
250
+ try {
251
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
252
+ const ptr0 = passArray8ToWasm0(script, wasm.__wbindgen_malloc);
253
+ const len0 = WASM_VECTOR_LEN;
254
+ wasm.generate_intent_payload_wasm(retptr, ptr0, len0);
255
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
256
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
257
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
258
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
259
+ if (r3) {
260
+ throw takeObject(r2);
261
+ }
262
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
263
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
264
+ return v2;
265
+ } finally {
266
+ wasm.__wbindgen_add_to_stack_pointer(16);
267
+ }
268
+ }
269
+
270
+ function passArrayJsValueToWasm0(array, malloc) {
271
+ const ptr = malloc(array.length * 4, 4) >>> 0;
272
+ const mem = getUint32Memory0();
273
+ for (let i = 0; i < array.length; i++) {
274
+ mem[ptr / 4 + i] = addHeapObject(array[i]);
275
+ }
276
+ WASM_VECTOR_LEN = array.length;
277
+ return ptr;
278
+ }
248
279
 
249
280
  function getArrayU8FromWasm0(ptr, len) {
250
281
  ptr = ptr >>> 0;
251
282
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
252
283
  }
253
284
 
254
- function passArray8ToWasm0(arg, malloc) {
255
- const ptr = malloc(arg.length * 1, 1) >>> 0;
256
- getUint8Memory0().set(arg, ptr / 1);
257
- WASM_VECTOR_LEN = arg.length;
258
- return ptr;
259
- }
260
-
261
285
  function handleError(f, args) {
262
286
  try {
263
287
  return f.apply(this, args);
@@ -265,36 +289,33 @@ function handleError(f, args) {
265
289
  wasm.__wbindgen_exn_store(addHeapObject(e));
266
290
  }
267
291
  }
268
- function __wbg_adapter_87(arg0, arg1, arg2, arg3) {
269
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h4c0838795c3445c5(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
292
+ function __wbg_adapter_90(arg0, arg1, arg2, arg3) {
293
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h7a552e5a28352106(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
270
294
  }
271
295
 
272
- /**
273
- */
274
- const ArgumentOperation = Object.freeze({ Move:0,"0":"Move",Copy:1,"1":"Copy",Borrow:2,"2":"Borrow",BorrowMut:3,"3":"BorrowMut", });
275
296
  /**
276
297
  * Arguments for each function.
277
298
  */
278
299
  const BatchArgumentType = Object.freeze({ Raw:0,"0":"Raw",Signer:1,"1":"Signer",PreviousResult:2,"2":"PreviousResult", });
279
300
 
280
- const BatchArgumentFinalization = (typeof FinalizationRegistry === 'undefined')
301
+ const BatchArgumentWASMFinalization = (typeof FinalizationRegistry === 'undefined')
281
302
  ? { register: () => {}, unregister: () => {} }
282
- : new FinalizationRegistry(ptr => wasm.__wbg_batchargument_free(ptr >>> 0));
303
+ : new FinalizationRegistry(ptr => wasm.__wbg_batchargumentwasm_free(ptr >>> 0));
283
304
  /**
284
305
  * Arguments for each function. Wasm bindgen only support C-style enum so use option to work around.
285
306
  */
286
- class BatchArgument {
307
+ class BatchArgumentWASM {
287
308
 
288
309
  static __wrap(ptr) {
289
310
  ptr = ptr >>> 0;
290
- const obj = Object.create(BatchArgument.prototype);
311
+ const obj = Object.create(BatchArgumentWASM.prototype);
291
312
  obj.__wbg_ptr = ptr;
292
- BatchArgumentFinalization.register(obj, obj.__wbg_ptr, obj);
313
+ BatchArgumentWASMFinalization.register(obj, obj.__wbg_ptr, obj);
293
314
  return obj;
294
315
  }
295
316
 
296
317
  static __unwrap(jsValue) {
297
- if (!(jsValue instanceof BatchArgument)) {
318
+ if (!(jsValue instanceof BatchArgumentWASM)) {
298
319
  return 0;
299
320
  }
300
321
  return jsValue.__destroy_into_raw();
@@ -303,82 +324,82 @@ class BatchArgument {
303
324
  __destroy_into_raw() {
304
325
  const ptr = this.__wbg_ptr;
305
326
  this.__wbg_ptr = 0;
306
- BatchArgumentFinalization.unregister(this);
327
+ BatchArgumentWASMFinalization.unregister(this);
307
328
  return ptr;
308
329
  }
309
330
 
310
331
  free() {
311
332
  const ptr = this.__destroy_into_raw();
312
- wasm.__wbg_batchargument_free(ptr);
333
+ wasm.__wbg_batchargumentwasm_free(ptr);
313
334
  }
314
335
  /**
315
336
  * @param {Uint8Array} bytes
316
- * @returns {BatchArgument}
337
+ * @returns {BatchArgumentWASM}
317
338
  */
318
339
  static new_bytes(bytes) {
319
340
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
320
341
  const len0 = WASM_VECTOR_LEN;
321
- const ret = wasm.batchargument_new_bytes(ptr0, len0);
322
- return BatchArgument.__wrap(ret);
342
+ const ret = wasm.batchargumentwasm_new_bytes(ptr0, len0);
343
+ return BatchArgumentWASM.__wrap(ret);
323
344
  }
324
345
  /**
325
346
  * @param {number} signer_idx
326
- * @returns {BatchArgument}
347
+ * @returns {BatchArgumentWASM}
327
348
  */
328
349
  static new_signer(signer_idx) {
329
- const ret = wasm.batchargument_new_signer(signer_idx);
330
- return BatchArgument.__wrap(ret);
350
+ const ret = wasm.batchargumentwasm_new_signer(signer_idx);
351
+ return BatchArgumentWASM.__wrap(ret);
331
352
  }
332
353
  /**
333
- * @returns {BatchArgument}
354
+ * @returns {BatchArgumentWASM}
334
355
  */
335
356
  borrow() {
336
357
  try {
337
358
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
338
- wasm.batchargument_borrow(retptr, this.__wbg_ptr);
359
+ wasm.batchargumentwasm_borrow(retptr, this.__wbg_ptr);
339
360
  var r0 = getInt32Memory0()[retptr / 4 + 0];
340
361
  var r1 = getInt32Memory0()[retptr / 4 + 1];
341
362
  var r2 = getInt32Memory0()[retptr / 4 + 2];
342
363
  if (r2) {
343
364
  throw takeObject(r1);
344
365
  }
345
- return BatchArgument.__wrap(r0);
366
+ return BatchArgumentWASM.__wrap(r0);
346
367
  } finally {
347
368
  wasm.__wbindgen_add_to_stack_pointer(16);
348
369
  }
349
370
  }
350
371
  /**
351
- * @returns {BatchArgument}
372
+ * @returns {BatchArgumentWASM}
352
373
  */
353
374
  borrow_mut() {
354
375
  try {
355
376
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
356
- wasm.batchargument_borrow_mut(retptr, this.__wbg_ptr);
377
+ wasm.batchargumentwasm_borrow_mut(retptr, this.__wbg_ptr);
357
378
  var r0 = getInt32Memory0()[retptr / 4 + 0];
358
379
  var r1 = getInt32Memory0()[retptr / 4 + 1];
359
380
  var r2 = getInt32Memory0()[retptr / 4 + 2];
360
381
  if (r2) {
361
382
  throw takeObject(r1);
362
383
  }
363
- return BatchArgument.__wrap(r0);
384
+ return BatchArgumentWASM.__wrap(r0);
364
385
  } finally {
365
386
  wasm.__wbindgen_add_to_stack_pointer(16);
366
387
  }
367
388
  }
368
389
  /**
369
- * @returns {BatchArgument}
390
+ * @returns {BatchArgumentWASM}
370
391
  */
371
392
  copy() {
372
393
  try {
373
394
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
374
- wasm.batchargument_copy(retptr, this.__wbg_ptr);
395
+ wasm.batchargumentwasm_copy(retptr, this.__wbg_ptr);
375
396
  var r0 = getInt32Memory0()[retptr / 4 + 0];
376
397
  var r1 = getInt32Memory0()[retptr / 4 + 1];
377
398
  var r2 = getInt32Memory0()[retptr / 4 + 2];
378
399
  if (r2) {
379
400
  throw takeObject(r1);
380
401
  }
381
- return BatchArgument.__wrap(r0);
402
+ return BatchArgumentWASM.__wrap(r0);
382
403
  } finally {
383
404
  wasm.__wbindgen_add_to_stack_pointer(16);
384
405
  }
@@ -393,6 +414,14 @@ const BatchedFunctionCallFinalization = (typeof FinalizationRegistry === 'undefi
393
414
  */
394
415
  class BatchedFunctionCall {
395
416
 
417
+ static __wrap(ptr) {
418
+ ptr = ptr >>> 0;
419
+ const obj = Object.create(BatchedFunctionCall.prototype);
420
+ obj.__wbg_ptr = ptr;
421
+ BatchedFunctionCallFinalization.register(obj, obj.__wbg_ptr, obj);
422
+ return obj;
423
+ }
424
+
396
425
  __destroy_into_raw() {
397
426
  const ptr = this.__wbg_ptr;
398
427
  this.__wbg_ptr = 0;
@@ -451,8 +480,8 @@ class BatchedFunctionCallBuilder {
451
480
  * @param {string} module
452
481
  * @param {string} _function
453
482
  * @param {(string)[]} ty_args
454
- * @param {(BatchArgument)[]} args
455
- * @returns {(BatchArgument)[]}
483
+ * @param {(BatchArgumentWASM)[]} args
484
+ * @returns {(BatchArgumentWASM)[]}
456
485
  */
457
486
  add_batched_call(module, _function, ty_args, args) {
458
487
  try {
@@ -517,32 +546,33 @@ class BatchedFunctionCallBuilder {
517
546
  }
518
547
  }
519
548
 
520
- const PreviousResultFinalization = (typeof FinalizationRegistry === 'undefined')
521
- ? { register: () => {}, unregister: () => {} }
522
- : new FinalizationRegistry(ptr => wasm.__wbg_previousresult_free(ptr >>> 0));
523
- /**
524
- */
525
- class PreviousResult {
526
-
527
- __destroy_into_raw() {
528
- const ptr = this.__wbg_ptr;
529
- this.__wbg_ptr = 0;
530
- PreviousResultFinalization.unregister(this);
531
- return ptr;
532
- }
533
-
534
- free() {
535
- const ptr = this.__destroy_into_raw();
536
- wasm.__wbg_previousresult_free(ptr);
537
- }
538
- }
539
-
540
549
  function __wbg_get_imports() {
541
550
  const imports = {};
542
551
  imports.wbg = {};
552
+ imports.wbg.__wbg_batchargumentwasm_new = function(arg0) {
553
+ const ret = BatchArgumentWASM.__wrap(arg0);
554
+ return addHeapObject(ret);
555
+ };
556
+ imports.wbg.__wbg_batchedfunctioncall_new = function(arg0) {
557
+ const ret = BatchedFunctionCall.__wrap(arg0);
558
+ return addHeapObject(ret);
559
+ };
543
560
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
544
561
  takeObject(arg0);
545
562
  };
563
+ imports.wbg.__wbindgen_cb_drop = function(arg0) {
564
+ const obj = takeObject(arg0).original;
565
+ if (obj.cnt-- == 1) {
566
+ obj.a = 0;
567
+ return true;
568
+ }
569
+ const ret = false;
570
+ return ret;
571
+ };
572
+ imports.wbg.__wbg_batchargumentwasm_unwrap = function(arg0) {
573
+ const ret = BatchArgumentWASM.__unwrap(takeObject(arg0));
574
+ return ret;
575
+ };
546
576
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
547
577
  const ret = getStringFromWasm0(arg0, arg1);
548
578
  return addHeapObject(ret);
@@ -555,23 +585,6 @@ function __wbg_get_imports() {
555
585
  getInt32Memory0()[arg0 / 4 + 1] = len1;
556
586
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
557
587
  };
558
- imports.wbg.__wbg_batchargument_unwrap = function(arg0) {
559
- const ret = BatchArgument.__unwrap(takeObject(arg0));
560
- return ret;
561
- };
562
- imports.wbg.__wbg_batchargument_new = function(arg0) {
563
- const ret = BatchArgument.__wrap(arg0);
564
- return addHeapObject(ret);
565
- };
566
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
567
- const obj = takeObject(arg0).original;
568
- if (obj.cnt-- == 1) {
569
- obj.a = 0;
570
- return true;
571
- }
572
- const ret = false;
573
- return ret;
574
- };
575
588
  imports.wbg.__wbg_fetch_1e4e8ed1f64c7e28 = function(arg0) {
576
589
  const ret = fetch(getObject(arg0));
577
590
  return addHeapObject(ret);
@@ -580,9 +593,6 @@ function __wbg_get_imports() {
580
593
  const ret = getObject(arg0);
581
594
  return addHeapObject(ret);
582
595
  };
583
- imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) {
584
- queueMicrotask(getObject(arg0));
585
- };
586
596
  imports.wbg.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function(arg0) {
587
597
  const ret = getObject(arg0).queueMicrotask;
588
598
  return addHeapObject(ret);
@@ -591,10 +601,20 @@ function __wbg_get_imports() {
591
601
  const ret = typeof(getObject(arg0)) === 'function';
592
602
  return ret;
593
603
  };
604
+ imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) {
605
+ queueMicrotask(getObject(arg0));
606
+ };
594
607
  imports.wbg.__wbg_fetch_693453ca3f88c055 = function(arg0, arg1) {
595
608
  const ret = getObject(arg0).fetch(getObject(arg1));
596
609
  return addHeapObject(ret);
597
610
  };
611
+ imports.wbg.__wbg_new_7a20246daa6eec7e = function() { return handleError(function () {
612
+ const ret = new Headers();
613
+ return addHeapObject(ret);
614
+ }, arguments) };
615
+ imports.wbg.__wbg_append_aa3f462f9e2b5ff2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
616
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
617
+ }, arguments) };
598
618
  imports.wbg.__wbg_newwithstrandinit_f581dff0d19a8b03 = function() { return handleError(function (arg0, arg1, arg2) {
599
619
  const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
600
620
  return addHeapObject(ret);
@@ -610,13 +630,6 @@ function __wbg_get_imports() {
610
630
  imports.wbg.__wbg_abort_2c4fb490d878d2b2 = function(arg0) {
611
631
  getObject(arg0).abort();
612
632
  };
613
- imports.wbg.__wbg_new_7a20246daa6eec7e = function() { return handleError(function () {
614
- const ret = new Headers();
615
- return addHeapObject(ret);
616
- }, arguments) };
617
- imports.wbg.__wbg_append_aa3f462f9e2b5ff2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
618
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
619
- }, arguments) };
620
633
  imports.wbg.__wbg_instanceof_Response_4c3b1446206114d1 = function(arg0) {
621
634
  let result;
622
635
  try {
@@ -718,7 +731,7 @@ function __wbg_get_imports() {
718
731
  const a = state0.a;
719
732
  state0.a = 0;
720
733
  try {
721
- return __wbg_adapter_87(a, state0.b, arg0, arg1);
734
+ return __wbg_adapter_90(a, state0.b, arg0, arg1);
722
735
  } finally {
723
736
  state0.a = a;
724
737
  }
@@ -753,10 +766,6 @@ function __wbg_get_imports() {
753
766
  const ret = new Uint8Array(getObject(arg0));
754
767
  return addHeapObject(ret);
755
768
  };
756
- imports.wbg.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) {
757
- const ret = JSON.stringify(getObject(arg0));
758
- return addHeapObject(ret);
759
- }, arguments) };
760
769
  imports.wbg.__wbg_has_0af94d20077affa2 = function() { return handleError(function (arg0, arg1) {
761
770
  const ret = Reflect.has(getObject(arg0), getObject(arg1));
762
771
  return ret;
@@ -765,6 +774,10 @@ function __wbg_get_imports() {
765
774
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
766
775
  return ret;
767
776
  }, arguments) };
777
+ imports.wbg.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) {
778
+ const ret = JSON.stringify(getObject(arg0));
779
+ return addHeapObject(ret);
780
+ }, arguments) };
768
781
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
769
782
  const ret = debugString(getObject(arg1));
770
783
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -779,8 +792,8 @@ function __wbg_get_imports() {
779
792
  const ret = wasm.memory;
780
793
  return addHeapObject(ret);
781
794
  };
782
- imports.wbg.__wbindgen_closure_wrapper540 = function(arg0, arg1, arg2) {
783
- const ret = makeMutClosure(arg0, arg1, 264, __wbg_adapter_24);
795
+ imports.wbg.__wbindgen_closure_wrapper1042 = function(arg0, arg1, arg2) {
796
+ const ret = makeMutClosure(arg0, arg1, 297, __wbg_adapter_24);
784
797
  return addHeapObject(ret);
785
798
  };
786
799
 
@@ -812,14 +825,13 @@ function initSync(module) {
812
825
  }
813
826
 
814
827
  async function get_wasm (){
815
- return (await Promise.resolve().then(function () { return require('./aptos_intent_bg-Cvhg0cOA.js'); })).default()
828
+ return (await Promise.resolve().then(function () { return require('./aptos_intent_bg-Dke4lYNx.js'); })).default()
816
829
  }
817
830
 
818
- exports.ArgumentOperation = ArgumentOperation;
819
- exports.BatchArgument = BatchArgument;
820
831
  exports.BatchArgumentType = BatchArgumentType;
832
+ exports.BatchArgumentWASM = BatchArgumentWASM;
821
833
  exports.BatchedFunctionCall = BatchedFunctionCall;
822
834
  exports.BatchedFunctionCallBuilder = BatchedFunctionCallBuilder;
823
- exports.PreviousResult = PreviousResult;
835
+ exports.generate_intent_payload_wasm = generate_intent_payload_wasm;
824
836
  exports.get_wasm = get_wasm;
825
837
  exports.initSync = initSync;