@zkpassport/sdk 0.3.4 → 0.4.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.
- package/dist/cjs/assets/abi/ZKPassportVerifier.json +14 -14
- package/dist/cjs/index.d.ts +10 -5
- package/dist/cjs/index.js +77 -104
- package/dist/esm/assets/abi/ZKPassportVerifier.json +14 -14
- package/dist/esm/index.d.ts +10 -5
- package/dist/esm/index.js +78 -105
- package/package.json +3 -2
- package/src/assets/abi/ZKPassportVerifier.json +14 -14
- package/src/index.ts +86 -119
- package/src/encryption.ts +0 -45
- package/src/json-rpc.ts +0 -61
- package/src/mobile.ts +0 -186
- package/src/websocket.ts +0 -16
package/src/websocket.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export function getWebSocketClient(url: string, origin?: string) {
|
|
2
|
-
if (typeof window !== "undefined" && window.WebSocket) {
|
|
3
|
-
// Browser environment
|
|
4
|
-
return new WebSocket(url)
|
|
5
|
-
} else {
|
|
6
|
-
// Node.js environment
|
|
7
|
-
const WebSocket = require("ws")
|
|
8
|
-
return new WebSocket(url, {
|
|
9
|
-
headers: {
|
|
10
|
-
Origin: origin || "nodejs",
|
|
11
|
-
},
|
|
12
|
-
}) as import("ws").WebSocket
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type WebSocketClient = ReturnType<typeof getWebSocketClient>
|