@cloak.dev/sdk 0.1.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.
@@ -0,0 +1,42 @@
1
+ import {
2
+ NATIVE_SOL_MINT,
3
+ bigintToBytes32,
4
+ bigintToHex,
5
+ computeCommitment,
6
+ computeNullifier,
7
+ computeSignature,
8
+ createUtxo,
9
+ createZeroUtxo,
10
+ derivePublicKey,
11
+ deriveUtxoKeypairFromSpendKey,
12
+ deserializeUtxo,
13
+ generateUtxoKeypair,
14
+ hexToBigint,
15
+ pubkeyToFieldElement,
16
+ randomFieldElement,
17
+ selectUtxos,
18
+ serializeUtxo,
19
+ sumUtxoAmounts,
20
+ utxoEquals
21
+ } from "./chunk-2SOX3JNO.js";
22
+ export {
23
+ NATIVE_SOL_MINT,
24
+ bigintToBytes32,
25
+ bigintToHex,
26
+ computeCommitment,
27
+ computeNullifier,
28
+ computeSignature,
29
+ createUtxo,
30
+ createZeroUtxo,
31
+ derivePublicKey,
32
+ deriveUtxoKeypairFromSpendKey,
33
+ deserializeUtxo,
34
+ generateUtxoKeypair,
35
+ hexToBigint,
36
+ pubkeyToFieldElement,
37
+ randomFieldElement,
38
+ selectUtxos,
39
+ serializeUtxo,
40
+ sumUtxoAmounts,
41
+ utxoEquals
42
+ };
package/package.json ADDED
@@ -0,0 +1,120 @@
1
+ {
2
+ "name": "@cloak.dev/sdk",
3
+ "description": "TypeScript SDK for Cloak",
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "scripts": {
17
+ "build": "tsup src/index.ts --clean --format cjs,esm --dts --external fs --external path --external crypto",
18
+ "lint": "tsc --noEmit",
19
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest",
20
+ "test:examples": "CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/fast-send.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/fast-usdc-send.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/usdc-pool-transfer.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/transfer.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/swap.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/swap-recovery.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/history-scan.ts",
21
+ "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
22
+ "test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
23
+ "test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
24
+ "prepublishOnly": "npm run build",
25
+ "example:fast-send": "tsx examples/fast-send.ts",
26
+ "example:fast-usdc-send": "tsx examples/fast-usdc-send.ts",
27
+ "example:usdc-pool-transfer": "tsx examples/usdc-pool-transfer.ts",
28
+ "example:history-scan": "tsx examples/history-scan.ts",
29
+ "example:swap": "tsx examples/swap.ts",
30
+ "example:swap-recovery": "tsx examples/swap-recovery.ts",
31
+ "example:swap-usdc": "OUTPUT_TOKEN_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v SWAP_MARKER_TAG=swap-usdc tsx examples/swap.ts",
32
+ "example:swap-brz": "TRY_BRZ_FIRST=true OUTPUT_TOKEN_MINT=FtgGSFADXBtroxq8VCausXRr2of47QBf5AS1NtZCu4GD FALLBACK_OUTPUT_TOKEN_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v SWAP_MARKER_TAG=swap-brz tsx examples/swap.ts",
33
+ "soak:swap": "CLOAK_SOAK_NAME=swap CLOAK_SOAK_RUN_CMD='npx tsx examples/swap.ts' CLOAK_FORCE_RELAY_MERKLE_TREE=1 tsx scripts/soak-runner.ts",
34
+ "soak:fast-send": "CLOAK_SOAK_NAME=fast-send CLOAK_SOAK_RUN_CMD='npx tsx examples/fast-send.ts' CLOAK_FORCE_RELAY_MERKLE_TREE=1 tsx scripts/soak-runner.ts",
35
+ "example:transfer": "tsx examples/transfer.ts",
36
+ "script:admin-compliance": "tsx scripts/admin-compliance-report.ts",
37
+ "script:compliance-e2e-smoke": "tsx scripts/compliance-e2e-smoke.ts"
38
+ },
39
+ "keywords": [
40
+ "solana",
41
+ "cloak",
42
+ "privacy",
43
+ "zero-knowledge",
44
+ "zkp",
45
+ "private-transactions",
46
+ "web3",
47
+ "blockchain"
48
+ ],
49
+ "author": "Cloak Labs",
50
+ "license": "Apache-2.0",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/cloak-ag/sdk.git"
54
+ },
55
+ "homepage": "https://cloak.ag",
56
+ "bugs": {
57
+ "url": "https://github.com/cloak-ag/sdk/issues"
58
+ },
59
+ "dependencies": {
60
+ "@jup-ag/api": "^6.0.48",
61
+ "@lightprotocol/hasher.rs": "^0.2.1",
62
+ "@noble/hashes": "^1.8.0",
63
+ "@solana/spl-token": "^0.4.0",
64
+ "@solana/web3.js": "^1.0.0",
65
+ "bs58": "^6.0.0",
66
+ "circomlibjs": "^0.1.7",
67
+ "ffjavascript": "^0.3.0",
68
+ "snarkjs": "^0.7.4",
69
+ "tweetnacl": "^1.0.3",
70
+ "tweetnacl-util": "^0.15.1",
71
+ "yaml": "^2.8.2"
72
+ },
73
+ "devDependencies": {
74
+ "@coral-xyz/anchor": "^0.32.1",
75
+ "@types/jest": "^29.5.0",
76
+ "@types/node": "^22.0.0",
77
+ "jest": "^29.5.0",
78
+ "ts-jest": "^29.1.0",
79
+ "ts-node": "^10.9.0",
80
+ "tsconfig-paths": "^4.2.0",
81
+ "tsup": "^8.0.0",
82
+ "tsx": "^4.20.6",
83
+ "typescript": "^5.0.0"
84
+ },
85
+ "peerDependencies": {
86
+ "@switchboard-xyz/common": "^5.6.1",
87
+ "@switchboard-xyz/on-demand": "^3.8.2",
88
+ "@solana/spl-token": "^0.4.0",
89
+ "@solana/web3.js": "^1.0.0"
90
+ },
91
+ "peerDependenciesMeta": {
92
+ "@switchboard-xyz/common": {
93
+ "optional": true
94
+ },
95
+ "@switchboard-xyz/on-demand": {
96
+ "optional": true
97
+ },
98
+ "@solana/spl-token": {
99
+ "optional": true
100
+ }
101
+ },
102
+ "files": [
103
+ "dist",
104
+ "README.md",
105
+ "LICENSE"
106
+ ],
107
+ "publishConfig": {
108
+ "access": "public"
109
+ },
110
+ "engines": {
111
+ "node": ">=18.0.0"
112
+ },
113
+ "overrides": {
114
+ "glob": "^10.5.0",
115
+ "js-yaml": "^3.14.2",
116
+ "diff": "^4.0.4",
117
+ "bigint-buffer": "npm:bigint-buffer-fixed@^1.1.6",
118
+ "tar": "^7.5.4"
119
+ }
120
+ }