@scallop-io/sui-scallop-sdk 0.46.36 → 0.46.37

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 (41) hide show
  1. package/dist/builders/loyaltyProgramBuilder.d.ts +12 -0
  2. package/dist/builders/referralBuilder.d.ts +1 -1
  3. package/dist/constants/testAddress.d.ts +2 -0
  4. package/dist/index.js +567 -71
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +557 -61
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/models/scallopQuery.d.ts +10 -3
  9. package/dist/models/scallopUtils.d.ts +1 -1
  10. package/dist/queries/index.d.ts +1 -0
  11. package/dist/queries/loyaltyProgramQuery.d.ts +10 -0
  12. package/dist/queries/vescaQuery.d.ts +8 -6
  13. package/dist/types/address.d.ts +6 -0
  14. package/dist/types/builder/index.d.ts +3 -1
  15. package/dist/types/builder/loyaltyProgram.d.ts +23 -0
  16. package/dist/types/builder/vesca.d.ts +16 -0
  17. package/dist/types/query/index.d.ts +1 -0
  18. package/dist/types/query/loyaltyProgram.d.ts +5 -0
  19. package/dist/types/query/vesca.d.ts +18 -0
  20. package/dist/utils/builder.d.ts +6 -5
  21. package/package.json +7 -6
  22. package/src/builders/index.ts +6 -1
  23. package/src/builders/loyaltyProgramBuilder.ts +115 -0
  24. package/src/builders/referralBuilder.ts +1 -1
  25. package/src/builders/vescaBuilder.ts +5 -1
  26. package/src/constants/testAddress.ts +383 -0
  27. package/src/models/scallopAddress.ts +12 -2
  28. package/src/models/scallopCache.ts +0 -1
  29. package/src/models/scallopQuery.ts +16 -5
  30. package/src/models/scallopUtils.ts +3 -3
  31. package/src/queries/index.ts +1 -0
  32. package/src/queries/loyaltyProgramQuery.ts +77 -0
  33. package/src/queries/vescaQuery.ts +70 -15
  34. package/src/types/address.ts +6 -0
  35. package/src/types/builder/index.ts +3 -0
  36. package/src/types/builder/loyaltyProgram.ts +35 -0
  37. package/src/types/builder/vesca.ts +16 -0
  38. package/src/types/query/index.ts +1 -0
  39. package/src/types/query/loyaltyProgram.ts +5 -0
  40. package/src/types/query/vesca.ts +21 -0
  41. package/src/utils/builder.ts +69 -53
package/dist/index.mjs CHANGED
@@ -284,9 +284,7 @@ var ScallopCache = class {
284
284
  ],
285
285
  queryFn: async () => {
286
286
  return await this.suiKit.inspectTxn(txBytes);
287
- },
288
- staleTime: 8e3
289
- // make stale time longer for inspectTxn results
287
+ }
290
288
  });
291
289
  return query;
292
290
  }
@@ -420,6 +418,310 @@ var ScallopCache = class {
420
418
 
421
419
  // src/models/scallopAddress.ts
422
420
  import axios from "axios";
421
+
422
+ // src/constants/testAddress.ts
423
+ var TEST_ADDRESSES = {
424
+ core: {
425
+ version: "0x07871c4b3c847a0f674510d4978d5cf6f960452795e8ff6f189fd2088a3f6ac7",
426
+ versionCap: "0x590a4011cb649b3878f3ea14b3a78674642a9548d79b7e091ef679574b158a07",
427
+ object: "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf",
428
+ market: "0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9",
429
+ adminCap: "0x09689d018e71c337d9db6d67cbca06b74ed92196103624028ccc3ecea411777c",
430
+ coinDecimalsRegistry: "0x200abe9bf19751cc566ae35aa58e2b7e4ff688fc1130f8d8909ea09bc137d668",
431
+ obligationAccessStore: "0x733e30b7c94d619d78cb8f5bc4bfbb759ced9a531239028caabb2474e5be59c9",
432
+ coins: {
433
+ cetus: {
434
+ id: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b",
435
+ metaData: "0x4c0dce55eff2db5419bbd2d239d1aa22b4a400c01bbb648b058a9883989025da",
436
+ treasury: "",
437
+ oracle: {
438
+ supra: "",
439
+ switchboard: "",
440
+ pyth: {
441
+ feed: "e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef",
442
+ feedObject: "0x24c0247fb22457a719efac7f670cdc79be321b521460bd6bd2ccfa9f80713b14"
443
+ }
444
+ }
445
+ },
446
+ apt: {
447
+ id: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37",
448
+ metaData: "0xc969c5251f372c0f34c32759f1d315cf1ea0ee5e4454b52aea08778eacfdd0a8",
449
+ treasury: "",
450
+ oracle: {
451
+ supra: "",
452
+ switchboard: "",
453
+ pyth: {
454
+ feed: "03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5",
455
+ feedObject: "0x7c5b7837c44a69b469325463ac0673ac1aa8435ff44ddb4191c9ae380463647f"
456
+ }
457
+ }
458
+ },
459
+ sol: {
460
+ id: "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8",
461
+ metaData: "0x4d2c39082b4477e3e79dc4562d939147ab90c42fc5f3e4acf03b94383cd69b6e",
462
+ treasury: "",
463
+ oracle: {
464
+ supra: "",
465
+ switchboard: "",
466
+ pyth: {
467
+ feed: "ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d",
468
+ feedObject: "0x9d0d275efbd37d8a8855f6f2c761fa5983293dd8ce202ee5196626de8fcd4469"
469
+ }
470
+ }
471
+ },
472
+ btc: {
473
+ id: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881",
474
+ metaData: "0x5d3c6e60eeff8a05b693b481539e7847dfe33013e7070cdcb387f5c0cac05dfd",
475
+ treasury: "",
476
+ oracle: {
477
+ supra: "",
478
+ switchboard: "",
479
+ pyth: {
480
+ feed: "e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
481
+ feedObject: "0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2"
482
+ }
483
+ }
484
+ },
485
+ eth: {
486
+ id: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5",
487
+ metaData: "0x8900e4ceede3363bef086d6b50ca89d816d0e90bf6bc46efefe1f8455e08f50f",
488
+ treasury: "",
489
+ oracle: {
490
+ supra: "",
491
+ switchboard: "",
492
+ pyth: {
493
+ feed: "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
494
+ feedObject: "0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab"
495
+ }
496
+ }
497
+ },
498
+ usdc: {
499
+ id: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf",
500
+ metaData: "0x4fbf84f3029bd0c0b77164b587963be957f853eccf834a67bb9ecba6ec80f189",
501
+ treasury: "",
502
+ oracle: {
503
+ supra: "",
504
+ switchboard: "",
505
+ pyth: {
506
+ feed: "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
507
+ feedObject: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab"
508
+ }
509
+ }
510
+ },
511
+ usdt: {
512
+ id: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c",
513
+ metaData: "0xfb0e3eb97dd158a5ae979dddfa24348063843c5b20eb8381dd5fa7c93699e45c",
514
+ treasury: "",
515
+ oracle: {
516
+ supra: "",
517
+ switchboard: "",
518
+ pyth: {
519
+ feed: "2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
520
+ feedObject: "0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572"
521
+ }
522
+ }
523
+ },
524
+ sui: {
525
+ id: "0x0000000000000000000000000000000000000000000000000000000000000002",
526
+ metaData: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
527
+ treasury: "",
528
+ oracle: {
529
+ supra: "",
530
+ switchboard: "0xbca474133638352ba83ccf7b5c931d50f764b09550e16612c9f70f1e21f3f594",
531
+ pyth: {
532
+ feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
533
+ feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
534
+ }
535
+ }
536
+ },
537
+ afsui: {
538
+ id: "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc",
539
+ metaData: "0x2f9217f533e51334873a39b8026a4aa6919497b47f49d0986a4f1aec66f8a34d",
540
+ treasury: "",
541
+ oracle: {
542
+ supra: "",
543
+ switchboard: "",
544
+ pyth: {
545
+ feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
546
+ feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
547
+ }
548
+ }
549
+ },
550
+ hasui: {
551
+ id: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d",
552
+ metaData: "0x2c5f33af93f6511df699aaaa5822d823aac6ed99d4a0de2a4a50b3afa0172e24",
553
+ treasury: "",
554
+ oracle: {
555
+ supra: "",
556
+ switchboard: "",
557
+ pyth: {
558
+ feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
559
+ feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
560
+ }
561
+ }
562
+ },
563
+ vsui: {
564
+ id: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55",
565
+ metaData: "0xabd84a23467b33854ab25cf862006fd97479f8f6f53e50fe732c43a274d939bd",
566
+ treasury: "",
567
+ oracle: {
568
+ supra: "",
569
+ switchboard: "",
570
+ pyth: {
571
+ feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
572
+ feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
573
+ }
574
+ }
575
+ },
576
+ sca: {
577
+ id: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6",
578
+ metaData: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
579
+ treasury: "",
580
+ oracle: {
581
+ supra: "",
582
+ switchboard: "",
583
+ pyth: {
584
+ feed: "7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc",
585
+ feedObject: "0xf6de1d3279a269a597d813cbaca59aa906543ab9a8c64e84a4722f1a20863985"
586
+ }
587
+ }
588
+ }
589
+ },
590
+ oracles: {
591
+ xOracle: "0x93d5bf0936b71eb27255941e532fac33b5a5c7759e377b4923af0a1359ad494f",
592
+ xOracleCap: "0x1edeae568fde99e090dbdec4bcdbd33a15f53a1ce1f87aeef1a560dedf4b4a90",
593
+ supra: { registry: "", registryCap: "", holder: "" },
594
+ switchboard: { registry: "", registryCap: "" },
595
+ pyth: {
596
+ registry: "0xedc293f9413a5a7a5d53bdba1fd889d0a4030894469228f0acdae4aa3c55a213",
597
+ registryCap: "0xbcb07141eb1f7e01fbda4130ecf5f5adaeabb77f5d9c32158b7532bcd2197acd",
598
+ state: "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8",
599
+ wormhole: "0x5306f64e312b581766351c07af79c72fcb1cd25147157fdc2f8ad76de9a3fb6a",
600
+ wormholeState: "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"
601
+ }
602
+ },
603
+ packages: {
604
+ coinDecimalsRegistry: {
605
+ id: "0xca5a5a62f01c79a104bf4d31669e29daa387f325c241de4edbe30986a9bc8b0d",
606
+ upgradeCap: "0x34e76a945d29f195bc53ca704fa70877d1cf3a5d7bbfdda1b13e633fff13c0f6"
607
+ },
608
+ math: {
609
+ id: "0xad013d5fde39e15eabda32b3dbdafd67dac32b798ce63237c27a8f73339b9b6f",
610
+ upgradeCap: "0x3a329598231de02e6135c62284b66005b41cad1d9ab7ca2dc79c08293aba2ec6"
611
+ },
612
+ whitelist: {
613
+ id: "0x1318fdc90319ec9c24df1456d960a447521b0a658316155895014a6e39b5482f",
614
+ upgradeCap: "0xf5a22aea23db664f7b69855b6a546747f17c1ec4230319cfc17225e462b05761"
615
+ },
616
+ x: {
617
+ id: "0x779b5c547976899f5474f3a5bc0db36ddf4697ad7e5a901db0415c2281d28162",
618
+ upgradeCap: "0x3f203f6fff6a69d151e4f1cd931f22b68c489ef2759765662fc7baf673943c9e"
619
+ },
620
+ protocol: {
621
+ id: "0x6e641f0dca8aedab3101d047e96439178f16301bf0b57fe8745086ff1195eb3e",
622
+ upgradeCap: "0x38527d154618d1fd5a644b90717fe07cf0e9f26b46b63e9568e611a3f86d5c1a"
623
+ },
624
+ protocolWhitelist: {
625
+ id: "0x4c262d9343dac53ecb28f482a2a3f62c73d0ebac5b5f03d57383d56ff219acdf",
626
+ upgradeCap: "0x4a5e88a75039b00988f633f811f58117f31b8627a46bf822aa114d9010049449"
627
+ },
628
+ query: {
629
+ id: "0xb8d603a39114a5efef3dd0bf84df0bed1be1fbd39b78b7dd6e8a61ccc5e6006f",
630
+ upgradeCap: "0x0d535c35f608b9b01b7ccce11acf43b1dd80c1b72bf8b541744a6e28e8d2745f"
631
+ },
632
+ supra: { id: "", upgradeCap: "" },
633
+ pyth: {
634
+ id: "0x910f30cbc7f601f75a5141a01265cd47c62d468707c5e1aecb32a18f448cb25a",
635
+ upgradeCap: "0xdf0ffbae1ea5bb25fbca5efba433dcf00c7cced65679af2f04728901275c6157"
636
+ },
637
+ switchboard: { id: "", upgradeCap: "" },
638
+ xOracle: {
639
+ id: "0x1478a432123e4b3d61878b629f2c692969fdb375644f1251cd278a4b1e7d7cd6",
640
+ upgradeCap: "0x0f928a6b2e26b73330fecaf9b44acfc9800a4a9794d6415c2a3153bc70e3c1f0"
641
+ },
642
+ testCoin: { id: "", upgradeCap: "" }
643
+ }
644
+ },
645
+ spool: {
646
+ id: "0x7c4fdabe81c31b19a45d1e572a52a539997a90903fbb5bfab71480abe0fa62c3",
647
+ adminCap: "0xdd8a047cbbf802bfcde5288b8ef1910965d789cc614da11d39af05fca0bd020a",
648
+ object: "0xe87f1b2d498106a2c61421cec75b7b5c5e348512b0dc263949a0e7a3c256571a",
649
+ pools: {
650
+ seth: {
651
+ id: "0xeec40beccb07c575bebd842eeaabb835f77cd3dab73add433477e57f583a6787",
652
+ rewardPoolId: "0x957de68a18d87817de8309b30c1ec269a4d87ae513abbeed86b5619cb9ce1077"
653
+ },
654
+ ssui: {
655
+ id: "0x4f0ba970d3c11db05c8f40c64a15b6a33322db3702d634ced6536960ab6f3ee4",
656
+ rewardPoolId: "0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9"
657
+ },
658
+ susdc: {
659
+ id: "0x4ace6648ddc64e646ba47a957c562c32c9599b3bba8f5ac1aadb2ae23a2f8ca0",
660
+ rewardPoolId: "0xf4268cc9b9413b9bfe09e8966b8de650494c9e5784bf0930759cfef4904daff8"
661
+ },
662
+ susdt: {
663
+ id: "0xcb328f7ffa7f9342ed85af3fdb2f22919e1a06dfb2f713c04c73543870d7548f",
664
+ rewardPoolId: "0x2c9f934d67a5baa586ceec2cc24163a2f049a6af3d5ba36b84d8ac40f25c4080"
665
+ },
666
+ scetus: {
667
+ id: "0xac1bb13bf4472a637c18c2415fb0e3c1227ea2bcf35242e50563c98215bd298e",
668
+ rewardPoolId: "0x6835c1224126a45086fc6406adc249e3f30df18d779ca4f4e570e38716a17f3f"
669
+ },
670
+ safsui: {
671
+ id: "0xeedf438abcaa6ce4d9625ffca110920592d5867e4c5637d84ad9f466c4feb800",
672
+ rewardPoolId: "0x89255a2f86ed7fbfef35ab8b7be48cc7667015975be2685dd9a55a9a64baf76e"
673
+ },
674
+ shasui: {
675
+ id: "0xa6148bc1b623e936d39a952ceb5bea79e8b37228a8f595067bf1852efd3c34aa",
676
+ rewardPoolId: "0x6f3563644d3e2ef13176dbf9d865bd93479df60ccbe07b7e66db57f6309f5a66"
677
+ },
678
+ svsui: {
679
+ id: "0x69ce8e537e750a95381e6040794afa5ab1758353a1a2e1de7760391b01f91670",
680
+ rewardPoolId: "0xbca914adce058ad0902c7f3cfcd698392a475f00dcfdc3f76001d0370b98777a"
681
+ }
682
+ },
683
+ config: ""
684
+ },
685
+ borrowIncentive: {
686
+ id: "0x6152f696fc3a658f33c4b891764731a59153125ffedfa8bff7167c42823f58a9",
687
+ adminCap: "0xc486afa253646f4d381e81d7f1df8aa4723b845a6bb356f69bad635ffefffe2c",
688
+ object: "0x002875153e09f8145ab63527bc85c00f2bd102e12f9573c47f8cdf1a1cb62934",
689
+ query: "0x529edc54a3dce2207703ceebbccb0ac14133f7825c1f528775ba0d85a4063489",
690
+ incentivePools: "0x6547e143d406b5ccd5f46aae482497de279cc1a68c406f701df70a05f9212ab4",
691
+ incentiveAccounts: "0xc4701fdbc1c92f9a636d334d66012b3027659e9fb8aff27279a82edfb6b77d02",
692
+ config: "0xdf5d04b4691cc67e82fd4db8394d89ff44823a9de29716c924f74bb4f11cc1f7"
693
+ },
694
+ referral: {
695
+ id: "0xa3654ebb63eb06c0f4ff52f8aa6512df9f164f7772bdf15dac3709bd3798dda9",
696
+ object: "0x5658d4bf5ddcba27e4337b4262108b3ad1716643cac8c2054ac341538adc72ec",
697
+ adminCap: "0xc5dc06b9074291259f2cac460c940012c781c4430e42125c541cc43101c3bcbd",
698
+ referralBindings: "0xf63299d58789d99de94092b9011323466e55ca0c1ea1a7a3786a589af46e1c09",
699
+ bindingTableId: "0x1c8202b17267ec8d6cf97ca013615354181a04f179570e42601ff2dae19294b1",
700
+ referralRevenuePool: "0x6abd852caf90769c1b185cdf636d841673fa95528f0550f018b8a138bd283c07",
701
+ revenueTableId: "0x595baa3654c297bff84ab7786a2d250f019cefc66e8df8e89fd9d41e02bd30dd",
702
+ referralTiers: "0x962cb903d8d7346190c5204785ccbb91b61086aa764f674c8145df82335cf83e",
703
+ tiersTableId: "0xeac755a7a8b7798530905ac79e8c114f19d0f130f6eab012954f08faac29c75d",
704
+ authorizedWitnessList: "0xf21b0ed043c9bb70842c0129159f4943dbcc3c9ef2f2f808af65f8be25cfd20e",
705
+ version: "0x1bd4b7285f72e11c316b828c7c47b3f4da18dcec9f9b3dba6d8629cbb6f93e5e"
706
+ },
707
+ vesca: {
708
+ id: "0xb15b6e0cdd85afb5028bea851dd249405e734d800a259147bbc24980629723a4",
709
+ object: "0xb15b6e0cdd85afb5028bea851dd249405e734d800a259147bbc24980629723a4",
710
+ adminCap: "0x8ffa76135c5b85c5fbd73a6448a4a733d826cb63a267ab817656acb77c72d4a5",
711
+ tableId: "0xe3153b2bf124be0b86cb8bd468346a861efd0da52fc42197b54d2f616488a311",
712
+ table: "0x611cb8d9d4d90867467b5ebdf4cc447a0047ed5b01334a28a29fcfe733e3d609",
713
+ treasury: "0xe8c112c09b88158dc6c8e23d1fbae5b3c7136cdee54b7dafc08e65db28c4a5bc",
714
+ config: "0xe0a2ff281e73c1d53cfa85807080f87e833e4f1a7f93dcf8800b3865269a76b9"
715
+ },
716
+ loyaltyProgram: {
717
+ id: "0xd17bcf8b5a59652c36225d478564a8593ae0ed7d650bcacdda1d6fe179127907",
718
+ object: "0xd17bcf8b5a59652c36225d478564a8593ae0ed7d650bcacdda1d6fe179127907",
719
+ rewardPool: "0xf9c090492ef476bd542109d0913ffe871cbfa28578b7114eca2a8c0e5671786f",
720
+ userRewardTableId: "0x748a80395849ed37db1b0e14f2ab5d1d96458d2359ab3a84eb079d0f4ac7cf2e"
721
+ }
722
+ };
723
+
724
+ // src/models/scallopAddress.ts
423
725
  var EMPTY_ADDRESSES = {
424
726
  core: {
425
727
  version: "",
@@ -712,6 +1014,12 @@ var EMPTY_ADDRESSES = {
712
1014
  referralTiers: "",
713
1015
  tiersTableId: "",
714
1016
  authorizedWitnessList: ""
1017
+ },
1018
+ loyaltyProgram: {
1019
+ id: "",
1020
+ object: "",
1021
+ rewardPool: "",
1022
+ userRewardTableId: ""
715
1023
  }
716
1024
  };
717
1025
  var ScallopAddress = class {
@@ -730,7 +1038,9 @@ var ScallopAddress = class {
730
1038
  this._auth = auth;
731
1039
  this._id = id;
732
1040
  this._network = network || "mainnet";
733
- this._addressesMap = /* @__PURE__ */ new Map();
1041
+ this._addressesMap = IS_VE_SCA_TEST ? /* @__PURE__ */ new Map([["mainnet", TEST_ADDRESSES]]) : /* @__PURE__ */ new Map();
1042
+ if (IS_VE_SCA_TEST)
1043
+ this._currentAddresses = TEST_ADDRESSES;
734
1044
  }
735
1045
  /**
736
1046
  * Get addresses API id.
@@ -1040,7 +1350,37 @@ var requireSender = (txBlock) => {
1040
1350
  }
1041
1351
  return sender;
1042
1352
  };
1043
- var checkLockSca = (scaAmountOrCoin, lockPeriodInDays, newUnlockAtInSecondTimestamp, prevUnlockAtInSecondTimestamp) => {
1353
+ var checkVesca = (prevUnlockAtInMillisTimestamp) => {
1354
+ if (prevUnlockAtInMillisTimestamp === void 0) {
1355
+ throw new Error("veSca not found");
1356
+ }
1357
+ };
1358
+ var checkVescaExpired = (prevUnlockAtInMillisTimestamp) => {
1359
+ if (prevUnlockAtInMillisTimestamp <= (/* @__PURE__ */ new Date()).getTime()) {
1360
+ throw new Error("veSca is expired, use renewExpiredVeScaQuick instead");
1361
+ }
1362
+ };
1363
+ var checkExtendLockPeriod = (lockPeriodInDays, newUnlockAtInSecondTimestamp, prevUnlockAtInMillisTimestamp) => {
1364
+ checkVesca(prevUnlockAtInMillisTimestamp);
1365
+ checkVescaExpired(prevUnlockAtInMillisTimestamp);
1366
+ const prevUnlockAtInSecondTimestamp = Math.floor(
1367
+ prevUnlockAtInMillisTimestamp / 1e3
1368
+ );
1369
+ if (lockPeriodInDays < 1) {
1370
+ throw new Error("Minimum lock period is 1 day");
1371
+ }
1372
+ const availableLockPeriodInDays = Math.floor(
1373
+ (newUnlockAtInSecondTimestamp - prevUnlockAtInSecondTimestamp) / UNLOCK_ROUND_DURATION
1374
+ );
1375
+ console.log("availableLockPeriodInDays", availableLockPeriodInDays);
1376
+ if (lockPeriodInDays > availableLockPeriodInDays) {
1377
+ throw new Error(
1378
+ `Cannot extend lock period by ${lockPeriodInDays} days, maximum lock period is ~4 years (${MAX_LOCK_ROUNDS} days), remaining lock period is ${MAX_LOCK_ROUNDS - availableLockPeriodInDays}`
1379
+ );
1380
+ }
1381
+ };
1382
+ var checkLockSca = (scaAmountOrCoin, lockPeriodInDays, newUnlockAtInSecondTimestamp, prevUnlockAtInMillisTimestamp) => {
1383
+ const prevUnlockAtInSecondTimestamp = prevUnlockAtInMillisTimestamp ? Math.floor(prevUnlockAtInMillisTimestamp / 1e3) : void 0;
1044
1384
  const isInitialLock = !prevUnlockAtInSecondTimestamp;
1045
1385
  const isLockExpired = !isInitialLock && prevUnlockAtInSecondTimestamp * 1e3 <= (/* @__PURE__ */ new Date()).getTime();
1046
1386
  if (isInitialLock || isLockExpired) {
@@ -1065,52 +1405,36 @@ var checkLockSca = (scaAmountOrCoin, lockPeriodInDays, newUnlockAtInSecondTimest
1065
1405
  );
1066
1406
  }
1067
1407
  } else {
1068
- checkVesca(prevUnlockAtInSecondTimestamp);
1408
+ checkVesca(prevUnlockAtInMillisTimestamp);
1409
+ checkVescaExpired(prevUnlockAtInMillisTimestamp);
1069
1410
  if (typeof scaAmountOrCoin === "number" && scaAmountOrCoin < MIN_TOP_UP_AMOUNT) {
1070
1411
  throw new Error("Minimum top up amount is 1 SCA");
1071
1412
  }
1072
- if (!!newUnlockAtInSecondTimestamp && !!prevUnlockAtInSecondTimestamp) {
1073
- const totalLockDuration = newUnlockAtInSecondTimestamp - prevUnlockAtInSecondTimestamp;
1074
- if (totalLockDuration > MAX_LOCK_DURATION - UNLOCK_ROUND_DURATION) {
1075
- throw new Error(
1076
- `Maximum lock period is ~4 years (${MAX_LOCK_ROUNDS - 1} days)`
1077
- );
1078
- }
1079
- }
1080
- }
1081
- };
1082
- var checkExtendLockPeriod = (lockPeriodInDays, newUnlockAtInSecondTimestamp, prevUnlockAtInSecondTimestamp) => {
1083
- checkVesca(prevUnlockAtInSecondTimestamp);
1084
- if (lockPeriodInDays <= 0) {
1085
- throw new Error("Lock period must be greater than 0");
1086
- }
1087
- const isInitialLock = !prevUnlockAtInSecondTimestamp;
1088
- const isLockExpired = !isInitialLock && prevUnlockAtInSecondTimestamp * 1e3 <= (/* @__PURE__ */ new Date()).getTime();
1089
- if (isLockExpired) {
1090
- throw new Error("veSca is expired, use renewExpiredVeScaQuick instead");
1091
- }
1092
- if (prevUnlockAtInSecondTimestamp) {
1093
- const totalLockDuration = newUnlockAtInSecondTimestamp - prevUnlockAtInSecondTimestamp;
1094
- if (totalLockDuration > MAX_LOCK_DURATION - UNLOCK_ROUND_DURATION) {
1095
- throw new Error(
1096
- `Maximum lock period is ~4 years (${MAX_LOCK_ROUNDS - 1} days)`
1413
+ if (newUnlockAtInSecondTimestamp && lockPeriodInDays) {
1414
+ checkExtendLockPeriod(
1415
+ lockPeriodInDays,
1416
+ newUnlockAtInSecondTimestamp,
1417
+ prevUnlockAtInMillisTimestamp
1097
1418
  );
1098
1419
  }
1099
1420
  }
1100
1421
  };
1101
- var checkExtendLockAmount = (scaAmount, prevUnlockAtInSecondTimestamp) => {
1102
- checkVesca(prevUnlockAtInSecondTimestamp);
1422
+ var checkExtendLockAmount = (scaAmount, prevUnlockAtInMillisTimestamp) => {
1423
+ checkVesca(prevUnlockAtInMillisTimestamp);
1424
+ checkVescaExpired(prevUnlockAtInMillisTimestamp);
1103
1425
  if (scaAmount < MIN_TOP_UP_AMOUNT) {
1104
1426
  throw new Error("Minimum top up amount is 1 SCA");
1105
1427
  }
1106
- const isInitialLock = !prevUnlockAtInSecondTimestamp;
1107
- const isLockExpired = !isInitialLock && prevUnlockAtInSecondTimestamp * 1e3 <= (/* @__PURE__ */ new Date()).getTime();
1428
+ const isInitialLock = !prevUnlockAtInMillisTimestamp;
1429
+ const isLockExpired = !isInitialLock && prevUnlockAtInMillisTimestamp <= (/* @__PURE__ */ new Date()).getTime();
1108
1430
  if (isLockExpired) {
1109
1431
  throw new Error("veSca is expired, use renewExpiredVeScaQuick instead");
1110
1432
  }
1111
1433
  };
1112
- var checkRenewExpiredVeSca = (scaAmount, lockPeriodInDays, prevUnlockAtInSecondTimestamp) => {
1113
- checkVesca(prevUnlockAtInSecondTimestamp);
1434
+ var checkRenewExpiredVeSca = (scaAmount, lockPeriodInDays, prevUnlockAtInMillisTimestamp) => {
1435
+ if (!prevUnlockAtInMillisTimestamp || prevUnlockAtInMillisTimestamp > (/* @__PURE__ */ new Date()).getTime()) {
1436
+ throw new Error("Renew method can only be used for expired veSca");
1437
+ }
1114
1438
  if (scaAmount < MIN_INITIAL_LOCK_AMOUNT) {
1115
1439
  throw new Error("Minimum lock amount for renewing expired vesca 10 SCA");
1116
1440
  }
@@ -1121,11 +1445,6 @@ var checkRenewExpiredVeSca = (scaAmount, lockPeriodInDays, prevUnlockAtInSecondT
1121
1445
  );
1122
1446
  }
1123
1447
  };
1124
- var checkVesca = (prevUnlockAtInSecondTimestamp) => {
1125
- if (prevUnlockAtInSecondTimestamp === void 0) {
1126
- throw new Error("veSca not found");
1127
- }
1128
- };
1129
1448
 
1130
1449
  // src/utils/query.ts
1131
1450
  import BigNumber from "bignumber.js";
@@ -3202,6 +3521,7 @@ var getTotalValueLocked = async (query, indexer = false) => {
3202
3521
  import BigNumber5 from "bignumber.js";
3203
3522
  import { SUI_CLOCK_OBJECT_ID, SuiTxBlock as SuiTxBlock2 } from "@scallop-io/sui-kit";
3204
3523
  import { bcs } from "@mysten/sui.js/bcs";
3524
+ import { z as zod } from "zod";
3205
3525
  var getVescaKeys = async (query, ownerAddress) => {
3206
3526
  const owner = ownerAddress || query.suiKit.currentAddress();
3207
3527
  const veScaObjId = query.address.get("vesca.object");
@@ -3230,10 +3550,9 @@ var getVescaKeys = async (query, ownerAddress) => {
3230
3550
  };
3231
3551
  var getVeScas = async (query, ownerAddress) => {
3232
3552
  const keyObjectDatas = await getVescaKeys(query, ownerAddress);
3233
- const keyObjectId = keyObjectDatas.map((data) => data.objectId);
3234
- const veScas = Array(keyObjectId.length).fill(null);
3235
- const tasks = keyObjectId.map(async (keyId, idx) => {
3236
- const veSca = await getVeSca(query, keyId);
3553
+ const veScas = Array(keyObjectDatas.length).fill(null);
3554
+ const tasks = keyObjectDatas.map(async (veScaKey, idx) => {
3555
+ const veSca = await getVeSca(query, veScaKey);
3237
3556
  if (veSca) {
3238
3557
  veScas[idx] = veSca;
3239
3558
  }
@@ -3241,15 +3560,25 @@ var getVeScas = async (query, ownerAddress) => {
3241
3560
  await Promise.allSettled(tasks);
3242
3561
  return veScas.filter(Boolean).sort((a, b) => b.currentVeScaBalance - a.currentVeScaBalance);
3243
3562
  };
3244
- var getVeSca = async (query, veScaKeyId, ownerAddress) => {
3563
+ var SuiObjectRefZod = zod.object({
3564
+ objectId: zod.string(),
3565
+ digest: zod.string(),
3566
+ version: zod.string()
3567
+ });
3568
+ var getVeSca = async (query, veScaKey, ownerAddress) => {
3245
3569
  const tableId = query.address.get(`vesca.tableId`);
3246
- veScaKeyId = veScaKeyId || (await getVescaKeys(query, ownerAddress))[0].objectId;
3570
+ veScaKey = veScaKey || (await getVescaKeys(query, ownerAddress))[0];
3571
+ if (!veScaKey)
3572
+ return void 0;
3573
+ if (typeof veScaKey === "object") {
3574
+ veScaKey = SuiObjectRefZod.parse(veScaKey);
3575
+ }
3247
3576
  let vesca = void 0;
3248
3577
  const veScaDynamicFieldObjectResponse = await query.cache.queryGetDynamicFieldObject({
3249
3578
  parentId: tableId,
3250
3579
  name: {
3251
3580
  type: "0x2::object::ID",
3252
- value: veScaKeyId
3581
+ value: typeof veScaKey === "string" ? veScaKey : veScaKey.objectId
3253
3582
  }
3254
3583
  });
3255
3584
  const veScaDynamicFieldObject = veScaDynamicFieldObjectResponse.data;
@@ -3264,7 +3593,9 @@ var getVeSca = async (query, veScaKeyId, ownerAddress) => {
3264
3593
  const currentVeScaBalance = lockedScaCoin * (Math.floor(remainingLockPeriodInMilliseconds / 1e3) / MAX_LOCK_DURATION);
3265
3594
  vesca = {
3266
3595
  id: veScaDynamicFieldObject.objectId,
3267
- keyId: veScaKeyId,
3596
+ keyId: typeof veScaKey === "string" ? veScaKey : veScaKey.objectId,
3597
+ keyObject: typeof veScaKey === "string" ? void 0 : veScaKey,
3598
+ object: SuiObjectRefZod.parse(veScaDynamicFieldObjectResponse.data),
3268
3599
  lockedScaAmount,
3269
3600
  lockedScaCoin,
3270
3601
  currentVeScaBalance,
@@ -3273,10 +3604,10 @@ var getVeSca = async (query, veScaKeyId, ownerAddress) => {
3273
3604
  }
3274
3605
  return vesca;
3275
3606
  };
3276
- var getTotalVeScaTreasuryAmount = async (query) => {
3607
+ var getTotalVeScaTreasuryAmount = async (query, veScaTreasury) => {
3277
3608
  const veScaPkgId = query.address.get("vesca.id");
3278
3609
  const veScaConfig = query.address.get("vesca.config");
3279
- const veScaTreasury = query.address.get("vesca.treasury");
3610
+ veScaTreasury = veScaTreasury ?? query.address.get("vesca.treasury");
3280
3611
  const refreshQueryTarget = `${veScaPkgId}::treasury::refresh`;
3281
3612
  const refreshArgs = [veScaConfig, veScaTreasury, SUI_CLOCK_OBJECT_ID];
3282
3613
  const veScaAmountQueryTarget = `${veScaPkgId}::treasury::total_ve_sca_amount`;
@@ -3312,8 +3643,7 @@ var getTotalVeScaTreasuryAmount = async (query) => {
3312
3643
  ],
3313
3644
  queryFn: async () => {
3314
3645
  return await query.suiKit.inspectTxn(txBytes);
3315
- },
3316
- staleTime: 8e3
3646
+ }
3317
3647
  });
3318
3648
  const results = res.results;
3319
3649
  if (results && results[1].returnValues) {
@@ -3323,6 +3653,30 @@ var getTotalVeScaTreasuryAmount = async (query) => {
3323
3653
  }
3324
3654
  return "0";
3325
3655
  };
3656
+ var getVeScaTreasuryInfo = async (query) => {
3657
+ const veScaTreasuryId = query.address.get("vesca.treasury");
3658
+ const veScaTreasury = await query.cache.queryGetObject(veScaTreasuryId, {
3659
+ showContent: true
3660
+ });
3661
+ if (!veScaTreasury || veScaTreasury.data?.content?.dataType !== "moveObject")
3662
+ return null;
3663
+ const treasuryFields = veScaTreasury.data.content.fields;
3664
+ console.log(treasuryFields);
3665
+ const totalLockedSca = BigNumber5(
3666
+ treasuryFields.unlock_schedule.fields.locked_sca_amount
3667
+ ).shiftedBy(-9).toNumber();
3668
+ const totalVeSca = BigNumber5(
3669
+ await getTotalVeScaTreasuryAmount(query, veScaTreasury.data) ?? 0
3670
+ ).shiftedBy(-9).toNumber();
3671
+ const averageLockingPeriod = totalLockedSca > 0 ? totalVeSca / totalLockedSca * 4 : 0;
3672
+ const averageLockingPeriodUnit = "year";
3673
+ return {
3674
+ totalLockedSca,
3675
+ totalVeSca,
3676
+ averageLockingPeriod,
3677
+ averageLockingPeriodUnit
3678
+ };
3679
+ };
3326
3680
 
3327
3681
  // src/queries/referralQuery.ts
3328
3682
  var queryVeScaKeyIdFromReferralBindings = async (query, refereeAddress) => {
@@ -3340,6 +3694,57 @@ var queryVeScaKeyIdFromReferralBindings = async (query, refereeAddress) => {
3340
3694
  return fields.value;
3341
3695
  };
3342
3696
 
3697
+ // src/queries/loyaltyProgramQuery.ts
3698
+ import BigNumber6 from "bignumber.js";
3699
+ import { z as zod2 } from "zod";
3700
+ var rewardPoolFieldsZod = zod2.object({
3701
+ balance: zod2.string(),
3702
+ enable_claim: zod2.boolean()
3703
+ }).transform((value) => ({
3704
+ totalPoolReward: BigNumber6(value.balance).shiftedBy(-9).toNumber(),
3705
+ isClaimEnabled: value.enable_claim
3706
+ }));
3707
+ var userRewardFieldsZod = zod2.object({
3708
+ value: zod2.string()
3709
+ }).transform((value) => BigNumber6(value.value).shiftedBy(-9).toNumber());
3710
+ var getLoyaltyProgramInformations = async (query, veScaKey) => {
3711
+ const rewardPool = query.address.get("loyaltyProgram.rewardPool");
3712
+ const rewardPoolObject = await query.cache.queryGetObject(rewardPool, {
3713
+ showContent: true
3714
+ });
3715
+ if (rewardPoolObject.data?.content?.dataType !== "moveObject")
3716
+ return null;
3717
+ const rewardPoolFields = rewardPoolObject.data.content.fields;
3718
+ const { isClaimEnabled, totalPoolReward } = rewardPoolFieldsZod.parse(
3719
+ rewardPoolFields
3720
+ );
3721
+ const result = {
3722
+ pendingReward: 0,
3723
+ totalPoolReward,
3724
+ isClaimEnabled
3725
+ };
3726
+ veScaKey = veScaKey || (await query.getVeScas())[0]?.keyObject;
3727
+ if (!veScaKey)
3728
+ return result;
3729
+ const userRewardTableId = query.address.get(
3730
+ "loyaltyProgram.userRewardTableId"
3731
+ );
3732
+ const userRewardObject = await query.cache.queryGetDynamicFieldObject({
3733
+ parentId: userRewardTableId,
3734
+ name: {
3735
+ type: "0x2::object::ID",
3736
+ value: typeof veScaKey === "string" ? veScaKey : veScaKey.objectId
3737
+ }
3738
+ });
3739
+ if (userRewardObject.data?.content?.dataType !== "moveObject")
3740
+ return result;
3741
+ const userRewardFields = userRewardObject.data.content.fields;
3742
+ result.pendingReward = userRewardFieldsZod.parse(
3743
+ userRewardFields
3744
+ );
3745
+ return result;
3746
+ };
3747
+
3343
3748
  // src/models/scallopIndexer.ts
3344
3749
  import axios2 from "axios";
3345
3750
  var ScallopIndexer = class {
@@ -3886,11 +4291,11 @@ var ScallopQuery = class {
3886
4291
  * Get total vesca treasury with movecall
3887
4292
  * @returns Promise<string | undefined>
3888
4293
  */
3889
- async getTotalVeScaTreasuryAmount() {
3890
- return await getTotalVeScaTreasuryAmount(this);
4294
+ async getVeScaTreasuryInfo() {
4295
+ return await getVeScaTreasuryInfo(this);
3891
4296
  }
3892
4297
  /**
3893
- * Return binded veScaKeyId of walletAddress if exist
4298
+ * Return binded referrer veScaKeyId of referee walletAddress if exist
3894
4299
  * @param walletAddress
3895
4300
  * @returns veScaKeyId
3896
4301
  */
@@ -3913,6 +4318,14 @@ var ScallopQuery = class {
3913
4318
  async getBindedVeScaKey(obligationId) {
3914
4319
  return await getBindedVeScaKey(this, obligationId);
3915
4320
  }
4321
+ /**
4322
+ * Get user's veSCA loyalty program informations
4323
+ * @param walletAddress
4324
+ * @returns Loyalty program information
4325
+ */
4326
+ async getLoyaltyProgramInfos(veScaKey) {
4327
+ return await getLoyaltyProgramInformations(this, veScaKey);
4328
+ }
3916
4329
  };
3917
4330
 
3918
4331
  // src/constants/pyth.ts
@@ -4264,9 +4677,9 @@ var ScallopUtils = class {
4264
4677
  * @param unlockAtInSecondTimestamp The unlock timestamp from veSca object.
4265
4678
  * @return New unlock at in seconds timestamp.
4266
4679
  */
4267
- getUnlockAt(extendLockPeriodInDay, unlockAtInSecondTimestamp) {
4680
+ getUnlockAt(extendLockPeriodInDay, unlockAtInMillisTimestamp) {
4268
4681
  const now = Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
4269
- const remainingLockPeriod = unlockAtInSecondTimestamp ? Math.max(unlockAtInSecondTimestamp - now, 0) : 0;
4682
+ const remainingLockPeriod = unlockAtInMillisTimestamp ? Math.max(Math.floor(unlockAtInMillisTimestamp / 1e3) - now, 0) : 0;
4270
4683
  let newUnlockAtInSecondTimestamp = 0;
4271
4684
  if (remainingLockPeriod === 0) {
4272
4685
  const lockPeriod = (extendLockPeriodInDay ?? 1) * UNLOCK_ROUND_DURATION;
@@ -5166,7 +5579,10 @@ var generateQuickVeScaMethod = ({
5166
5579
  },
5167
5580
  extendLockPeriodQuick: async (lockPeriodInDays, veScaKey, autoCheck = true) => {
5168
5581
  const veSca = await requireVeSca(builder, txBlock, veScaKey);
5169
- const newUnlockAt = builder.utils.getUnlockAt(lockPeriodInDays);
5582
+ const newUnlockAt = builder.utils.getUnlockAt(
5583
+ lockPeriodInDays,
5584
+ veSca?.unlockAt
5585
+ );
5170
5586
  if (autoCheck)
5171
5587
  checkExtendLockPeriod(lockPeriodInDays, newUnlockAt, veSca?.unlockAt);
5172
5588
  if (veSca) {
@@ -5636,12 +6052,90 @@ var newReferralTxBlock = (builder, initTxBlock) => {
5636
6052
  });
5637
6053
  };
5638
6054
 
6055
+ // src/builders/loyaltyProgramBuilder.ts
6056
+ import { TransactionBlock as TransactionBlock6 } from "@mysten/sui.js/transactions";
6057
+ import { SuiTxBlock as SuiKitTxBlock6 } from "@scallop-io/sui-kit";
6058
+ var generateLoyaltyProgramNormalMethod = ({ builder, txBlock }) => {
6059
+ const loyaltyProgramIds = {
6060
+ loyaltyProgramPkgId: builder.address.get("loyaltyProgram.id"),
6061
+ rewardPool: builder.address.get("loyaltyProgram.rewardPool"),
6062
+ userRewardTableId: builder.address.get(
6063
+ "loyaltyProgram.userRewardTableId"
6064
+ )
6065
+ };
6066
+ return {
6067
+ claimLoyaltyRevenue: (veScaKey) => {
6068
+ return txBlock.moveCall(
6069
+ `${loyaltyProgramIds.loyaltyProgramPkgId}::reward_pool::redeem_reward`,
6070
+ [loyaltyProgramIds.rewardPool, veScaKey]
6071
+ );
6072
+ }
6073
+ };
6074
+ };
6075
+ var generateLoyaltyProgramQuickMethod = ({
6076
+ builder,
6077
+ txBlock
6078
+ }) => {
6079
+ return {
6080
+ claimLoyaltyRevenueQuick: async (veScaKey) => {
6081
+ veScaKey = veScaKey || (await builder.query.getVeScas())[0]?.keyObject;
6082
+ const sender = requireSender(txBlock);
6083
+ if (!veScaKey)
6084
+ throw new Error(`No veScaKey found for user ${sender}`);
6085
+ const toTransferObject = [];
6086
+ const rewardCoin = txBlock.claimLoyaltyRevenue(veScaKey);
6087
+ try {
6088
+ const existingScaCoin = await builder.suiKit.suiInteractor.selectCoins(
6089
+ sender,
6090
+ Infinity,
6091
+ coinIds.sca
6092
+ );
6093
+ txBlock.mergeCoins(rewardCoin, existingScaCoin);
6094
+ } catch (e) {
6095
+ } finally {
6096
+ toTransferObject.push(rewardCoin);
6097
+ }
6098
+ if (toTransferObject.length > 0) {
6099
+ txBlock.transferObjects(toTransferObject, sender);
6100
+ }
6101
+ }
6102
+ };
6103
+ };
6104
+ var newLoyaltyProgramTxBlock = (builder, initTxBlock) => {
6105
+ const txBlock = initTxBlock instanceof TransactionBlock6 ? new SuiKitTxBlock6(initTxBlock) : initTxBlock ? initTxBlock : new SuiKitTxBlock6();
6106
+ const normalMethod = generateLoyaltyProgramNormalMethod({
6107
+ builder,
6108
+ txBlock
6109
+ });
6110
+ const normalTxBlock = new Proxy(txBlock, {
6111
+ get: (target, prop) => {
6112
+ if (prop in normalMethod) {
6113
+ return Reflect.get(normalMethod, prop);
6114
+ }
6115
+ return Reflect.get(target, prop);
6116
+ }
6117
+ });
6118
+ const quickMethod = generateLoyaltyProgramQuickMethod({
6119
+ builder,
6120
+ txBlock: normalTxBlock
6121
+ });
6122
+ return new Proxy(normalTxBlock, {
6123
+ get: (target, prop) => {
6124
+ if (prop in quickMethod) {
6125
+ return Reflect.get(quickMethod, prop);
6126
+ }
6127
+ return Reflect.get(target, prop);
6128
+ }
6129
+ });
6130
+ };
6131
+
5639
6132
  // src/builders/index.ts
5640
6133
  var newScallopTxBlock = (builder, initTxBlock) => {
5641
6134
  const vescaTxBlock = newVeScaTxBlock(builder, initTxBlock);
6135
+ const loyaltyTxBlock = newLoyaltyProgramTxBlock(builder, vescaTxBlock);
5642
6136
  const borrowIncentiveTxBlock = newBorrowIncentiveTxBlock(
5643
6137
  builder,
5644
- vescaTxBlock
6138
+ loyaltyTxBlock
5645
6139
  );
5646
6140
  const referralTxBlock = newReferralTxBlock(builder, borrowIncentiveTxBlock);
5647
6141
  const spoolTxBlock = newSpoolTxBlock(builder, referralTxBlock);
@@ -5656,6 +6150,8 @@ var newScallopTxBlock = (builder, initTxBlock) => {
5656
6150
  return Reflect.get(referralTxBlock, prop);
5657
6151
  } else if (prop in spoolTxBlock) {
5658
6152
  return Reflect.get(spoolTxBlock, prop);
6153
+ } else if (prop in loyaltyTxBlock) {
6154
+ return Reflect.get(loyaltyTxBlock, prop);
5659
6155
  }
5660
6156
  return Reflect.get(target, prop);
5661
6157
  }