@pyratzlabs/react-fhevm-utils 2.0.4 → 2.2.0

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.
Files changed (35) hide show
  1. package/dist/client/context/FhevmProvider.d.ts +15 -0
  2. package/dist/client/context/FhevmProvider.js +34 -0
  3. package/dist/client/hooks/useDecryptHandles.d.ts +70 -0
  4. package/dist/client/hooks/useDecryptHandles.js +41 -0
  5. package/dist/client/hooks/useEncryptValue.d.ts +104 -0
  6. package/dist/client/hooks/useEncryptValue.js +21 -0
  7. package/dist/client/hooks/useEncryptedApprove.d.ts +11 -0
  8. package/dist/client/hooks/useEncryptedApprove.js +26 -0
  9. package/dist/client/hooks/useEncryptedBatchTransfer.d.ts +17 -0
  10. package/dist/client/hooks/useEncryptedBatchTransfer.js +21 -0
  11. package/dist/client/hooks/useEncryptedTransfer.d.ts +11 -0
  12. package/dist/client/hooks/useEncryptedTransfer.js +24 -0
  13. package/dist/client/hooks/useFhevmInstance.d.ts +3 -0
  14. package/dist/client/hooks/useFhevmInstance.js +5 -0
  15. package/dist/client/hooks/useGetEncryptedBalance.d.ts +8 -0
  16. package/dist/client/hooks/useGetEncryptedBalance.js +16 -0
  17. package/dist/client/hooks/useGetFhevmConfig.d.ts +3 -0
  18. package/dist/client/hooks/useGetFhevmConfig.js +5 -0
  19. package/dist/client/hooks/usePerformTransaction.d.ts +17 -0
  20. package/dist/client/hooks/usePerformTransaction.js +40 -0
  21. package/dist/client/hooks/useUnwrap.d.ts +11 -0
  22. package/dist/client/hooks/useUnwrap.js +27 -0
  23. package/dist/index.d.ts +8 -7
  24. package/dist/index.js +8 -7
  25. package/dist/server/encrypt.d.ts +6 -0
  26. package/dist/server/encrypt.js +21 -0
  27. package/dist/server.d.ts +1 -0
  28. package/dist/server.js +1 -0
  29. package/dist/types/ABI/FeeManager.abi.d.ts +392 -0
  30. package/dist/types/ABI/FeeManager.abi.js +508 -0
  31. package/dist/types/ABI/TransferBatcher.abi.d.ts +63 -0
  32. package/dist/types/ABI/TransferBatcher.abi.js +81 -0
  33. package/dist/types/ABI/encryptedABI.d.ts +1107 -0
  34. package/dist/types/ABI/encryptedABI.js +1439 -0
  35. package/package.json +1 -1
@@ -0,0 +1,508 @@
1
+ export const FEE_MANAGER_ABI = [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: "uint64",
6
+ name: "transferFee_",
7
+ type: "uint64",
8
+ },
9
+ {
10
+ internalType: "uint64",
11
+ name: "wrapFeeBasisPoints_",
12
+ type: "uint64",
13
+ },
14
+ {
15
+ internalType: "uint64",
16
+ name: "unwrapFeeBasisPoints_",
17
+ type: "uint64",
18
+ },
19
+ {
20
+ internalType: "uint64",
21
+ name: "deployFee_",
22
+ type: "uint64",
23
+ },
24
+ {
25
+ internalType: "address",
26
+ name: "feeRecipient_",
27
+ type: "address",
28
+ },
29
+ ],
30
+ stateMutability: "nonpayable",
31
+ type: "constructor",
32
+ },
33
+ {
34
+ inputs: [],
35
+ name: "FeeExceedsMaximum",
36
+ type: "error",
37
+ },
38
+ {
39
+ inputs: [
40
+ {
41
+ internalType: "address",
42
+ name: "owner",
43
+ type: "address",
44
+ },
45
+ ],
46
+ name: "OwnableInvalidOwner",
47
+ type: "error",
48
+ },
49
+ {
50
+ inputs: [
51
+ {
52
+ internalType: "address",
53
+ name: "account",
54
+ type: "address",
55
+ },
56
+ ],
57
+ name: "OwnableUnauthorizedAccount",
58
+ type: "error",
59
+ },
60
+ {
61
+ inputs: [],
62
+ name: "ZeroAddressFeeRecipient",
63
+ type: "error",
64
+ },
65
+ {
66
+ anonymous: false,
67
+ inputs: [
68
+ {
69
+ indexed: false,
70
+ internalType: "uint64",
71
+ name: "oldDeployFee",
72
+ type: "uint64",
73
+ },
74
+ {
75
+ indexed: false,
76
+ internalType: "uint64",
77
+ name: "newDeployFee",
78
+ type: "uint64",
79
+ },
80
+ ],
81
+ name: "DeployFeeUpdated",
82
+ type: "event",
83
+ },
84
+ {
85
+ anonymous: false,
86
+ inputs: [
87
+ {
88
+ indexed: true,
89
+ internalType: "address",
90
+ name: "oldRecipient",
91
+ type: "address",
92
+ },
93
+ {
94
+ indexed: true,
95
+ internalType: "address",
96
+ name: "newRecipient",
97
+ type: "address",
98
+ },
99
+ ],
100
+ name: "FeeRecipientUpdated",
101
+ type: "event",
102
+ },
103
+ {
104
+ anonymous: false,
105
+ inputs: [
106
+ {
107
+ indexed: true,
108
+ internalType: "address",
109
+ name: "previousOwner",
110
+ type: "address",
111
+ },
112
+ {
113
+ indexed: true,
114
+ internalType: "address",
115
+ name: "newOwner",
116
+ type: "address",
117
+ },
118
+ ],
119
+ name: "OwnershipTransferStarted",
120
+ type: "event",
121
+ },
122
+ {
123
+ anonymous: false,
124
+ inputs: [
125
+ {
126
+ indexed: true,
127
+ internalType: "address",
128
+ name: "previousOwner",
129
+ type: "address",
130
+ },
131
+ {
132
+ indexed: true,
133
+ internalType: "address",
134
+ name: "newOwner",
135
+ type: "address",
136
+ },
137
+ ],
138
+ name: "OwnershipTransferred",
139
+ type: "event",
140
+ },
141
+ {
142
+ anonymous: false,
143
+ inputs: [
144
+ {
145
+ indexed: false,
146
+ internalType: "uint64",
147
+ name: "oldTransferFee",
148
+ type: "uint64",
149
+ },
150
+ {
151
+ indexed: false,
152
+ internalType: "uint64",
153
+ name: "newTransferFee",
154
+ type: "uint64",
155
+ },
156
+ ],
157
+ name: "TransferFeeUpdated",
158
+ type: "event",
159
+ },
160
+ {
161
+ anonymous: false,
162
+ inputs: [
163
+ {
164
+ indexed: false,
165
+ internalType: "uint64",
166
+ name: "oldFeeBasisPoints",
167
+ type: "uint64",
168
+ },
169
+ {
170
+ indexed: false,
171
+ internalType: "uint64",
172
+ name: "newFeeBasisPoints",
173
+ type: "uint64",
174
+ },
175
+ ],
176
+ name: "UnwrapFeeBasisPointsUpdated",
177
+ type: "event",
178
+ },
179
+ {
180
+ anonymous: false,
181
+ inputs: [
182
+ {
183
+ indexed: false,
184
+ internalType: "uint64",
185
+ name: "oldFeeBasisPoints",
186
+ type: "uint64",
187
+ },
188
+ {
189
+ indexed: false,
190
+ internalType: "uint64",
191
+ name: "newFeeBasisPoints",
192
+ type: "uint64",
193
+ },
194
+ ],
195
+ name: "WrapFeeBasisPointsUpdated",
196
+ type: "event",
197
+ },
198
+ {
199
+ inputs: [],
200
+ name: "acceptOwnership",
201
+ outputs: [],
202
+ stateMutability: "nonpayable",
203
+ type: "function",
204
+ },
205
+ {
206
+ inputs: [],
207
+ name: "deployFee",
208
+ outputs: [
209
+ {
210
+ internalType: "uint64",
211
+ name: "",
212
+ type: "uint64",
213
+ },
214
+ ],
215
+ stateMutability: "view",
216
+ type: "function",
217
+ },
218
+ {
219
+ inputs: [],
220
+ name: "feeRecipient",
221
+ outputs: [
222
+ {
223
+ internalType: "address",
224
+ name: "",
225
+ type: "address",
226
+ },
227
+ ],
228
+ stateMutability: "view",
229
+ type: "function",
230
+ },
231
+ {
232
+ inputs: [
233
+ {
234
+ internalType: "address",
235
+ name: "deployer",
236
+ type: "address",
237
+ },
238
+ ],
239
+ name: "getDeployFee",
240
+ outputs: [
241
+ {
242
+ internalType: "uint64",
243
+ name: "",
244
+ type: "uint64",
245
+ },
246
+ ],
247
+ stateMutability: "view",
248
+ type: "function",
249
+ },
250
+ {
251
+ inputs: [],
252
+ name: "getFeeRecipient",
253
+ outputs: [
254
+ {
255
+ internalType: "address",
256
+ name: "",
257
+ type: "address",
258
+ },
259
+ ],
260
+ stateMutability: "view",
261
+ type: "function",
262
+ },
263
+ {
264
+ inputs: [
265
+ {
266
+ internalType: "address",
267
+ name: "transferFrom",
268
+ type: "address",
269
+ },
270
+ {
271
+ internalType: "address",
272
+ name: "transferTo",
273
+ type: "address",
274
+ },
275
+ ],
276
+ name: "getTransferFee",
277
+ outputs: [
278
+ {
279
+ internalType: "uint64",
280
+ name: "",
281
+ type: "uint64",
282
+ },
283
+ ],
284
+ stateMutability: "view",
285
+ type: "function",
286
+ },
287
+ {
288
+ inputs: [
289
+ {
290
+ internalType: "euint64",
291
+ name: "amount",
292
+ type: "bytes32",
293
+ },
294
+ {
295
+ internalType: "address",
296
+ name: "unwrapFrom",
297
+ type: "address",
298
+ },
299
+ {
300
+ internalType: "address",
301
+ name: "unwrapTo",
302
+ type: "address",
303
+ },
304
+ ],
305
+ name: "getUnwrapFee",
306
+ outputs: [
307
+ {
308
+ internalType: "euint64",
309
+ name: "",
310
+ type: "bytes32",
311
+ },
312
+ ],
313
+ stateMutability: "nonpayable",
314
+ type: "function",
315
+ },
316
+ {
317
+ inputs: [
318
+ {
319
+ internalType: "uint64",
320
+ name: "amount",
321
+ type: "uint64",
322
+ },
323
+ {
324
+ internalType: "address",
325
+ name: "wrapFrom",
326
+ type: "address",
327
+ },
328
+ {
329
+ internalType: "address",
330
+ name: "wrapTo",
331
+ type: "address",
332
+ },
333
+ ],
334
+ name: "getWrapFee",
335
+ outputs: [
336
+ {
337
+ internalType: "uint64",
338
+ name: "",
339
+ type: "uint64",
340
+ },
341
+ ],
342
+ stateMutability: "view",
343
+ type: "function",
344
+ },
345
+ {
346
+ inputs: [],
347
+ name: "owner",
348
+ outputs: [
349
+ {
350
+ internalType: "address",
351
+ name: "",
352
+ type: "address",
353
+ },
354
+ ],
355
+ stateMutability: "view",
356
+ type: "function",
357
+ },
358
+ {
359
+ inputs: [],
360
+ name: "pendingOwner",
361
+ outputs: [
362
+ {
363
+ internalType: "address",
364
+ name: "",
365
+ type: "address",
366
+ },
367
+ ],
368
+ stateMutability: "view",
369
+ type: "function",
370
+ },
371
+ {
372
+ inputs: [],
373
+ name: "protocolId",
374
+ outputs: [
375
+ {
376
+ internalType: "uint256",
377
+ name: "",
378
+ type: "uint256",
379
+ },
380
+ ],
381
+ stateMutability: "pure",
382
+ type: "function",
383
+ },
384
+ {
385
+ inputs: [],
386
+ name: "renounceOwnership",
387
+ outputs: [],
388
+ stateMutability: "nonpayable",
389
+ type: "function",
390
+ },
391
+ {
392
+ inputs: [
393
+ {
394
+ internalType: "uint64",
395
+ name: "newDeployFee",
396
+ type: "uint64",
397
+ },
398
+ ],
399
+ name: "setDeployFee",
400
+ outputs: [],
401
+ stateMutability: "nonpayable",
402
+ type: "function",
403
+ },
404
+ {
405
+ inputs: [
406
+ {
407
+ internalType: "address",
408
+ name: "recipient",
409
+ type: "address",
410
+ },
411
+ ],
412
+ name: "setFeeRecipient",
413
+ outputs: [],
414
+ stateMutability: "nonpayable",
415
+ type: "function",
416
+ },
417
+ {
418
+ inputs: [
419
+ {
420
+ internalType: "uint64",
421
+ name: "newTransferFee",
422
+ type: "uint64",
423
+ },
424
+ ],
425
+ name: "setTransferFee",
426
+ outputs: [],
427
+ stateMutability: "nonpayable",
428
+ type: "function",
429
+ },
430
+ {
431
+ inputs: [
432
+ {
433
+ internalType: "uint64",
434
+ name: "feeBasisPoints",
435
+ type: "uint64",
436
+ },
437
+ ],
438
+ name: "setUnwrapFeeBasisPoints",
439
+ outputs: [],
440
+ stateMutability: "nonpayable",
441
+ type: "function",
442
+ },
443
+ {
444
+ inputs: [
445
+ {
446
+ internalType: "uint64",
447
+ name: "feeBasisPoints",
448
+ type: "uint64",
449
+ },
450
+ ],
451
+ name: "setWrapFeeBasisPoints",
452
+ outputs: [],
453
+ stateMutability: "nonpayable",
454
+ type: "function",
455
+ },
456
+ {
457
+ inputs: [],
458
+ name: "transferFee",
459
+ outputs: [
460
+ {
461
+ internalType: "uint64",
462
+ name: "",
463
+ type: "uint64",
464
+ },
465
+ ],
466
+ stateMutability: "view",
467
+ type: "function",
468
+ },
469
+ {
470
+ inputs: [
471
+ {
472
+ internalType: "address",
473
+ name: "newOwner",
474
+ type: "address",
475
+ },
476
+ ],
477
+ name: "transferOwnership",
478
+ outputs: [],
479
+ stateMutability: "nonpayable",
480
+ type: "function",
481
+ },
482
+ {
483
+ inputs: [],
484
+ name: "unwrapFeeBasisPoints",
485
+ outputs: [
486
+ {
487
+ internalType: "uint64",
488
+ name: "",
489
+ type: "uint64",
490
+ },
491
+ ],
492
+ stateMutability: "view",
493
+ type: "function",
494
+ },
495
+ {
496
+ inputs: [],
497
+ name: "wrapFeeBasisPoints",
498
+ outputs: [
499
+ {
500
+ internalType: "uint64",
501
+ name: "",
502
+ type: "uint64",
503
+ },
504
+ ],
505
+ stateMutability: "view",
506
+ type: "function",
507
+ },
508
+ ];
@@ -0,0 +1,63 @@
1
+ export declare const TRANSFER_BATCHER_ABI: readonly [{
2
+ readonly anonymous: false;
3
+ readonly inputs: readonly [{
4
+ readonly indexed: false;
5
+ readonly internalType: "address";
6
+ readonly name: "cToken";
7
+ readonly type: "address";
8
+ }, {
9
+ readonly indexed: false;
10
+ readonly internalType: "address";
11
+ readonly name: "sender";
12
+ readonly type: "address";
13
+ }, {
14
+ readonly indexed: false;
15
+ readonly internalType: "uint256";
16
+ readonly name: "startTxId";
17
+ readonly type: "uint256";
18
+ }, {
19
+ readonly indexed: false;
20
+ readonly internalType: "uint256";
21
+ readonly name: "endTxId";
22
+ readonly type: "uint256";
23
+ }];
24
+ readonly name: "BatchTransfer";
25
+ readonly type: "event";
26
+ }, {
27
+ readonly inputs: readonly [{
28
+ readonly internalType: "contract RegulatedERC7984Upgradeable";
29
+ readonly name: "cToken";
30
+ readonly type: "address";
31
+ }, {
32
+ readonly components: readonly [{
33
+ readonly internalType: "address";
34
+ readonly name: "to";
35
+ readonly type: "address";
36
+ }, {
37
+ readonly internalType: "externalEuint64";
38
+ readonly name: "encryptedAmount";
39
+ readonly type: "bytes32";
40
+ }, {
41
+ readonly internalType: "bytes";
42
+ readonly name: "inputProof";
43
+ readonly type: "bytes";
44
+ }];
45
+ readonly internalType: "struct ERC7984TransferBatcher.ConfidentialTransferInput[]";
46
+ readonly name: "transfers";
47
+ readonly type: "tuple[]";
48
+ }];
49
+ readonly name: "confidentialBatchTransfer";
50
+ readonly outputs: readonly [];
51
+ readonly stateMutability: "nonpayable";
52
+ readonly type: "function";
53
+ }, {
54
+ readonly inputs: readonly [];
55
+ readonly name: "protocolId";
56
+ readonly outputs: readonly [{
57
+ readonly internalType: "uint256";
58
+ readonly name: "";
59
+ readonly type: "uint256";
60
+ }];
61
+ readonly stateMutability: "pure";
62
+ readonly type: "function";
63
+ }];
@@ -0,0 +1,81 @@
1
+ export const TRANSFER_BATCHER_ABI = [
2
+ {
3
+ anonymous: false,
4
+ inputs: [
5
+ {
6
+ indexed: false,
7
+ internalType: "address",
8
+ name: "cToken",
9
+ type: "address",
10
+ },
11
+ {
12
+ indexed: false,
13
+ internalType: "address",
14
+ name: "sender",
15
+ type: "address",
16
+ },
17
+ {
18
+ indexed: false,
19
+ internalType: "uint256",
20
+ name: "startTxId",
21
+ type: "uint256",
22
+ },
23
+ {
24
+ indexed: false,
25
+ internalType: "uint256",
26
+ name: "endTxId",
27
+ type: "uint256",
28
+ },
29
+ ],
30
+ name: "BatchTransfer",
31
+ type: "event",
32
+ },
33
+ {
34
+ inputs: [
35
+ {
36
+ internalType: "contract RegulatedERC7984Upgradeable",
37
+ name: "cToken",
38
+ type: "address",
39
+ },
40
+ {
41
+ components: [
42
+ {
43
+ internalType: "address",
44
+ name: "to",
45
+ type: "address",
46
+ },
47
+ {
48
+ internalType: "externalEuint64",
49
+ name: "encryptedAmount",
50
+ type: "bytes32",
51
+ },
52
+ {
53
+ internalType: "bytes",
54
+ name: "inputProof",
55
+ type: "bytes",
56
+ },
57
+ ],
58
+ internalType: "struct ERC7984TransferBatcher.ConfidentialTransferInput[]",
59
+ name: "transfers",
60
+ type: "tuple[]",
61
+ },
62
+ ],
63
+ name: "confidentialBatchTransfer",
64
+ outputs: [],
65
+ stateMutability: "nonpayable",
66
+ type: "function",
67
+ },
68
+ {
69
+ inputs: [],
70
+ name: "protocolId",
71
+ outputs: [
72
+ {
73
+ internalType: "uint256",
74
+ name: "",
75
+ type: "uint256",
76
+ },
77
+ ],
78
+ stateMutability: "pure",
79
+ type: "function",
80
+ },
81
+ ];