@sip-protocol/sdk 0.2.0 → 0.2.2
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/browser.d.mts +2 -1
- package/dist/browser.d.ts +2 -1
- package/dist/browser.js +7501 -8281
- package/dist/browser.mjs +625 -18
- package/dist/chunk-4VJHI66K.mjs +12120 -0
- package/dist/chunk-DU7LQDD2.mjs +10148 -0
- package/dist/chunk-UHZKNGIT.mjs +223 -0
- package/dist/chunk-VITVG25F.mjs +982 -0
- package/dist/index.d.mts +31 -493
- package/dist/index.d.ts +31 -493
- package/dist/index.js +3 -2367
- package/dist/index.mjs +17 -19
- package/dist/noir-BHQtFvRk.d.mts +467 -0
- package/dist/noir-BHQtFvRk.d.ts +467 -0
- package/dist/proofs/noir.d.mts +2 -0
- package/dist/proofs/noir.d.ts +2 -0
- package/dist/proofs/noir.js +1862 -0
- package/dist/proofs/noir.mjs +790 -0
- package/package.json +8 -6
- package/src/browser.ts +4 -2
- package/src/index.ts +6 -3
- package/src/proofs/index.ts +15 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sip-protocol/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Core SDK for Shielded Intents Protocol - Privacy layer for cross-chain transactions",
|
|
5
5
|
"author": "SIP Protocol <hello@sip-protocol.org>",
|
|
6
6
|
"homepage": "https://sip-protocol.org",
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
"types": "./dist/browser.d.ts",
|
|
26
26
|
"import": "./dist/browser.mjs",
|
|
27
27
|
"require": "./dist/browser.js"
|
|
28
|
+
},
|
|
29
|
+
"./proofs/noir": {
|
|
30
|
+
"types": "./dist/proofs/noir.d.ts",
|
|
31
|
+
"import": "./dist/proofs/noir.mjs",
|
|
32
|
+
"require": "./dist/proofs/noir.js"
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
|
-
"browser": {
|
|
31
|
-
"./dist/index.mjs": "./dist/browser.mjs"
|
|
32
|
-
},
|
|
33
35
|
"files": [
|
|
34
36
|
"dist",
|
|
35
37
|
"src"
|
|
@@ -60,8 +62,8 @@
|
|
|
60
62
|
],
|
|
61
63
|
"license": "MIT",
|
|
62
64
|
"scripts": {
|
|
63
|
-
"build": "tsup src/index.ts src/browser.ts --format cjs,esm --dts",
|
|
64
|
-
"dev": "tsup src/index.ts src/browser.ts --format cjs,esm --dts --watch",
|
|
65
|
+
"build": "tsup src/index.ts src/browser.ts src/proofs/noir.ts --format cjs,esm --dts",
|
|
66
|
+
"dev": "tsup src/index.ts src/browser.ts src/proofs/noir.ts --format cjs,esm --dts --watch",
|
|
65
67
|
"lint": "eslint --ext .ts src/",
|
|
66
68
|
"typecheck": "tsc --noEmit",
|
|
67
69
|
"clean": "rm -rf dist",
|
package/src/browser.ts
CHANGED
|
@@ -19,9 +19,11 @@
|
|
|
19
19
|
// Re-export everything from main entry
|
|
20
20
|
export * from './index'
|
|
21
21
|
|
|
22
|
-
// Browser-specific exports (
|
|
22
|
+
// Browser-specific exports (import directly from browser module to get WASM support)
|
|
23
|
+
export { BrowserNoirProvider } from './proofs/browser'
|
|
24
|
+
|
|
25
|
+
// Re-export utilities that are already in main (for convenience)
|
|
23
26
|
export {
|
|
24
|
-
BrowserNoirProvider,
|
|
25
27
|
isBrowser,
|
|
26
28
|
supportsWebWorkers,
|
|
27
29
|
supportsSharedArrayBuffer,
|
package/src/index.ts
CHANGED
|
@@ -164,12 +164,15 @@ export {
|
|
|
164
164
|
} from './validation'
|
|
165
165
|
|
|
166
166
|
// Proof providers
|
|
167
|
+
// NOTE: NoirProofProvider and BrowserNoirProvider are NOT exported here
|
|
168
|
+
// to avoid bundling WASM in server builds (e.g., Next.js SSR).
|
|
169
|
+
// For ZK proof generation:
|
|
170
|
+
// - Browser: import { BrowserNoirProvider } from '@sip-protocol/sdk/browser'
|
|
171
|
+
// - Node.js: import { NoirProofProvider } from '@sip-protocol/sdk/proofs/noir'
|
|
167
172
|
export {
|
|
168
173
|
MockProofProvider,
|
|
169
|
-
NoirProofProvider,
|
|
170
|
-
BrowserNoirProvider,
|
|
171
174
|
ProofGenerationError,
|
|
172
|
-
// Browser utilities
|
|
175
|
+
// Browser utilities (safe - no WASM)
|
|
173
176
|
isBrowser,
|
|
174
177
|
supportsWebWorkers,
|
|
175
178
|
supportsSharedArrayBuffer,
|
package/src/proofs/index.ts
CHANGED
|
@@ -47,15 +47,15 @@ export { ProofGenerationError } from './interface'
|
|
|
47
47
|
// Mock provider (testing only)
|
|
48
48
|
export { MockProofProvider } from './mock'
|
|
49
49
|
|
|
50
|
-
//
|
|
51
|
-
|
|
50
|
+
// NOTE: NoirProofProvider is NOT exported from main entry to avoid bundling WASM
|
|
51
|
+
// in server-side builds (e.g., Next.js SSR). Import directly if needed:
|
|
52
|
+
//
|
|
53
|
+
// import { NoirProofProvider } from '@sip-protocol/sdk/proofs/noir'
|
|
54
|
+
//
|
|
55
|
+
// Types are safe to export (no runtime WASM dependency)
|
|
52
56
|
export type { NoirProviderConfig } from './noir'
|
|
53
57
|
|
|
54
|
-
// Browser
|
|
55
|
-
export { BrowserNoirProvider } from './browser'
|
|
56
|
-
export type { BrowserNoirProviderConfig, ProofProgressCallback } from './browser'
|
|
57
|
-
|
|
58
|
-
// Browser utilities
|
|
58
|
+
// Browser utilities (no WASM dependencies - safe for all environments)
|
|
59
59
|
export {
|
|
60
60
|
isBrowser,
|
|
61
61
|
supportsWebWorkers,
|
|
@@ -64,3 +64,11 @@ export {
|
|
|
64
64
|
hexToBytes as browserHexToBytes,
|
|
65
65
|
bytesToHex as browserBytesToHex,
|
|
66
66
|
} from './browser-utils'
|
|
67
|
+
|
|
68
|
+
// NOTE: BrowserNoirProvider is NOT exported from main entry to avoid bundling WASM
|
|
69
|
+
// in server-side builds. Import from '@sip-protocol/sdk/browser' instead:
|
|
70
|
+
//
|
|
71
|
+
// import { BrowserNoirProvider } from '@sip-protocol/sdk/browser'
|
|
72
|
+
//
|
|
73
|
+
// Types are safe to export (no runtime WASM dependency)
|
|
74
|
+
export type { BrowserNoirProviderConfig, ProofProgressCallback } from './browser'
|