@reyaxyz/common 0.344.0 → 0.344.1-perpob.110

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.
Files changed (140) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/exposure/command.js +8 -22
  3. package/dist/commands/exposure/command.js.map +1 -1
  4. package/dist/incentives-api-types.js.map +1 -1
  5. package/dist/rest/helpers/constants.js +12 -0
  6. package/dist/rest/helpers/constants.js.map +1 -1
  7. package/dist/services/getNativeToken.js +1 -0
  8. package/dist/services/getNativeToken.js.map +1 -1
  9. package/dist/services/getSocketAddresses.js +1 -0
  10. package/dist/services/getSocketAddresses.js.map +1 -1
  11. package/dist/trading-api-types.js.map +1 -1
  12. package/dist/transactions/abis/Errors.json +1283 -34
  13. package/dist/transactions/abis/OrdersGateway.json +729 -123
  14. package/dist/transactions/abis/PassivePerpProxy.json +542 -0
  15. package/dist/transactions/buildMulticallTx.js.map +1 -1
  16. package/dist/transactions/consts.js +1 -2
  17. package/dist/transactions/consts.js.map +1 -1
  18. package/dist/transactions/contractAddresses.js +46 -5
  19. package/dist/transactions/contractAddresses.js.map +1 -1
  20. package/dist/transactions/executeTransaction.js +8 -123
  21. package/dist/transactions/executeTransaction.js.map +1 -1
  22. package/dist/transactions/sign.js +285 -79
  23. package/dist/transactions/sign.js.map +1 -1
  24. package/dist/types/commands/exposure/command.d.ts +8 -7
  25. package/dist/types/commands/exposure/command.d.ts.map +1 -1
  26. package/dist/types/incentives-api-types.d.ts +40 -17
  27. package/dist/types/incentives-api-types.d.ts.map +1 -1
  28. package/dist/types/rest/helpers/constants.d.ts +1 -1
  29. package/dist/types/rest/helpers/constants.d.ts.map +1 -1
  30. package/dist/types/services/getNativeToken.d.ts.map +1 -1
  31. package/dist/types/services/getSocketAddresses.d.ts.map +1 -1
  32. package/dist/types/trading-api-types.d.ts +144 -94
  33. package/dist/types/trading-api-types.d.ts.map +1 -1
  34. package/dist/types/transactions/buildMulticallTx.d.ts +1 -0
  35. package/dist/types/transactions/buildMulticallTx.d.ts.map +1 -1
  36. package/dist/types/transactions/consts.d.ts +0 -1
  37. package/dist/types/transactions/consts.d.ts.map +1 -1
  38. package/dist/types/transactions/contractAddresses.d.ts +1 -1
  39. package/dist/types/transactions/contractAddresses.d.ts.map +1 -1
  40. package/dist/types/transactions/executeTransaction.d.ts +2 -15
  41. package/dist/types/transactions/executeTransaction.d.ts.map +1 -1
  42. package/dist/types/transactions/sign.d.ts +117 -6
  43. package/dist/types/transactions/sign.d.ts.map +1 -1
  44. package/dist/types/types.d.ts +52 -64
  45. package/dist/types/types.d.ts.map +1 -1
  46. package/dist/types/utils/calculate.d.ts +14 -2
  47. package/dist/types/utils/calculate.d.ts.map +1 -1
  48. package/dist/types/utils/compute-trade-pnl.d.ts +39 -0
  49. package/dist/types/utils/compute-trade-pnl.d.ts.map +1 -0
  50. package/dist/types/utils/consts.d.ts +2 -2
  51. package/dist/types/utils/consts.d.ts.map +1 -1
  52. package/dist/types/utils/error-sanitizer.d.ts +15 -0
  53. package/dist/types/utils/error-sanitizer.d.ts.map +1 -0
  54. package/dist/types/utils/index.d.ts +3 -0
  55. package/dist/types/utils/index.d.ts.map +1 -1
  56. package/dist/types/utils/layerzero.d.ts +22 -0
  57. package/dist/types/utils/layerzero.d.ts.map +1 -0
  58. package/dist/types/utils/network.d.ts.map +1 -1
  59. package/dist/types/utils/throttled-error.d.ts +42 -0
  60. package/dist/types/utils/throttled-error.d.ts.map +1 -0
  61. package/dist/types/utils/token/batch-token-getters.d.ts +0 -5
  62. package/dist/types/utils/token/batch-token-getters.d.ts.map +1 -1
  63. package/dist/types/utils/token/normalize.d.ts +2 -1
  64. package/dist/types/utils/token/normalize.d.ts.map +1 -1
  65. package/dist/types/utils/token/token-getters.d.ts +0 -2
  66. package/dist/types/utils/token/token-getters.d.ts.map +1 -1
  67. package/dist/types/utils/token/token-info-getters.d.ts.map +1 -1
  68. package/dist/types/utils/token/token-info.d.ts.map +1 -1
  69. package/dist/types.js +41 -11
  70. package/dist/types.js.map +1 -1
  71. package/dist/utils/calculate.js +137 -16
  72. package/dist/utils/calculate.js.map +1 -1
  73. package/dist/utils/compute-trade-pnl.js +60 -0
  74. package/dist/utils/compute-trade-pnl.js.map +1 -0
  75. package/dist/utils/consts.js +8 -13
  76. package/dist/utils/consts.js.map +1 -1
  77. package/dist/utils/error-sanitizer.js +135 -0
  78. package/dist/utils/error-sanitizer.js.map +1 -0
  79. package/dist/utils/index.js +3 -0
  80. package/dist/utils/index.js.map +1 -1
  81. package/dist/utils/layerzero.js +31 -0
  82. package/dist/utils/layerzero.js.map +1 -0
  83. package/dist/utils/network.js +4 -0
  84. package/dist/utils/network.js.map +1 -1
  85. package/dist/utils/throttled-error.js +60 -0
  86. package/dist/utils/throttled-error.js.map +1 -0
  87. package/dist/utils/token/batch-token-getters.js +13 -64
  88. package/dist/utils/token/batch-token-getters.js.map +1 -1
  89. package/dist/utils/token/normalize.js +2 -2
  90. package/dist/utils/token/normalize.js.map +1 -1
  91. package/dist/utils/token/token-getters.js +1 -42
  92. package/dist/utils/token/token-getters.js.map +1 -1
  93. package/dist/utils/token/token-info-getters.js +45 -4
  94. package/dist/utils/token/token-info-getters.js.map +1 -1
  95. package/dist/utils/token/token-info.js +6 -0
  96. package/dist/utils/token/token-info.js.map +1 -1
  97. package/package.json +3 -3
  98. package/src/commands/exposure/command.ts +8 -38
  99. package/src/incentives-api-types.ts +66 -33
  100. package/src/rest/helpers/constants.ts +22 -0
  101. package/src/services/getNativeToken.ts +1 -0
  102. package/src/services/getSocketAddresses.ts +1 -0
  103. package/src/trading-api-types.ts +175 -127
  104. package/src/transactions/abis/Errors.json +5133 -3884
  105. package/src/transactions/abis/OrdersGateway.json +730 -124
  106. package/src/transactions/abis/PassivePerpProxy.json +542 -0
  107. package/src/transactions/buildMulticallTx.ts +4 -0
  108. package/src/transactions/consts.ts +0 -1
  109. package/src/transactions/contractAddresses.ts +43 -6
  110. package/src/transactions/executeTransaction.ts +2 -130
  111. package/src/transactions/sign.ts +347 -93
  112. package/src/types.ts +90 -74
  113. package/src/utils/calculate.ts +181 -21
  114. package/src/utils/compute-trade-pnl.ts +110 -0
  115. package/src/utils/consts.ts +10 -22
  116. package/src/utils/error-sanitizer.ts +137 -0
  117. package/src/utils/index.ts +3 -0
  118. package/src/utils/layerzero.ts +66 -0
  119. package/src/utils/network.ts +4 -0
  120. package/src/utils/throttled-error.ts +85 -0
  121. package/src/utils/token/batch-token-getters.ts +0 -28
  122. package/src/utils/token/normalize.ts +6 -1
  123. package/src/utils/token/token-getters.ts +0 -29
  124. package/src/utils/token/token-info-getters.ts +54 -4
  125. package/src/utils/token/token-info.ts +35 -0
  126. package/dist/types/utils/layerzero/index.d.ts +0 -3
  127. package/dist/types/utils/layerzero/index.d.ts.map +0 -1
  128. package/dist/types/utils/layerzero/oft-config.d.ts +0 -4
  129. package/dist/types/utils/layerzero/oft-config.d.ts.map +0 -1
  130. package/dist/types/utils/layerzero/types.d.ts +0 -23
  131. package/dist/types/utils/layerzero/types.d.ts.map +0 -1
  132. package/dist/utils/layerzero/index.js +0 -19
  133. package/dist/utils/layerzero/index.js.map +0 -1
  134. package/dist/utils/layerzero/oft-config.js +0 -29
  135. package/dist/utils/layerzero/oft-config.js.map +0 -1
  136. package/dist/utils/layerzero/types.js +0 -3
  137. package/dist/utils/layerzero/types.js.map +0 -1
  138. package/src/utils/layerzero/index.ts +0 -2
  139. package/src/utils/layerzero/oft-config.ts +0 -32
  140. package/src/utils/layerzero/types.ts +0 -25
@@ -331,6 +331,548 @@
331
331
  ],
332
332
  "outputs": [],
333
333
  "stateMutability": "nonpayable"
334
+ },
335
+ {
336
+ "type": "event",
337
+ "name": "PassivePerpExecutionV3",
338
+ "inputs": [
339
+ {
340
+ "name": "marketId",
341
+ "type": "uint128",
342
+ "indexed": true,
343
+ "internalType": "uint128"
344
+ },
345
+ {
346
+ "name": "exchangeId",
347
+ "type": "uint128",
348
+ "indexed": false,
349
+ "internalType": "uint128"
350
+ },
351
+ {
352
+ "name": "accountId",
353
+ "type": "uint128",
354
+ "indexed": true,
355
+ "internalType": "uint128"
356
+ },
357
+ {
358
+ "name": "counterpartyAccountId",
359
+ "type": "uint128",
360
+ "indexed": false,
361
+ "internalType": "uint128"
362
+ },
363
+ {
364
+ "name": "eventSequenceNumber",
365
+ "type": "uint128",
366
+ "indexed": true,
367
+ "internalType": "uint128"
368
+ },
369
+ {
370
+ "name": "blockTimestamp",
371
+ "type": "uint256",
372
+ "indexed": false,
373
+ "internalType": "uint256"
374
+ },
375
+ {
376
+ "name": "data",
377
+ "type": "tuple",
378
+ "indexed": false,
379
+ "internalType": "struct PassivePerpExecutionEventDataV3",
380
+ "components": [
381
+ {
382
+ "name": "executedBase",
383
+ "type": "int256",
384
+ "internalType": "SD59x18"
385
+ },
386
+ {
387
+ "name": "perpFillFees",
388
+ "type": "tuple",
389
+ "internalType": "struct PerpFillFees",
390
+ "components": [
391
+ {
392
+ "name": "protocolFeeCredit",
393
+ "type": "uint256",
394
+ "internalType": "uint256"
395
+ },
396
+ {
397
+ "name": "referrerFeeCredit",
398
+ "type": "uint256",
399
+ "internalType": "uint256"
400
+ },
401
+ {
402
+ "name": "takerRebateCredit",
403
+ "type": "uint256",
404
+ "internalType": "uint256"
405
+ },
406
+ {
407
+ "name": "poolFeeCredit",
408
+ "type": "uint256",
409
+ "internalType": "uint256"
410
+ }
411
+ ]
412
+ },
413
+ {
414
+ "name": "executedPrice",
415
+ "type": "uint256",
416
+ "internalType": "UD60x18"
417
+ },
418
+ {
419
+ "name": "referrerAccountId",
420
+ "type": "uint128",
421
+ "internalType": "uint128"
422
+ },
423
+ {
424
+ "name": "executionType",
425
+ "type": "uint8",
426
+ "internalType": "enum ExecutionType"
427
+ },
428
+ {
429
+ "name": "positionData",
430
+ "type": "tuple",
431
+ "internalType": "struct PerpPosition",
432
+ "components": [
433
+ {
434
+ "name": "base",
435
+ "type": "int256",
436
+ "internalType": "SD59x18"
437
+ },
438
+ {
439
+ "name": "realizedPnL",
440
+ "type": "int256",
441
+ "internalType": "SD59x18"
442
+ },
443
+ {
444
+ "name": "lastPriceData",
445
+ "type": "tuple",
446
+ "internalType": "struct PriceData",
447
+ "components": [
448
+ {
449
+ "name": "price",
450
+ "type": "uint256",
451
+ "internalType": "UD60x18"
452
+ },
453
+ {
454
+ "name": "timestamp",
455
+ "type": "uint256",
456
+ "internalType": "uint256"
457
+ }
458
+ ]
459
+ },
460
+ {
461
+ "name": "trackers",
462
+ "type": "tuple",
463
+ "internalType": "struct FundingAndADLTrackers",
464
+ "components": [
465
+ {
466
+ "name": "fundingValue",
467
+ "type": "int256",
468
+ "internalType": "SD59x18"
469
+ },
470
+ {
471
+ "name": "baseMultiplier",
472
+ "type": "uint256",
473
+ "internalType": "UD60x18"
474
+ },
475
+ {
476
+ "name": "adlUnwindPrice",
477
+ "type": "uint256",
478
+ "internalType": "UD60x18"
479
+ }
480
+ ]
481
+ },
482
+ {
483
+ "name": "averageEntryFundingValue",
484
+ "type": "int256",
485
+ "internalType": "SD59x18"
486
+ },
487
+ {
488
+ "name": "session",
489
+ "type": "uint128",
490
+ "internalType": "uint128"
491
+ }
492
+ ]
493
+ },
494
+ {
495
+ "name": "counterpartyPositionData",
496
+ "type": "tuple",
497
+ "internalType": "struct PerpPosition",
498
+ "components": [
499
+ {
500
+ "name": "base",
501
+ "type": "int256",
502
+ "internalType": "SD59x18"
503
+ },
504
+ {
505
+ "name": "realizedPnL",
506
+ "type": "int256",
507
+ "internalType": "SD59x18"
508
+ },
509
+ {
510
+ "name": "lastPriceData",
511
+ "type": "tuple",
512
+ "internalType": "struct PriceData",
513
+ "components": [
514
+ {
515
+ "name": "price",
516
+ "type": "uint256",
517
+ "internalType": "UD60x18"
518
+ },
519
+ {
520
+ "name": "timestamp",
521
+ "type": "uint256",
522
+ "internalType": "uint256"
523
+ }
524
+ ]
525
+ },
526
+ {
527
+ "name": "trackers",
528
+ "type": "tuple",
529
+ "internalType": "struct FundingAndADLTrackers",
530
+ "components": [
531
+ {
532
+ "name": "fundingValue",
533
+ "type": "int256",
534
+ "internalType": "SD59x18"
535
+ },
536
+ {
537
+ "name": "baseMultiplier",
538
+ "type": "uint256",
539
+ "internalType": "UD60x18"
540
+ },
541
+ {
542
+ "name": "adlUnwindPrice",
543
+ "type": "uint256",
544
+ "internalType": "UD60x18"
545
+ }
546
+ ]
547
+ },
548
+ {
549
+ "name": "averageEntryFundingValue",
550
+ "type": "int256",
551
+ "internalType": "SD59x18"
552
+ },
553
+ {
554
+ "name": "session",
555
+ "type": "uint128",
556
+ "internalType": "uint128"
557
+ }
558
+ ]
559
+ },
560
+ {
561
+ "name": "preOrderPositionData",
562
+ "type": "tuple",
563
+ "internalType": "struct PerpPosition",
564
+ "components": [
565
+ {
566
+ "name": "base",
567
+ "type": "int256",
568
+ "internalType": "SD59x18"
569
+ },
570
+ {
571
+ "name": "realizedPnL",
572
+ "type": "int256",
573
+ "internalType": "SD59x18"
574
+ },
575
+ {
576
+ "name": "lastPriceData",
577
+ "type": "tuple",
578
+ "internalType": "struct PriceData",
579
+ "components": [
580
+ {
581
+ "name": "price",
582
+ "type": "uint256",
583
+ "internalType": "UD60x18"
584
+ },
585
+ {
586
+ "name": "timestamp",
587
+ "type": "uint256",
588
+ "internalType": "uint256"
589
+ }
590
+ ]
591
+ },
592
+ {
593
+ "name": "trackers",
594
+ "type": "tuple",
595
+ "internalType": "struct FundingAndADLTrackers",
596
+ "components": [
597
+ {
598
+ "name": "fundingValue",
599
+ "type": "int256",
600
+ "internalType": "SD59x18"
601
+ },
602
+ {
603
+ "name": "baseMultiplier",
604
+ "type": "uint256",
605
+ "internalType": "UD60x18"
606
+ },
607
+ {
608
+ "name": "adlUnwindPrice",
609
+ "type": "uint256",
610
+ "internalType": "UD60x18"
611
+ }
612
+ ]
613
+ },
614
+ {
615
+ "name": "averageEntryFundingValue",
616
+ "type": "int256",
617
+ "internalType": "SD59x18"
618
+ },
619
+ {
620
+ "name": "session",
621
+ "type": "uint128",
622
+ "internalType": "uint128"
623
+ }
624
+ ]
625
+ },
626
+ {
627
+ "name": "preOrderCounterpartyPositionData",
628
+ "type": "tuple",
629
+ "internalType": "struct PerpPosition",
630
+ "components": [
631
+ {
632
+ "name": "base",
633
+ "type": "int256",
634
+ "internalType": "SD59x18"
635
+ },
636
+ {
637
+ "name": "realizedPnL",
638
+ "type": "int256",
639
+ "internalType": "SD59x18"
640
+ },
641
+ {
642
+ "name": "lastPriceData",
643
+ "type": "tuple",
644
+ "internalType": "struct PriceData",
645
+ "components": [
646
+ {
647
+ "name": "price",
648
+ "type": "uint256",
649
+ "internalType": "UD60x18"
650
+ },
651
+ {
652
+ "name": "timestamp",
653
+ "type": "uint256",
654
+ "internalType": "uint256"
655
+ }
656
+ ]
657
+ },
658
+ {
659
+ "name": "trackers",
660
+ "type": "tuple",
661
+ "internalType": "struct FundingAndADLTrackers",
662
+ "components": [
663
+ {
664
+ "name": "fundingValue",
665
+ "type": "int256",
666
+ "internalType": "SD59x18"
667
+ },
668
+ {
669
+ "name": "baseMultiplier",
670
+ "type": "uint256",
671
+ "internalType": "UD60x18"
672
+ },
673
+ {
674
+ "name": "adlUnwindPrice",
675
+ "type": "uint256",
676
+ "internalType": "UD60x18"
677
+ }
678
+ ]
679
+ },
680
+ {
681
+ "name": "averageEntryFundingValue",
682
+ "type": "int256",
683
+ "internalType": "SD59x18"
684
+ },
685
+ {
686
+ "name": "session",
687
+ "type": "uint128",
688
+ "internalType": "uint128"
689
+ }
690
+ ]
691
+ },
692
+ {
693
+ "name": "positionAccountOwner",
694
+ "type": "address",
695
+ "internalType": "address"
696
+ },
697
+ {
698
+ "name": "counterpartyAccountOwner",
699
+ "type": "address",
700
+ "internalType": "address"
701
+ },
702
+ {
703
+ "name": "accountOrderId",
704
+ "type": "uint64",
705
+ "internalType": "uint64"
706
+ },
707
+ {
708
+ "name": "counterpartyOrderId",
709
+ "type": "uint64",
710
+ "internalType": "uint64"
711
+ },
712
+ {
713
+ "name": "counterpartyExchangeId",
714
+ "type": "uint128",
715
+ "internalType": "uint128"
716
+ },
717
+ {
718
+ "name": "meNonce",
719
+ "type": "uint256",
720
+ "internalType": "uint256"
721
+ },
722
+ {
723
+ "name": "metadata",
724
+ "type": "bytes",
725
+ "internalType": "bytes"
726
+ }
727
+ ]
728
+ }
729
+ ],
730
+ "anonymous": false
731
+ },
732
+ {
733
+ "type": "event",
734
+ "name": "FeeTierParametersUpdated",
735
+ "inputs": [
736
+ {
737
+ "name": "tierId",
738
+ "type": "uint256",
739
+ "indexed": true,
740
+ "internalType": "uint256"
741
+ },
742
+ {
743
+ "name": "feeTierParameters",
744
+ "type": "tuple",
745
+ "indexed": false,
746
+ "internalType": "struct FeeTierParameters",
747
+ "components": [
748
+ {
749
+ "name": "takerFee",
750
+ "type": "uint256",
751
+ "internalType": "UD60x18"
752
+ },
753
+ {
754
+ "name": "makerFee",
755
+ "type": "uint256",
756
+ "internalType": "UD60x18"
757
+ },
758
+ {
759
+ "name": "makerRebate",
760
+ "type": "uint256",
761
+ "internalType": "UD60x18"
762
+ }
763
+ ]
764
+ },
765
+ {
766
+ "name": "blockTimestamp",
767
+ "type": "uint256",
768
+ "indexed": false,
769
+ "internalType": "uint256"
770
+ }
771
+ ],
772
+ "anonymous": false
773
+ },
774
+ {
775
+ "type": "event",
776
+ "name": "GlobalFeeParametersUpdated",
777
+ "inputs": [
778
+ {
779
+ "name": "globalFeeParameters",
780
+ "type": "tuple",
781
+ "indexed": false,
782
+ "internalType": "struct GlobalFeeParameters",
783
+ "components": [
784
+ {
785
+ "name": "ogDiscount",
786
+ "type": "uint256",
787
+ "internalType": "UD60x18"
788
+ },
789
+ {
790
+ "name": "refereeDiscount",
791
+ "type": "uint256",
792
+ "internalType": "UD60x18"
793
+ },
794
+ {
795
+ "name": "referrerRebate",
796
+ "type": "uint256",
797
+ "internalType": "UD60x18"
798
+ },
799
+ {
800
+ "name": "affiliateReferrerRebate",
801
+ "type": "uint256",
802
+ "internalType": "UD60x18"
803
+ },
804
+ {
805
+ "name": "vltzDiscount",
806
+ "type": "uint256",
807
+ "internalType": "UD60x18"
808
+ },
809
+ {
810
+ "name": "spreadDiscount",
811
+ "type": "uint256",
812
+ "internalType": "UD60x18"
813
+ }
814
+ ]
815
+ },
816
+ {
817
+ "name": "blockTimestamp",
818
+ "type": "uint256",
819
+ "indexed": false,
820
+ "internalType": "uint256"
821
+ }
822
+ ],
823
+ "anonymous": false
824
+ },
825
+ {
826
+ "type": "event",
827
+ "name": "AccountOwnerFeeConfigurationUpdated",
828
+ "inputs": [
829
+ {
830
+ "name": "accountOwner",
831
+ "type": "address",
832
+ "indexed": true,
833
+ "internalType": "address"
834
+ },
835
+ {
836
+ "name": "accountOwnerFeeConfig",
837
+ "type": "tuple",
838
+ "indexed": false,
839
+ "internalType": "struct AccountOwnerFeeConfig",
840
+ "components": [
841
+ {
842
+ "name": "tierId",
843
+ "type": "uint256",
844
+ "internalType": "uint256"
845
+ },
846
+ {
847
+ "name": "ogStatus",
848
+ "type": "bool",
849
+ "internalType": "bool"
850
+ },
851
+ {
852
+ "name": "affiliateStatus",
853
+ "type": "bool",
854
+ "internalType": "bool"
855
+ },
856
+ {
857
+ "name": "vltzStatus",
858
+ "type": "bool",
859
+ "internalType": "bool"
860
+ },
861
+ {
862
+ "name": "spreadDiscountStatus",
863
+ "type": "bool",
864
+ "internalType": "bool"
865
+ }
866
+ ]
867
+ },
868
+ {
869
+ "name": "blockTimestamp",
870
+ "type": "uint256",
871
+ "indexed": false,
872
+ "internalType": "uint256"
873
+ }
874
+ ],
875
+ "anonymous": false
334
876
  }
335
877
  ]
336
878
  }
@@ -1 +1 @@
1
- {"version":3,"file":"buildMulticallTx.js","sourceRoot":"/","sources":["transactions/buildMulticallTx.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,wDAAuD;AACvD,sEAAmE;AAO5D,IAAM,mBAAmB,GAAG,UAAC,SAAmB;IACrD,IAAM,iBAAiB,GAAG,cAAc,CAAC;IACzC,IAAM,UAAU,GAAwB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC3D,IAAM,SAAS,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,oBAAO,CAAC,CAAC;IAChD,IAAM,QAAQ,GAAG,SAAS,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;IAC7E,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEF,IAAM,eAAe,GAAG,UAAC,cAAuB,EAAE,KAAa;IAC7D,IAAM,iBAAiB,GAAG,6BAA6B,CAAC;IACxD,IAAM,UAAU,GAAsB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IAC9D,IAAM,SAAS,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,2BAAY,CAAC,CAAC;IACrD,IAAM,QAAQ,GAAG,SAAS,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;IAC7E,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEK,IAAM,qBAAqB,GAAG,UAAC,KAAa;IACjD,OAAA,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC;AAA5B,CAA4B,CAAC;AADlB,QAAA,qBAAqB,yBACH;AAExB,IAAM,uBAAuB,GAAG,UAAC,KAAa;IACnD,OAAA,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC;AAA7B,CAA6B,CAAC;AADnB,QAAA,uBAAuB,2BACJ","sourcesContent":["import { ethers } from 'ethers';\nimport { abi as CoreAbi } from './abis/CoreProxy.json';\nimport { abi as MulticallAbi } from './abis/CustomMulticall3.json';\n\nexport type Call = {\n target: string;\n callData: string;\n};\n\nexport const encodeCoreMulticall = (calldatas: string[]): string => {\n const functionSignature = 'tryAggregate';\n const parameters: [boolean, string[]] = [false, calldatas];\n const INTERFACE = new ethers.Interface(CoreAbi);\n const calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);\n return calldata;\n};\n\nconst encodeMulticall = (requireSuccess: boolean, calls: Call[]): string => {\n const functionSignature = 'tryAggregatePreservingError';\n const parameters: [boolean, Call[]] = [requireSuccess, calls];\n const INTERFACE = new ethers.Interface(MulticallAbi);\n const calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);\n return calldata;\n};\n\nexport const encodeStrictMulticall = (calls: Call[]) =>\n encodeMulticall(true, calls);\n\nexport const encodeOptionalMulticall = (calls: Call[]) =>\n encodeMulticall(false, calls);\n"]}
1
+ {"version":3,"file":"buildMulticallTx.js","sourceRoot":"/","sources":["transactions/buildMulticallTx.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,wDAAuD;AACvD,sEAAmE;AAW5D,IAAM,mBAAmB,GAAG,UAAC,SAAmB;IACrD,IAAM,iBAAiB,GAAG,cAAc,CAAC;IACzC,IAAM,UAAU,GAAwB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC3D,IAAM,SAAS,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,oBAAO,CAAC,CAAC;IAChD,IAAM,QAAQ,GAAG,SAAS,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;IAC7E,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEF,IAAM,eAAe,GAAG,UAAC,cAAuB,EAAE,KAAa;IAC7D,IAAM,iBAAiB,GAAG,6BAA6B,CAAC;IACxD,IAAM,UAAU,GAAsB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IAC9D,IAAM,SAAS,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,2BAAY,CAAC,CAAC;IACrD,IAAM,QAAQ,GAAG,SAAS,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;IAC7E,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEK,IAAM,qBAAqB,GAAG,UAAC,KAAa;IACjD,OAAA,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC;AAA5B,CAA4B,CAAC;AADlB,QAAA,qBAAqB,yBACH;AAExB,IAAM,uBAAuB,GAAG,UAAC,KAAa;IACnD,OAAA,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC;AAA7B,CAA6B,CAAC;AADnB,QAAA,uBAAuB,2BACJ","sourcesContent":["import { ethers } from 'ethers';\nimport { abi as CoreAbi } from './abis/CoreProxy.json';\nimport { abi as MulticallAbi } from './abis/CustomMulticall3.json';\n\nexport type Call = {\n target: string;\n callData: string;\n // Optional gas-limit override used by the off-chain transaction relay.\n // Ignored by on-chain Multicall3 struct encoding (ethers skips unknown\n // fields when matching the Solidity tuple).\n gasLimit?: number;\n};\n\nexport const encodeCoreMulticall = (calldatas: string[]): string => {\n const functionSignature = 'tryAggregate';\n const parameters: [boolean, string[]] = [false, calldatas];\n const INTERFACE = new ethers.Interface(CoreAbi);\n const calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);\n return calldata;\n};\n\nconst encodeMulticall = (requireSuccess: boolean, calls: Call[]): string => {\n const functionSignature = 'tryAggregatePreservingError';\n const parameters: [boolean, Call[]] = [requireSuccess, calls];\n const INTERFACE = new ethers.Interface(MulticallAbi);\n const calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);\n return calldata;\n};\n\nexport const encodeStrictMulticall = (calls: Call[]) =>\n encodeMulticall(true, calls);\n\nexport const encodeOptionalMulticall = (calls: Call[]) =>\n encodeMulticall(false, calls);\n"]}
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CONDITIONAL_ORDER_SIG_DEADLINE = exports.PUBLISHER_ACCOUNT = exports.RELAYER_ACCOUNT = exports.ORDERS_GATEWAY_DEADLINE_IN_SECONDS = exports.CORE_DEADLINE_IN_SECONDS = exports.BRIDGE_DEADLINE_IN_SECONDS = void 0;
3
+ exports.PUBLISHER_ACCOUNT = exports.RELAYER_ACCOUNT = exports.ORDERS_GATEWAY_DEADLINE_IN_SECONDS = exports.CORE_DEADLINE_IN_SECONDS = exports.BRIDGE_DEADLINE_IN_SECONDS = void 0;
4
4
  exports.BRIDGE_DEADLINE_IN_SECONDS = 15 * 60; // 15 minutes
5
5
  exports.CORE_DEADLINE_IN_SECONDS = 60; // 1 minute
6
6
  exports.ORDERS_GATEWAY_DEADLINE_IN_SECONDS = 60; // 1 minute
7
7
  exports.RELAYER_ACCOUNT = '0xb43c317c9c9215d268881d7d6b59c2d3d0247da1'; // @todo update value
8
8
  exports.PUBLISHER_ACCOUNT = '0xE32519ca0e751C754c8E1378846B5cd95A1CB66a'; // @todo update value
9
- exports.CONDITIONAL_ORDER_SIG_DEADLINE = Math.pow(10, 18); // very big number for timestamp
10
9
  //# sourceMappingURL=consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"/","sources":["transactions/consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa;AACnD,QAAA,wBAAwB,GAAG,EAAE,CAAC,CAAC,WAAW;AAC1C,QAAA,kCAAkC,GAAG,EAAE,CAAC,CAAC,WAAW;AACpD,QAAA,eAAe,GAAG,4CAA4C,CAAC,CAAC,qBAAqB;AACrF,QAAA,iBAAiB,GAAG,4CAA4C,CAAC,CAAC,qBAAqB;AACvF,QAAA,8BAA8B,GAAG,SAAA,EAAE,EAAI,EAAE,CAAA,CAAC,CAAC,gCAAgC","sourcesContent":["export const BRIDGE_DEADLINE_IN_SECONDS = 15 * 60; // 15 minutes\nexport const CORE_DEADLINE_IN_SECONDS = 60; // 1 minute\nexport const ORDERS_GATEWAY_DEADLINE_IN_SECONDS = 60; // 1 minute\nexport const RELAYER_ACCOUNT = '0xb43c317c9c9215d268881d7d6b59c2d3d0247da1'; // @todo update value\nexport const PUBLISHER_ACCOUNT = '0xE32519ca0e751C754c8E1378846B5cd95A1CB66a'; // @todo update value\nexport const CONDITIONAL_ORDER_SIG_DEADLINE = 10 ** 18; // very big number for timestamp\n"]}
1
+ {"version":3,"file":"consts.js","sourceRoot":"/","sources":["transactions/consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa;AACnD,QAAA,wBAAwB,GAAG,EAAE,CAAC,CAAC,WAAW;AAC1C,QAAA,kCAAkC,GAAG,EAAE,CAAC,CAAC,WAAW;AACpD,QAAA,eAAe,GAAG,4CAA4C,CAAC,CAAC,qBAAqB;AACrF,QAAA,iBAAiB,GAAG,4CAA4C,CAAC,CAAC,qBAAqB","sourcesContent":["export const BRIDGE_DEADLINE_IN_SECONDS = 15 * 60; // 15 minutes\nexport const CORE_DEADLINE_IN_SECONDS = 60; // 1 minute\nexport const ORDERS_GATEWAY_DEADLINE_IN_SECONDS = 60; // 1 minute\nexport const RELAYER_ACCOUNT = '0xb43c317c9c9215d268881d7d6b59c2d3d0247da1'; // @todo update value\nexport const PUBLISHER_ACCOUNT = '0xE32519ca0e751C754c8E1378846B5cd95A1CB66a'; // @todo update value\n"]}
@@ -1,5 +1,16 @@
1
1
  "use strict";
2
- var _a, _b, _c;
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var _a, _b, _c, _d, _e;
3
14
  Object.defineProperty(exports, "__esModule", { value: true });
4
15
  exports.getAddress = exports.ContractType = void 0;
5
16
  var types_1 = require("../types");
@@ -14,9 +25,9 @@ var ContractType;
14
25
  ContractType["ORACLE_ADAPTERS_PROXY"] = "oracle_adapters_proxy";
15
26
  ContractType["MULTICALL"] = "multicall";
16
27
  ContractType["REYA_SBTS"] = "reya_sbts";
17
- ContractType["TGE_DISTRIBUTOR"] = "tge_distributor";
28
+ ContractType["REYA_TGE_DISTRIBUTION"] = "reya_tge_distribution";
18
29
  })(ContractType || (exports.ContractType = ContractType = {}));
19
- var addresses = (_a = {},
30
+ var remoteAddresses = (_a = {},
20
31
  _a[types_1.ReyaChainId.reyaCronos] = (_b = {},
21
32
  _b[ContractType.CORE_PROXY] = '0xc6fb022962e1426f4e0ec9d2f8861c57926e9f72',
22
33
  _b[ContractType.PASSIVE_POOL_PROXY] = '0x9a3a664987b88790a6fdc1632e3b607813fd94ff',
@@ -27,7 +38,7 @@ var addresses = (_a = {},
27
38
  _b[ContractType.ORACLE_ADAPTERS_PROXY] = '0xc501a2356703cd351703d68963c6f4136120f7cf',
28
39
  _b[ContractType.MULTICALL] = '0x5abde4f0af8eaf3c9967f7fa126e59a103357b5c',
29
40
  _b[ContractType.REYA_SBTS] = '0xc0092ea9179ace93b0cd8910958e335575562722',
30
- _b[ContractType.TGE_DISTRIBUTOR] = '0x95375788a8137958dc8d93f774f4795bf28b0143',
41
+ _b[ContractType.REYA_TGE_DISTRIBUTION] = '0x16917248669fa64340e6517538e419588e9684c3',
31
42
  _b),
32
43
  _a[types_1.ReyaChainId.reyaNetwork] = (_c = {},
33
44
  _c[ContractType.CORE_PROXY] = '0xa763b6a5e09378434406c003dae6487fbbdc1a80',
@@ -39,10 +50,40 @@ var addresses = (_a = {},
39
50
  _c[ContractType.ORACLE_ADAPTERS_PROXY] = '0x32edabc058c1207fe0ec5f8557643c28e4ff379e',
40
51
  _c[ContractType.MULTICALL] = '0xed28d27dfca47ad2513c9f2e2d3c098c2ea5a47f',
41
52
  _c[ContractType.REYA_SBTS] = '0x14d7c1efc024e118df70b241afbd2447d37f1ed6',
42
- _c[ContractType.TGE_DISTRIBUTOR] = '0x0000000000000000000000000000000000000000',
53
+ _c[ContractType.REYA_TGE_DISTRIBUTION] = '0x0000000000000000000000000000000000000000',
43
54
  _c),
44
55
  _a);
56
+ var addresses = __assign(__assign({}, remoteAddresses), (_d = {}, _d[types_1.ReyaChainId.reyaLocal] = {}, _d));
57
+ // Map stores the resolved env-var VALUES (not the var names) so that
58
+ // webpack / Next.js `DefinePlugin` can statically inline them into
59
+ // browser bundles.
60
+ //
61
+ // DefinePlugin only inlines literal `process.env.NAME` access — a
62
+ // dynamic `process.env[varName]` lookup is opaque to its source-text
63
+ // pass and stays `undefined` in the browser. Keeping the four
64
+ // `process.env.*` accesses as static literals in this object literal
65
+ // is what makes the override work in both Node (real `process.env` at
66
+ // runtime) and browser (DefinePlugin-substituted constants at build
67
+ // time). See PR #2660 / Daniel's comment for the discovery context.
68
+ //
69
+ // New entries must use the same static-literal pattern; do NOT
70
+ // introduce a dynamic `process.env[someVar]` lookup downstream.
71
+ var CONTRACT_ADDRESS_ENV_OVERRIDES = (_e = {},
72
+ _e[ContractType.CORE_PROXY] = process.env.CORE_PROXY_ADDRESS,
73
+ _e[ContractType.PASSIVE_PERP_PROXY] = process.env.PASSIVE_PERP_PROXY_ADDRESS,
74
+ _e[ContractType.ORDERS_GATEWAY_PROXY] = process.env.ORDERS_GATEWAY_PROXY_ADDRESS,
75
+ _e[ContractType.PERIPHERY_PROXY] = process.env.PERIPHERY_PROXY_ADDRESS,
76
+ _e);
45
77
  var getAddress = function (chainId, contractName) {
78
+ // Normalize env-overridden addresses to lowercase. The hardcoded fallback
79
+ // map below stores lowercased values, and downstream comparisons (e.g.
80
+ // transaction-whitelist.ts uses `convertToAddress(target) === OG_ADDRESS`,
81
+ // which lowercases the runtime target) assume that invariant. Without
82
+ // this, a checksummed env value silently fails every comparison and the
83
+ // OG-aware settlement path gets bypassed.
84
+ var override = CONTRACT_ADDRESS_ENV_OVERRIDES[contractName];
85
+ if (override)
86
+ return override.toLowerCase();
46
87
  var keyChainId = chainId.toString();
47
88
  if (!Object.keys(addresses).includes(keyChainId)) {
48
89
  throw new Error("Unspecified addresses for chain id ".concat(keyChainId));