@glowlabs-org/utils 0.2.168 → 0.2.169

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.
@@ -3496,6 +3496,7 @@ function ControlRouter(baseUrl) {
3496
3496
  let isRetryingFailedOperation = false;
3497
3497
  let isPayingProtocolDepositUsingStakedControl = false;
3498
3498
  let isMigratingUser = false;
3499
+ let isDelegatingSgctl = false;
3499
3500
  const stakeGctl = async (stakeRequest) => {
3500
3501
  isStaking = true;
3501
3502
  try {
@@ -3707,6 +3708,99 @@ function ControlRouter(baseUrl) {
3707
3708
  throw new Error(parseApiError$4(error));
3708
3709
  }
3709
3710
  };
3711
+ const delegateSgctl = async (delegationRequest) => {
3712
+ isDelegatingSgctl = true;
3713
+ try {
3714
+ sentryAddBreadcrumb({
3715
+ category: "control-api",
3716
+ message: "POST /delegate-sgctl",
3717
+ level: "info",
3718
+ data: {
3719
+ baseUrl,
3720
+ wallet: delegationRequest.wallet,
3721
+ applicationId: delegationRequest.applicationId,
3722
+ fractionId: delegationRequest.fractionId,
3723
+ amount: delegationRequest.amount,
3724
+ },
3725
+ });
3726
+ const response = await request(`/delegate-sgctl`, {
3727
+ method: "POST",
3728
+ headers: { "Content-Type": "application/json" },
3729
+ body: JSON.stringify(delegationRequest),
3730
+ });
3731
+ return response;
3732
+ }
3733
+ catch (error) {
3734
+ sentryCaptureException(error, {
3735
+ action: "delegateSgctl",
3736
+ baseUrl,
3737
+ wallet: delegationRequest.wallet,
3738
+ applicationId: delegationRequest.applicationId,
3739
+ fractionId: delegationRequest.fractionId,
3740
+ amount: delegationRequest.amount,
3741
+ });
3742
+ throw new Error(parseApiError$4(error));
3743
+ }
3744
+ finally {
3745
+ isDelegatingSgctl = false;
3746
+ }
3747
+ };
3748
+ const refundDelegation = async (refundRequest) => {
3749
+ try {
3750
+ sentryAddBreadcrumb({
3751
+ category: "control-api",
3752
+ message: "POST /delegate-sgctl/refund",
3753
+ level: "info",
3754
+ data: {
3755
+ baseUrl,
3756
+ fractionId: refundRequest.fractionId,
3757
+ },
3758
+ });
3759
+ const response = await request(`/delegate-sgctl/refund`, {
3760
+ method: "POST",
3761
+ headers: { "Content-Type": "application/json" },
3762
+ body: JSON.stringify(refundRequest),
3763
+ });
3764
+ return response;
3765
+ }
3766
+ catch (error) {
3767
+ sentryCaptureException(error, {
3768
+ action: "refundDelegation",
3769
+ baseUrl,
3770
+ fractionId: refundRequest.fractionId,
3771
+ });
3772
+ throw new Error(parseApiError$4(error));
3773
+ }
3774
+ };
3775
+ const finalizeDelegation = async (finalizeRequest) => {
3776
+ try {
3777
+ sentryAddBreadcrumb({
3778
+ category: "control-api",
3779
+ message: "POST /delegate-sgctl/finalize",
3780
+ level: "info",
3781
+ data: {
3782
+ baseUrl,
3783
+ fractionId: finalizeRequest.fractionId,
3784
+ farmId: finalizeRequest.farmId,
3785
+ },
3786
+ });
3787
+ const response = await request(`/delegate-sgctl/finalize`, {
3788
+ method: "POST",
3789
+ headers: { "Content-Type": "application/json" },
3790
+ body: JSON.stringify(finalizeRequest),
3791
+ });
3792
+ return response;
3793
+ }
3794
+ catch (error) {
3795
+ sentryCaptureException(error, {
3796
+ action: "finalizeDelegation",
3797
+ baseUrl,
3798
+ fractionId: finalizeRequest.fractionId,
3799
+ farmId: finalizeRequest.farmId,
3800
+ });
3801
+ throw new Error(parseApiError$4(error));
3802
+ }
3803
+ };
3710
3804
  // --------------------------- Public API ----------------------------------
3711
3805
  return {
3712
3806
  // Queries
@@ -3736,6 +3830,9 @@ function ControlRouter(baseUrl) {
3736
3830
  retryFailedOperation,
3737
3831
  payProtocolDepositUsingStakedControl,
3738
3832
  migrateUser,
3833
+ delegateSgctl,
3834
+ refundDelegation,
3835
+ finalizeDelegation,
3739
3836
  // Processing flags
3740
3837
  get isStaking() {
3741
3838
  return isStaking;
@@ -3755,6 +3852,9 @@ function ControlRouter(baseUrl) {
3755
3852
  get isMigratingUser() {
3756
3853
  return isMigratingUser;
3757
3854
  },
3855
+ get isDelegatingSgctl() {
3856
+ return isDelegatingSgctl;
3857
+ },
3758
3858
  };
3759
3859
  }
3760
3860
 
@@ -5231,4 +5331,4 @@ exports.useOffchainFractions = useOffchainFractions;
5231
5331
  exports.useRewardsKernel = useRewardsKernel;
5232
5332
  exports.waitForEthersTransactionWithRetry = waitForEthersTransactionWithRetry;
5233
5333
  exports.waitForViemTransactionWithRetry = waitForViemTransactionWithRetry;
5234
- //# sourceMappingURL=calculate-farm-efficiency-D-hx2uPV.js.map
5334
+ //# sourceMappingURL=calculate-farm-efficiency-BVpffn8k.js.map