@lucid-evolution/provider 0.1.77 → 0.1.79

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/index.cjs CHANGED
@@ -52,7 +52,7 @@ var import_utils2 = require("@lucid-evolution/utils");
52
52
  // package.json
53
53
  var package_default = {
54
54
  name: "@lucid-evolution/provider",
55
- version: "0.1.77",
55
+ version: "0.1.79",
56
56
  description: "",
57
57
  main: "./dist/index.js",
58
58
  types: "./dist/index.d.ts",
@@ -2340,13 +2340,20 @@ var AccountInfoSchema = S4.Struct({
2340
2340
  var DatumInfo = S4.Struct({
2341
2341
  bytes: S4.String
2342
2342
  });
2343
- var postWithSchemaValidation = (url, data, schema) => (0, import_effect3.pipe)(
2344
- import_platform2.HttpClientRequest.post(url),
2345
- import_platform2.HttpClientRequest.jsonBody(data),
2346
- import_effect3.Effect.flatMap(import_platform2.HttpClient.fetchOk),
2343
+ var postWithSchemaValidation = (url, data, schema, headers = {}) => (0, import_effect3.pipe)(
2344
+ import_effect3.Effect.succeed(import_platform2.HttpClientRequest.post(url)),
2345
+ import_effect3.Effect.map(import_platform2.HttpClientRequest.setHeaders(headers)),
2346
+ import_effect3.Effect.flatMap(
2347
+ (req) => headers["Content-Type"] === "application/cbor" ? import_effect3.Effect.succeed(
2348
+ import_platform2.HttpClientRequest.uint8ArrayBody(
2349
+ data,
2350
+ headers["Content-Type"]
2351
+ )(req)
2352
+ ) : import_platform2.HttpClientRequest.jsonBody(data)(req)
2353
+ ),
2354
+ import_effect3.Effect.flatMap(import_platform2.HttpClient.fetch),
2347
2355
  import_platform2.HttpClientResponse.json,
2348
2356
  import_effect3.Effect.flatMap(S4.decodeUnknown(schema))
2349
- // Effect.scoped
2350
2357
  );
2351
2358
  var getWithSchemaValidation = (url, schema) => (0, import_effect3.pipe)(
2352
2359
  import_platform2.HttpClientRequest.get(url),
@@ -2629,7 +2636,9 @@ var Koios = class {
2629
2636
  const body = (0, import_core_utils4.fromHex)(tx);
2630
2637
  const schema = TxHashSchema;
2631
2638
  const result = await (0, import_effect4.pipe)(
2632
- postWithSchemaValidation(url, body, schema),
2639
+ postWithSchemaValidation(url, body, schema, {
2640
+ "Content-Type": "application/cbor"
2641
+ }),
2633
2642
  import_effect4.Effect.timeout(1e4),
2634
2643
  import_effect4.Effect.catchAllCause((cause) => new KoiosError({ cause })),
2635
2644
  import_effect4.Effect.runPromise
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  // package.json
12
12
  var package_default = {
13
13
  name: "@lucid-evolution/provider",
14
- version: "0.1.77",
14
+ version: "0.1.79",
15
15
  description: "",
16
16
  main: "./dist/index.js",
17
17
  types: "./dist/index.d.ts",
@@ -2315,13 +2315,20 @@ var AccountInfoSchema = S4.Struct({
2315
2315
  var DatumInfo = S4.Struct({
2316
2316
  bytes: S4.String
2317
2317
  });
2318
- var postWithSchemaValidation = (url, data, schema) => pipe3(
2319
- HttpClientRequest2.post(url),
2320
- HttpClientRequest2.jsonBody(data),
2321
- Effect2.flatMap(HttpClient2.fetchOk),
2318
+ var postWithSchemaValidation = (url, data, schema, headers = {}) => pipe3(
2319
+ Effect2.succeed(HttpClientRequest2.post(url)),
2320
+ Effect2.map(HttpClientRequest2.setHeaders(headers)),
2321
+ Effect2.flatMap(
2322
+ (req) => headers["Content-Type"] === "application/cbor" ? Effect2.succeed(
2323
+ HttpClientRequest2.uint8ArrayBody(
2324
+ data,
2325
+ headers["Content-Type"]
2326
+ )(req)
2327
+ ) : HttpClientRequest2.jsonBody(data)(req)
2328
+ ),
2329
+ Effect2.flatMap(HttpClient2.fetch),
2322
2330
  HttpClientResponse2.json,
2323
2331
  Effect2.flatMap(S4.decodeUnknown(schema))
2324
- // Effect.scoped
2325
2332
  );
2326
2333
  var getWithSchemaValidation = (url, schema) => pipe3(
2327
2334
  HttpClientRequest2.get(url),
@@ -2604,7 +2611,9 @@ var Koios = class {
2604
2611
  const body = fromHex4(tx);
2605
2612
  const schema = TxHashSchema;
2606
2613
  const result = await pipe4(
2607
- postWithSchemaValidation(url, body, schema),
2614
+ postWithSchemaValidation(url, body, schema, {
2615
+ "Content-Type": "application/cbor"
2616
+ }),
2608
2617
  Effect3.timeout(1e4),
2609
2618
  Effect3.catchAllCause((cause) => new KoiosError({ cause })),
2610
2619
  Effect3.runPromise
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-evolution/provider",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",