@midnight-ntwrk/wallet-sdk-prover-client 1.2.1 → 1.2.3
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/README.md +7 -0
- package/dist/effect/HttpProverClient.js +7 -2
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
> [!IMPORTANT]
|
|
2
|
+
> **This package has moved.** The `@midnight-ntwrk` scope is published only
|
|
3
|
+
> during the migration window and will stop receiving updates. Please migrate to
|
|
4
|
+
> [`@midnightntwrk/wallet-sdk-prover-client`](https://www.npmjs.com/package/@midnightntwrk/wallet-sdk-prover-client).
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# @midnight-ntwrk/wallet-sdk-prover-client
|
|
2
9
|
|
|
3
10
|
Client for interacting with the Midnight ZK proof generation service.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { Chunk, Duration, Effect, Either, Layer, pipe, Schedule, Stream } from 'effect';
|
|
14
|
-
import { FetchHttpClient, HttpClient, HttpClientRequest } from '@effect/platform';
|
|
14
|
+
import { FetchHttpClient, HttpBody, HttpClient, HttpClientRequest } from '@effect/platform';
|
|
15
15
|
import { ProverClient } from './ProverClient.js';
|
|
16
16
|
import { ClientError, HttpURL, ServerError, } from '@midnight-ntwrk/wallet-sdk-utilities/networking';
|
|
17
17
|
import { BlobOps, EitherOps } from '@midnight-ntwrk/wallet-sdk-utilities';
|
|
@@ -42,7 +42,12 @@ class HttpProverClientImpl {
|
|
|
42
42
|
const receiveBody = (response) => pipe(response.stream, Stream.runCollect, Effect.flatMap((chunks) => concatBytes(Chunk.toArray(chunks))));
|
|
43
43
|
// Build endpoint URL from the already validated base URL
|
|
44
44
|
const url = HttpURL.HttpURL(new URL(path, this.baseUrl));
|
|
45
|
-
const proveTxRequest = pipe(Effect.succeed(payload), Effect.map((body) => HttpClientRequest.post(url).pipe(
|
|
45
|
+
const proveTxRequest = pipe(Effect.succeed(payload), Effect.map((body) => HttpClientRequest.post(url).pipe(
|
|
46
|
+
// A raw body must be used instead of `bodyUint8Array` so that no explicit `content-length`
|
|
47
|
+
// header is attached: `fetch` derives the length from the body itself, and an explicit
|
|
48
|
+
// header is rejected as malformed by undici >= 8.2.0 when it is installed as the global
|
|
49
|
+
// dispatcher (e.g. transitively via testcontainers or @effect/platform-node).
|
|
50
|
+
HttpClientRequest.setBody(HttpBody.raw(body, { contentType: 'application/octet-stream' })))), Effect.flatMap(HttpClient.execute), Effect.flatMap((response) => Effect.gen(function* () {
|
|
46
51
|
if (response.status !== 200) {
|
|
47
52
|
const text = yield* response.text;
|
|
48
53
|
return yield* new ClientError({ message: `${failurePrefix}: ${text}` });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midnight-ntwrk/wallet-sdk-prover-client",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
"author": "Midnight Foundation",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"publishConfig": {
|
|
11
|
-
"registry": "https://
|
|
11
|
+
"registry": "https://registry.npmjs.org/",
|
|
12
|
+
"access": "public"
|
|
12
13
|
},
|
|
13
14
|
"files": [
|
|
14
15
|
"dist/"
|
|
15
16
|
],
|
|
16
17
|
"repository": {
|
|
17
18
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/midnight-
|
|
19
|
+
"url": "git+https://github.com/midnightntwrk/midnight-wallet.git",
|
|
20
|
+
"directory": "packages/prover-client"
|
|
19
21
|
},
|
|
20
22
|
"exports": {
|
|
21
23
|
".": {
|
|
@@ -29,9 +31,9 @@
|
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
33
|
"@effect/platform": "^0.96.0",
|
|
32
|
-
"@midnight-ntwrk/ledger-v8": "^8.0
|
|
33
|
-
"@midnight-ntwrk/
|
|
34
|
-
"@midnight-ntwrk/
|
|
34
|
+
"@midnight-ntwrk/ledger-v8": "^8.1.0",
|
|
35
|
+
"@midnight-ntwrk/zkir-v2": "^2.1.0",
|
|
36
|
+
"@midnight-ntwrk/wallet-sdk-utilities": "^1.2.0",
|
|
35
37
|
"effect": "^3.19.19",
|
|
36
38
|
"web-worker": "^1.5.0"
|
|
37
39
|
},
|