anymal-protocol 1.0.127 → 1.0.129

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
@@ -2939,15 +2939,28 @@ function useCoinbaseClaimActionReward() {
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
+ const opsRes = await sendOperationFn(
2951
+ evmAddress,
2952
+ callData,
2953
+ validationContractAddress
2954
+ );
2955
+ return { success: opsRes.success, message: opsRes.message, status };
2956
+ } catch (error) {
2957
+ console.error(error);
2958
+ return {
2959
+ success: false,
2960
+ message: "Reward not claimed",
2961
+ status: "error"
2962
+ };
2963
+ }
2951
2964
  },
2952
2965
  []
2953
2966
  );
@@ -2967,21 +2980,30 @@ function useCoinbaseMintAnymalNFT() {
2967
2980
  status: "error"
2968
2981
  };
2969
2982
  }
2970
- const functionName = "submitMetadataByCampaignName";
2971
- const args = [
2972
- pid,
2973
- nftId,
2974
- `https://dev-nft.petastic.com/metadata/${nftId}`,
2975
- "petastic-signup-campaign-1",
2976
- anymalTxId
2977
- ];
2978
- const callData = (0, import_viem3.encodeFunctionData)({
2979
- abi: PET_NFT_ABI,
2980
- functionName,
2981
- args
2982
- });
2983
- await sendOperationFn(evmAddress, callData, validationContractAddress);
2984
- return { success: true, message: "Pet Passport Created", status };
2983
+ try {
2984
+ const functionName = "submitMetadataByCampaignName";
2985
+ const args = [
2986
+ pid,
2987
+ nftId,
2988
+ `https://dev-nft.petastic.com/metadata/${nftId}`,
2989
+ "petastic-signup-campaign-1",
2990
+ anymalTxId
2991
+ ];
2992
+ const callData = (0, import_viem3.encodeFunctionData)({
2993
+ abi: PET_NFT_ABI,
2994
+ functionName,
2995
+ args
2996
+ });
2997
+ const opsRes = await sendOperationFn(
2998
+ evmAddress,
2999
+ callData,
3000
+ validationContractAddress
3001
+ );
3002
+ return { success: opsRes.success, message: opsRes.message, status };
3003
+ } catch (error) {
3004
+ console.error(error);
3005
+ return { success: false, message: "Error", status: "error" };
3006
+ }
2985
3007
  },
2986
3008
  []
2987
3009
  );
package/dist/index.mjs CHANGED
@@ -2861,15 +2861,28 @@ function useCoinbaseClaimActionReward() {
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
+ const opsRes = await sendOperationFn(
2873
+ evmAddress,
2874
+ callData,
2875
+ validationContractAddress
2876
+ );
2877
+ return { success: opsRes.success, message: opsRes.message, status };
2878
+ } catch (error) {
2879
+ console.error(error);
2880
+ return {
2881
+ success: false,
2882
+ message: "Reward not claimed",
2883
+ status: "error"
2884
+ };
2885
+ }
2873
2886
  },
2874
2887
  []
2875
2888
  );
@@ -2889,21 +2902,30 @@ function useCoinbaseMintAnymalNFT() {
2889
2902
  status: "error"
2890
2903
  };
2891
2904
  }
2892
- const functionName = "submitMetadataByCampaignName";
2893
- const args = [
2894
- pid,
2895
- nftId,
2896
- `https://dev-nft.petastic.com/metadata/${nftId}`,
2897
- "petastic-signup-campaign-1",
2898
- anymalTxId
2899
- ];
2900
- const callData = encodeFunctionData2({
2901
- abi: PET_NFT_ABI,
2902
- functionName,
2903
- args
2904
- });
2905
- await sendOperationFn(evmAddress, callData, validationContractAddress);
2906
- return { success: true, message: "Pet Passport Created", status };
2905
+ try {
2906
+ const functionName = "submitMetadataByCampaignName";
2907
+ const args = [
2908
+ pid,
2909
+ nftId,
2910
+ `https://dev-nft.petastic.com/metadata/${nftId}`,
2911
+ "petastic-signup-campaign-1",
2912
+ anymalTxId
2913
+ ];
2914
+ const callData = encodeFunctionData2({
2915
+ abi: PET_NFT_ABI,
2916
+ functionName,
2917
+ args
2918
+ });
2919
+ const opsRes = await sendOperationFn(
2920
+ evmAddress,
2921
+ callData,
2922
+ validationContractAddress
2923
+ );
2924
+ return { success: opsRes.success, message: opsRes.message, status };
2925
+ } catch (error) {
2926
+ console.error(error);
2927
+ return { success: false, message: "Error", status: "error" };
2928
+ }
2907
2929
  },
2908
2930
  []
2909
2931
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.127",
3
+ "version": "1.0.129",
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": {