@gmsol-labs/gmsol-sdk 0.8.0-beta.4 → 0.9.0-alpha.0

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/index_bg.js CHANGED
@@ -287,6 +287,156 @@ export function update_orders(args) {
287
287
  return TransactionGroup.__wrap(ret[0]);
288
288
  }
289
289
 
290
+ /**
291
+ * @param {CreateDepositParamsJs[]} deposits
292
+ * @param {CreateDepositOptions} options
293
+ * @returns {CreateDepositsBuilder}
294
+ */
295
+ export function create_deposits_builder(deposits, options) {
296
+ const ptr0 = passArrayJsValueToWasm0(deposits, wasm.__wbindgen_malloc);
297
+ const len0 = WASM_VECTOR_LEN;
298
+ const ret = wasm.create_deposits_builder(ptr0, len0, options);
299
+ if (ret[2]) {
300
+ throw takeFromExternrefTable0(ret[1]);
301
+ }
302
+ return CreateDepositsBuilder.__wrap(ret[0]);
303
+ }
304
+
305
+ /**
306
+ * @param {CreateDepositParamsJs[]} deposits
307
+ * @param {CreateDepositOptions} options
308
+ * @returns {TransactionGroup}
309
+ */
310
+ export function create_deposits(deposits, options) {
311
+ const ptr0 = passArrayJsValueToWasm0(deposits, wasm.__wbindgen_malloc);
312
+ const len0 = WASM_VECTOR_LEN;
313
+ const ret = wasm.create_deposits(ptr0, len0, options);
314
+ if (ret[2]) {
315
+ throw takeFromExternrefTable0(ret[1]);
316
+ }
317
+ return TransactionGroup.__wrap(ret[0]);
318
+ }
319
+
320
+ /**
321
+ * @param {CreateWithdrawalParamsJs[]} withdrawals
322
+ * @param {CreateWithdrawalOptions} options
323
+ * @returns {CreateWithdrawalsBuilder}
324
+ */
325
+ export function create_withdrawals_builder(withdrawals, options) {
326
+ const ptr0 = passArrayJsValueToWasm0(withdrawals, wasm.__wbindgen_malloc);
327
+ const len0 = WASM_VECTOR_LEN;
328
+ const ret = wasm.create_withdrawals_builder(ptr0, len0, options);
329
+ if (ret[2]) {
330
+ throw takeFromExternrefTable0(ret[1]);
331
+ }
332
+ return CreateWithdrawalsBuilder.__wrap(ret[0]);
333
+ }
334
+
335
+ /**
336
+ * @param {CreateWithdrawalParamsJs[]} withdrawals
337
+ * @param {CreateWithdrawalOptions} options
338
+ * @returns {TransactionGroup}
339
+ */
340
+ export function create_withdrawals(withdrawals, options) {
341
+ const ptr0 = passArrayJsValueToWasm0(withdrawals, wasm.__wbindgen_malloc);
342
+ const len0 = WASM_VECTOR_LEN;
343
+ const ret = wasm.create_withdrawals(ptr0, len0, options);
344
+ if (ret[2]) {
345
+ throw takeFromExternrefTable0(ret[1]);
346
+ }
347
+ return TransactionGroup.__wrap(ret[0]);
348
+ }
349
+
350
+ /**
351
+ * @param {CreateShiftParamsJs[]} shifts
352
+ * @param {CreateShiftOptions} options
353
+ * @returns {CreateShiftsBuilder}
354
+ */
355
+ export function create_shifts_builder(shifts, options) {
356
+ const ptr0 = passArrayJsValueToWasm0(shifts, wasm.__wbindgen_malloc);
357
+ const len0 = WASM_VECTOR_LEN;
358
+ const ret = wasm.create_shifts_builder(ptr0, len0, options);
359
+ if (ret[2]) {
360
+ throw takeFromExternrefTable0(ret[1]);
361
+ }
362
+ return CreateShiftsBuilder.__wrap(ret[0]);
363
+ }
364
+
365
+ /**
366
+ * @param {CreateShiftParamsJs[]} shifts
367
+ * @param {CreateShiftOptions} options
368
+ * @returns {TransactionGroup}
369
+ */
370
+ export function create_shifts(shifts, options) {
371
+ const ptr0 = passArrayJsValueToWasm0(shifts, wasm.__wbindgen_malloc);
372
+ const len0 = WASM_VECTOR_LEN;
373
+ const ret = wasm.create_shifts(ptr0, len0, options);
374
+ if (ret[2]) {
375
+ throw takeFromExternrefTable0(ret[1]);
376
+ }
377
+ return TransactionGroup.__wrap(ret[0]);
378
+ }
379
+
380
+ /**
381
+ * @param {CreateGlvDepositParamsJs[]} deposits
382
+ * @param {CreateGlvDepositOptions} options
383
+ * @returns {CreateGlvDepositsBuilder}
384
+ */
385
+ export function create_glv_deposits_builder(deposits, options) {
386
+ const ptr0 = passArrayJsValueToWasm0(deposits, wasm.__wbindgen_malloc);
387
+ const len0 = WASM_VECTOR_LEN;
388
+ const ret = wasm.create_glv_deposits_builder(ptr0, len0, options);
389
+ if (ret[2]) {
390
+ throw takeFromExternrefTable0(ret[1]);
391
+ }
392
+ return CreateGlvDepositsBuilder.__wrap(ret[0]);
393
+ }
394
+
395
+ /**
396
+ * @param {CreateGlvDepositParamsJs[]} deposits
397
+ * @param {CreateGlvDepositOptions} options
398
+ * @returns {TransactionGroup}
399
+ */
400
+ export function create_glv_deposits(deposits, options) {
401
+ const ptr0 = passArrayJsValueToWasm0(deposits, wasm.__wbindgen_malloc);
402
+ const len0 = WASM_VECTOR_LEN;
403
+ const ret = wasm.create_glv_deposits(ptr0, len0, options);
404
+ if (ret[2]) {
405
+ throw takeFromExternrefTable0(ret[1]);
406
+ }
407
+ return TransactionGroup.__wrap(ret[0]);
408
+ }
409
+
410
+ /**
411
+ * @param {CreateGlvWithdrawalParamsJs[]} withdrawals
412
+ * @param {CreateGlvWithdrawalOptions} options
413
+ * @returns {CreateGlvWithdrawalsBuilder}
414
+ */
415
+ export function create_glv_withdrawals_builder(withdrawals, options) {
416
+ const ptr0 = passArrayJsValueToWasm0(withdrawals, wasm.__wbindgen_malloc);
417
+ const len0 = WASM_VECTOR_LEN;
418
+ const ret = wasm.create_glv_withdrawals_builder(ptr0, len0, options);
419
+ if (ret[2]) {
420
+ throw takeFromExternrefTable0(ret[1]);
421
+ }
422
+ return CreateGlvWithdrawalsBuilder.__wrap(ret[0]);
423
+ }
424
+
425
+ /**
426
+ * @param {CreateGlvWithdrawalParamsJs[]} withdrawals
427
+ * @param {CreateGlvWithdrawalOptions} options
428
+ * @returns {TransactionGroup}
429
+ */
430
+ export function create_glv_withdrawals(withdrawals, options) {
431
+ const ptr0 = passArrayJsValueToWasm0(withdrawals, wasm.__wbindgen_malloc);
432
+ const len0 = WASM_VECTOR_LEN;
433
+ const ret = wasm.create_glv_withdrawals(ptr0, len0, options);
434
+ if (ret[2]) {
435
+ throw takeFromExternrefTable0(ret[1]);
436
+ }
437
+ return TransactionGroup.__wrap(ret[0]);
438
+ }
439
+
290
440
  /**
291
441
  * Apply `factor` to the `value`.
292
442
  * @param {bigint} value
@@ -305,6 +455,126 @@ export function solana_program_init() {
305
455
  wasm.solana_program_init();
306
456
  }
307
457
 
458
+ const CreateDepositsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
459
+ ? { register: () => {}, unregister: () => {} }
460
+ : new FinalizationRegistry(ptr => wasm.__wbg_createdepositsbuilder_free(ptr >>> 0, 1));
461
+
462
+ export class CreateDepositsBuilder {
463
+
464
+ static __wrap(ptr) {
465
+ ptr = ptr >>> 0;
466
+ const obj = Object.create(CreateDepositsBuilder.prototype);
467
+ obj.__wbg_ptr = ptr;
468
+ CreateDepositsBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
469
+ return obj;
470
+ }
471
+
472
+ __destroy_into_raw() {
473
+ const ptr = this.__wbg_ptr;
474
+ this.__wbg_ptr = 0;
475
+ CreateDepositsBuilderFinalization.unregister(this);
476
+ return ptr;
477
+ }
478
+
479
+ free() {
480
+ const ptr = this.__destroy_into_raw();
481
+ wasm.__wbg_createdepositsbuilder_free(ptr, 0);
482
+ }
483
+ /**
484
+ * @param {TransactionGroupOptions | null} [transaction_group]
485
+ * @param {BuildTransactionOptions | null} [build]
486
+ * @returns {TransactionGroup}
487
+ */
488
+ build_with_options(transaction_group, build) {
489
+ const ptr = this.__destroy_into_raw();
490
+ const ret = wasm.createdepositsbuilder_build_with_options(ptr, isLikeNone(transaction_group) ? 0 : addToExternrefTable0(transaction_group), isLikeNone(build) ? 0 : addToExternrefTable0(build));
491
+ if (ret[2]) {
492
+ throw takeFromExternrefTable0(ret[1]);
493
+ }
494
+ return TransactionGroup.__wrap(ret[0]);
495
+ }
496
+ }
497
+
498
+ const CreateGlvDepositsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
499
+ ? { register: () => {}, unregister: () => {} }
500
+ : new FinalizationRegistry(ptr => wasm.__wbg_createglvdepositsbuilder_free(ptr >>> 0, 1));
501
+
502
+ export class CreateGlvDepositsBuilder {
503
+
504
+ static __wrap(ptr) {
505
+ ptr = ptr >>> 0;
506
+ const obj = Object.create(CreateGlvDepositsBuilder.prototype);
507
+ obj.__wbg_ptr = ptr;
508
+ CreateGlvDepositsBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
509
+ return obj;
510
+ }
511
+
512
+ __destroy_into_raw() {
513
+ const ptr = this.__wbg_ptr;
514
+ this.__wbg_ptr = 0;
515
+ CreateGlvDepositsBuilderFinalization.unregister(this);
516
+ return ptr;
517
+ }
518
+
519
+ free() {
520
+ const ptr = this.__destroy_into_raw();
521
+ wasm.__wbg_createglvdepositsbuilder_free(ptr, 0);
522
+ }
523
+ /**
524
+ * @param {TransactionGroupOptions | null} [transaction_group]
525
+ * @param {BuildTransactionOptions | null} [build]
526
+ * @returns {TransactionGroup}
527
+ */
528
+ build_with_options(transaction_group, build) {
529
+ const ptr = this.__destroy_into_raw();
530
+ const ret = wasm.createglvdepositsbuilder_build_with_options(ptr, isLikeNone(transaction_group) ? 0 : addToExternrefTable0(transaction_group), isLikeNone(build) ? 0 : addToExternrefTable0(build));
531
+ if (ret[2]) {
532
+ throw takeFromExternrefTable0(ret[1]);
533
+ }
534
+ return TransactionGroup.__wrap(ret[0]);
535
+ }
536
+ }
537
+
538
+ const CreateGlvWithdrawalsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
539
+ ? { register: () => {}, unregister: () => {} }
540
+ : new FinalizationRegistry(ptr => wasm.__wbg_createglvwithdrawalsbuilder_free(ptr >>> 0, 1));
541
+
542
+ export class CreateGlvWithdrawalsBuilder {
543
+
544
+ static __wrap(ptr) {
545
+ ptr = ptr >>> 0;
546
+ const obj = Object.create(CreateGlvWithdrawalsBuilder.prototype);
547
+ obj.__wbg_ptr = ptr;
548
+ CreateGlvWithdrawalsBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
549
+ return obj;
550
+ }
551
+
552
+ __destroy_into_raw() {
553
+ const ptr = this.__wbg_ptr;
554
+ this.__wbg_ptr = 0;
555
+ CreateGlvWithdrawalsBuilderFinalization.unregister(this);
556
+ return ptr;
557
+ }
558
+
559
+ free() {
560
+ const ptr = this.__destroy_into_raw();
561
+ wasm.__wbg_createglvwithdrawalsbuilder_free(ptr, 0);
562
+ }
563
+ /**
564
+ * @param {TransactionGroupOptions | null} [transaction_group]
565
+ * @param {BuildTransactionOptions | null} [build]
566
+ * @returns {TransactionGroup}
567
+ */
568
+ build_with_options(transaction_group, build) {
569
+ const ptr = this.__destroy_into_raw();
570
+ const ret = wasm.createglvwithdrawalsbuilder_build_with_options(ptr, isLikeNone(transaction_group) ? 0 : addToExternrefTable0(transaction_group), isLikeNone(build) ? 0 : addToExternrefTable0(build));
571
+ if (ret[2]) {
572
+ throw takeFromExternrefTable0(ret[1]);
573
+ }
574
+ return TransactionGroup.__wrap(ret[0]);
575
+ }
576
+ }
577
+
308
578
  const CreateOrdersBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
309
579
  ? { register: () => {}, unregister: () => {} }
310
580
  : new FinalizationRegistry(ptr => wasm.__wbg_createordersbuilder_free(ptr >>> 0, 1));
@@ -359,80 +629,629 @@ export class CreateOrdersBuilder {
359
629
  }
360
630
  }
361
631
 
362
- const ElGamalKeypairFinalization = (typeof FinalizationRegistry === 'undefined')
632
+ const CreateShiftsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
633
+ ? { register: () => {}, unregister: () => {} }
634
+ : new FinalizationRegistry(ptr => wasm.__wbg_createshiftsbuilder_free(ptr >>> 0, 1));
635
+
636
+ export class CreateShiftsBuilder {
637
+
638
+ static __wrap(ptr) {
639
+ ptr = ptr >>> 0;
640
+ const obj = Object.create(CreateShiftsBuilder.prototype);
641
+ obj.__wbg_ptr = ptr;
642
+ CreateShiftsBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
643
+ return obj;
644
+ }
645
+
646
+ __destroy_into_raw() {
647
+ const ptr = this.__wbg_ptr;
648
+ this.__wbg_ptr = 0;
649
+ CreateShiftsBuilderFinalization.unregister(this);
650
+ return ptr;
651
+ }
652
+
653
+ free() {
654
+ const ptr = this.__destroy_into_raw();
655
+ wasm.__wbg_createshiftsbuilder_free(ptr, 0);
656
+ }
657
+ /**
658
+ * @param {TransactionGroupOptions | null} [transaction_group]
659
+ * @param {BuildTransactionOptions | null} [build]
660
+ * @returns {TransactionGroup}
661
+ */
662
+ build_with_options(transaction_group, build) {
663
+ const ptr = this.__destroy_into_raw();
664
+ const ret = wasm.createshiftsbuilder_build_with_options(ptr, isLikeNone(transaction_group) ? 0 : addToExternrefTable0(transaction_group), isLikeNone(build) ? 0 : addToExternrefTable0(build));
665
+ if (ret[2]) {
666
+ throw takeFromExternrefTable0(ret[1]);
667
+ }
668
+ return TransactionGroup.__wrap(ret[0]);
669
+ }
670
+ }
671
+
672
+ const CreateWithdrawalsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
673
+ ? { register: () => {}, unregister: () => {} }
674
+ : new FinalizationRegistry(ptr => wasm.__wbg_createwithdrawalsbuilder_free(ptr >>> 0, 1));
675
+
676
+ export class CreateWithdrawalsBuilder {
677
+
678
+ static __wrap(ptr) {
679
+ ptr = ptr >>> 0;
680
+ const obj = Object.create(CreateWithdrawalsBuilder.prototype);
681
+ obj.__wbg_ptr = ptr;
682
+ CreateWithdrawalsBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
683
+ return obj;
684
+ }
685
+
686
+ __destroy_into_raw() {
687
+ const ptr = this.__wbg_ptr;
688
+ this.__wbg_ptr = 0;
689
+ CreateWithdrawalsBuilderFinalization.unregister(this);
690
+ return ptr;
691
+ }
692
+
693
+ free() {
694
+ const ptr = this.__destroy_into_raw();
695
+ wasm.__wbg_createwithdrawalsbuilder_free(ptr, 0);
696
+ }
697
+ /**
698
+ * @param {TransactionGroupOptions | null} [transaction_group]
699
+ * @param {BuildTransactionOptions | null} [build]
700
+ * @returns {TransactionGroup}
701
+ */
702
+ build_with_options(transaction_group, build) {
703
+ const ptr = this.__destroy_into_raw();
704
+ const ret = wasm.createwithdrawalsbuilder_build_with_options(ptr, isLikeNone(transaction_group) ? 0 : addToExternrefTable0(transaction_group), isLikeNone(build) ? 0 : addToExternrefTable0(build));
705
+ if (ret[2]) {
706
+ throw takeFromExternrefTable0(ret[1]);
707
+ }
708
+ return TransactionGroup.__wrap(ret[0]);
709
+ }
710
+ }
711
+
712
+ const DepositSimulationOutputFinalization = (typeof FinalizationRegistry === 'undefined')
713
+ ? { register: () => {}, unregister: () => {} }
714
+ : new FinalizationRegistry(ptr => wasm.__wbg_depositsimulationoutput_free(ptr >>> 0, 1));
715
+ /**
716
+ * Simulation output for deposit.
717
+ */
718
+ export class DepositSimulationOutput {
719
+
720
+ static __wrap(ptr) {
721
+ ptr = ptr >>> 0;
722
+ const obj = Object.create(DepositSimulationOutput.prototype);
723
+ obj.__wbg_ptr = ptr;
724
+ DepositSimulationOutputFinalization.register(obj, obj.__wbg_ptr, obj);
725
+ return obj;
726
+ }
727
+
728
+ __destroy_into_raw() {
729
+ const ptr = this.__wbg_ptr;
730
+ this.__wbg_ptr = 0;
731
+ DepositSimulationOutputFinalization.unregister(this);
732
+ return ptr;
733
+ }
734
+
735
+ free() {
736
+ const ptr = this.__destroy_into_raw();
737
+ wasm.__wbg_depositsimulationoutput_free(ptr, 0);
738
+ }
739
+ /**
740
+ * Returns the deposit report.
741
+ * @returns {string}
742
+ */
743
+ report() {
744
+ let deferred2_0;
745
+ let deferred2_1;
746
+ try {
747
+ const ret = wasm.depositsimulationoutput_report(this.__wbg_ptr);
748
+ var ptr1 = ret[0];
749
+ var len1 = ret[1];
750
+ if (ret[3]) {
751
+ ptr1 = 0; len1 = 0;
752
+ throw takeFromExternrefTable0(ret[2]);
753
+ }
754
+ deferred2_0 = ptr1;
755
+ deferred2_1 = len1;
756
+ return getStringFromWasm0(ptr1, len1);
757
+ } finally {
758
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
759
+ }
760
+ }
761
+ /**
762
+ * Returns swap reports for the long token path.
763
+ * @returns {string[]}
764
+ */
765
+ long_swaps() {
766
+ const ret = wasm.depositsimulationoutput_long_swaps(this.__wbg_ptr);
767
+ if (ret[3]) {
768
+ throw takeFromExternrefTable0(ret[2]);
769
+ }
770
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
771
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
772
+ return v1;
773
+ }
774
+ /**
775
+ * Returns swap reports for the short token path.
776
+ * @returns {string[]}
777
+ */
778
+ short_swaps() {
779
+ const ret = wasm.depositsimulationoutput_short_swaps(this.__wbg_ptr);
780
+ if (ret[3]) {
781
+ throw takeFromExternrefTable0(ret[2]);
782
+ }
783
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
784
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
785
+ return v1;
786
+ }
787
+ }
788
+
789
+ const ElGamalKeypairFinalization = (typeof FinalizationRegistry === 'undefined')
790
+ ? { register: () => {}, unregister: () => {} }
791
+ : new FinalizationRegistry(ptr => wasm.__wbg_elgamalkeypair_free(ptr >>> 0, 1));
792
+ /**
793
+ * A (twisted) ElGamal encryption keypair.
794
+ *
795
+ * The instances of the secret key are zeroized on drop.
796
+ */
797
+ export class ElGamalKeypair {
798
+
799
+ static __wrap(ptr) {
800
+ ptr = ptr >>> 0;
801
+ const obj = Object.create(ElGamalKeypair.prototype);
802
+ obj.__wbg_ptr = ptr;
803
+ ElGamalKeypairFinalization.register(obj, obj.__wbg_ptr, obj);
804
+ return obj;
805
+ }
806
+
807
+ __destroy_into_raw() {
808
+ const ptr = this.__wbg_ptr;
809
+ this.__wbg_ptr = 0;
810
+ ElGamalKeypairFinalization.unregister(this);
811
+ return ptr;
812
+ }
813
+
814
+ free() {
815
+ const ptr = this.__destroy_into_raw();
816
+ wasm.__wbg_elgamalkeypair_free(ptr, 0);
817
+ }
818
+ /**
819
+ * Generates the public and secret keys for ElGamal encryption.
820
+ *
821
+ * This function is randomized. It internally samples a scalar element using `OsRng`.
822
+ * @returns {ElGamalKeypair}
823
+ */
824
+ static new_rand() {
825
+ const ret = wasm.elgamalkeypair_new_rand();
826
+ return ElGamalKeypair.__wrap(ret);
827
+ }
828
+ /**
829
+ * @returns {ElGamalPubkey}
830
+ */
831
+ pubkey_owned() {
832
+ const ret = wasm.elgamalkeypair_pubkey_owned(this.__wbg_ptr);
833
+ return ElGamalPubkey.__wrap(ret);
834
+ }
835
+ }
836
+
837
+ const ElGamalPubkeyFinalization = (typeof FinalizationRegistry === 'undefined')
838
+ ? { register: () => {}, unregister: () => {} }
839
+ : new FinalizationRegistry(ptr => wasm.__wbg_elgamalpubkey_free(ptr >>> 0, 1));
840
+ /**
841
+ * Public key for the ElGamal encryption scheme.
842
+ */
843
+ export class ElGamalPubkey {
844
+
845
+ static __wrap(ptr) {
846
+ ptr = ptr >>> 0;
847
+ const obj = Object.create(ElGamalPubkey.prototype);
848
+ obj.__wbg_ptr = ptr;
849
+ ElGamalPubkeyFinalization.register(obj, obj.__wbg_ptr, obj);
850
+ return obj;
851
+ }
852
+
853
+ __destroy_into_raw() {
854
+ const ptr = this.__wbg_ptr;
855
+ this.__wbg_ptr = 0;
856
+ ElGamalPubkeyFinalization.unregister(this);
857
+ return ptr;
858
+ }
859
+
860
+ free() {
861
+ const ptr = this.__destroy_into_raw();
862
+ wasm.__wbg_elgamalpubkey_free(ptr, 0);
863
+ }
864
+ }
865
+
866
+ const GlvFinalization = (typeof FinalizationRegistry === 'undefined')
867
+ ? { register: () => {}, unregister: () => {} }
868
+ : new FinalizationRegistry(ptr => wasm.__wbg_glv_free(ptr >>> 0, 1));
869
+ /**
870
+ * Wrapper of [`Glv`].
871
+ */
872
+ export class Glv {
873
+
874
+ static __wrap(ptr) {
875
+ ptr = ptr >>> 0;
876
+ const obj = Object.create(Glv.prototype);
877
+ obj.__wbg_ptr = ptr;
878
+ GlvFinalization.register(obj, obj.__wbg_ptr, obj);
879
+ return obj;
880
+ }
881
+
882
+ __destroy_into_raw() {
883
+ const ptr = this.__wbg_ptr;
884
+ this.__wbg_ptr = 0;
885
+ GlvFinalization.unregister(this);
886
+ return ptr;
887
+ }
888
+
889
+ free() {
890
+ const ptr = this.__destroy_into_raw();
891
+ wasm.__wbg_glv_free(ptr, 0);
892
+ }
893
+ /**
894
+ * Create from base64 encoded account data with options.
895
+ * @param {string} data
896
+ * @param {boolean | null} [no_discriminator]
897
+ * @returns {Glv}
898
+ */
899
+ static decode_from_base64_with_options(data, no_discriminator) {
900
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
901
+ const len0 = WASM_VECTOR_LEN;
902
+ const ret = wasm.glv_decode_from_base64_with_options(ptr0, len0, isLikeNone(no_discriminator) ? 0xFFFFFF : no_discriminator ? 1 : 0);
903
+ if (ret[2]) {
904
+ throw takeFromExternrefTable0(ret[1]);
905
+ }
906
+ return Glv.__wrap(ret[0]);
907
+ }
908
+ /**
909
+ * Create from base64 encoded account data with options.
910
+ * @param {Uint8Array} data
911
+ * @param {boolean | null} [no_discriminator]
912
+ * @returns {Glv}
913
+ */
914
+ static decode_with_options(data, no_discriminator) {
915
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
916
+ const len0 = WASM_VECTOR_LEN;
917
+ const ret = wasm.glv_decode_with_options(ptr0, len0, isLikeNone(no_discriminator) ? 0xFFFFFF : no_discriminator ? 1 : 0);
918
+ if (ret[2]) {
919
+ throw takeFromExternrefTable0(ret[1]);
920
+ }
921
+ return Glv.__wrap(ret[0]);
922
+ }
923
+ /**
924
+ * Convert into [`JsGlvModel`].
925
+ * @param {bigint} supply
926
+ * @returns {GlvModel}
927
+ */
928
+ to_model(supply) {
929
+ const ret = wasm.glv_to_model(this.__wbg_ptr, supply, supply >> BigInt(64));
930
+ if (ret[2]) {
931
+ throw takeFromExternrefTable0(ret[1]);
932
+ }
933
+ return GlvModel.__wrap(ret[0]);
934
+ }
935
+ /**
936
+ * Returns GLV token address.
937
+ * @returns {string}
938
+ */
939
+ glv_token_address() {
940
+ let deferred1_0;
941
+ let deferred1_1;
942
+ try {
943
+ const ret = wasm.glv_glv_token_address(this.__wbg_ptr);
944
+ deferred1_0 = ret[0];
945
+ deferred1_1 = ret[1];
946
+ return getStringFromWasm0(ret[0], ret[1]);
947
+ } finally {
948
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
949
+ }
950
+ }
951
+ /**
952
+ * Returns long token address.
953
+ * @returns {string}
954
+ */
955
+ long_token_address() {
956
+ let deferred1_0;
957
+ let deferred1_1;
958
+ try {
959
+ const ret = wasm.glv_long_token_address(this.__wbg_ptr);
960
+ deferred1_0 = ret[0];
961
+ deferred1_1 = ret[1];
962
+ return getStringFromWasm0(ret[0], ret[1]);
963
+ } finally {
964
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
965
+ }
966
+ }
967
+ /**
968
+ * Returns short token address.
969
+ * @returns {string}
970
+ */
971
+ short_token_address() {
972
+ let deferred1_0;
973
+ let deferred1_1;
974
+ try {
975
+ const ret = wasm.glv_short_token_address(this.__wbg_ptr);
976
+ deferred1_0 = ret[0];
977
+ deferred1_1 = ret[1];
978
+ return getStringFromWasm0(ret[0], ret[1]);
979
+ } finally {
980
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
981
+ }
982
+ }
983
+ /**
984
+ * Create a clone of this market.
985
+ * @returns {Glv}
986
+ */
987
+ clone() {
988
+ const ret = wasm.glv_clone(this.__wbg_ptr);
989
+ return Glv.__wrap(ret);
990
+ }
991
+ }
992
+
993
+ const GlvDepositSimulationOutputFinalization = (typeof FinalizationRegistry === 'undefined')
994
+ ? { register: () => {}, unregister: () => {} }
995
+ : new FinalizationRegistry(ptr => wasm.__wbg_glvdepositsimulationoutput_free(ptr >>> 0, 1));
996
+ /**
997
+ * Simulation output for GLV deposit.
998
+ */
999
+ export class GlvDepositSimulationOutput {
1000
+
1001
+ static __wrap(ptr) {
1002
+ ptr = ptr >>> 0;
1003
+ const obj = Object.create(GlvDepositSimulationOutput.prototype);
1004
+ obj.__wbg_ptr = ptr;
1005
+ GlvDepositSimulationOutputFinalization.register(obj, obj.__wbg_ptr, obj);
1006
+ return obj;
1007
+ }
1008
+
1009
+ __destroy_into_raw() {
1010
+ const ptr = this.__wbg_ptr;
1011
+ this.__wbg_ptr = 0;
1012
+ GlvDepositSimulationOutputFinalization.unregister(this);
1013
+ return ptr;
1014
+ }
1015
+
1016
+ free() {
1017
+ const ptr = this.__destroy_into_raw();
1018
+ wasm.__wbg_glvdepositsimulationoutput_free(ptr, 0);
1019
+ }
1020
+ /**
1021
+ * Returns the deposit report.
1022
+ * @returns {string | undefined}
1023
+ */
1024
+ deposit_report() {
1025
+ const ret = wasm.glvdepositsimulationoutput_deposit_report(this.__wbg_ptr);
1026
+ if (ret[3]) {
1027
+ throw takeFromExternrefTable0(ret[2]);
1028
+ }
1029
+ let v1;
1030
+ if (ret[0] !== 0) {
1031
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1032
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1033
+ }
1034
+ return v1;
1035
+ }
1036
+ /**
1037
+ * Returns swap reports for the long token path.
1038
+ * @returns {string[]}
1039
+ */
1040
+ long_swaps() {
1041
+ const ret = wasm.glvdepositsimulationoutput_long_swaps(this.__wbg_ptr);
1042
+ if (ret[3]) {
1043
+ throw takeFromExternrefTable0(ret[2]);
1044
+ }
1045
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1046
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1047
+ return v1;
1048
+ }
1049
+ /**
1050
+ * Returns swap reports for the short token path.
1051
+ * @returns {string[]}
1052
+ */
1053
+ short_swaps() {
1054
+ const ret = wasm.glvdepositsimulationoutput_short_swaps(this.__wbg_ptr);
1055
+ if (ret[3]) {
1056
+ throw takeFromExternrefTable0(ret[2]);
1057
+ }
1058
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1059
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1060
+ return v1;
1061
+ }
1062
+ /**
1063
+ * Returns the output GLV token amount.
1064
+ * @returns {bigint}
1065
+ */
1066
+ output_amount() {
1067
+ const ret = wasm.glvdepositsimulationoutput_output_amount(this.__wbg_ptr);
1068
+ return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64)));
1069
+ }
1070
+ }
1071
+
1072
+ const GlvModelFinalization = (typeof FinalizationRegistry === 'undefined')
363
1073
  ? { register: () => {}, unregister: () => {} }
364
- : new FinalizationRegistry(ptr => wasm.__wbg_elgamalkeypair_free(ptr >>> 0, 1));
1074
+ : new FinalizationRegistry(ptr => wasm.__wbg_glvmodel_free(ptr >>> 0, 1));
365
1075
  /**
366
- * A (twisted) ElGamal encryption keypair.
367
- *
368
- * The instances of the secret key are zeroized on drop.
1076
+ * Wrapper of [`GlvModel`].
369
1077
  */
370
- export class ElGamalKeypair {
1078
+ export class GlvModel {
371
1079
 
372
1080
  static __wrap(ptr) {
373
1081
  ptr = ptr >>> 0;
374
- const obj = Object.create(ElGamalKeypair.prototype);
1082
+ const obj = Object.create(GlvModel.prototype);
375
1083
  obj.__wbg_ptr = ptr;
376
- ElGamalKeypairFinalization.register(obj, obj.__wbg_ptr, obj);
1084
+ GlvModelFinalization.register(obj, obj.__wbg_ptr, obj);
377
1085
  return obj;
378
1086
  }
379
1087
 
380
1088
  __destroy_into_raw() {
381
1089
  const ptr = this.__wbg_ptr;
382
1090
  this.__wbg_ptr = 0;
383
- ElGamalKeypairFinalization.unregister(this);
1091
+ GlvModelFinalization.unregister(this);
384
1092
  return ptr;
385
1093
  }
386
1094
 
387
1095
  free() {
388
1096
  const ptr = this.__destroy_into_raw();
389
- wasm.__wbg_elgamalkeypair_free(ptr, 0);
1097
+ wasm.__wbg_glvmodel_free(ptr, 0);
390
1098
  }
391
1099
  /**
392
- * Generates the public and secret keys for ElGamal encryption.
393
- *
394
- * This function is randomized. It internally samples a scalar element using `OsRng`.
395
- * @returns {ElGamalKeypair}
1100
+ * Returns current supply.
1101
+ * @returns {bigint}
396
1102
  */
397
- static new_rand() {
398
- const ret = wasm.elgamalkeypair_new_rand();
399
- return ElGamalKeypair.__wrap(ret);
1103
+ supply() {
1104
+ const ret = wasm.glvmodel_supply(this.__wbg_ptr);
1105
+ return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64)));
400
1106
  }
401
1107
  /**
402
- * @returns {ElGamalPubkey}
1108
+ * Returns GLV token address.
1109
+ * @returns {string}
403
1110
  */
404
- pubkey_owned() {
405
- const ret = wasm.elgamalkeypair_pubkey_owned(this.__wbg_ptr);
406
- return ElGamalPubkey.__wrap(ret);
1111
+ glv_token_address() {
1112
+ let deferred1_0;
1113
+ let deferred1_1;
1114
+ try {
1115
+ const ret = wasm.glvmodel_glv_token_address(this.__wbg_ptr);
1116
+ deferred1_0 = ret[0];
1117
+ deferred1_1 = ret[1];
1118
+ return getStringFromWasm0(ret[0], ret[1]);
1119
+ } finally {
1120
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1121
+ }
1122
+ }
1123
+ /**
1124
+ * Returns long token address.
1125
+ * @returns {string}
1126
+ */
1127
+ long_token_address() {
1128
+ let deferred1_0;
1129
+ let deferred1_1;
1130
+ try {
1131
+ const ret = wasm.glvmodel_long_token_address(this.__wbg_ptr);
1132
+ deferred1_0 = ret[0];
1133
+ deferred1_1 = ret[1];
1134
+ return getStringFromWasm0(ret[0], ret[1]);
1135
+ } finally {
1136
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1137
+ }
1138
+ }
1139
+ /**
1140
+ * Returns short token address.
1141
+ * @returns {string}
1142
+ */
1143
+ short_token_address() {
1144
+ let deferred1_0;
1145
+ let deferred1_1;
1146
+ try {
1147
+ const ret = wasm.glvmodel_short_token_address(this.__wbg_ptr);
1148
+ deferred1_0 = ret[0];
1149
+ deferred1_1 = ret[1];
1150
+ return getStringFromWasm0(ret[0], ret[1]);
1151
+ } finally {
1152
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1153
+ }
1154
+ }
1155
+ /**
1156
+ * Create a clone of this market model.
1157
+ * @returns {GlvModel}
1158
+ */
1159
+ clone() {
1160
+ const ret = wasm.glvmodel_clone(this.__wbg_ptr);
1161
+ return GlvModel.__wrap(ret);
407
1162
  }
408
1163
  }
409
1164
 
410
- const ElGamalPubkeyFinalization = (typeof FinalizationRegistry === 'undefined')
1165
+ const GlvWithdrawalSimulationOutputFinalization = (typeof FinalizationRegistry === 'undefined')
411
1166
  ? { register: () => {}, unregister: () => {} }
412
- : new FinalizationRegistry(ptr => wasm.__wbg_elgamalpubkey_free(ptr >>> 0, 1));
1167
+ : new FinalizationRegistry(ptr => wasm.__wbg_glvwithdrawalsimulationoutput_free(ptr >>> 0, 1));
413
1168
  /**
414
- * Public key for the ElGamal encryption scheme.
1169
+ * Simulation output for withdrawal.
415
1170
  */
416
- export class ElGamalPubkey {
1171
+ export class GlvWithdrawalSimulationOutput {
417
1172
 
418
1173
  static __wrap(ptr) {
419
1174
  ptr = ptr >>> 0;
420
- const obj = Object.create(ElGamalPubkey.prototype);
1175
+ const obj = Object.create(GlvWithdrawalSimulationOutput.prototype);
421
1176
  obj.__wbg_ptr = ptr;
422
- ElGamalPubkeyFinalization.register(obj, obj.__wbg_ptr, obj);
1177
+ GlvWithdrawalSimulationOutputFinalization.register(obj, obj.__wbg_ptr, obj);
423
1178
  return obj;
424
1179
  }
425
1180
 
426
1181
  __destroy_into_raw() {
427
1182
  const ptr = this.__wbg_ptr;
428
1183
  this.__wbg_ptr = 0;
429
- ElGamalPubkeyFinalization.unregister(this);
1184
+ GlvWithdrawalSimulationOutputFinalization.unregister(this);
430
1185
  return ptr;
431
1186
  }
432
1187
 
433
1188
  free() {
434
1189
  const ptr = this.__destroy_into_raw();
435
- wasm.__wbg_elgamalpubkey_free(ptr, 0);
1190
+ wasm.__wbg_glvwithdrawalsimulationoutput_free(ptr, 0);
1191
+ }
1192
+ /**
1193
+ * Returns the withdraw report.
1194
+ * @returns {string}
1195
+ */
1196
+ withdraw_report() {
1197
+ let deferred2_0;
1198
+ let deferred2_1;
1199
+ try {
1200
+ const ret = wasm.glvwithdrawalsimulationoutput_withdraw_report(this.__wbg_ptr);
1201
+ var ptr1 = ret[0];
1202
+ var len1 = ret[1];
1203
+ if (ret[3]) {
1204
+ ptr1 = 0; len1 = 0;
1205
+ throw takeFromExternrefTable0(ret[2]);
1206
+ }
1207
+ deferred2_0 = ptr1;
1208
+ deferred2_1 = len1;
1209
+ return getStringFromWasm0(ptr1, len1);
1210
+ } finally {
1211
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1212
+ }
1213
+ }
1214
+ /**
1215
+ * Returns swap reports for the long token path.
1216
+ * @returns {string[]}
1217
+ */
1218
+ long_swaps() {
1219
+ const ret = wasm.glvwithdrawalsimulationoutput_long_swaps(this.__wbg_ptr);
1220
+ if (ret[3]) {
1221
+ throw takeFromExternrefTable0(ret[2]);
1222
+ }
1223
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1224
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1225
+ return v1;
1226
+ }
1227
+ /**
1228
+ * Returns swap reports for the short token path.
1229
+ * @returns {string[]}
1230
+ */
1231
+ short_swaps() {
1232
+ const ret = wasm.glvwithdrawalsimulationoutput_short_swaps(this.__wbg_ptr);
1233
+ if (ret[3]) {
1234
+ throw takeFromExternrefTable0(ret[2]);
1235
+ }
1236
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1237
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1238
+ return v1;
1239
+ }
1240
+ /**
1241
+ * Returns long token output amount.
1242
+ * @returns {bigint}
1243
+ */
1244
+ long_output_amount() {
1245
+ const ret = wasm.glvwithdrawalsimulationoutput_long_output_amount(this.__wbg_ptr);
1246
+ return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64)));
1247
+ }
1248
+ /**
1249
+ * Returns short token output amount.
1250
+ * @returns {bigint}
1251
+ */
1252
+ short_output_amount() {
1253
+ const ret = wasm.glvwithdrawalsimulationoutput_short_output_amount(this.__wbg_ptr);
1254
+ return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64)));
436
1255
  }
437
1256
  }
438
1257
 
@@ -1047,6 +1866,14 @@ export class MarketModel {
1047
1866
  }
1048
1867
  return takeFromExternrefTable0(ret[0]);
1049
1868
  }
1869
+ /**
1870
+ * Returns current supply.
1871
+ * @returns {bigint}
1872
+ */
1873
+ supply() {
1874
+ const ret = wasm.marketmodel_supply(this.__wbg_ptr);
1875
+ return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64)));
1876
+ }
1050
1877
  /**
1051
1878
  * Create an empty position model.
1052
1879
  * @param {CreateEmptyPositionArgs} args
@@ -1630,6 +2457,79 @@ export class Pubkey {
1630
2457
  }
1631
2458
  }
1632
2459
 
2460
+ const ShiftSimulationOutputFinalization = (typeof FinalizationRegistry === 'undefined')
2461
+ ? { register: () => {}, unregister: () => {} }
2462
+ : new FinalizationRegistry(ptr => wasm.__wbg_shiftsimulationoutput_free(ptr >>> 0, 1));
2463
+ /**
2464
+ * Simulation output for shift.
2465
+ */
2466
+ export class ShiftSimulationOutput {
2467
+
2468
+ static __wrap(ptr) {
2469
+ ptr = ptr >>> 0;
2470
+ const obj = Object.create(ShiftSimulationOutput.prototype);
2471
+ obj.__wbg_ptr = ptr;
2472
+ ShiftSimulationOutputFinalization.register(obj, obj.__wbg_ptr, obj);
2473
+ return obj;
2474
+ }
2475
+
2476
+ __destroy_into_raw() {
2477
+ const ptr = this.__wbg_ptr;
2478
+ this.__wbg_ptr = 0;
2479
+ ShiftSimulationOutputFinalization.unregister(this);
2480
+ return ptr;
2481
+ }
2482
+
2483
+ free() {
2484
+ const ptr = this.__destroy_into_raw();
2485
+ wasm.__wbg_shiftsimulationoutput_free(ptr, 0);
2486
+ }
2487
+ /**
2488
+ * Returns the deposit report.
2489
+ * @returns {string}
2490
+ */
2491
+ deposit_report() {
2492
+ let deferred2_0;
2493
+ let deferred2_1;
2494
+ try {
2495
+ const ret = wasm.shiftsimulationoutput_deposit_report(this.__wbg_ptr);
2496
+ var ptr1 = ret[0];
2497
+ var len1 = ret[1];
2498
+ if (ret[3]) {
2499
+ ptr1 = 0; len1 = 0;
2500
+ throw takeFromExternrefTable0(ret[2]);
2501
+ }
2502
+ deferred2_0 = ptr1;
2503
+ deferred2_1 = len1;
2504
+ return getStringFromWasm0(ptr1, len1);
2505
+ } finally {
2506
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2507
+ }
2508
+ }
2509
+ /**
2510
+ * Returns the withdraw report.
2511
+ * @returns {string}
2512
+ */
2513
+ withdraw_report() {
2514
+ let deferred2_0;
2515
+ let deferred2_1;
2516
+ try {
2517
+ const ret = wasm.shiftsimulationoutput_withdraw_report(this.__wbg_ptr);
2518
+ var ptr1 = ret[0];
2519
+ var len1 = ret[1];
2520
+ if (ret[3]) {
2521
+ ptr1 = 0; len1 = 0;
2522
+ throw takeFromExternrefTable0(ret[2]);
2523
+ }
2524
+ deferred2_0 = ptr1;
2525
+ deferred2_1 = len1;
2526
+ return getStringFromWasm0(ptr1, len1);
2527
+ } finally {
2528
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2529
+ }
2530
+ }
2531
+ }
2532
+
1633
2533
  const SimulatorFinalization = (typeof FinalizationRegistry === 'undefined')
1634
2534
  ? { register: () => {}, unregister: () => {} }
1635
2535
  : new FinalizationRegistry(ptr => wasm.__wbg_simulator_free(ptr >>> 0, 1));
@@ -1685,6 +2585,20 @@ export class Simulator {
1685
2585
  }
1686
2586
  return takeFromExternrefTable0(ret[0]);
1687
2587
  }
2588
+ /**
2589
+ * Get GLV by its GLV token.
2590
+ * @param {string} glv_token
2591
+ * @returns {GlvModel | undefined}
2592
+ */
2593
+ get_glv(glv_token) {
2594
+ const ptr0 = passStringToWasm0(glv_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2595
+ const len0 = WASM_VECTOR_LEN;
2596
+ const ret = wasm.simulator_get_glv(this.__wbg_ptr, ptr0, len0);
2597
+ if (ret[2]) {
2598
+ throw takeFromExternrefTable0(ret[1]);
2599
+ }
2600
+ return ret[0] === 0 ? undefined : GlvModel.__wrap(ret[0]);
2601
+ }
1688
2602
  /**
1689
2603
  * Upsert the prices for the given token.
1690
2604
  * @param {string} token
@@ -1699,6 +2613,18 @@ export class Simulator {
1699
2613
  }
1700
2614
  }
1701
2615
  /**
2616
+ * Upsert a GLV model.
2617
+ * @param {GlvModel} glv
2618
+ */
2619
+ insert_glv(glv) {
2620
+ _assertClass(glv, GlvModel);
2621
+ const ret = wasm.simulator_insert_glv(this.__wbg_ptr, glv.__wbg_ptr);
2622
+ if (ret[1]) {
2623
+ throw takeFromExternrefTable0(ret[0]);
2624
+ }
2625
+ }
2626
+ /**
2627
+ * Simulate an order execution.
1702
2628
  * @param {SimulateOrderArgs} args
1703
2629
  * @param {Position | null} [position]
1704
2630
  * @returns {OrderSimulationOutput}
@@ -1715,6 +2641,66 @@ export class Simulator {
1715
2641
  }
1716
2642
  return OrderSimulationOutput.__wrap(ret[0]);
1717
2643
  }
2644
+ /**
2645
+ * Simulate a deposit execution.
2646
+ * @param {SimulateDepositArgs} args
2647
+ * @returns {DepositSimulationOutput}
2648
+ */
2649
+ simulate_deposit(args) {
2650
+ const ret = wasm.simulator_simulate_deposit(this.__wbg_ptr, args);
2651
+ if (ret[2]) {
2652
+ throw takeFromExternrefTable0(ret[1]);
2653
+ }
2654
+ return DepositSimulationOutput.__wrap(ret[0]);
2655
+ }
2656
+ /**
2657
+ * Simulate a withdrawal execution.
2658
+ * @param {SimulateWithdrawalArgs} args
2659
+ * @returns {WithdrawalSimulationOutput}
2660
+ */
2661
+ simulate_withdrawal(args) {
2662
+ const ret = wasm.simulator_simulate_withdrawal(this.__wbg_ptr, args);
2663
+ if (ret[2]) {
2664
+ throw takeFromExternrefTable0(ret[1]);
2665
+ }
2666
+ return WithdrawalSimulationOutput.__wrap(ret[0]);
2667
+ }
2668
+ /**
2669
+ * Simulate a shift execution.
2670
+ * @param {SimulateShiftArgs} args
2671
+ * @returns {ShiftSimulationOutput}
2672
+ */
2673
+ simulate_shift(args) {
2674
+ const ret = wasm.simulator_simulate_shift(this.__wbg_ptr, args);
2675
+ if (ret[2]) {
2676
+ throw takeFromExternrefTable0(ret[1]);
2677
+ }
2678
+ return ShiftSimulationOutput.__wrap(ret[0]);
2679
+ }
2680
+ /**
2681
+ * Simulate a GLV deposit execution.
2682
+ * @param {SimulateGlvDepositArgs} args
2683
+ * @returns {GlvDepositSimulationOutput}
2684
+ */
2685
+ simulate_glv_deposit(args) {
2686
+ const ret = wasm.simulator_simulate_glv_deposit(this.__wbg_ptr, args);
2687
+ if (ret[2]) {
2688
+ throw takeFromExternrefTable0(ret[1]);
2689
+ }
2690
+ return GlvDepositSimulationOutput.__wrap(ret[0]);
2691
+ }
2692
+ /**
2693
+ * Simulate a GLV withdrawal execution.
2694
+ * @param {SimulateGlvWithdrawalArgs} args
2695
+ * @returns {GlvWithdrawalSimulationOutput}
2696
+ */
2697
+ simulate_glv_withdrawal(args) {
2698
+ const ret = wasm.simulator_simulate_glv_withdrawal(this.__wbg_ptr, args);
2699
+ if (ret[2]) {
2700
+ throw takeFromExternrefTable0(ret[1]);
2701
+ }
2702
+ return GlvWithdrawalSimulationOutput.__wrap(ret[0]);
2703
+ }
1718
2704
  /**
1719
2705
  * Create a clone of this simulator.
1720
2706
  * @returns {Simulator}
@@ -2305,6 +3291,99 @@ export class User {
2305
3291
  }
2306
3292
  }
2307
3293
 
3294
+ const WithdrawalSimulationOutputFinalization = (typeof FinalizationRegistry === 'undefined')
3295
+ ? { register: () => {}, unregister: () => {} }
3296
+ : new FinalizationRegistry(ptr => wasm.__wbg_withdrawalsimulationoutput_free(ptr >>> 0, 1));
3297
+ /**
3298
+ * Simulation output for withdrawal.
3299
+ */
3300
+ export class WithdrawalSimulationOutput {
3301
+
3302
+ static __wrap(ptr) {
3303
+ ptr = ptr >>> 0;
3304
+ const obj = Object.create(WithdrawalSimulationOutput.prototype);
3305
+ obj.__wbg_ptr = ptr;
3306
+ WithdrawalSimulationOutputFinalization.register(obj, obj.__wbg_ptr, obj);
3307
+ return obj;
3308
+ }
3309
+
3310
+ __destroy_into_raw() {
3311
+ const ptr = this.__wbg_ptr;
3312
+ this.__wbg_ptr = 0;
3313
+ WithdrawalSimulationOutputFinalization.unregister(this);
3314
+ return ptr;
3315
+ }
3316
+
3317
+ free() {
3318
+ const ptr = this.__destroy_into_raw();
3319
+ wasm.__wbg_withdrawalsimulationoutput_free(ptr, 0);
3320
+ }
3321
+ /**
3322
+ * Returns the withdraw report.
3323
+ * @returns {string}
3324
+ */
3325
+ report() {
3326
+ let deferred2_0;
3327
+ let deferred2_1;
3328
+ try {
3329
+ const ret = wasm.withdrawalsimulationoutput_report(this.__wbg_ptr);
3330
+ var ptr1 = ret[0];
3331
+ var len1 = ret[1];
3332
+ if (ret[3]) {
3333
+ ptr1 = 0; len1 = 0;
3334
+ throw takeFromExternrefTable0(ret[2]);
3335
+ }
3336
+ deferred2_0 = ptr1;
3337
+ deferred2_1 = len1;
3338
+ return getStringFromWasm0(ptr1, len1);
3339
+ } finally {
3340
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
3341
+ }
3342
+ }
3343
+ /**
3344
+ * Returns swap reports for the long token path.
3345
+ * @returns {string[]}
3346
+ */
3347
+ long_swaps() {
3348
+ const ret = wasm.withdrawalsimulationoutput_long_swaps(this.__wbg_ptr);
3349
+ if (ret[3]) {
3350
+ throw takeFromExternrefTable0(ret[2]);
3351
+ }
3352
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
3353
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
3354
+ return v1;
3355
+ }
3356
+ /**
3357
+ * Returns swap reports for the short token path.
3358
+ * @returns {string[]}
3359
+ */
3360
+ short_swaps() {
3361
+ const ret = wasm.withdrawalsimulationoutput_short_swaps(this.__wbg_ptr);
3362
+ if (ret[3]) {
3363
+ throw takeFromExternrefTable0(ret[2]);
3364
+ }
3365
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
3366
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
3367
+ return v1;
3368
+ }
3369
+ /**
3370
+ * Returns long token output amount.
3371
+ * @returns {bigint}
3372
+ */
3373
+ long_output_amount() {
3374
+ const ret = wasm.withdrawalsimulationoutput_long_output_amount(this.__wbg_ptr);
3375
+ return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64)));
3376
+ }
3377
+ /**
3378
+ * Returns short token output amount.
3379
+ * @returns {bigint}
3380
+ */
3381
+ short_output_amount() {
3382
+ const ret = wasm.withdrawalsimulationoutput_short_output_amount(this.__wbg_ptr);
3383
+ return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64)));
3384
+ }
3385
+ }
3386
+
2308
3387
  export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
2309
3388
  const ret = String(arg1);
2310
3389
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);