@settlemint/dalp-sdk 3.1.19-main.35740775477 → 3.1.19-main.35754573872

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/auth.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  makeCookieStore2,
11
11
  createCookieStoreFetch2,
12
12
  SDK_USER_AGENT2
13
- } from "./chunk-qv2wgcmj.js";
13
+ } from "./chunk-ky89t16a.js";
14
14
 
15
15
  // src/auth/live.ts
16
16
  import { apiKeyClient } from "@better-auth/api-key/client";
package/dist/bundler.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import"./chunk-j4sxrfzz.js";
2
- import"./chunk-tmyd93kk.js";
2
+ import"./chunk-wmzaewxm.js";
3
3
  import"./chunk-xp3fx2yt.js";
4
4
  import {
5
5
  buildDalpClient
6
- } from "./chunk-7y52nnrf.js";
6
+ } from "./chunk-eh86kbrr.js";
7
7
 
8
8
  // src/bundler.ts
9
9
  import { getAddress, hexToBigInt, isHex } from "viem";
@@ -4,7 +4,7 @@ import {
4
4
  sendRequest,
5
5
  createFetchExecutor,
6
6
  createTanstackFactories
7
- } from "./chunk-tmyd93kk.js";
7
+ } from "./chunk-wmzaewxm.js";
8
8
  import {
9
9
  buildProxy,
10
10
  findRoute
@@ -102,7 +102,7 @@ function createCookieStoreFetch2(cookieStore, fetchImpl = globalThis.fetch) {
102
102
  // package.json
103
103
  var package_default = {
104
104
  name: "@settlemint/dalp-sdk",
105
- version: "3.1.19-main.35740775477",
105
+ version: "3.1.19-main.35754573872",
106
106
  private: false,
107
107
  description: "Fully typed SDK for the DALP tokenization platform API",
108
108
  homepage: "https://settlemint.com",
@@ -700,6 +700,19 @@ function sdkErrorFromEnvelope(payload, response) {
700
700
  ...Object.keys(data).length === 0 ? {} : { details: data }
701
701
  });
702
702
  }
703
+ function malformedSuccessError(response, text) {
704
+ const contentType = response.headers.get("content-type") ?? "";
705
+ return new DalpSdkError2({
706
+ code: "sdk.transport.MALFORMED_RESPONSE",
707
+ category: "dependency",
708
+ status: response.status,
709
+ retryable: true,
710
+ message: `DALP API responded ${String(response.status)} without a JSON object body`,
711
+ why: text === "" ? "The platform answered with an empty body where a JSON envelope was expected." : "The platform answered with a body that is not a JSON object, so the envelope cannot be read.",
712
+ fix: "Check the base URL and any proxy in front of the API: a sign-in page, an HTML error page, or a truncated body reached the client instead of the API envelope.",
713
+ details: { contentType, bodyLength: text.length, bodyPreview: text.slice(0, 120) }
714
+ });
715
+ }
703
716
  async function readResponse(response) {
704
717
  const text = await response.text();
705
718
  let payload;
@@ -711,6 +724,9 @@ async function readResponse(response) {
711
724
  if (!response.ok) {
712
725
  throw makeDalpApiError2(sdkErrorFromEnvelope(payload, response));
713
726
  }
727
+ if (payload === null || typeof payload !== "object") {
728
+ throw makeDalpApiError2(malformedSuccessError(response, text));
729
+ }
714
730
  return payload;
715
731
  }
716
732
 
package/dist/effect.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  streamRequest,
9
9
  sendRequest,
10
10
  queryKeyFor2
11
- } from "./chunk-tmyd93kk.js";
11
+ } from "./chunk-wmzaewxm.js";
12
12
  import"./chunk-xp3fx2yt.js";
13
13
  import {
14
14
  buildProxy,
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  RESERVED_STREAM_FAILURE_EVENT2,
15
15
  STREAM_FAILED_ERROR_CODE2,
16
16
  decodeEventStream2
17
- } from "./chunk-tmyd93kk.js";
17
+ } from "./chunk-wmzaewxm.js";
18
18
  import {
19
19
  SECRET_REDACTION_MARKER2,
20
20
  Secret2,
@@ -25,13 +25,13 @@ import {
25
25
  createCookieStoreFetch2,
26
26
  SDK_VERSION2,
27
27
  SDK_USER_AGENT2
28
- } from "./chunk-qv2wgcmj.js";
28
+ } from "./chunk-ky89t16a.js";
29
29
  import {
30
30
  readsAsIndexerRebuild2
31
31
  } from "./chunk-5qkmb0bq.js";
32
32
  import {
33
33
  buildDalpClient
34
- } from "./chunk-7y52nnrf.js";
34
+ } from "./chunk-eh86kbrr.js";
35
35
 
36
36
  // src/proxy/client.ts
37
37
  function createDalpClient(options) {
@@ -3,7 +3,7 @@ import {
3
3
  canonicalize2,
4
4
  queryKeyFor2,
5
5
  UI_SETTLEMENT_TIMEOUT_MS2
6
- } from "./chunk-tmyd93kk.js";
6
+ } from "./chunk-wmzaewxm.js";
7
7
  import"./chunk-xp3fx2yt.js";
8
8
  export {
9
9
  UI_SETTLEMENT_TIMEOUT_MS2 as UI_SETTLEMENT_TIMEOUT_MS,