@hashgraphonline/standards-sdk 0.0.3 → 0.0.5

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,4 +1,4 @@
1
- import { d as dijkstraExports, M as ModalCtrl, R as RouterCtrl, T as ToastCtrl, a as ThemeCtrl, E as EventsCtrl, b as ExplorerCtrl, C as ConfigCtrl, c as CoreUtil, O as OptionsCtrl } from "./index-jG6VI_MC.js";
1
+ import { d as dijkstraExports, M as ModalCtrl, R as RouterCtrl, T as ToastCtrl, a as ThemeCtrl, E as EventsCtrl, b as ExplorerCtrl, C as ConfigCtrl, c as CoreUtil, O as OptionsCtrl } from "./index-CpR1_h-C.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
@@ -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);
@@ -117532,9 +117560,13 @@ __publicField(_InscriptionSDK, "VALID_MIME_TYPES", {
117532
117560
  jpeg: "image/jpeg",
117533
117561
  png: "image/png",
117534
117562
  gif: "image/gif",
117563
+ ico: "image/x-icon",
117564
+ heic: "image/heic",
117565
+ heif: "image/heif",
117535
117566
  bmp: "image/bmp",
117536
117567
  webp: "image/webp",
117537
117568
  tiff: "image/tiff",
117569
+ tif: "image/tiff",
117538
117570
  svg: "image/svg+xml",
117539
117571
  mp4: "video/mp4",
117540
117572
  webm: "video/webm",
@@ -117547,12 +117579,71 @@ __publicField(_InscriptionSDK, "VALID_MIME_TYPES", {
117547
117579
  ppt: "application/vnd.ms-powerpoint",
117548
117580
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
117549
117581
  html: "text/html",
117582
+ htm: "text/html",
117550
117583
  css: "text/css",
117551
- js: "text/javascript",
117584
+ php: "application/x-httpd-php",
117585
+ java: "text/x-java-source",
117586
+ js: "application/javascript",
117587
+ mjs: "application/javascript",
117552
117588
  csv: "text/csv",
117553
117589
  json: "application/json",
117554
117590
  txt: "text/plain",
117555
- glb: "model/gltf-binary"
117591
+ glb: "model/gltf-binary",
117592
+ wav: "audio/wav",
117593
+ ogg: "audio/ogg",
117594
+ oga: "audio/ogg",
117595
+ flac: "audio/flac",
117596
+ aac: "audio/aac",
117597
+ m4a: "audio/mp4",
117598
+ avi: "video/x-msvideo",
117599
+ mov: "video/quicktime",
117600
+ mkv: "video/x-matroska",
117601
+ m4v: "video/mp4",
117602
+ mpg: "video/mpeg",
117603
+ mpeg: "video/mpeg",
117604
+ ts: "application/typescript",
117605
+ zip: "application/zip",
117606
+ rar: "application/vnd.rar",
117607
+ tar: "application/x-tar",
117608
+ gz: "application/gzip",
117609
+ "7z": "application/x-7z-compressed",
117610
+ xml: "application/xml",
117611
+ yaml: "application/yaml",
117612
+ yml: "application/yaml",
117613
+ md: "text/markdown",
117614
+ markdown: "text/markdown",
117615
+ rtf: "application/rtf",
117616
+ gltf: "model/gltf+json",
117617
+ usdz: "model/vnd.usdz+zip",
117618
+ obj: "model/obj",
117619
+ stl: "model/stl",
117620
+ fbx: "application/octet-stream",
117621
+ ttf: "font/ttf",
117622
+ otf: "font/otf",
117623
+ woff: "font/woff",
117624
+ woff2: "font/woff2",
117625
+ eot: "application/vnd.ms-fontobject",
117626
+ psd: "application/vnd.adobe.photoshop",
117627
+ ai: "application/postscript",
117628
+ eps: "application/postscript",
117629
+ ps: "application/postscript",
117630
+ sqlite: "application/x-sqlite3",
117631
+ db: "application/x-sqlite3",
117632
+ apk: "application/vnd.android.package-archive",
117633
+ ics: "text/calendar",
117634
+ vcf: "text/vcard",
117635
+ py: "text/x-python",
117636
+ rb: "text/x-ruby",
117637
+ go: "text/x-go",
117638
+ rs: "text/x-rust",
117639
+ typescript: "application/typescript",
117640
+ jsx: "text/jsx",
117641
+ tsx: "text/tsx",
117642
+ sql: "application/sql",
117643
+ toml: "application/toml",
117644
+ avif: "image/avif",
117645
+ jxl: "image/jxl",
117646
+ weba: "audio/webm"
117556
117647
  });
117557
117648
  let InscriptionSDK = _InscriptionSDK;
117558
117649
  class Registration {
@@ -133970,7 +134061,7 @@ function publicKeyToAddress(publicKey) {
133970
134061
  }
133971
134062
  async function recoverPublicKey({ hash: hash3, signature: signature2 }) {
133972
134063
  const hashHex = isHex(hash3) ? hash3 : toHex(hash3);
133973
- const { secp256k1: secp256k12 } = await import("./secp256k1-CXHq2QGB.js");
134064
+ const { secp256k1: secp256k12 } = await import("./secp256k1-Cup2jAjC.js");
133974
134065
  const signature_ = (() => {
133975
134066
  if (typeof signature2 === "object" && "r" in signature2 && "s" in signature2) {
133976
134067
  const { r: r3, s: s2, v: v2, yParity } = signature2;
@@ -145716,7 +145807,7 @@ class WalletConnectModal {
145716
145807
  }
145717
145808
  async initUi() {
145718
145809
  if (typeof window !== "undefined") {
145719
- await import("./index-G5o9_z49.js");
145810
+ await import("./index-BYZnC2Ep.js");
145720
145811
  const modal = document.createElement("wcm-modal");
145721
145812
  document.body.insertAdjacentElement("beforeend", modal);
145722
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-jG6VI_MC.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-jG6VI_MC.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,