@midnight-ntwrk/wallet-sdk-prover-client 1.2.0-rc.0 → 1.2.1

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.
@@ -1,12 +1,12 @@
1
1
  import { Effect, Layer } from 'effect';
2
2
  import { ProverClient } from './ProverClient.js';
3
- import { InvalidProtocolSchemeError } from '@midnight-ntwrk/wallet-sdk-utilities/networking';
3
+ import { type InvalidProtocolSchemeError } from '@midnight-ntwrk/wallet-sdk-utilities/networking';
4
4
  /**
5
5
  * Creates a layer for a {@link ProverClient} that sends requests to a Proof Server over HTTP.
6
6
  *
7
7
  * @param config The server configuration to use when configuring the HTTP elements of the layer.
8
- * @returns A `Layer` for {@link ProverClient} that sends requests to a configured Proof Server over HTTP.
9
- * The layer can fail with an `InvalidProtocolSchemeError` if `config` is invalid for a HTTP context.
8
+ * @returns A `Layer` for {@link ProverClient} that sends requests to a configured Proof Server over HTTP. The layer can
9
+ * fail with an `InvalidProtocolSchemeError` if `config` is invalid for a HTTP context.
10
10
  */
11
11
  export declare const layer: (config: ProverClient.ServerConfig) => Layer.Layer<ProverClient, InvalidProtocolSchemeError>;
12
12
  export declare const create: (config: ProverClient.ServerConfig) => Effect.Effect<ProverClient.Service, InvalidProtocolSchemeError>;
@@ -22,8 +22,8 @@ const CHECK_TX_PATH = '/check';
22
22
  * Creates a layer for a {@link ProverClient} that sends requests to a Proof Server over HTTP.
23
23
  *
24
24
  * @param config The server configuration to use when configuring the HTTP elements of the layer.
25
- * @returns A `Layer` for {@link ProverClient} that sends requests to a configured Proof Server over HTTP.
26
- * The layer can fail with an `InvalidProtocolSchemeError` if `config` is invalid for a HTTP context.
25
+ * @returns A `Layer` for {@link ProverClient} that sends requests to a configured Proof Server over HTTP. The layer can
26
+ * fail with an `InvalidProtocolSchemeError` if `config` is invalid for a HTTP context.
27
27
  */
28
28
  export const layer = (config) => Layer.effect(ProverClient, HttpURL.make(new URL(config.url)).pipe(Either.map((baseUrl) => new HttpProverClientImpl(baseUrl)), Either.match({
29
29
  onLeft: (l) => Effect.fail(l),
@@ -1,24 +1,18 @@
1
- import { Effect, Context } from 'effect';
2
- import * as ledger from '@midnight-ntwrk/ledger-v8';
3
- import { ClientError, ServerError } from '@midnight-ntwrk/wallet-sdk-utilities/networking';
1
+ import { type Effect, Context } from 'effect';
2
+ import type * as ledger from '@midnight-ntwrk/ledger-v8';
3
+ import { type ClientError, type ServerError } from '@midnight-ntwrk/wallet-sdk-utilities/networking';
4
4
  import type { KeyMaterialProvider } from '@midnight-ntwrk/zkir-v2';
5
5
  declare const ProverClient_base: Context.TagClass<ProverClient, "@midnight-ntwrk/prover-client#ProverClient", ProverClient.Service>;
6
- /**
7
- * A client that provides proof services for unproven transactions.
8
- */
6
+ /** A client that provides proof services for unproven transactions. */
9
7
  export declare class ProverClient extends ProverClient_base {
10
8
  }
11
9
  export declare namespace ProverClient {
12
- /**
13
- * Provides server-related configuration for {@link ProverClient} implementations.
14
- */
10
+ /** Provides server-related configuration for {@link ProverClient} implementations. */
15
11
  interface ServerConfig {
16
12
  /** The base URL to the Proof Server. */
17
13
  readonly url: URL | string;
18
14
  }
19
- /**
20
- * Provides wasm-related configuration for {@link KeyMaterialProvider} implementations.
21
- */
15
+ /** Provides wasm-related configuration for {@link KeyMaterialProvider} implementations. */
22
16
  interface WasmConfig {
23
17
  /** The Key Material Provider. */
24
18
  readonly keyMaterialProvider: KeyMaterialProvider;
@@ -29,7 +23,7 @@ export declare namespace ProverClient {
29
23
  *
30
24
  * @param transaction A serialized unproven transaction.
31
25
  * @returns An `Effect` that yields with a serialized transaction representing the proven version of `transaction`;
32
- * or fails with a client or server side error.
26
+ * or fails with a client or server side error.
33
27
  */
34
28
  proveTransaction<S extends ledger.Signaturish, B extends ledger.Bindingish>(tx: ledger.Transaction<S, ledger.PreProof, B>, costModel?: ledger.CostModel): Effect.Effect<ledger.Transaction<S, ledger.Proof, B>, ClientError | ServerError>;
35
29
  asProvingProvider(): ledger.ProvingProvider;
@@ -11,8 +11,6 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { Context } from 'effect';
14
- /**
15
- * A client that provides proof services for unproven transactions.
16
- */
14
+ /** A client that provides proof services for unproven transactions. */
17
15
  export class ProverClient extends Context.Tag('@midnight-ntwrk/prover-client#ProverClient')() {
18
16
  }
@@ -1,6 +1,6 @@
1
1
  import { Effect, Layer, Schema } from 'effect';
2
- import { InvalidProtocolSchemeError } from '@midnight-ntwrk/wallet-sdk-utilities/networking';
3
- import { KeyMaterialProvider } from '@midnight-ntwrk/zkir-v2';
2
+ import { type InvalidProtocolSchemeError } from '@midnight-ntwrk/wallet-sdk-utilities/networking';
3
+ import { type KeyMaterialProvider } from '@midnight-ntwrk/zkir-v2';
4
4
  import { ProverClient } from './ProverClient.js';
5
5
  /**
6
6
  * Creates a layer for a {@link ProverClient} that sends requests to a Wasm Prover.
package/dist/index.d.ts CHANGED
@@ -1,17 +1,14 @@
1
1
  import { ProverClient } from './effect/index.js';
2
- import * as ledger from '@midnight-ntwrk/ledger-v8';
3
- /**
4
- * Sends serialized unproven transactions to a Proof Server over HTTP.
5
- */
2
+ import type * as ledger from '@midnight-ntwrk/ledger-v8';
3
+ /** Sends serialized unproven transactions to a Proof Server over HTTP. */
6
4
  export declare class HttpProverClient {
7
5
  #private;
8
6
  /**
9
7
  * Initializes a new {@link HttpProverClient}.
10
8
  *
11
9
  * @param config The server configuration to use when configuring the HTTP elements of the Proof Server.
12
- * @throws {@link ProverClient.InvalidProtocolSchemeError}
13
- * The `config` is invalid for a HTTP context. E.g., expecting 'http:' or 'https:' URLs but something other
14
- * was provided.
10
+ * @throws {@link ProverClient.InvalidProtocolSchemeError} The `config` is invalid for a HTTP context. E.g., expecting
11
+ * 'http:' or 'https:' URLs but something other was provided.
15
12
  */
16
13
  constructor(config: ProverClient.ProverClient.ServerConfig);
17
14
  /**
@@ -19,12 +16,10 @@ export declare class HttpProverClient {
19
16
  *
20
17
  * @param transaction An unproven ledger transaction.
21
18
  * @returns A `Promise` that resolves with a proven transaction or fails with a client or server side error.
22
- * @throws {@link ClientError}
23
- * There was an issue with the provided `transaction`, or a connection with the configured Proof
24
- * Server could not be initiated.
25
- * @throws {@link ServerError}
26
- * Unable to establish a connection with the configured Proof Server, or there was an internal error that
27
- * prevented the proof request from being executed.
19
+ * @throws {@link ClientError} There was an issue with the provided `transaction`, or a connection with the configured
20
+ * Proof Server could not be initiated.
21
+ * @throws {@link ServerError} Unable to establish a connection with the configured Proof Server, or there was an
22
+ * internal error that prevented the proof request from being executed.
28
23
  */
29
24
  proveTransaction<S extends ledger.Signaturish, B extends ledger.Bindingish>(transaction: ledger.Transaction<S, ledger.PreProof, B>, costModel?: ledger.CostModel): Promise<ledger.Transaction<S, ledger.Proof, B>>;
30
25
  }
package/dist/index.js CHANGED
@@ -12,18 +12,15 @@
12
12
  // limitations under the License.
13
13
  import { Effect } from 'effect';
14
14
  import { ProverClient, HttpProverClient as _HttpProverClient } from './effect/index.js';
15
- /**
16
- * Sends serialized unproven transactions to a Proof Server over HTTP.
17
- */
15
+ /** Sends serialized unproven transactions to a Proof Server over HTTP. */
18
16
  export class HttpProverClient {
19
17
  #innerClient;
20
18
  /**
21
19
  * Initializes a new {@link HttpProverClient}.
22
20
  *
23
21
  * @param config The server configuration to use when configuring the HTTP elements of the Proof Server.
24
- * @throws {@link ProverClient.InvalidProtocolSchemeError}
25
- * The `config` is invalid for a HTTP context. E.g., expecting 'http:' or 'https:' URLs but something other
26
- * was provided.
22
+ * @throws {@link ProverClient.InvalidProtocolSchemeError} The `config` is invalid for a HTTP context. E.g., expecting
23
+ * 'http:' or 'https:' URLs but something other was provided.
27
24
  */
28
25
  constructor(config) {
29
26
  this.#innerClient = Effect.gen(function* () {
@@ -35,12 +32,10 @@ export class HttpProverClient {
35
32
  *
36
33
  * @param transaction An unproven ledger transaction.
37
34
  * @returns A `Promise` that resolves with a proven transaction or fails with a client or server side error.
38
- * @throws {@link ClientError}
39
- * There was an issue with the provided `transaction`, or a connection with the configured Proof
40
- * Server could not be initiated.
41
- * @throws {@link ServerError}
42
- * Unable to establish a connection with the configured Proof Server, or there was an internal error that
43
- * prevented the proof request from being executed.
35
+ * @throws {@link ClientError} There was an issue with the provided `transaction`, or a connection with the configured
36
+ * Proof Server could not be initiated.
37
+ * @throws {@link ServerError} Unable to establish a connection with the configured Proof Server, or there was an
38
+ * internal error that prevented the proof request from being executed.
44
39
  */
45
40
  proveTransaction(transaction, costModel) {
46
41
  return this.#innerClient.proveTransaction(transaction, costModel).pipe(Effect.runPromise);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midnight-ntwrk/wallet-sdk-prover-client",
3
- "version": "1.2.0-rc.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -28,9 +28,9 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@effect/platform": "^0.94.5",
32
- "@midnight-ntwrk/ledger-v8": "^8.0.2",
33
- "@midnight-ntwrk/wallet-sdk-utilities": "1.1.0-rc.0",
31
+ "@effect/platform": "^0.96.0",
32
+ "@midnight-ntwrk/ledger-v8": "^8.0.3",
33
+ "@midnight-ntwrk/wallet-sdk-utilities": "1.1.1",
34
34
  "@midnight-ntwrk/zkir-v2": "2.1.0",
35
35
  "effect": "^3.19.19",
36
36
  "web-worker": "^1.5.0"