anymal-protocol 1.0.139 → 1.0.141

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
@@ -3043,52 +3043,29 @@ function useCoinbaseCreateOrganizationWallet() {
3043
3043
  status: "error"
3044
3044
  };
3045
3045
  }
3046
- const result = await sendOperationFn(
3047
- evmAddress,
3048
- orgContractAddress,
3049
- ORGANIZATION_BEACON_ABI,
3050
- "createOrganizationProxy",
3051
- [ownerAddress, orgName, orgPid]
3052
- );
3053
- if (!result.success) {
3054
- return { ...result, status: "error" };
3055
- }
3056
- let proxyAddress;
3057
3046
  try {
3058
- const txHash = data?.receipts?.[0]?.transactionHash || data?.transactionHash;
3059
- if (txHash) {
3060
- const receipt = await publicClient.getTransactionReceipt({
3061
- hash: txHash
3062
- });
3063
- for (const log of receipt.logs) {
3064
- try {
3065
- const decoded = (0, import_viem3.decodeEventLog)({
3066
- abi: ORGANIZATION_BEACON_ABI,
3067
- data: log.data,
3068
- topics: log.topics
3069
- });
3070
- if (decoded.eventName === "NewOrganizationCreated") {
3071
- proxyAddress = decoded.args.proxyAddress;
3072
- break;
3073
- }
3074
- } catch {
3075
- }
3076
- }
3047
+ const result = await sendOperationFn(
3048
+ evmAddress,
3049
+ orgContractAddress,
3050
+ ORGANIZATION_BEACON_ABI,
3051
+ "createOrganizationProxy",
3052
+ [ownerAddress, orgName, orgPid]
3053
+ );
3054
+ if (!result.success) {
3055
+ return { ...result, status: "error" };
3077
3056
  }
3078
- } catch (e) {
3079
- console.error("Failed to get transaction receipt:", e);
3080
- }
3081
- if (!proxyAddress) {
3082
3057
  return {
3083
3058
  ...result,
3084
3059
  status
3085
3060
  };
3061
+ } catch (error) {
3062
+ console.error("Org wallet creation error", error);
3063
+ return {
3064
+ success: false,
3065
+ message: "Error",
3066
+ status: "error"
3067
+ };
3086
3068
  }
3087
- return {
3088
- ...result,
3089
- proxyAddress,
3090
- status
3091
- };
3092
3069
  },
3093
3070
  [sendOperationFn, data, publicClient, status]
3094
3071
  );
package/dist/index.mjs CHANGED
@@ -2934,7 +2934,7 @@ function useCoinbaseMintAnymalNFT() {
2934
2934
 
2935
2935
  // src/utils/coinbase/useCoinbaseCreateOrganizationWallet.ts
2936
2936
  import { useCallback as useCallback13, useMemo as useMemo2 } from "react";
2937
- import { createPublicClient as createPublicClient2, decodeEventLog, http as http2 } from "viem";
2937
+ import { createPublicClient as createPublicClient2, http as http2 } from "viem";
2938
2938
  import { baseSepolia as baseSepolia2 } from "viem/chains";
2939
2939
  function useCoinbaseCreateOrganizationWallet() {
2940
2940
  const { sendOperationFn, data, status } = useSendCoinbaseUserOperation();
@@ -2964,52 +2964,29 @@ function useCoinbaseCreateOrganizationWallet() {
2964
2964
  status: "error"
2965
2965
  };
2966
2966
  }
2967
- const result = await sendOperationFn(
2968
- evmAddress,
2969
- orgContractAddress,
2970
- ORGANIZATION_BEACON_ABI,
2971
- "createOrganizationProxy",
2972
- [ownerAddress, orgName, orgPid]
2973
- );
2974
- if (!result.success) {
2975
- return { ...result, status: "error" };
2976
- }
2977
- let proxyAddress;
2978
2967
  try {
2979
- const txHash = data?.receipts?.[0]?.transactionHash || data?.transactionHash;
2980
- if (txHash) {
2981
- const receipt = await publicClient.getTransactionReceipt({
2982
- hash: txHash
2983
- });
2984
- for (const log of receipt.logs) {
2985
- try {
2986
- const decoded = decodeEventLog({
2987
- abi: ORGANIZATION_BEACON_ABI,
2988
- data: log.data,
2989
- topics: log.topics
2990
- });
2991
- if (decoded.eventName === "NewOrganizationCreated") {
2992
- proxyAddress = decoded.args.proxyAddress;
2993
- break;
2994
- }
2995
- } catch {
2996
- }
2997
- }
2968
+ const result = await sendOperationFn(
2969
+ evmAddress,
2970
+ orgContractAddress,
2971
+ ORGANIZATION_BEACON_ABI,
2972
+ "createOrganizationProxy",
2973
+ [ownerAddress, orgName, orgPid]
2974
+ );
2975
+ if (!result.success) {
2976
+ return { ...result, status: "error" };
2998
2977
  }
2999
- } catch (e) {
3000
- console.error("Failed to get transaction receipt:", e);
3001
- }
3002
- if (!proxyAddress) {
3003
2978
  return {
3004
2979
  ...result,
3005
2980
  status
3006
2981
  };
2982
+ } catch (error) {
2983
+ console.error("Org wallet creation error", error);
2984
+ return {
2985
+ success: false,
2986
+ message: "Error",
2987
+ status: "error"
2988
+ };
3007
2989
  }
3008
- return {
3009
- ...result,
3010
- proxyAddress,
3011
- status
3012
- };
3013
2990
  },
3014
2991
  [sendOperationFn, data, publicClient, status]
3015
2992
  );
@@ -3527,7 +3504,7 @@ function useApproveKibbleToken() {
3527
3504
 
3528
3505
  // src/utils/organization/useCreateOrganizationBase.ts
3529
3506
  import { useCallback as useCallback19 } from "react";
3530
- import { decodeEventLog as decodeEventLog2, encodeFunctionData as encodeFunctionData5 } from "viem";
3507
+ import { decodeEventLog, encodeFunctionData as encodeFunctionData5 } from "viem";
3531
3508
  function useCreateOrganizationBase() {
3532
3509
  return useCallback19(
3533
3510
  /**
@@ -3589,7 +3566,7 @@ function useCreateOrganizationBase() {
3589
3566
  let proxyAddress;
3590
3567
  for (const log of txReceipt.logs) {
3591
3568
  try {
3592
- const decoded = decodeEventLog2({
3569
+ const decoded = decodeEventLog({
3593
3570
  abi: ORGANIZATION_BEACON_ABI,
3594
3571
  data: log.data,
3595
3572
  topics: log.topics
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.139",
3
+ "version": "1.0.141",
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": {