anymal-protocol 1.0.126 → 1.0.128

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/dist/index.js CHANGED
@@ -2935,19 +2935,24 @@ function useCoinbaseClaimActionReward() {
2935
2935
  if (!evmAddress || !actionId || claimIndex === void 0 || !validationContractAddress) {
2936
2936
  return {
2937
2937
  success: false,
2938
- message: "Missing information",
2938
+ message: "Missing important data",
2939
2939
  status: "error"
2940
2940
  };
2941
2941
  }
2942
- const args = [actionId, claimIndex];
2943
- const functionName = "claimByIndex";
2944
- const callData = (0, import_viem2.encodeFunctionData)({
2945
- abi: REWARDABLE_ACTIONS_ABI,
2946
- functionName,
2947
- args
2948
- });
2949
- await sendOperationFn(evmAddress, callData, validationContractAddress);
2950
- return { success: true, message: "Reward claimed", status };
2942
+ try {
2943
+ const args = [actionId, claimIndex];
2944
+ const functionName = "claimByIndex";
2945
+ const callData = (0, import_viem2.encodeFunctionData)({
2946
+ abi: REWARDABLE_ACTIONS_ABI,
2947
+ functionName,
2948
+ args
2949
+ });
2950
+ await sendOperationFn(evmAddress, callData, validationContractAddress);
2951
+ return { success: true, message: "Reward claimed", status };
2952
+ } catch (error) {
2953
+ console.error(error);
2954
+ return { success: false, message: "Reward not claimed", status };
2955
+ }
2951
2956
  },
2952
2957
  []
2953
2958
  );
package/dist/index.mjs CHANGED
@@ -2857,19 +2857,24 @@ function useCoinbaseClaimActionReward() {
2857
2857
  if (!evmAddress || !actionId || claimIndex === void 0 || !validationContractAddress) {
2858
2858
  return {
2859
2859
  success: false,
2860
- message: "Missing information",
2860
+ message: "Missing important data",
2861
2861
  status: "error"
2862
2862
  };
2863
2863
  }
2864
- const args = [actionId, claimIndex];
2865
- const functionName = "claimByIndex";
2866
- const callData = encodeFunctionData({
2867
- abi: REWARDABLE_ACTIONS_ABI,
2868
- functionName,
2869
- args
2870
- });
2871
- await sendOperationFn(evmAddress, callData, validationContractAddress);
2872
- return { success: true, message: "Reward claimed", status };
2864
+ try {
2865
+ const args = [actionId, claimIndex];
2866
+ const functionName = "claimByIndex";
2867
+ const callData = encodeFunctionData({
2868
+ abi: REWARDABLE_ACTIONS_ABI,
2869
+ functionName,
2870
+ args
2871
+ });
2872
+ await sendOperationFn(evmAddress, callData, validationContractAddress);
2873
+ return { success: true, message: "Reward claimed", status };
2874
+ } catch (error) {
2875
+ console.error(error);
2876
+ return { success: false, message: "Reward not claimed", status };
2877
+ }
2873
2878
  },
2874
2879
  []
2875
2880
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.126",
3
+ "version": "1.0.128",
4
4
  "description": "A React/TypeScript-based utility library for reusable functions and hooks inside of the Anymal Ecosystem.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {