anymal-protocol 1.0.39 → 1.0.41

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.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- declare function useVerifyAccount(): (pid: string, dbAuthToken: string, bundlerClient: any, smartAccount: any, accountRewardsContractAddress: `0x${string}`) => Promise<{
1
+ declare function useVerifyAccount(): (pid: string, isCampaign: boolean, dbAuthToken: string, bundlerClient: any, smartAccount: any, accountRewardsContractAddress: `0x${string}`) => Promise<{
2
2
  success: boolean;
3
3
  message: string;
4
4
  }>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare function useVerifyAccount(): (pid: string, dbAuthToken: string, bundlerClient: any, smartAccount: any, accountRewardsContractAddress: `0x${string}`) => Promise<{
1
+ declare function useVerifyAccount(): (pid: string, isCampaign: boolean, dbAuthToken: string, bundlerClient: any, smartAccount: any, accountRewardsContractAddress: `0x${string}`) => Promise<{
2
2
  success: boolean;
3
3
  message: string;
4
4
  }>;
package/dist/index.js CHANGED
@@ -70,7 +70,7 @@ var MARKETPLACE_ABI = [{ "inputs": [{ "internalType": "address", "name": "target
70
70
  // src/utils/account/useVerifyAccount.ts
71
71
  function useVerifyAccount() {
72
72
  return (0, import_react.useCallback)(
73
- async (pid, dbAuthToken, bundlerClient, smartAccount, accountRewardsContractAddress) => {
73
+ async (pid, isCampaign, dbAuthToken, bundlerClient, smartAccount, accountRewardsContractAddress) => {
74
74
  if (!dbAuthToken || !bundlerClient || !smartAccount || !accountRewardsContractAddress || !pid) {
75
75
  return {
76
76
  success: false,
@@ -80,7 +80,7 @@ function useVerifyAccount() {
80
80
  const callData = (0, import_viem.encodeFunctionData)({
81
81
  abi: VERIFY_ACCOUNT_ABI,
82
82
  functionName: "claimRewardByName",
83
- args: ["petastic-signup-campaign-1", pid]
83
+ args: [isCampaign ? "petastic-signup-campaign-1" : "default", pid]
84
84
  });
85
85
  try {
86
86
  const userOpHash = await bundlerClient.sendUserOperation({
@@ -92,7 +92,6 @@ function useVerifyAccount() {
92
92
  }
93
93
  ],
94
94
  maxPriorityFeePerGas: (0, import_viem.parseGwei)("0.001")
95
- // maxFeePerGas: parseGwei("5.599"),
96
95
  });
97
96
  await bundlerClient.waitForUserOperationReceipt({
98
97
  hash: userOpHash,
@@ -469,7 +468,6 @@ function useMintAnymalNFT() {
469
468
  }
470
469
  ],
471
470
  maxPriorityFeePerGas: (0, import_viem2.parseGwei)("0.001")
472
- // maxFeePerGas: parseGwei("5.599"),
473
471
  });
474
472
  await bundlerClient.waitForUserOperationReceipt({
475
473
  hash: userOpHash,
@@ -862,6 +860,7 @@ function useApproveKibbleToken() {
862
860
  // amount to approve
863
861
  ]
864
862
  });
863
+ console.log("About to call sendUserOperation");
865
864
  const userOpHash = await bundlerClient.sendUserOperation({
866
865
  account: smartAccount,
867
866
  calls: [
@@ -873,11 +872,14 @@ function useApproveKibbleToken() {
873
872
  maxPriorityFeePerGas: (0, import_viem4.parseGwei)("0.001")
874
873
  // maxFeePerGas: parseGwei("0.01"),
875
874
  });
875
+ console.log("sendUserOperation has been called");
876
+ console.log("About to call waitForUserOperationReceipt");
876
877
  await bundlerClient.waitForUserOperationReceipt({
877
878
  hash: userOpHash,
878
879
  timeout: 3e4,
879
880
  retryCount: 10
880
881
  });
882
+ console.log("waitForUserOperationReceipt has been called");
881
883
  return {
882
884
  success: true,
883
885
  message: "Approval transaction completed successfully."
package/dist/index.mjs CHANGED
@@ -25,7 +25,7 @@ var MARKETPLACE_ABI = [{ "inputs": [{ "internalType": "address", "name": "target
25
25
  // src/utils/account/useVerifyAccount.ts
26
26
  function useVerifyAccount() {
27
27
  return useCallback(
28
- async (pid, dbAuthToken, bundlerClient, smartAccount, accountRewardsContractAddress) => {
28
+ async (pid, isCampaign, dbAuthToken, bundlerClient, smartAccount, accountRewardsContractAddress) => {
29
29
  if (!dbAuthToken || !bundlerClient || !smartAccount || !accountRewardsContractAddress || !pid) {
30
30
  return {
31
31
  success: false,
@@ -35,7 +35,7 @@ function useVerifyAccount() {
35
35
  const callData = encodeFunctionData({
36
36
  abi: VERIFY_ACCOUNT_ABI,
37
37
  functionName: "claimRewardByName",
38
- args: ["petastic-signup-campaign-1", pid]
38
+ args: [isCampaign ? "petastic-signup-campaign-1" : "default", pid]
39
39
  });
40
40
  try {
41
41
  const userOpHash = await bundlerClient.sendUserOperation({
@@ -47,7 +47,6 @@ function useVerifyAccount() {
47
47
  }
48
48
  ],
49
49
  maxPriorityFeePerGas: parseGwei("0.001")
50
- // maxFeePerGas: parseGwei("5.599"),
51
50
  });
52
51
  await bundlerClient.waitForUserOperationReceipt({
53
52
  hash: userOpHash,
@@ -424,7 +423,6 @@ function useMintAnymalNFT() {
424
423
  }
425
424
  ],
426
425
  maxPriorityFeePerGas: parseGwei2("0.001")
427
- // maxFeePerGas: parseGwei("5.599"),
428
426
  });
429
427
  await bundlerClient.waitForUserOperationReceipt({
430
428
  hash: userOpHash,
@@ -817,6 +815,7 @@ function useApproveKibbleToken() {
817
815
  // amount to approve
818
816
  ]
819
817
  });
818
+ console.log("About to call sendUserOperation");
820
819
  const userOpHash = await bundlerClient.sendUserOperation({
821
820
  account: smartAccount,
822
821
  calls: [
@@ -828,11 +827,14 @@ function useApproveKibbleToken() {
828
827
  maxPriorityFeePerGas: parseGwei4("0.001")
829
828
  // maxFeePerGas: parseGwei("0.01"),
830
829
  });
830
+ console.log("sendUserOperation has been called");
831
+ console.log("About to call waitForUserOperationReceipt");
831
832
  await bundlerClient.waitForUserOperationReceipt({
832
833
  hash: userOpHash,
833
834
  timeout: 3e4,
834
835
  retryCount: 10
835
836
  });
837
+ console.log("waitForUserOperationReceipt has been called");
836
838
  return {
837
839
  success: true,
838
840
  message: "Approval transaction completed successfully."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
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
  "module": "dist/index.js",