@xyo-network/xl1-rpc 1.12.6 → 1.12.8

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.
@@ -444,6 +444,7 @@ var XyoRunnerRpcSchemas = {
444
444
  };
445
445
 
446
446
  // src/types/schema/XyoSignerRpcSchemas.ts
447
+ import { asHydratedTransactionWithStorageMeta } from "@xyo-network/xl1-protocol";
447
448
  import * as z15 from "zod";
448
449
  var XyoSignerRpcSchemas = {
449
450
  xyoSigner_address: {
@@ -494,7 +495,9 @@ var XyoSignerRpcSchemas = {
494
495
  },
495
496
  result: {
496
497
  to: SignedHydratedTransactionZod,
497
- from: SignedHydratedTransactionZod.transform((data) => data)
498
+ from: SignedHydratedTransactionZod.transform((data) => asHydratedTransactionWithStorageMeta(data, {
499
+ required: true
500
+ }))
498
501
  }
499
502
  }
500
503
  };
@@ -1184,10 +1187,14 @@ var HttpXyoDataLake = class extends AbstractXyoDataLake {
1184
1187
  if (result.status < 200 || result.status >= 300) {
1185
1188
  throw new Error(`Failed to add items [${result.status}]: ${result.statusText}`);
1186
1189
  }
1187
- if (!isAnyPayload3(result.data)) {
1190
+ if (!Array.isArray(result.data) || result.data.length !== 1) {
1191
+ throw new Error("Invalid response from server (expected an Array of Payloads)");
1192
+ }
1193
+ const [response] = result.data;
1194
+ if (!isAnyPayload3(response)) {
1188
1195
  throw new Error("Invalid response from server (expected a Payload)");
1189
1196
  }
1190
- return result.data;
1197
+ return response;
1191
1198
  }
1192
1199
  async fetchOne(hash, maxDepth = Number.MAX_SAFE_INTEGER) {
1193
1200
  if (maxDepth <= 0) {
@@ -1204,10 +1211,16 @@ var HttpXyoDataLake = class extends AbstractXyoDataLake {
1204
1211
  if (response.status < 200 || response.status >= 300) {
1205
1212
  throw new Error(`Failed to get item [${response.status}]: ${response.statusText}`);
1206
1213
  }
1207
- if (!isAnyPayload3(response.data)) {
1208
- throw new Error("Invalid response from server (expected a Payload)");
1214
+ const contentType = response.headers["content-type"];
1215
+ if (contentType && contentType.includes("application/json")) {
1216
+ const parsed = JSON.parse(response.data);
1217
+ if (!isAnyPayload3(parsed)) {
1218
+ throw new Error("Invalid response from server (expected a Payload)");
1219
+ }
1220
+ return parsed;
1221
+ } else {
1222
+ throw new Error(`Unexpected content type: ${contentType}`);
1209
1223
  }
1210
- return response.data;
1211
1224
  });
1212
1225
  }
1213
1226
  };