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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +31 -559
- package/dist/index.mjs +31 -559
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,545 +48,7 @@ var import_react = require("react");
|
|
|
48
48
|
var import_viem = require("viem");
|
|
49
49
|
|
|
50
50
|
// src/helpers/BlockchainAbiHelper.tsx
|
|
51
|
-
var PET_NFT_ABI = [
|
|
52
|
-
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
53
|
-
{
|
|
54
|
-
inputs: [],
|
|
55
|
-
name: "AccessControlBadConfirmation",
|
|
56
|
-
type: "error"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
inputs: [
|
|
60
|
-
{ internalType: "address", name: "account", type: "address" },
|
|
61
|
-
{
|
|
62
|
-
internalType: "bytes32",
|
|
63
|
-
name: "neededRole",
|
|
64
|
-
type: "bytes32"
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
name: "AccessControlUnauthorizedAccount",
|
|
68
|
-
type: "error"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
inputs: [{ internalType: "address", name: "target", type: "address" }],
|
|
72
|
-
name: "AddressEmptyCode",
|
|
73
|
-
type: "error"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
inputs: [{ internalType: "address", name: "implementation", type: "address" }],
|
|
77
|
-
name: "ERC1967InvalidImplementation",
|
|
78
|
-
type: "error"
|
|
79
|
-
},
|
|
80
|
-
{ inputs: [], name: "ERC1967NonPayable", type: "error" },
|
|
81
|
-
{
|
|
82
|
-
inputs: [],
|
|
83
|
-
name: "EnforcedPause",
|
|
84
|
-
type: "error"
|
|
85
|
-
},
|
|
86
|
-
{ inputs: [], name: "ExpectedPause", type: "error" },
|
|
87
|
-
{
|
|
88
|
-
inputs: [],
|
|
89
|
-
name: "FailedCall",
|
|
90
|
-
type: "error"
|
|
91
|
-
},
|
|
92
|
-
{ inputs: [], name: "InvalidInitialization", type: "error" },
|
|
93
|
-
{
|
|
94
|
-
inputs: [],
|
|
95
|
-
name: "NotInitializing",
|
|
96
|
-
type: "error"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
inputs: [],
|
|
100
|
-
name: "UUPSUnauthorizedCallContext",
|
|
101
|
-
type: "error"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
inputs: [{ internalType: "bytes32", name: "slot", type: "bytes32" }],
|
|
105
|
-
name: "UUPSUnsupportedProxiableUUID",
|
|
106
|
-
type: "error"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
anonymous: false,
|
|
110
|
-
inputs: [{ indexed: false, internalType: "uint64", name: "version", type: "uint64" }],
|
|
111
|
-
name: "Initialized",
|
|
112
|
-
type: "event"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
anonymous: false,
|
|
116
|
-
inputs: [
|
|
117
|
-
{
|
|
118
|
-
indexed: true,
|
|
119
|
-
internalType: "address",
|
|
120
|
-
name: "user",
|
|
121
|
-
type: "address"
|
|
122
|
-
},
|
|
123
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
124
|
-
{
|
|
125
|
-
indexed: false,
|
|
126
|
-
internalType: "string",
|
|
127
|
-
name: "nftId",
|
|
128
|
-
type: "string"
|
|
129
|
-
},
|
|
130
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
131
|
-
{
|
|
132
|
-
indexed: false,
|
|
133
|
-
internalType: "uint256",
|
|
134
|
-
name: "campaignId",
|
|
135
|
-
type: "uint256"
|
|
136
|
-
},
|
|
137
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
138
|
-
],
|
|
139
|
-
name: "MetadataApproved",
|
|
140
|
-
type: "event"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
anonymous: false,
|
|
144
|
-
inputs: [
|
|
145
|
-
{
|
|
146
|
-
indexed: true,
|
|
147
|
-
internalType: "address",
|
|
148
|
-
name: "user",
|
|
149
|
-
type: "address"
|
|
150
|
-
},
|
|
151
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
152
|
-
{
|
|
153
|
-
indexed: false,
|
|
154
|
-
internalType: "string",
|
|
155
|
-
name: "nftId",
|
|
156
|
-
type: "string"
|
|
157
|
-
},
|
|
158
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
159
|
-
{
|
|
160
|
-
indexed: false,
|
|
161
|
-
internalType: "uint256",
|
|
162
|
-
name: "campaignId",
|
|
163
|
-
type: "uint256"
|
|
164
|
-
},
|
|
165
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
166
|
-
],
|
|
167
|
-
name: "MetadataRejected",
|
|
168
|
-
type: "event"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
anonymous: false,
|
|
172
|
-
inputs: [
|
|
173
|
-
{
|
|
174
|
-
indexed: true,
|
|
175
|
-
internalType: "address",
|
|
176
|
-
name: "user",
|
|
177
|
-
type: "address"
|
|
178
|
-
},
|
|
179
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
180
|
-
{
|
|
181
|
-
indexed: false,
|
|
182
|
-
internalType: "string",
|
|
183
|
-
name: "nftId",
|
|
184
|
-
type: "string"
|
|
185
|
-
},
|
|
186
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
187
|
-
{
|
|
188
|
-
indexed: false,
|
|
189
|
-
internalType: "uint256",
|
|
190
|
-
name: "campaignId",
|
|
191
|
-
type: "uint256"
|
|
192
|
-
},
|
|
193
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
194
|
-
],
|
|
195
|
-
name: "MetadataSubmitted",
|
|
196
|
-
type: "event"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
anonymous: false,
|
|
200
|
-
inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
|
|
201
|
-
name: "Paused",
|
|
202
|
-
type: "event"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
anonymous: false,
|
|
206
|
-
inputs: [
|
|
207
|
-
{
|
|
208
|
-
indexed: true,
|
|
209
|
-
internalType: "address",
|
|
210
|
-
name: "user",
|
|
211
|
-
type: "address"
|
|
212
|
-
},
|
|
213
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
214
|
-
{
|
|
215
|
-
indexed: false,
|
|
216
|
-
internalType: "string",
|
|
217
|
-
name: "nftId",
|
|
218
|
-
type: "string"
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
indexed: false,
|
|
222
|
-
internalType: "uint256",
|
|
223
|
-
name: "rewardAmount",
|
|
224
|
-
type: "uint256"
|
|
225
|
-
},
|
|
226
|
-
{ indexed: false, internalType: "uint256", name: "campaignId", type: "uint256" }
|
|
227
|
-
],
|
|
228
|
-
name: "RewardDistributed",
|
|
229
|
-
type: "event"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
anonymous: false,
|
|
233
|
-
inputs: [
|
|
234
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
235
|
-
{
|
|
236
|
-
indexed: true,
|
|
237
|
-
internalType: "bytes32",
|
|
238
|
-
name: "previousAdminRole",
|
|
239
|
-
type: "bytes32"
|
|
240
|
-
},
|
|
241
|
-
{ indexed: true, internalType: "bytes32", name: "newAdminRole", type: "bytes32" }
|
|
242
|
-
],
|
|
243
|
-
name: "RoleAdminChanged",
|
|
244
|
-
type: "event"
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
anonymous: false,
|
|
248
|
-
inputs: [
|
|
249
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
250
|
-
{
|
|
251
|
-
indexed: true,
|
|
252
|
-
internalType: "address",
|
|
253
|
-
name: "account",
|
|
254
|
-
type: "address"
|
|
255
|
-
},
|
|
256
|
-
{ indexed: true, internalType: "address", name: "sender", type: "address" }
|
|
257
|
-
],
|
|
258
|
-
name: "RoleGranted",
|
|
259
|
-
type: "event"
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
anonymous: false,
|
|
263
|
-
inputs: [
|
|
264
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
265
|
-
{
|
|
266
|
-
indexed: true,
|
|
267
|
-
internalType: "address",
|
|
268
|
-
name: "account",
|
|
269
|
-
type: "address"
|
|
270
|
-
},
|
|
271
|
-
{ indexed: true, internalType: "address", name: "sender", type: "address" }
|
|
272
|
-
],
|
|
273
|
-
name: "RoleRevoked",
|
|
274
|
-
type: "event"
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
anonymous: false,
|
|
278
|
-
inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
|
|
279
|
-
name: "Unpaused",
|
|
280
|
-
type: "event"
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
anonymous: false,
|
|
284
|
-
inputs: [{ indexed: true, internalType: "address", name: "implementation", type: "address" }],
|
|
285
|
-
name: "Upgraded",
|
|
286
|
-
type: "event"
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
inputs: [],
|
|
290
|
-
name: "APPROVER_ROLE",
|
|
291
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
292
|
-
stateMutability: "view",
|
|
293
|
-
type: "function"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
inputs: [],
|
|
297
|
-
name: "DEFAULT_ADMIN_ROLE",
|
|
298
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
299
|
-
stateMutability: "view",
|
|
300
|
-
type: "function"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
inputs: [],
|
|
304
|
-
name: "UPGRADE_INTERFACE_VERSION",
|
|
305
|
-
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
306
|
-
stateMutability: "view",
|
|
307
|
-
type: "function"
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
inputs: [
|
|
311
|
-
{ internalType: "address", name: "_user", type: "address" },
|
|
312
|
-
{
|
|
313
|
-
internalType: "string",
|
|
314
|
-
name: "_pid",
|
|
315
|
-
type: "string"
|
|
316
|
-
},
|
|
317
|
-
{ internalType: "string", name: "_nftId", type: "string" },
|
|
318
|
-
{
|
|
319
|
-
internalType: "string",
|
|
320
|
-
name: "_metadataURL",
|
|
321
|
-
type: "string"
|
|
322
|
-
},
|
|
323
|
-
{ internalType: "uint256", name: "_campaignId", type: "uint256" }
|
|
324
|
-
],
|
|
325
|
-
name: "approveMetadata",
|
|
326
|
-
outputs: [],
|
|
327
|
-
stateMutability: "nonpayable",
|
|
328
|
-
type: "function"
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
inputs: [],
|
|
332
|
-
name: "campaignCount",
|
|
333
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
334
|
-
stateMutability: "view",
|
|
335
|
-
type: "function"
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
339
|
-
name: "campaigns",
|
|
340
|
-
outputs: [
|
|
341
|
-
{ internalType: "string", name: "name", type: "string" },
|
|
342
|
-
{
|
|
343
|
-
internalType: "uint256",
|
|
344
|
-
name: "rewardAmount",
|
|
345
|
-
type: "uint256"
|
|
346
|
-
},
|
|
347
|
-
{ internalType: "bool", name: "isActive", type: "bool" }
|
|
348
|
-
],
|
|
349
|
-
stateMutability: "view",
|
|
350
|
-
type: "function"
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
inputs: [
|
|
354
|
-
{ internalType: "string", name: "_name", type: "string" },
|
|
355
|
-
{
|
|
356
|
-
internalType: "uint256",
|
|
357
|
-
name: "_rewardAmount",
|
|
358
|
-
type: "uint256"
|
|
359
|
-
}
|
|
360
|
-
],
|
|
361
|
-
name: "createCampaign",
|
|
362
|
-
outputs: [],
|
|
363
|
-
stateMutability: "nonpayable",
|
|
364
|
-
type: "function"
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
inputs: [],
|
|
368
|
-
name: "defaultRewardAmount",
|
|
369
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
370
|
-
stateMutability: "view",
|
|
371
|
-
type: "function"
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
|
|
375
|
-
name: "getRoleAdmin",
|
|
376
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
377
|
-
stateMutability: "view",
|
|
378
|
-
type: "function"
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
inputs: [
|
|
382
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
383
|
-
{
|
|
384
|
-
internalType: "address",
|
|
385
|
-
name: "account",
|
|
386
|
-
type: "address"
|
|
387
|
-
}
|
|
388
|
-
],
|
|
389
|
-
name: "grantRole",
|
|
390
|
-
outputs: [],
|
|
391
|
-
stateMutability: "nonpayable",
|
|
392
|
-
type: "function"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
inputs: [
|
|
396
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
397
|
-
{
|
|
398
|
-
internalType: "address",
|
|
399
|
-
name: "account",
|
|
400
|
-
type: "address"
|
|
401
|
-
}
|
|
402
|
-
],
|
|
403
|
-
name: "hasRole",
|
|
404
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
405
|
-
stateMutability: "view",
|
|
406
|
-
type: "function"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
inputs: [
|
|
410
|
-
{
|
|
411
|
-
internalType: "address",
|
|
412
|
-
name: "initialOwner",
|
|
413
|
-
type: "address"
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
internalType: "contract IERC20",
|
|
417
|
-
name: "_rewardToken",
|
|
418
|
-
type: "address"
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
internalType: "contract IPetToken",
|
|
422
|
-
name: "_petToken",
|
|
423
|
-
type: "address"
|
|
424
|
-
},
|
|
425
|
-
{ internalType: "uint256", name: "_defaultRewardAmount", type: "uint256" }
|
|
426
|
-
],
|
|
427
|
-
name: "initialize",
|
|
428
|
-
outputs: [],
|
|
429
|
-
stateMutability: "nonpayable",
|
|
430
|
-
type: "function"
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
inputs: [],
|
|
434
|
-
name: "pause",
|
|
435
|
-
outputs: [],
|
|
436
|
-
stateMutability: "nonpayable",
|
|
437
|
-
type: "function"
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
inputs: [],
|
|
441
|
-
name: "paused",
|
|
442
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
443
|
-
stateMutability: "view",
|
|
444
|
-
type: "function"
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
inputs: [],
|
|
448
|
-
name: "petToken",
|
|
449
|
-
outputs: [{ internalType: "contract IPetToken", name: "", type: "address" }],
|
|
450
|
-
stateMutability: "view",
|
|
451
|
-
type: "function"
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
inputs: [],
|
|
455
|
-
name: "proxiableUUID",
|
|
456
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
457
|
-
stateMutability: "view",
|
|
458
|
-
type: "function"
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
inputs: [
|
|
462
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
463
|
-
{
|
|
464
|
-
internalType: "address",
|
|
465
|
-
name: "callerConfirmation",
|
|
466
|
-
type: "address"
|
|
467
|
-
}
|
|
468
|
-
],
|
|
469
|
-
name: "renounceRole",
|
|
470
|
-
outputs: [],
|
|
471
|
-
stateMutability: "nonpayable",
|
|
472
|
-
type: "function"
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
inputs: [
|
|
476
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
477
|
-
{
|
|
478
|
-
internalType: "address",
|
|
479
|
-
name: "account",
|
|
480
|
-
type: "address"
|
|
481
|
-
}
|
|
482
|
-
],
|
|
483
|
-
name: "revokeRole",
|
|
484
|
-
outputs: [],
|
|
485
|
-
stateMutability: "nonpayable",
|
|
486
|
-
type: "function"
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
inputs: [],
|
|
490
|
-
name: "rewardToken",
|
|
491
|
-
outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
|
|
492
|
-
stateMutability: "view",
|
|
493
|
-
type: "function"
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
inputs: [
|
|
497
|
-
{ internalType: "string", name: "_pid", type: "string" },
|
|
498
|
-
{
|
|
499
|
-
internalType: "string",
|
|
500
|
-
name: "_nftId",
|
|
501
|
-
type: "string"
|
|
502
|
-
},
|
|
503
|
-
{ internalType: "string", name: "_metadataURL", type: "string" },
|
|
504
|
-
{
|
|
505
|
-
internalType: "uint256",
|
|
506
|
-
name: "_campaignId",
|
|
507
|
-
type: "uint256"
|
|
508
|
-
}
|
|
509
|
-
],
|
|
510
|
-
name: "submitMetadata",
|
|
511
|
-
outputs: [],
|
|
512
|
-
stateMutability: "nonpayable",
|
|
513
|
-
type: "function"
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
inputs: [
|
|
517
|
-
{ internalType: "string", name: "_pid", type: "string" },
|
|
518
|
-
{
|
|
519
|
-
internalType: "string",
|
|
520
|
-
name: "_nftId",
|
|
521
|
-
type: "string"
|
|
522
|
-
},
|
|
523
|
-
{ internalType: "string", name: "_metadataURL", type: "string" },
|
|
524
|
-
{
|
|
525
|
-
internalType: "string",
|
|
526
|
-
name: "_campaignName",
|
|
527
|
-
type: "string"
|
|
528
|
-
}
|
|
529
|
-
],
|
|
530
|
-
name: "submitMetadataByCampaignName",
|
|
531
|
-
outputs: [],
|
|
532
|
-
stateMutability: "nonpayable",
|
|
533
|
-
type: "function"
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
537
|
-
name: "supportsInterface",
|
|
538
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
539
|
-
stateMutability: "view",
|
|
540
|
-
type: "function"
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
inputs: [],
|
|
544
|
-
name: "unpause",
|
|
545
|
-
outputs: [],
|
|
546
|
-
stateMutability: "nonpayable",
|
|
547
|
-
type: "function"
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
inputs: [
|
|
551
|
-
{
|
|
552
|
-
internalType: "uint256",
|
|
553
|
-
name: "_campaignId",
|
|
554
|
-
type: "uint256"
|
|
555
|
-
},
|
|
556
|
-
{ internalType: "uint256", name: "_rewardAmount", type: "uint256" },
|
|
557
|
-
{
|
|
558
|
-
internalType: "bool",
|
|
559
|
-
name: "_isActive",
|
|
560
|
-
type: "bool"
|
|
561
|
-
}
|
|
562
|
-
],
|
|
563
|
-
name: "updateCampaign",
|
|
564
|
-
outputs: [],
|
|
565
|
-
stateMutability: "nonpayable",
|
|
566
|
-
type: "function"
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
inputs: [{ internalType: "uint256", name: "_rewardAmount", type: "uint256" }],
|
|
570
|
-
name: "updateDefaultReward",
|
|
571
|
-
outputs: [],
|
|
572
|
-
stateMutability: "nonpayable",
|
|
573
|
-
type: "function"
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
inputs: [
|
|
577
|
-
{
|
|
578
|
-
internalType: "address",
|
|
579
|
-
name: "newImplementation",
|
|
580
|
-
type: "address"
|
|
581
|
-
},
|
|
582
|
-
{ internalType: "bytes", name: "data", type: "bytes" }
|
|
583
|
-
],
|
|
584
|
-
name: "upgradeToAndCall",
|
|
585
|
-
outputs: [],
|
|
586
|
-
stateMutability: "payable",
|
|
587
|
-
type: "function"
|
|
588
|
-
}
|
|
589
|
-
];
|
|
51
|
+
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" }];
|
|
590
52
|
var VERIFY_ACCOUNT_ABI = [
|
|
591
53
|
{
|
|
592
54
|
inputs: [
|
|
@@ -912,21 +374,27 @@ function useFetchNotifications() {
|
|
|
912
374
|
}
|
|
913
375
|
try {
|
|
914
376
|
const query = `
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
377
|
+
query AnymalNotification($groupBy: [AnymalNotificationField!], $filter: AnymalNotificationFilterArg) {
|
|
378
|
+
AnymalNotification(groupBy: $groupBy, filter: $filter) {
|
|
379
|
+
anymalTxId
|
|
380
|
+
title
|
|
381
|
+
_group {
|
|
382
|
+
source
|
|
383
|
+
action
|
|
384
|
+
anymalTxId
|
|
385
|
+
id
|
|
386
|
+
pid
|
|
387
|
+
read
|
|
388
|
+
source
|
|
389
|
+
tags
|
|
390
|
+
text
|
|
391
|
+
title
|
|
392
|
+
timeAddedUtc
|
|
393
|
+
timeUpdatedUtc
|
|
394
|
+
type
|
|
928
395
|
}
|
|
929
396
|
}
|
|
397
|
+
}
|
|
930
398
|
`;
|
|
931
399
|
const filter = {
|
|
932
400
|
pid: {
|
|
@@ -934,7 +402,8 @@ function useFetchNotifications() {
|
|
|
934
402
|
},
|
|
935
403
|
...additionalFilters || {}
|
|
936
404
|
};
|
|
937
|
-
const
|
|
405
|
+
const groupBy = ["anymalTxId", "title"];
|
|
406
|
+
const variables = { filter, groupBy };
|
|
938
407
|
const response = await fetch(endpoint, {
|
|
939
408
|
method: "POST",
|
|
940
409
|
headers: {
|
|
@@ -947,8 +416,8 @@ function useFetchNotifications() {
|
|
|
947
416
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
948
417
|
}
|
|
949
418
|
const data = await response.json();
|
|
950
|
-
if (data?.data?.
|
|
951
|
-
return data.data.
|
|
419
|
+
if (data?.data?.AnymalNotification?.length > 0) {
|
|
420
|
+
return data.data.AnymalNotification;
|
|
952
421
|
} else {
|
|
953
422
|
return null;
|
|
954
423
|
}
|
|
@@ -966,7 +435,7 @@ var import_viem2 = require("viem");
|
|
|
966
435
|
var import_react10 = require("react");
|
|
967
436
|
function useMintAnymalNFT() {
|
|
968
437
|
return (0, import_react10.useCallback)(
|
|
969
|
-
async (pid, nftId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
|
|
438
|
+
async (pid, nftId, anymalTxId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
|
|
970
439
|
if (!dbAuthToken || !nftId || !bundlerClient || !smartAccount || !pid || !validationContractAddress) {
|
|
971
440
|
return {
|
|
972
441
|
success: false,
|
|
@@ -980,7 +449,8 @@ function useMintAnymalNFT() {
|
|
|
980
449
|
pid,
|
|
981
450
|
nftId,
|
|
982
451
|
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
983
|
-
"petastic-signup-campaign-1"
|
|
452
|
+
"petastic-signup-campaign-1",
|
|
453
|
+
anymalTxId
|
|
984
454
|
]
|
|
985
455
|
});
|
|
986
456
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
@@ -1114,7 +584,7 @@ function useDeleteAnymalFromDatabase() {
|
|
|
1114
584
|
var import_react13 = require("react");
|
|
1115
585
|
function useSaveAnymalMetadata() {
|
|
1116
586
|
return (0, import_react13.useCallback)(
|
|
1117
|
-
async (idToken, publicKey, nftMetadataInput, authServiceBaseUrl) => {
|
|
587
|
+
async (userPid, anymalTxId, idToken, publicKey, nftMetadataInput, authServiceBaseUrl) => {
|
|
1118
588
|
const response = await fetch(`${authServiceBaseUrl}/process-nft`, {
|
|
1119
589
|
method: "POST",
|
|
1120
590
|
headers: {
|
|
@@ -1123,7 +593,9 @@ function useSaveAnymalMetadata() {
|
|
|
1123
593
|
},
|
|
1124
594
|
body: JSON.stringify({
|
|
1125
595
|
appPubKey: publicKey,
|
|
1126
|
-
nftMetadataInput
|
|
596
|
+
nftMetadataInput,
|
|
597
|
+
pid: userPid,
|
|
598
|
+
anymalTxId
|
|
1127
599
|
})
|
|
1128
600
|
});
|
|
1129
601
|
const data = await response.json();
|