@pyratzlabs/react-fhevm-utils 3.5.4 → 3.5.6
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/{src/index.d.ts → index.d.ts} +0 -1
- package/dist/{src/index.js → index.js} +0 -2
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +2 -0
- package/package.json +5 -1
- package/dist/package.json +0 -40
- package/dist/src/config.test.d.ts +0 -1
- package/dist/src/config.test.js +0 -57
- /package/dist/{src/client → client}/context/FhevmProvider.d.ts +0 -0
- /package/dist/{src/client → client}/context/FhevmProvider.js +0 -0
- /package/dist/{src/client → client}/hooks/useAccount.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useAccount.js +0 -0
- /package/dist/{src/client → client}/hooks/useDecryptHandles.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useDecryptHandles.js +0 -0
- /package/dist/{src/client → client}/hooks/useEncryptValue.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useEncryptValue.js +0 -0
- /package/dist/{src/client → client}/hooks/useEncryptedBatchTransfer.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useEncryptedBatchTransfer.js +0 -0
- /package/dist/{src/client → client}/hooks/useEncryptedTransfer.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useEncryptedTransfer.js +0 -0
- /package/dist/{src/client → client}/hooks/useFhevmInstance.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useFhevmInstance.js +0 -0
- /package/dist/{src/client → client}/hooks/useFinalizeUnwrap.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useFinalizeUnwrap.js +0 -0
- /package/dist/{src/client → client}/hooks/useGetEncryptedBalance.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useGetEncryptedBalance.js +0 -0
- /package/dist/{src/client → client}/hooks/useGetFhevmConfig.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useGetFhevmConfig.js +0 -0
- /package/dist/{src/client → client}/hooks/usePerformTransaction.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/usePerformTransaction.js +0 -0
- /package/dist/{src/client → client}/hooks/usePublicDecrypt.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/usePublicDecrypt.js +0 -0
- /package/dist/{src/client → client}/hooks/useSetOperator.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useSetOperator.js +0 -0
- /package/dist/{src/client → client}/hooks/useUnwrap.d.ts +0 -0
- /package/dist/{src/client → client}/hooks/useUnwrap.js +0 -0
- /package/dist/{src/config.d.ts → config.d.ts} +0 -0
- /package/dist/{src/config.js → config.js} +0 -0
- /package/dist/{src/lib → lib}/fhevm.d.ts +0 -0
- /package/dist/{src/lib → lib}/fhevm.js +0 -0
- /package/dist/{src/server → server}/encrypt.d.ts +0 -0
- /package/dist/{src/server → server}/encrypt.js +0 -0
- /package/dist/{src/server.d.ts → server.d.ts} +0 -0
- /package/dist/{src/server.js → server.js} +0 -0
- /package/dist/{src/types → types}/ABI/FeeManager.abi.d.ts +0 -0
- /package/dist/{src/types → types}/ABI/FeeManager.abi.js +0 -0
- /package/dist/{src/types → types}/ABI/TransferBatcher.abi.d.ts +0 -0
- /package/dist/{src/types → types}/ABI/TransferBatcher.abi.js +0 -0
- /package/dist/{src/types → types}/ABI/Wrapper.abi.d.ts +0 -0
- /package/dist/{src/types → types}/ABI/Wrapper.abi.js +0 -0
- /package/dist/{src/types → types}/ABI/encryptedABI.d.ts +0 -0
- /package/dist/{src/types → types}/ABI/encryptedABI.js +0 -0
- /package/dist/{src/types → types}/fhevmConfig.d.ts +0 -0
- /package/dist/{src/types → types}/fhevmConfig.js +0 -0
- /package/dist/{src/utils → utils}/number.utils.d.ts +0 -0
- /package/dist/{src/utils → utils}/number.utils.js +0 -0
- /package/dist/{src/utils → utils}/string.utils.d.ts +0 -0
- /package/dist/{src/utils → utils}/string.utils.js +0 -0
|
@@ -10,4 +10,3 @@ export { useSetOperator } from "./client/hooks/useSetOperator";
|
|
|
10
10
|
export { usePublicDecrypt } from "./client/hooks/usePublicDecrypt";
|
|
11
11
|
export { useFinalizeUnwrap } from "./client/hooks/useFinalizeUnwrap";
|
|
12
12
|
export { type FhevmConfig, type Network } from "./types/fhevmConfig";
|
|
13
|
-
export { ZAMA_RELAYER_VERSION, ZAMA_RELAYER_CDN_URL } from "./config";
|
|
@@ -11,5 +11,3 @@ export { useEncryptedBatchTransfer } from "./client/hooks/useEncryptedBatchTrans
|
|
|
11
11
|
export { useSetOperator } from "./client/hooks/useSetOperator";
|
|
12
12
|
export { usePublicDecrypt } from "./client/hooks/usePublicDecrypt";
|
|
13
13
|
export { useFinalizeUnwrap } from "./client/hooks/useFinalizeUnwrap";
|
|
14
|
-
// config
|
|
15
|
-
export { ZAMA_RELAYER_VERSION, ZAMA_RELAYER_CDN_URL } from "./config";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ZAMA_RELAYER_VERSION, ZAMA_RELAYER_CDN_URL } from "../config";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyratzlabs/react-fhevm-utils",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.6",
|
|
4
4
|
"description": "React hooks and utilities for Fhevmjs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./server": {
|
|
15
|
+
"types": "./dist/server/index.d.ts",
|
|
16
|
+
"default": "./dist/server/index.js"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
"scripts": {
|
package/dist/package.json
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pyratzlabs/react-fhevm-utils",
|
|
3
|
-
"version": "3.5.3",
|
|
4
|
-
"description": "React hooks and utilities for Fhevmjs",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist"
|
|
8
|
-
],
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"default": "./dist/index.js"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "tsc",
|
|
17
|
-
"test": "node --import tsx --test src/**/*.test.ts",
|
|
18
|
-
"clean": "rm -rf dist",
|
|
19
|
-
"preversion": "npm run build"
|
|
20
|
-
},
|
|
21
|
-
"keywords": [
|
|
22
|
-
"fhevm"
|
|
23
|
-
],
|
|
24
|
-
"author": "Pyratzlabs",
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@types/node": "^22.10.5",
|
|
28
|
-
"@types/react": "^19.1.0",
|
|
29
|
-
"ts-node": "^10.9.2",
|
|
30
|
-
"tsx": "^4.19.2",
|
|
31
|
-
"typescript": "^5.8.2"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"@tanstack/react-query": "^5.71.5",
|
|
35
|
-
"@zama-fhe/relayer-sdk": "^0.4.0-3",
|
|
36
|
-
"react": "^19.1.0",
|
|
37
|
-
"viem": "^2.25.0",
|
|
38
|
-
"wagmi": "^2.14.16"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/config.test.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { describe, it } from "node:test";
|
|
2
|
-
import assert from "node:assert";
|
|
3
|
-
import { ZAMA_RELAYER_VERSION, ZAMA_RELAYER_CDN_URL } from "./config";
|
|
4
|
-
import packageJson from "../package.json";
|
|
5
|
-
describe("Config", () => {
|
|
6
|
-
describe("ZAMA_RELAYER_VERSION", () => {
|
|
7
|
-
it("should be defined and not empty", () => {
|
|
8
|
-
assert.ok(ZAMA_RELAYER_VERSION);
|
|
9
|
-
assert.ok(ZAMA_RELAYER_VERSION.length > 0);
|
|
10
|
-
});
|
|
11
|
-
it("should not contain special characters like ^, ~, >, <, =", () => {
|
|
12
|
-
assert.ok(!ZAMA_RELAYER_VERSION.match(/[\^~><= ]/));
|
|
13
|
-
});
|
|
14
|
-
it("should match the version format (semver-like)", () => {
|
|
15
|
-
// Matches version format like: 0.4.0-3, 1.2.3, 1.0.0-beta.1
|
|
16
|
-
const versionPattern = /^\d+\.\d+\.\d+(-[\w.-]+)?$/;
|
|
17
|
-
assert.ok(versionPattern.test(ZAMA_RELAYER_VERSION), `Version "${ZAMA_RELAYER_VERSION}" should match semver pattern`);
|
|
18
|
-
});
|
|
19
|
-
it("should match the cleaned version from package.json", () => {
|
|
20
|
-
const rawVersion = packageJson.dependencies["@zama-fhe/relayer-sdk"];
|
|
21
|
-
const cleanedVersion = rawVersion.replace(/^[\^~>=<]+/, "");
|
|
22
|
-
assert.strictEqual(ZAMA_RELAYER_VERSION, cleanedVersion);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
describe("ZAMA_RELAYER_CDN_URL", () => {
|
|
26
|
-
it("should be defined and not empty", () => {
|
|
27
|
-
assert.ok(ZAMA_RELAYER_CDN_URL);
|
|
28
|
-
assert.ok(ZAMA_RELAYER_CDN_URL.length > 0);
|
|
29
|
-
});
|
|
30
|
-
it("should be a valid URL", () => {
|
|
31
|
-
assert.doesNotThrow(() => {
|
|
32
|
-
new URL(ZAMA_RELAYER_CDN_URL);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
it("should start with https://cdn.zama.org", () => {
|
|
36
|
-
assert.ok(ZAMA_RELAYER_CDN_URL.startsWith("https://cdn.zama.org"));
|
|
37
|
-
});
|
|
38
|
-
it("should include the version number", () => {
|
|
39
|
-
assert.ok(ZAMA_RELAYER_CDN_URL.includes(ZAMA_RELAYER_VERSION));
|
|
40
|
-
});
|
|
41
|
-
it("should have the correct format", () => {
|
|
42
|
-
const expectedUrl = `https://cdn.zama.org/relayer-sdk-js/${ZAMA_RELAYER_VERSION}/relayer-sdk-js.umd.cjs`;
|
|
43
|
-
assert.strictEqual(ZAMA_RELAYER_CDN_URL, expectedUrl);
|
|
44
|
-
});
|
|
45
|
-
it("should end with .umd.cjs", () => {
|
|
46
|
-
assert.ok(ZAMA_RELAYER_CDN_URL.endsWith(".umd.cjs"));
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
describe("Version consistency", () => {
|
|
50
|
-
it("should ensure CDN URL updates when version changes", () => {
|
|
51
|
-
// This test ensures that if the version is updated in package.json,
|
|
52
|
-
// the CDN URL will also be updated accordingly
|
|
53
|
-
const expectedPattern = new RegExp(`https://cdn\\.zama\\.org/relayer-sdk-js/${ZAMA_RELAYER_VERSION.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/relayer-sdk-js\\.umd\\.cjs`);
|
|
54
|
-
assert.ok(expectedPattern.test(ZAMA_RELAYER_CDN_URL));
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|