anymal-protocol 1.0.73 → 1.0.75

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
@@ -261,7 +261,7 @@ interface ActionDefinition {
261
261
  name: string;
262
262
  namespace: string;
263
263
  description: string;
264
- rewardAmount: number;
264
+ rewardAmount: string;
265
265
  maxClaims: number;
266
266
  ruleType: string;
267
267
  requiresReview: boolean;
@@ -358,7 +358,7 @@ declare function useClaimActionReward(): (actionId: string, claimIndex: number,
358
358
  message: string;
359
359
  }>;
360
360
 
361
- declare function useClaimOrgActionReward(): (orgContractAddress: string, actionId: string, claimIndex: number, smartAccount: any, bundlerClient: any) => Promise<{
361
+ declare function useClaimOrgActionReward(): (orgContractAddress: string, rewardableActionContractAddress: string, actionId: string, claimIndex: number, smartAccount: any, bundlerClient: any) => Promise<{
362
362
  success: boolean;
363
363
  message: string;
364
364
  }>;
package/dist/index.d.ts CHANGED
@@ -261,7 +261,7 @@ interface ActionDefinition {
261
261
  name: string;
262
262
  namespace: string;
263
263
  description: string;
264
- rewardAmount: number;
264
+ rewardAmount: string;
265
265
  maxClaims: number;
266
266
  ruleType: string;
267
267
  requiresReview: boolean;
@@ -358,7 +358,7 @@ declare function useClaimActionReward(): (actionId: string, claimIndex: number,
358
358
  message: string;
359
359
  }>;
360
360
 
361
- declare function useClaimOrgActionReward(): (orgContractAddress: string, actionId: string, claimIndex: number, smartAccount: any, bundlerClient: any) => Promise<{
361
+ declare function useClaimOrgActionReward(): (orgContractAddress: string, rewardableActionContractAddress: string, actionId: string, claimIndex: number, smartAccount: any, bundlerClient: any) => Promise<{
362
362
  success: boolean;
363
363
  message: string;
364
364
  }>;
package/dist/index.js CHANGED
@@ -2390,24 +2390,29 @@ var import_viem11 = require("viem");
2390
2390
  var import_react29 = require("react");
2391
2391
  function useClaimOrgActionReward() {
2392
2392
  return (0, import_react29.useCallback)(
2393
- async (orgContractAddress, actionId, claimIndex, smartAccount, bundlerClient) => {
2393
+ async (orgContractAddress, rewardableActionContractAddress, actionId, claimIndex, smartAccount, bundlerClient) => {
2394
2394
  if (!orgContractAddress || !actionId || claimIndex === void 0 || !bundlerClient || !smartAccount) {
2395
2395
  return {
2396
2396
  success: false,
2397
2397
  message: "Missing web3auth account info or contract address."
2398
2398
  };
2399
2399
  }
2400
- const callData = (0, import_viem11.encodeFunctionData)({
2400
+ const claimCallData = (0, import_viem11.encodeFunctionData)({
2401
2401
  abi: REWARDABLE_ACTIONS_ABI,
2402
2402
  functionName: "claimByIndex",
2403
2403
  args: [actionId, claimIndex]
2404
2404
  });
2405
+ const executeClaimCalldata = (0, import_viem11.encodeFunctionData)({
2406
+ abi: ORGANIZATION_IMPL_ABI,
2407
+ functionName: "executeCall",
2408
+ args: [rewardableActionContractAddress, claimCallData]
2409
+ });
2405
2410
  const userOpHash = await bundlerClient.sendUserOperation({
2406
2411
  account: smartAccount,
2407
2412
  calls: [
2408
2413
  {
2409
2414
  to: orgContractAddress,
2410
- data: callData
2415
+ data: executeClaimCalldata
2411
2416
  }
2412
2417
  ],
2413
2418
  maxPriorityFeePerGas: (0, import_viem11.parseGwei)("0.001")
package/dist/index.mjs CHANGED
@@ -2253,24 +2253,29 @@ import { encodeFunctionData as encodeFunctionData9, parseGwei as parseGwei9 } fr
2253
2253
  import { useCallback as useCallback29 } from "react";
2254
2254
  function useClaimOrgActionReward() {
2255
2255
  return useCallback29(
2256
- async (orgContractAddress, actionId, claimIndex, smartAccount, bundlerClient) => {
2256
+ async (orgContractAddress, rewardableActionContractAddress, actionId, claimIndex, smartAccount, bundlerClient) => {
2257
2257
  if (!orgContractAddress || !actionId || claimIndex === void 0 || !bundlerClient || !smartAccount) {
2258
2258
  return {
2259
2259
  success: false,
2260
2260
  message: "Missing web3auth account info or contract address."
2261
2261
  };
2262
2262
  }
2263
- const callData = encodeFunctionData9({
2263
+ const claimCallData = encodeFunctionData9({
2264
2264
  abi: REWARDABLE_ACTIONS_ABI,
2265
2265
  functionName: "claimByIndex",
2266
2266
  args: [actionId, claimIndex]
2267
2267
  });
2268
+ const executeClaimCalldata = encodeFunctionData9({
2269
+ abi: ORGANIZATION_IMPL_ABI,
2270
+ functionName: "executeCall",
2271
+ args: [rewardableActionContractAddress, claimCallData]
2272
+ });
2268
2273
  const userOpHash = await bundlerClient.sendUserOperation({
2269
2274
  account: smartAccount,
2270
2275
  calls: [
2271
2276
  {
2272
2277
  to: orgContractAddress,
2273
- data: callData
2278
+ data: executeClaimCalldata
2274
2279
  }
2275
2280
  ],
2276
2281
  maxPriorityFeePerGas: parseGwei9("0.001")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
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": {