@hashgraphonline/standards-sdk 0.0.4 → 0.0.6

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.
@@ -117153,9 +117153,10 @@ const _InscriptionSDK = class _InscriptionSDK2 {
117153
117153
  async getFileMetadata(url) {
117154
117154
  try {
117155
117155
  const response = await axios.get(url);
117156
+ const mimeType = response.headers["content-type"] || "";
117156
117157
  return {
117157
117158
  size: parseInt(response.headers["content-length"] || "0", 10),
117158
- mimeType: response.headers["content-type"] || ""
117159
+ mimeType
117159
117160
  };
117160
117161
  } catch (error) {
117161
117162
  this.logger.error("Error fetching file metadata:", error);
@@ -117198,6 +117199,28 @@ const _InscriptionSDK = class _InscriptionSDK2 {
117198
117199
  }
117199
117200
  this.validateFileInput(request.file);
117200
117201
  }
117202
+ normalizeMimeType(mimeType) {
117203
+ if (mimeType === "image/vnd.microsoft.icon") {
117204
+ this.logger.debug(
117205
+ "Normalizing MIME type from image/vnd.microsoft.icon to image/x-icon"
117206
+ );
117207
+ return "image/x-icon";
117208
+ }
117209
+ return mimeType;
117210
+ }
117211
+ validateMimeType(mimeType) {
117212
+ const validMimeTypes = Object.values(_InscriptionSDK2.VALID_MIME_TYPES);
117213
+ if (validMimeTypes.includes(mimeType)) {
117214
+ return true;
117215
+ }
117216
+ if (mimeType === "image/vnd.microsoft.icon") {
117217
+ this.logger.debug(
117218
+ "Accepting alternative MIME type for ICO: image/vnd.microsoft.icon"
117219
+ );
117220
+ return true;
117221
+ }
117222
+ return false;
117223
+ }
117201
117224
  validateFileInput(file) {
117202
117225
  if (file.type === "base64") {
117203
117226
  if (!file.base64) {
@@ -117211,12 +117234,14 @@ const _InscriptionSDK = class _InscriptionSDK2 {
117211
117234
  );
117212
117235
  }
117213
117236
  const mimeType = file.mimeType || this.getMimeType(file.fileName);
117214
- const validMimeTypes = Object.values(_InscriptionSDK2.VALID_MIME_TYPES);
117215
- if (!validMimeTypes.includes(mimeType)) {
117237
+ if (!this.validateMimeType(mimeType)) {
117216
117238
  throw new ValidationError(
117217
117239
  "File must have one of the supported MIME types"
117218
117240
  );
117219
117241
  }
117242
+ if (file.mimeType === "image/vnd.microsoft.icon") {
117243
+ file.mimeType = this.normalizeMimeType(file.mimeType);
117244
+ }
117220
117245
  } else if (file.type === "url") {
117221
117246
  if (!file.url) {
117222
117247
  throw new ValidationError("URL is required");
@@ -117241,6 +117266,9 @@ const _InscriptionSDK = class _InscriptionSDK2 {
117241
117266
  `File size exceeds maximum URL file limit of ${_InscriptionSDK2.MAX_URL_FILE_SIZE / 1024 / 1024}MB`
117242
117267
  );
117243
117268
  }
117269
+ if (fileMetadata.mimeType === "image/vnd.microsoft.icon") {
117270
+ fileMetadata.mimeType = this.normalizeMimeType(fileMetadata.mimeType);
117271
+ }
117244
117272
  }
117245
117273
  if (request.jsonFileURL) {
117246
117274
  const jsonMetadata = await this.getFileMetadata(request.jsonFileURL);
@@ -117538,6 +117566,7 @@ __publicField(_InscriptionSDK, "VALID_MIME_TYPES", {
117538
117566
  bmp: "image/bmp",
117539
117567
  webp: "image/webp",
117540
117568
  tiff: "image/tiff",
117569
+ tif: "image/tiff",
117541
117570
  svg: "image/svg+xml",
117542
117571
  mp4: "video/mp4",
117543
117572
  webm: "video/webm",
@@ -117550,16 +117579,19 @@ __publicField(_InscriptionSDK, "VALID_MIME_TYPES", {
117550
117579
  ppt: "application/vnd.ms-powerpoint",
117551
117580
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
117552
117581
  html: "text/html",
117582
+ htm: "text/html",
117553
117583
  css: "text/css",
117554
- php: "text/x-php",
117555
- java: "text/x-java",
117556
- js: "text/javascript",
117584
+ php: "application/x-httpd-php",
117585
+ java: "text/x-java-source",
117586
+ js: "application/javascript",
117587
+ mjs: "application/javascript",
117557
117588
  csv: "text/csv",
117558
117589
  json: "application/json",
117559
117590
  txt: "text/plain",
117560
117591
  glb: "model/gltf-binary",
117561
117592
  wav: "audio/wav",
117562
117593
  ogg: "audio/ogg",
117594
+ oga: "audio/ogg",
117563
117595
  flac: "audio/flac",
117564
117596
  aac: "audio/aac",
117565
117597
  m4a: "audio/mp4",
@@ -117567,7 +117599,9 @@ __publicField(_InscriptionSDK, "VALID_MIME_TYPES", {
117567
117599
  mov: "video/quicktime",
117568
117600
  mkv: "video/x-matroska",
117569
117601
  m4v: "video/mp4",
117570
- ts: "video/mp2t",
117602
+ mpg: "video/mpeg",
117603
+ mpeg: "video/mpeg",
117604
+ ts: "application/typescript",
117571
117605
  zip: "application/zip",
117572
117606
  rar: "application/vnd.rar",
117573
117607
  tar: "application/x-tar",
@@ -117589,12 +117623,12 @@ __publicField(_InscriptionSDK, "VALID_MIME_TYPES", {
117589
117623
  woff: "font/woff",
117590
117624
  woff2: "font/woff2",
117591
117625
  eot: "application/vnd.ms-fontobject",
117592
- psd: "image/vnd.adobe.photoshop",
117626
+ psd: "application/vnd.adobe.photoshop",
117593
117627
  ai: "application/postscript",
117594
117628
  eps: "application/postscript",
117595
117629
  ps: "application/postscript",
117596
- sqlite: "application/vnd.sqlite3",
117597
- db: "application/vnd.sqlite3",
117630
+ sqlite: "application/x-sqlite3",
117631
+ db: "application/x-sqlite3",
117598
117632
  apk: "application/vnd.android.package-archive",
117599
117633
  ics: "text/calendar",
117600
117634
  vcf: "text/vcard",
@@ -117602,13 +117636,14 @@ __publicField(_InscriptionSDK, "VALID_MIME_TYPES", {
117602
117636
  rb: "text/x-ruby",
117603
117637
  go: "text/x-go",
117604
117638
  rs: "text/x-rust",
117605
- typescript: "text/typescript",
117639
+ typescript: "application/typescript",
117606
117640
  jsx: "text/jsx",
117607
117641
  tsx: "text/tsx",
117608
117642
  sql: "application/sql",
117609
117643
  toml: "application/toml",
117610
117644
  avif: "image/avif",
117611
- jxl: "image/jxl"
117645
+ jxl: "image/jxl",
117646
+ weba: "audio/webm"
117612
117647
  });
117613
117648
  let InscriptionSDK = _InscriptionSDK;
117614
117649
  class Registration {
@@ -134026,7 +134061,7 @@ function publicKeyToAddress(publicKey) {
134026
134061
  }
134027
134062
  async function recoverPublicKey({ hash: hash3, signature: signature2 }) {
134028
134063
  const hashHex = isHex(hash3) ? hash3 : toHex(hash3);
134029
- const { secp256k1: secp256k12 } = await import("./secp256k1-DrkwdU-G.js");
134064
+ const { secp256k1: secp256k12 } = await import("./secp256k1-Cup2jAjC.js");
134030
134065
  const signature_ = (() => {
134031
134066
  if (typeof signature2 === "object" && "r" in signature2 && "s" in signature2) {
134032
134067
  const { r: r3, s: s2, v: v2, yParity } = signature2;
@@ -145772,7 +145807,7 @@ class WalletConnectModal {
145772
145807
  }
145773
145808
  async initUi() {
145774
145809
  if (typeof window !== "undefined") {
145775
- await import("./index-5jxKYRjw.js");
145810
+ await import("./index-BYZnC2Ep.js");
145776
145811
  const modal = document.createElement("wcm-modal");
145777
145812
  document.body.insertAdjacentElement("beforeend", modal);
145778
145813
  OptionsCtrl.setIsUiLoaded(true);
@@ -1,4 +1,4 @@
1
- import { H as Hash, e as createView, f as aexists, t as toBytes, g as aoutput, w as wrapConstructor, r as rotr, h as ahash, i as abytes$1, j as randomBytes, k as concatBytes$1 } from "./index-CXCIEcrN.js";
1
+ import { H as Hash, e as createView, f as aexists, t as toBytes, g as aoutput, w as wrapConstructor, r as rotr, h as ahash, i as abytes$1, j as randomBytes, k as concatBytes$1 } from "./index-CpR1_h-C.js";
2
2
  function setBigUint64(view, byteOffset, value, isLE) {
3
3
  if (typeof view.setBigUint64 === "function")
4
4
  return view.setBigUint64(byteOffset, value, isLE);
@@ -1,4 +1,4 @@
1
- import { n, l, m, L, W, o, p, q } from "./index-CXCIEcrN.js";
1
+ import { n, l, m, L, W, o, p, q } from "./index-CpR1_h-C.js";
2
2
  export {
3
3
  n as EVMBridge,
4
4
  l as HCS10,