anymal-protocol 1.0.24 → 1.0.26

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.mjs CHANGED
@@ -3,545 +3,7 @@ import { useCallback } from "react";
3
3
  import { encodeFunctionData, parseGwei } from "viem";
4
4
 
5
5
  // src/helpers/BlockchainAbiHelper.tsx
6
- var PET_NFT_ABI = [
7
- { inputs: [], stateMutability: "nonpayable", type: "constructor" },
8
- {
9
- inputs: [],
10
- name: "AccessControlBadConfirmation",
11
- type: "error"
12
- },
13
- {
14
- inputs: [
15
- { internalType: "address", name: "account", type: "address" },
16
- {
17
- internalType: "bytes32",
18
- name: "neededRole",
19
- type: "bytes32"
20
- }
21
- ],
22
- name: "AccessControlUnauthorizedAccount",
23
- type: "error"
24
- },
25
- {
26
- inputs: [{ internalType: "address", name: "target", type: "address" }],
27
- name: "AddressEmptyCode",
28
- type: "error"
29
- },
30
- {
31
- inputs: [{ internalType: "address", name: "implementation", type: "address" }],
32
- name: "ERC1967InvalidImplementation",
33
- type: "error"
34
- },
35
- { inputs: [], name: "ERC1967NonPayable", type: "error" },
36
- {
37
- inputs: [],
38
- name: "EnforcedPause",
39
- type: "error"
40
- },
41
- { inputs: [], name: "ExpectedPause", type: "error" },
42
- {
43
- inputs: [],
44
- name: "FailedCall",
45
- type: "error"
46
- },
47
- { inputs: [], name: "InvalidInitialization", type: "error" },
48
- {
49
- inputs: [],
50
- name: "NotInitializing",
51
- type: "error"
52
- },
53
- {
54
- inputs: [],
55
- name: "UUPSUnauthorizedCallContext",
56
- type: "error"
57
- },
58
- {
59
- inputs: [{ internalType: "bytes32", name: "slot", type: "bytes32" }],
60
- name: "UUPSUnsupportedProxiableUUID",
61
- type: "error"
62
- },
63
- {
64
- anonymous: false,
65
- inputs: [{ indexed: false, internalType: "uint64", name: "version", type: "uint64" }],
66
- name: "Initialized",
67
- type: "event"
68
- },
69
- {
70
- anonymous: false,
71
- inputs: [
72
- {
73
- indexed: true,
74
- internalType: "address",
75
- name: "user",
76
- type: "address"
77
- },
78
- { indexed: false, internalType: "string", name: "pid", type: "string" },
79
- {
80
- indexed: false,
81
- internalType: "string",
82
- name: "nftId",
83
- type: "string"
84
- },
85
- { indexed: false, internalType: "string", name: "metadataURL", type: "string" },
86
- {
87
- indexed: false,
88
- internalType: "uint256",
89
- name: "campaignId",
90
- type: "uint256"
91
- },
92
- { indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
93
- ],
94
- name: "MetadataApproved",
95
- type: "event"
96
- },
97
- {
98
- anonymous: false,
99
- inputs: [
100
- {
101
- indexed: true,
102
- internalType: "address",
103
- name: "user",
104
- type: "address"
105
- },
106
- { indexed: false, internalType: "string", name: "pid", type: "string" },
107
- {
108
- indexed: false,
109
- internalType: "string",
110
- name: "nftId",
111
- type: "string"
112
- },
113
- { indexed: false, internalType: "string", name: "metadataURL", type: "string" },
114
- {
115
- indexed: false,
116
- internalType: "uint256",
117
- name: "campaignId",
118
- type: "uint256"
119
- },
120
- { indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
121
- ],
122
- name: "MetadataRejected",
123
- type: "event"
124
- },
125
- {
126
- anonymous: false,
127
- inputs: [
128
- {
129
- indexed: true,
130
- internalType: "address",
131
- name: "user",
132
- type: "address"
133
- },
134
- { indexed: false, internalType: "string", name: "pid", type: "string" },
135
- {
136
- indexed: false,
137
- internalType: "string",
138
- name: "nftId",
139
- type: "string"
140
- },
141
- { indexed: false, internalType: "string", name: "metadataURL", type: "string" },
142
- {
143
- indexed: false,
144
- internalType: "uint256",
145
- name: "campaignId",
146
- type: "uint256"
147
- },
148
- { indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
149
- ],
150
- name: "MetadataSubmitted",
151
- type: "event"
152
- },
153
- {
154
- anonymous: false,
155
- inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
156
- name: "Paused",
157
- type: "event"
158
- },
159
- {
160
- anonymous: false,
161
- inputs: [
162
- {
163
- indexed: true,
164
- internalType: "address",
165
- name: "user",
166
- type: "address"
167
- },
168
- { indexed: false, internalType: "string", name: "pid", type: "string" },
169
- {
170
- indexed: false,
171
- internalType: "string",
172
- name: "nftId",
173
- type: "string"
174
- },
175
- {
176
- indexed: false,
177
- internalType: "uint256",
178
- name: "rewardAmount",
179
- type: "uint256"
180
- },
181
- { indexed: false, internalType: "uint256", name: "campaignId", type: "uint256" }
182
- ],
183
- name: "RewardDistributed",
184
- type: "event"
185
- },
186
- {
187
- anonymous: false,
188
- inputs: [
189
- { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
190
- {
191
- indexed: true,
192
- internalType: "bytes32",
193
- name: "previousAdminRole",
194
- type: "bytes32"
195
- },
196
- { indexed: true, internalType: "bytes32", name: "newAdminRole", type: "bytes32" }
197
- ],
198
- name: "RoleAdminChanged",
199
- type: "event"
200
- },
201
- {
202
- anonymous: false,
203
- inputs: [
204
- { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
205
- {
206
- indexed: true,
207
- internalType: "address",
208
- name: "account",
209
- type: "address"
210
- },
211
- { indexed: true, internalType: "address", name: "sender", type: "address" }
212
- ],
213
- name: "RoleGranted",
214
- type: "event"
215
- },
216
- {
217
- anonymous: false,
218
- inputs: [
219
- { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
220
- {
221
- indexed: true,
222
- internalType: "address",
223
- name: "account",
224
- type: "address"
225
- },
226
- { indexed: true, internalType: "address", name: "sender", type: "address" }
227
- ],
228
- name: "RoleRevoked",
229
- type: "event"
230
- },
231
- {
232
- anonymous: false,
233
- inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
234
- name: "Unpaused",
235
- type: "event"
236
- },
237
- {
238
- anonymous: false,
239
- inputs: [{ indexed: true, internalType: "address", name: "implementation", type: "address" }],
240
- name: "Upgraded",
241
- type: "event"
242
- },
243
- {
244
- inputs: [],
245
- name: "APPROVER_ROLE",
246
- outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
247
- stateMutability: "view",
248
- type: "function"
249
- },
250
- {
251
- inputs: [],
252
- name: "DEFAULT_ADMIN_ROLE",
253
- outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
254
- stateMutability: "view",
255
- type: "function"
256
- },
257
- {
258
- inputs: [],
259
- name: "UPGRADE_INTERFACE_VERSION",
260
- outputs: [{ internalType: "string", name: "", type: "string" }],
261
- stateMutability: "view",
262
- type: "function"
263
- },
264
- {
265
- inputs: [
266
- { internalType: "address", name: "_user", type: "address" },
267
- {
268
- internalType: "string",
269
- name: "_pid",
270
- type: "string"
271
- },
272
- { internalType: "string", name: "_nftId", type: "string" },
273
- {
274
- internalType: "string",
275
- name: "_metadataURL",
276
- type: "string"
277
- },
278
- { internalType: "uint256", name: "_campaignId", type: "uint256" }
279
- ],
280
- name: "approveMetadata",
281
- outputs: [],
282
- stateMutability: "nonpayable",
283
- type: "function"
284
- },
285
- {
286
- inputs: [],
287
- name: "campaignCount",
288
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
289
- stateMutability: "view",
290
- type: "function"
291
- },
292
- {
293
- inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
294
- name: "campaigns",
295
- outputs: [
296
- { internalType: "string", name: "name", type: "string" },
297
- {
298
- internalType: "uint256",
299
- name: "rewardAmount",
300
- type: "uint256"
301
- },
302
- { internalType: "bool", name: "isActive", type: "bool" }
303
- ],
304
- stateMutability: "view",
305
- type: "function"
306
- },
307
- {
308
- inputs: [
309
- { internalType: "string", name: "_name", type: "string" },
310
- {
311
- internalType: "uint256",
312
- name: "_rewardAmount",
313
- type: "uint256"
314
- }
315
- ],
316
- name: "createCampaign",
317
- outputs: [],
318
- stateMutability: "nonpayable",
319
- type: "function"
320
- },
321
- {
322
- inputs: [],
323
- name: "defaultRewardAmount",
324
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
325
- stateMutability: "view",
326
- type: "function"
327
- },
328
- {
329
- inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
330
- name: "getRoleAdmin",
331
- outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
332
- stateMutability: "view",
333
- type: "function"
334
- },
335
- {
336
- inputs: [
337
- { internalType: "bytes32", name: "role", type: "bytes32" },
338
- {
339
- internalType: "address",
340
- name: "account",
341
- type: "address"
342
- }
343
- ],
344
- name: "grantRole",
345
- outputs: [],
346
- stateMutability: "nonpayable",
347
- type: "function"
348
- },
349
- {
350
- inputs: [
351
- { internalType: "bytes32", name: "role", type: "bytes32" },
352
- {
353
- internalType: "address",
354
- name: "account",
355
- type: "address"
356
- }
357
- ],
358
- name: "hasRole",
359
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
360
- stateMutability: "view",
361
- type: "function"
362
- },
363
- {
364
- inputs: [
365
- {
366
- internalType: "address",
367
- name: "initialOwner",
368
- type: "address"
369
- },
370
- {
371
- internalType: "contract IERC20",
372
- name: "_rewardToken",
373
- type: "address"
374
- },
375
- {
376
- internalType: "contract IPetToken",
377
- name: "_petToken",
378
- type: "address"
379
- },
380
- { internalType: "uint256", name: "_defaultRewardAmount", type: "uint256" }
381
- ],
382
- name: "initialize",
383
- outputs: [],
384
- stateMutability: "nonpayable",
385
- type: "function"
386
- },
387
- {
388
- inputs: [],
389
- name: "pause",
390
- outputs: [],
391
- stateMutability: "nonpayable",
392
- type: "function"
393
- },
394
- {
395
- inputs: [],
396
- name: "paused",
397
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
398
- stateMutability: "view",
399
- type: "function"
400
- },
401
- {
402
- inputs: [],
403
- name: "petToken",
404
- outputs: [{ internalType: "contract IPetToken", name: "", type: "address" }],
405
- stateMutability: "view",
406
- type: "function"
407
- },
408
- {
409
- inputs: [],
410
- name: "proxiableUUID",
411
- outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
412
- stateMutability: "view",
413
- type: "function"
414
- },
415
- {
416
- inputs: [
417
- { internalType: "bytes32", name: "role", type: "bytes32" },
418
- {
419
- internalType: "address",
420
- name: "callerConfirmation",
421
- type: "address"
422
- }
423
- ],
424
- name: "renounceRole",
425
- outputs: [],
426
- stateMutability: "nonpayable",
427
- type: "function"
428
- },
429
- {
430
- inputs: [
431
- { internalType: "bytes32", name: "role", type: "bytes32" },
432
- {
433
- internalType: "address",
434
- name: "account",
435
- type: "address"
436
- }
437
- ],
438
- name: "revokeRole",
439
- outputs: [],
440
- stateMutability: "nonpayable",
441
- type: "function"
442
- },
443
- {
444
- inputs: [],
445
- name: "rewardToken",
446
- outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
447
- stateMutability: "view",
448
- type: "function"
449
- },
450
- {
451
- inputs: [
452
- { internalType: "string", name: "_pid", type: "string" },
453
- {
454
- internalType: "string",
455
- name: "_nftId",
456
- type: "string"
457
- },
458
- { internalType: "string", name: "_metadataURL", type: "string" },
459
- {
460
- internalType: "uint256",
461
- name: "_campaignId",
462
- type: "uint256"
463
- }
464
- ],
465
- name: "submitMetadata",
466
- outputs: [],
467
- stateMutability: "nonpayable",
468
- type: "function"
469
- },
470
- {
471
- inputs: [
472
- { internalType: "string", name: "_pid", type: "string" },
473
- {
474
- internalType: "string",
475
- name: "_nftId",
476
- type: "string"
477
- },
478
- { internalType: "string", name: "_metadataURL", type: "string" },
479
- {
480
- internalType: "string",
481
- name: "_campaignName",
482
- type: "string"
483
- }
484
- ],
485
- name: "submitMetadataByCampaignName",
486
- outputs: [],
487
- stateMutability: "nonpayable",
488
- type: "function"
489
- },
490
- {
491
- inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
492
- name: "supportsInterface",
493
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
494
- stateMutability: "view",
495
- type: "function"
496
- },
497
- {
498
- inputs: [],
499
- name: "unpause",
500
- outputs: [],
501
- stateMutability: "nonpayable",
502
- type: "function"
503
- },
504
- {
505
- inputs: [
506
- {
507
- internalType: "uint256",
508
- name: "_campaignId",
509
- type: "uint256"
510
- },
511
- { internalType: "uint256", name: "_rewardAmount", type: "uint256" },
512
- {
513
- internalType: "bool",
514
- name: "_isActive",
515
- type: "bool"
516
- }
517
- ],
518
- name: "updateCampaign",
519
- outputs: [],
520
- stateMutability: "nonpayable",
521
- type: "function"
522
- },
523
- {
524
- inputs: [{ internalType: "uint256", name: "_rewardAmount", type: "uint256" }],
525
- name: "updateDefaultReward",
526
- outputs: [],
527
- stateMutability: "nonpayable",
528
- type: "function"
529
- },
530
- {
531
- inputs: [
532
- {
533
- internalType: "address",
534
- name: "newImplementation",
535
- type: "address"
536
- },
537
- { internalType: "bytes", name: "data", type: "bytes" }
538
- ],
539
- name: "upgradeToAndCall",
540
- outputs: [],
541
- stateMutability: "payable",
542
- type: "function"
543
- }
544
- ];
6
+ var PET_NFT_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataApproved", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "anymalTxId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataRejected", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataSubmitted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "RewardDistributed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "APPROVER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "approveMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "campaignCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "campaigns", "outputs": [{ "internalType": "string", "name": "name", "type": "string" }, { "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "isActive", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_name", "type": "string" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "createCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "defaultRewardAmount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IERC20", "name": "_rewardToken", "type": "address" }, { "internalType": "contract IPetToken", "name": "_petToken", "type": "address" }, { "internalType": "uint256", "name": "_defaultRewardAmount", "type": "uint256" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "petToken", "outputs": [{ "internalType": "contract IPetToken", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rewardToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "string", "name": "_campaignName", "type": "string" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadataByCampaignName", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "_isActive", "type": "bool" }], "name": "updateCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "updateDefaultReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
545
7
  var VERIFY_ACCOUNT_ABI = [
546
8
  {
547
9
  inputs: [
@@ -867,21 +329,27 @@ function useFetchNotifications() {
867
329
  }
868
330
  try {
869
331
  const query = `
870
- query Notification($filter: NotificationFilterArg) {
871
- Notification(filter: $filter) {
872
- _docID
873
- action
874
- id
875
- pid
876
- read
877
- source
878
- tags
879
- text
880
- timeAddedUtc
881
- timeUpdatedUtc
882
- type
332
+ query AnymalNotification($groupBy: [AnymalNotificationField!], $filter: AnymalNotificationFilterArg) {
333
+ AnymalNotification(groupBy: $groupBy, filter: $filter) {
334
+ anymalTxId
335
+ title
336
+ _group {
337
+ source
338
+ action
339
+ anymalTxId
340
+ id
341
+ pid
342
+ read
343
+ source
344
+ tags
345
+ text
346
+ title
347
+ timeAddedUtc
348
+ timeUpdatedUtc
349
+ type
883
350
  }
884
351
  }
352
+ }
885
353
  `;
886
354
  const filter = {
887
355
  pid: {
@@ -889,7 +357,8 @@ function useFetchNotifications() {
889
357
  },
890
358
  ...additionalFilters || {}
891
359
  };
892
- const variables = { filter };
360
+ const groupBy = ["anymalTxId", "title"];
361
+ const variables = { filter, groupBy };
893
362
  const response = await fetch(endpoint, {
894
363
  method: "POST",
895
364
  headers: {
@@ -902,8 +371,8 @@ function useFetchNotifications() {
902
371
  throw new Error(`HTTP error! Status: ${response.status}`);
903
372
  }
904
373
  const data = await response.json();
905
- if (data?.data?.Notification?.length > 0) {
906
- return data.data.Notification;
374
+ if (data?.data?.AnymalNotification?.length > 0) {
375
+ return data.data.AnymalNotification;
907
376
  } else {
908
377
  return null;
909
378
  }
@@ -921,7 +390,7 @@ import { encodeFunctionData as encodeFunctionData2, parseGwei as parseGwei2 } fr
921
390
  import { useCallback as useCallback10 } from "react";
922
391
  function useMintAnymalNFT() {
923
392
  return useCallback10(
924
- async (pid, nftId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
393
+ async (pid, nftId, anymalTxId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
925
394
  if (!dbAuthToken || !nftId || !bundlerClient || !smartAccount || !pid || !validationContractAddress) {
926
395
  return {
927
396
  success: false,
@@ -935,7 +404,8 @@ function useMintAnymalNFT() {
935
404
  pid,
936
405
  nftId,
937
406
  `https://dev-nft.petastic.com/metadata/${nftId}`,
938
- "petastic-signup-campaign-1"
407
+ "petastic-signup-campaign-1",
408
+ anymalTxId
939
409
  ]
940
410
  });
941
411
  const userOpHash = await bundlerClient.sendUserOperation({
@@ -1069,7 +539,7 @@ function useDeleteAnymalFromDatabase() {
1069
539
  import { useCallback as useCallback13 } from "react";
1070
540
  function useSaveAnymalMetadata() {
1071
541
  return useCallback13(
1072
- async (idToken, publicKey, nftMetadataInput, authServiceBaseUrl) => {
542
+ async (userPid, anymalTxId, idToken, publicKey, nftMetadataInput, authServiceBaseUrl) => {
1073
543
  const response = await fetch(`${authServiceBaseUrl}/process-nft`, {
1074
544
  method: "POST",
1075
545
  headers: {
@@ -1078,7 +548,9 @@ function useSaveAnymalMetadata() {
1078
548
  },
1079
549
  body: JSON.stringify({
1080
550
  appPubKey: publicKey,
1081
- nftMetadataInput
551
+ nftMetadataInput,
552
+ pid: userPid,
553
+ anymalTxId
1082
554
  })
1083
555
  });
1084
556
  const data = await response.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
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",