@cloak.dev/sdk 0.2.0 → 0.2.2-staging.9ffa9f5
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/LICENSE +202 -0
- package/README.md +201 -57
- package/dist/{chunk-YX5SCAMR.js → chunk-KNM6K5NG.js} +8 -95
- package/dist/index.cjs +3565 -4351
- package/dist/index.d.cts +732 -807
- package/dist/index.d.ts +732 -807
- package/dist/index.js +3452 -4182
- package/dist/{utxo-PFJT3ETR.js → utxo-XPEGGWZ6.js} +3 -3
- package/package.json +50 -20
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
NATIVE_SOL_MINT,
|
|
3
3
|
bigintToBytes322 as bigintToBytes32,
|
|
4
4
|
bigintToHex,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
computeCommitment,
|
|
6
|
+
computeNullifier,
|
|
7
7
|
computeSignature,
|
|
8
8
|
createUtxo,
|
|
9
9
|
createZeroUtxo,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
serializeUtxo,
|
|
20
20
|
sumUtxoAmounts,
|
|
21
21
|
utxoEquals
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-KNM6K5NG.js";
|
|
23
23
|
export {
|
|
24
24
|
NATIVE_SOL_MINT,
|
|
25
25
|
bigintToBytes32,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloak.dev/sdk",
|
|
3
|
-
"description": "Shield, send, and swap on Solana privately
|
|
4
|
-
"version": "0.2.
|
|
3
|
+
"description": "Shield, send, and swap on Solana privately — TypeScript SDK with UTXO-based zero-knowledge transactions",
|
|
4
|
+
"version": "0.2.2-staging.9ffa9f5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -17,26 +17,28 @@
|
|
|
17
17
|
"build": "tsup src/index.ts --clean --format cjs,esm --dts --external fs --external path --external crypto",
|
|
18
18
|
"lint": "tsc --noEmit",
|
|
19
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
20
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
|
|
22
21
|
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
|
|
23
22
|
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
|
|
24
23
|
"prepare": "npm run build",
|
|
25
24
|
"prepublishOnly": "npm run build && node scripts/verify-dist-matches-src.mjs",
|
|
26
25
|
"verify:dist": "node scripts/verify-dist-matches-src.mjs",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"example:
|
|
32
|
-
"example:
|
|
33
|
-
"example:
|
|
34
|
-
"example:swap
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"example:
|
|
38
|
-
"
|
|
39
|
-
"
|
|
26
|
+
"script:admin-compliance": "tsx scripts/admin-compliance.ts",
|
|
27
|
+
"script:compliance-smoke": "tsx scripts/compliance-smoke.ts",
|
|
28
|
+
"fixture:chain-note": "tsx scripts/gen-chain-note-v3-fixture.ts",
|
|
29
|
+
"test:examples": "CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/sol/deposit.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/sol/private-send.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/sol/withdraw.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/sol/swap.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/spl/deposit.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/spl/private-send.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/spl/withdraw.ts && CLOAK_EXAMPLE_DRY_RUN=1 tsx examples/viewing-keys.ts",
|
|
30
|
+
"example:deposit": "tsx examples/sol/deposit.ts",
|
|
31
|
+
"example:private-send": "tsx examples/sol/private-send.ts",
|
|
32
|
+
"example:withdraw": "tsx examples/sol/withdraw.ts",
|
|
33
|
+
"example:swap": "tsx examples/sol/swap.ts",
|
|
34
|
+
"example:spl-deposit": "tsx examples/spl/deposit.ts",
|
|
35
|
+
"example:spl-private-send": "tsx examples/spl/private-send.ts",
|
|
36
|
+
"example:spl-withdraw": "tsx examples/spl/withdraw.ts",
|
|
37
|
+
"example:viewing-keys": "tsx examples/viewing-keys.ts",
|
|
38
|
+
"example:swap-usdc": "OUTPUT_TOKEN_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v SWAP_MARKER_TAG=swap-usdc tsx examples/sol/swap.ts",
|
|
39
|
+
"example:swap-brz": "TRY_BRZ_FIRST=true OUTPUT_TOKEN_MINT=FtgGSFADXBtroxq8VCausXRr2of47QBf5AS1NtZCu4GD FALLBACK_OUTPUT_TOKEN_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v SWAP_MARKER_TAG=swap-brz tsx examples/sol/swap.ts",
|
|
40
|
+
"soak:swap": "CLOAK_SOAK_NAME=swap CLOAK_SOAK_RUN_CMD='npx tsx examples/sol/swap.ts' CLOAK_FORCE_RELAY_MERKLE_TREE=1 tsx scripts/soak-runner.ts",
|
|
41
|
+
"soak:withdraw": "CLOAK_SOAK_NAME=withdraw CLOAK_SOAK_RUN_CMD='npx tsx examples/sol/withdraw.ts' CLOAK_FORCE_RELAY_MERKLE_TREE=1 tsx scripts/soak-runner.ts"
|
|
40
42
|
},
|
|
41
43
|
"keywords": [
|
|
42
44
|
"solana",
|
|
@@ -69,8 +71,7 @@
|
|
|
69
71
|
"ffjavascript": "^0.3.0",
|
|
70
72
|
"snarkjs": "0.7.6",
|
|
71
73
|
"tweetnacl": "^1.0.3",
|
|
72
|
-
"tweetnacl-util": "^0.15.1"
|
|
73
|
-
"yaml": "^2.8.3"
|
|
74
|
+
"tweetnacl-util": "^0.15.1"
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
76
77
|
"@coral-xyz/anchor": "^0.32.1",
|
|
@@ -114,9 +115,38 @@
|
|
|
114
115
|
},
|
|
115
116
|
"overrides": {
|
|
116
117
|
"glob": "^10.5.0",
|
|
117
|
-
"js-yaml": "^3.
|
|
118
|
+
"js-yaml": "^3.15.1",
|
|
118
119
|
"diff": "^4.0.4",
|
|
119
120
|
"bigint-buffer": "npm:bigint-buffer-fixed@^1.1.6",
|
|
120
|
-
"tar": "^7.5.
|
|
121
|
+
"tar": "^7.5.21",
|
|
122
|
+
"handlebars": "^4.7.9",
|
|
123
|
+
"underscore": "^1.13.8",
|
|
124
|
+
"ip-address": "^10.4.0",
|
|
125
|
+
"@tootallnate/once": "^2.0.1",
|
|
126
|
+
"@babel/core": "^7.29.7",
|
|
127
|
+
"ws": "^8.21.0",
|
|
128
|
+
"picomatch@2": "^2.3.2",
|
|
129
|
+
"picomatch@4": "^4.0.7",
|
|
130
|
+
"brace-expansion@1": "^1.1.18",
|
|
131
|
+
"brace-expansion@2": "^2.1.4"
|
|
132
|
+
},
|
|
133
|
+
"resolutions": {
|
|
134
|
+
"glob": "^10.5.0",
|
|
135
|
+
"js-yaml": "^3.15.1",
|
|
136
|
+
"diff": "^4.0.4",
|
|
137
|
+
"bigint-buffer": "npm:bigint-buffer-fixed@^1.1.6",
|
|
138
|
+
"tar": "^7.5.21",
|
|
139
|
+
"handlebars": "^4.7.9",
|
|
140
|
+
"underscore": "^1.13.8",
|
|
141
|
+
"ip-address": "^10.4.0",
|
|
142
|
+
"@tootallnate/once": "^2.0.1",
|
|
143
|
+
"@babel/core": "^7.29.7",
|
|
144
|
+
"ws": "^8.21.0",
|
|
145
|
+
"jest-util/picomatch": "^2.3.2",
|
|
146
|
+
"anymatch/picomatch": "^2.3.2",
|
|
147
|
+
"micromatch/picomatch": "^2.3.2",
|
|
148
|
+
"picomatch": "^4.0.7",
|
|
149
|
+
"test-exclude/**/brace-expansion": "^1.1.18",
|
|
150
|
+
"brace-expansion": "^2.1.4"
|
|
121
151
|
}
|
|
122
152
|
}
|