anymal-protocol 1.0.91 → 1.0.93

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
@@ -19,6 +19,11 @@ declare function useUpdateUserPid(): (dbAuthToken: string, docID: string, pid: s
19
19
  declare function useUpdateUserAsVerified(): (recaptchaToken: string | null, docID: string, dbAuthToken: string, endpoint: string) => Promise<{
20
20
  success: boolean;
21
21
  message: string;
22
+ dbCid: any;
23
+ } | {
24
+ success: boolean;
25
+ message: string;
26
+ dbCid?: undefined;
22
27
  } | undefined>;
23
28
 
24
29
  declare function useUpdateUserName(): (dbAuthToken: string, docID: string, name: string, endpoint: string) => Promise<{
@@ -302,6 +307,7 @@ declare const convertToMultipleActionDefinitions: (frs: ActionDefinition[]) => A
302
307
  * Base fields sent with every action
303
308
  */
304
309
  interface BaseActionPayload {
310
+ multiplier?: number;
305
311
  campaignId?: string;
306
312
  actionId: string;
307
313
  timestamp: string;
package/dist/index.d.ts CHANGED
@@ -19,6 +19,11 @@ declare function useUpdateUserPid(): (dbAuthToken: string, docID: string, pid: s
19
19
  declare function useUpdateUserAsVerified(): (recaptchaToken: string | null, docID: string, dbAuthToken: string, endpoint: string) => Promise<{
20
20
  success: boolean;
21
21
  message: string;
22
+ dbCid: any;
23
+ } | {
24
+ success: boolean;
25
+ message: string;
26
+ dbCid?: undefined;
22
27
  } | undefined>;
23
28
 
24
29
  declare function useUpdateUserName(): (dbAuthToken: string, docID: string, name: string, endpoint: string) => Promise<{
@@ -302,6 +307,7 @@ declare const convertToMultipleActionDefinitions: (frs: ActionDefinition[]) => A
302
307
  * Base fields sent with every action
303
308
  */
304
309
  interface BaseActionPayload {
310
+ multiplier?: number;
305
311
  campaignId?: string;
306
312
  actionId: string;
307
313
  timestamp: string;
package/dist/index.js CHANGED
@@ -279,6 +279,9 @@ function useUpdateUserAsVerified() {
279
279
  mutation Update_User($docID: [ID], $input: UserMutationInputArg) {
280
280
  update_User(docID: $docID, input: $input) {
281
281
  isVerified
282
+ _version {
283
+ cid
284
+ }
282
285
  }
283
286
  }
284
287
  `;
@@ -299,8 +302,12 @@ function useUpdateUserAsVerified() {
299
302
  variables
300
303
  })
301
304
  });
302
- const responseMessage = response.ok ? "Your account has been verified!" : "An error has occured, try again.";
303
- return { success: response.ok, message: responseMessage };
305
+ const { data, errors } = await response.json();
306
+ if (errors) {
307
+ return { success: false, message: "Error occurred", dbCid: null };
308
+ }
309
+ const dbCid = data.update_User[0]._version[0].cid;
310
+ return { success: true, message: "Account verified", dbCid };
304
311
  } catch (error) {
305
312
  return { success: false, message: error.message };
306
313
  }
@@ -2468,6 +2475,7 @@ function useSubmitContractAction() {
2468
2475
  let sourceTypePayload = {};
2469
2476
  const basisType = {
2470
2477
  campaignId: payload.campaignId,
2478
+ multiplier: payload.multiplier,
2471
2479
  actionId: payload.actionId,
2472
2480
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2473
2481
  nonce: crypto.randomUUID(),
package/dist/index.mjs CHANGED
@@ -216,6 +216,9 @@ function useUpdateUserAsVerified() {
216
216
  mutation Update_User($docID: [ID], $input: UserMutationInputArg) {
217
217
  update_User(docID: $docID, input: $input) {
218
218
  isVerified
219
+ _version {
220
+ cid
221
+ }
219
222
  }
220
223
  }
221
224
  `;
@@ -236,8 +239,12 @@ function useUpdateUserAsVerified() {
236
239
  variables
237
240
  })
238
241
  });
239
- const responseMessage = response.ok ? "Your account has been verified!" : "An error has occured, try again.";
240
- return { success: response.ok, message: responseMessage };
242
+ const { data, errors } = await response.json();
243
+ if (errors) {
244
+ return { success: false, message: "Error occurred", dbCid: null };
245
+ }
246
+ const dbCid = data.update_User[0]._version[0].cid;
247
+ return { success: true, message: "Account verified", dbCid };
241
248
  } catch (error) {
242
249
  return { success: false, message: error.message };
243
250
  }
@@ -2325,6 +2332,7 @@ function useSubmitContractAction() {
2325
2332
  let sourceTypePayload = {};
2326
2333
  const basisType = {
2327
2334
  campaignId: payload.campaignId,
2335
+ multiplier: payload.multiplier,
2328
2336
  actionId: payload.actionId,
2329
2337
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2330
2338
  nonce: crypto.randomUUID(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.91",
3
+ "version": "1.0.93",
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": {