anymal-protocol 1.0.128 → 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
@@ -2947,11 +2947,19 @@ function useCoinbaseClaimActionReward() {
2947
2947
  functionName,
2948
2948
  args
2949
2949
  });
2950
- await sendOperationFn(evmAddress, callData, validationContractAddress);
2951
- return { success: true, message: "Reward claimed", status };
2950
+ const opsRes = await sendOperationFn(
2951
+ evmAddress,
2952
+ callData,
2953
+ validationContractAddress
2954
+ );
2955
+ return { success: opsRes.success, message: opsRes.message, status };
2952
2956
  } catch (error) {
2953
2957
  console.error(error);
2954
- return { success: false, message: "Reward not claimed", status };
2958
+ return {
2959
+ success: false,
2960
+ message: "Reward not claimed",
2961
+ status: "error"
2962
+ };
2955
2963
  }
2956
2964
  },
2957
2965
  []
@@ -2972,21 +2980,30 @@ function useCoinbaseMintAnymalNFT() {
2972
2980
  status: "error"
2973
2981
  };
2974
2982
  }
2975
- const functionName = "submitMetadataByCampaignName";
2976
- const args = [
2977
- pid,
2978
- nftId,
2979
- `https://dev-nft.petastic.com/metadata/${nftId}`,
2980
- "petastic-signup-campaign-1",
2981
- anymalTxId
2982
- ];
2983
- const callData = (0, import_viem3.encodeFunctionData)({
2984
- abi: PET_NFT_ABI,
2985
- functionName,
2986
- args
2987
- });
2988
- await sendOperationFn(evmAddress, callData, validationContractAddress);
2989
- 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
+ }
2990
3007
  },
2991
3008
  []
2992
3009
  );
package/dist/index.mjs CHANGED
@@ -2869,11 +2869,19 @@ function useCoinbaseClaimActionReward() {
2869
2869
  functionName,
2870
2870
  args
2871
2871
  });
2872
- await sendOperationFn(evmAddress, callData, validationContractAddress);
2873
- return { success: true, message: "Reward claimed", status };
2872
+ const opsRes = await sendOperationFn(
2873
+ evmAddress,
2874
+ callData,
2875
+ validationContractAddress
2876
+ );
2877
+ return { success: opsRes.success, message: opsRes.message, status };
2874
2878
  } catch (error) {
2875
2879
  console.error(error);
2876
- return { success: false, message: "Reward not claimed", status };
2880
+ return {
2881
+ success: false,
2882
+ message: "Reward not claimed",
2883
+ status: "error"
2884
+ };
2877
2885
  }
2878
2886
  },
2879
2887
  []
@@ -2894,21 +2902,30 @@ function useCoinbaseMintAnymalNFT() {
2894
2902
  status: "error"
2895
2903
  };
2896
2904
  }
2897
- const functionName = "submitMetadataByCampaignName";
2898
- const args = [
2899
- pid,
2900
- nftId,
2901
- `https://dev-nft.petastic.com/metadata/${nftId}`,
2902
- "petastic-signup-campaign-1",
2903
- anymalTxId
2904
- ];
2905
- const callData = encodeFunctionData2({
2906
- abi: PET_NFT_ABI,
2907
- functionName,
2908
- args
2909
- });
2910
- await sendOperationFn(evmAddress, callData, validationContractAddress);
2911
- 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
+ }
2912
2929
  },
2913
2930
  []
2914
2931
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.128",
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": {