anymal-protocol 1.0.46 → 1.0.47

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
@@ -133,6 +133,8 @@ declare function useProcessOrgPartialKibblePayment(): (orgContractAddress: strin
133
133
  message: string;
134
134
  }>;
135
135
 
136
+ declare function useUpdateOrgWalletAddress(): (dbAuthToken: string, docID: string, baseWalletAddress: string, endpoint: string) => Promise<void>;
137
+
136
138
  declare const generateBytes32Nonce: () => `0x${string}`;
137
139
 
138
140
  declare function useCreateUserAppData(): (appId: string, pid: string, dbAuthToken: string, endpoint: string) => Promise<{
@@ -142,4 +144,4 @@ declare function useCreateUserAppData(): (appId: string, pid: string, dbAuthToke
142
144
 
143
145
  declare function useFetchBalance(): (publicClient: any, walletAddress: string, kibbleTokenAddress: string) => Promise<number | undefined>;
144
146
 
145
- export { type AnymalNftMetadataInputData, type CreateAnymalInputData, generateBytes32Nonce, useAddAnymalToDatabase, useApproveKibbleToken, useApproveOrgPartialPayment, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useDeleteAnymalFromDatabase, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useUpdateAnymalWithNFT, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession };
147
+ export { type AnymalNftMetadataInputData, type CreateAnymalInputData, generateBytes32Nonce, useAddAnymalToDatabase, useApproveKibbleToken, useApproveOrgPartialPayment, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useDeleteAnymalFromDatabase, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useUpdateAnymalWithNFT, useUpdateOrgWalletAddress, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession };
package/dist/index.d.ts CHANGED
@@ -133,6 +133,8 @@ declare function useProcessOrgPartialKibblePayment(): (orgContractAddress: strin
133
133
  message: string;
134
134
  }>;
135
135
 
136
+ declare function useUpdateOrgWalletAddress(): (dbAuthToken: string, docID: string, baseWalletAddress: string, endpoint: string) => Promise<void>;
137
+
136
138
  declare const generateBytes32Nonce: () => `0x${string}`;
137
139
 
138
140
  declare function useCreateUserAppData(): (appId: string, pid: string, dbAuthToken: string, endpoint: string) => Promise<{
@@ -142,4 +144,4 @@ declare function useCreateUserAppData(): (appId: string, pid: string, dbAuthToke
142
144
 
143
145
  declare function useFetchBalance(): (publicClient: any, walletAddress: string, kibbleTokenAddress: string) => Promise<number | undefined>;
144
146
 
145
- export { type AnymalNftMetadataInputData, type CreateAnymalInputData, generateBytes32Nonce, useAddAnymalToDatabase, useApproveKibbleToken, useApproveOrgPartialPayment, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useDeleteAnymalFromDatabase, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useUpdateAnymalWithNFT, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession };
147
+ export { type AnymalNftMetadataInputData, type CreateAnymalInputData, generateBytes32Nonce, useAddAnymalToDatabase, useApproveKibbleToken, useApproveOrgPartialPayment, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useDeleteAnymalFromDatabase, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useUpdateAnymalWithNFT, useUpdateOrgWalletAddress, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession };
package/dist/index.js CHANGED
@@ -36,6 +36,7 @@ __export(index_exports, {
36
36
  useProcessPartialKibblePayment: () => useProcessPartialKibblePayment,
37
37
  useSaveAnymalMetadata: () => useSaveAnymalMetadata,
38
38
  useUpdateAnymalWithNFT: () => useUpdateAnymalWithNFT,
39
+ useUpdateOrgWalletAddress: () => useUpdateOrgWalletAddress,
39
40
  useUpdateUserAsVerified: () => useUpdateUserAsVerified,
40
41
  useUpdateUserEmail: () => useUpdateUserEmail,
41
42
  useUpdateUserName: () => useUpdateUserName,
@@ -453,7 +454,7 @@ function useUpdateUserEmail() {
453
454
  }
454
455
  `;
455
456
  const variables = {
456
- docId: [docID],
457
+ docID: [docID],
457
458
  input: {
458
459
  email
459
460
  }
@@ -494,7 +495,7 @@ function useUpdateUserPid() {
494
495
  }
495
496
  `;
496
497
  const variables = {
497
- docId: [docID],
498
+ docID: [docID],
498
499
  input: {
499
500
  pid
500
501
  }
@@ -536,7 +537,7 @@ function useUpdateUserAsVerified() {
536
537
  }
537
538
  `;
538
539
  const variables = {
539
- docId: [docID],
540
+ docID: [docID],
540
541
  input: {
541
542
  isVerified: true
542
543
  }
@@ -579,7 +580,7 @@ function useUpdateUserName() {
579
580
  }
580
581
  `;
581
582
  const variables = {
582
- docId: [docID],
583
+ docID: [docID],
583
584
  input: {
584
585
  name
585
586
  }
@@ -812,7 +813,7 @@ function useDeleteAnymalFromDatabase() {
812
813
  },
813
814
  body: JSON.stringify({
814
815
  query: mutation,
815
- variables: { docId: [anymalDocID] }
816
+ variables: { docID: [anymalDocID] }
816
817
  })
817
818
  });
818
819
  if (!response.ok)
@@ -1328,6 +1329,47 @@ function useProcessOrgPartialKibblePayment() {
1328
1329
  );
1329
1330
  }
1330
1331
 
1332
+ // src/utils/organization/useUpdateOrgWalletAddress.ts
1333
+ var import_react21 = require("react");
1334
+ function useUpdateOrgWalletAddress() {
1335
+ return (0, import_react21.useCallback)(
1336
+ async (dbAuthToken, docID, baseWalletAddress, endpoint) => {
1337
+ try {
1338
+ const mutation = `
1339
+ mutation Update_AnymalOrganization($docID: [ID], $input: AnymalOrganizationMutationInputArg) {
1340
+ update_AnymalOrganization(docID: $docID, input: $input) {
1341
+ baseWalletAddress
1342
+ }
1343
+ }
1344
+ `;
1345
+ const variables = {
1346
+ docID: [docID],
1347
+ input: {
1348
+ baseWalletAddress
1349
+ }
1350
+ };
1351
+ const response = await fetch(endpoint, {
1352
+ method: "POST",
1353
+ headers: {
1354
+ "Content-Type": "application/json",
1355
+ Authorization: `Bearer ${dbAuthToken}`
1356
+ },
1357
+ body: JSON.stringify({
1358
+ query: mutation,
1359
+ variables
1360
+ })
1361
+ });
1362
+ if (!response.ok) {
1363
+ throw new Error(`HTTP error! Status: ${response.status}`);
1364
+ }
1365
+ } catch (error) {
1366
+ console.error("Error updating baseWalletAddress:", error);
1367
+ }
1368
+ },
1369
+ []
1370
+ );
1371
+ }
1372
+
1331
1373
  // src/helpers/NonceHelper.tsx
1332
1374
  var import_uuid = require("uuid");
1333
1375
  var import_viem8 = require("viem");
@@ -1337,10 +1379,10 @@ var generateBytes32Nonce = () => {
1337
1379
  };
1338
1380
 
1339
1381
  // src/utils/application/useCreateUserAppData.ts
1340
- var import_react21 = require("react");
1382
+ var import_react22 = require("react");
1341
1383
  var import_uuid2 = require("uuid");
1342
1384
  function useCreateUserAppData() {
1343
- return (0, import_react21.useCallback)(
1385
+ return (0, import_react22.useCallback)(
1344
1386
  async (appId, pid, dbAuthToken, endpoint) => {
1345
1387
  if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
1346
1388
  const appValues = {
@@ -1393,10 +1435,10 @@ function useCreateUserAppData() {
1393
1435
  }
1394
1436
 
1395
1437
  // src/utils/balance/useFetchBalance.ts
1396
- var import_react22 = require("react");
1438
+ var import_react23 = require("react");
1397
1439
  var import_viem9 = require("viem");
1398
1440
  function useFetchBalance() {
1399
- return (0, import_react22.useCallback)(
1441
+ return (0, import_react23.useCallback)(
1400
1442
  async (publicClient, walletAddress, kibbleTokenAddress) => {
1401
1443
  try {
1402
1444
  const balance = await publicClient.readContract({
@@ -1431,6 +1473,7 @@ function useFetchBalance() {
1431
1473
  useProcessPartialKibblePayment,
1432
1474
  useSaveAnymalMetadata,
1433
1475
  useUpdateAnymalWithNFT,
1476
+ useUpdateOrgWalletAddress,
1434
1477
  useUpdateUserAsVerified,
1435
1478
  useUpdateUserEmail,
1436
1479
  useUpdateUserName,
package/dist/index.mjs CHANGED
@@ -405,7 +405,7 @@ function useUpdateUserEmail() {
405
405
  }
406
406
  `;
407
407
  const variables = {
408
- docId: [docID],
408
+ docID: [docID],
409
409
  input: {
410
410
  email
411
411
  }
@@ -446,7 +446,7 @@ function useUpdateUserPid() {
446
446
  }
447
447
  `;
448
448
  const variables = {
449
- docId: [docID],
449
+ docID: [docID],
450
450
  input: {
451
451
  pid
452
452
  }
@@ -488,7 +488,7 @@ function useUpdateUserAsVerified() {
488
488
  }
489
489
  `;
490
490
  const variables = {
491
- docId: [docID],
491
+ docID: [docID],
492
492
  input: {
493
493
  isVerified: true
494
494
  }
@@ -531,7 +531,7 @@ function useUpdateUserName() {
531
531
  }
532
532
  `;
533
533
  const variables = {
534
- docId: [docID],
534
+ docID: [docID],
535
535
  input: {
536
536
  name
537
537
  }
@@ -764,7 +764,7 @@ function useDeleteAnymalFromDatabase() {
764
764
  },
765
765
  body: JSON.stringify({
766
766
  query: mutation,
767
- variables: { docId: [anymalDocID] }
767
+ variables: { docID: [anymalDocID] }
768
768
  })
769
769
  });
770
770
  if (!response.ok)
@@ -1280,6 +1280,47 @@ function useProcessOrgPartialKibblePayment() {
1280
1280
  );
1281
1281
  }
1282
1282
 
1283
+ // src/utils/organization/useUpdateOrgWalletAddress.ts
1284
+ import { useCallback as useCallback21 } from "react";
1285
+ function useUpdateOrgWalletAddress() {
1286
+ return useCallback21(
1287
+ async (dbAuthToken, docID, baseWalletAddress, endpoint) => {
1288
+ try {
1289
+ const mutation = `
1290
+ mutation Update_AnymalOrganization($docID: [ID], $input: AnymalOrganizationMutationInputArg) {
1291
+ update_AnymalOrganization(docID: $docID, input: $input) {
1292
+ baseWalletAddress
1293
+ }
1294
+ }
1295
+ `;
1296
+ const variables = {
1297
+ docID: [docID],
1298
+ input: {
1299
+ baseWalletAddress
1300
+ }
1301
+ };
1302
+ const response = await fetch(endpoint, {
1303
+ method: "POST",
1304
+ headers: {
1305
+ "Content-Type": "application/json",
1306
+ Authorization: `Bearer ${dbAuthToken}`
1307
+ },
1308
+ body: JSON.stringify({
1309
+ query: mutation,
1310
+ variables
1311
+ })
1312
+ });
1313
+ if (!response.ok) {
1314
+ throw new Error(`HTTP error! Status: ${response.status}`);
1315
+ }
1316
+ } catch (error) {
1317
+ console.error("Error updating baseWalletAddress:", error);
1318
+ }
1319
+ },
1320
+ []
1321
+ );
1322
+ }
1323
+
1283
1324
  // src/helpers/NonceHelper.tsx
1284
1325
  import { v4 as uuidv4 } from "uuid";
1285
1326
  import { padHex } from "viem";
@@ -1289,10 +1330,10 @@ var generateBytes32Nonce = () => {
1289
1330
  };
1290
1331
 
1291
1332
  // src/utils/application/useCreateUserAppData.ts
1292
- import { useCallback as useCallback21 } from "react";
1333
+ import { useCallback as useCallback22 } from "react";
1293
1334
  import { v4 as uuid } from "uuid";
1294
1335
  function useCreateUserAppData() {
1295
- return useCallback21(
1336
+ return useCallback22(
1296
1337
  async (appId, pid, dbAuthToken, endpoint) => {
1297
1338
  if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
1298
1339
  const appValues = {
@@ -1345,10 +1386,10 @@ function useCreateUserAppData() {
1345
1386
  }
1346
1387
 
1347
1388
  // src/utils/balance/useFetchBalance.ts
1348
- import { useCallback as useCallback22 } from "react";
1389
+ import { useCallback as useCallback23 } from "react";
1349
1390
  import { erc20Abi as erc20Abi3, getAddress } from "viem";
1350
1391
  function useFetchBalance() {
1351
- return useCallback22(
1392
+ return useCallback23(
1352
1393
  async (publicClient, walletAddress, kibbleTokenAddress) => {
1353
1394
  try {
1354
1395
  const balance = await publicClient.readContract({
@@ -1382,6 +1423,7 @@ export {
1382
1423
  useProcessPartialKibblePayment,
1383
1424
  useSaveAnymalMetadata,
1384
1425
  useUpdateAnymalWithNFT,
1426
+ useUpdateOrgWalletAddress,
1385
1427
  useUpdateUserAsVerified,
1386
1428
  useUpdateUserEmail,
1387
1429
  useUpdateUserName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
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",