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