@pyratzlabs/react-fhevm-utils 1.0.3 → 1.0.4
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/README.md +5 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,11 +26,11 @@ This will download and install the @pyratzlabs/react-fhevm-utils library and its
|
|
|
26
26
|
npm install @tanstack/react-query ethers wagmi
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
You can
|
|
29
|
+
You can also use yarn or pnpm depending on your preferences
|
|
30
30
|
|
|
31
31
|
### Providers
|
|
32
32
|
|
|
33
|
-
You can declare these providers
|
|
33
|
+
You can declare these providers at the root of your projet, wherever it makes more sense to you.
|
|
34
34
|
|
|
35
35
|
```tsx
|
|
36
36
|
// src/app/layout.tsx
|
|
@@ -73,9 +73,11 @@ To retrieve user encrypted balance you can use useGetEncryptedBalance hook.
|
|
|
73
73
|
|
|
74
74
|
import React from "react";
|
|
75
75
|
|
|
76
|
+
const TOKEN_ADDRESS = "0xD61a80ec935D210b54FC97F0FBCB8C4793bE80C8";
|
|
77
|
+
|
|
76
78
|
export default function Home() {
|
|
77
79
|
const { encryptedBalance } = useGetEncryptedBalance({
|
|
78
|
-
tokenAddress:
|
|
80
|
+
tokenAddress: TOKEN_ADDRESS,
|
|
79
81
|
});
|
|
80
82
|
|
|
81
83
|
return (
|
|
@@ -278,26 +280,6 @@ export default function Home() {
|
|
|
278
280
|
}
|
|
279
281
|
```
|
|
280
282
|
|
|
281
|
-
## Retrieve Fhevm instance
|
|
282
|
-
|
|
283
|
-
To retrieve fhevm instance you can use useFhevmInstance hook.
|
|
284
|
-
|
|
285
|
-
```tsx
|
|
286
|
-
// src/app/page.tsx
|
|
287
|
-
|
|
288
|
-
import React from "react";
|
|
289
|
-
|
|
290
|
-
export default function Home() {
|
|
291
|
-
const { instance } = useFhevmInstance();
|
|
292
|
-
|
|
293
|
-
return (
|
|
294
|
-
<div className="space-y-4">
|
|
295
|
-
<p>Fhevm instance : {instance.toString()}</p>
|
|
296
|
-
</div>
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
```
|
|
300
|
-
|
|
301
283
|
## Override Fhvem configuration
|
|
302
284
|
|
|
303
285
|
You can override Fhevm configuration depending on the chain you're working with.
|