@hashgraphonline/hashinal-wc 1.0.92 → 1.0.95

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/README.md CHANGED
@@ -642,6 +642,7 @@ Version 1.0.58 and onward correlate with the NPM Package version.
642
642
  | v1.0.86 | 0.0.7770334 | UMD |
643
643
  | v1.0.88 | 0.0.7797532 | UMD |
644
644
  | v1.0.89 | 0.0.7812387 | UMD |
645
+ | v1.0.92 | 0.0.8084872 | UMD |
645
646
 
646
647
  ## Contributing
647
648
 
@@ -2419,7 +2419,7 @@ function pfGlobalThisOrFallback() {
2419
2419
  const qt = /* @__PURE__ */ getDefaultExportFromCjs$1(browser$1);
2420
2420
  const c = { level: "info" }, n = "custom_context";
2421
2421
  var x$1 = Object.defineProperty, S$1 = Object.defineProperties, _ = Object.getOwnPropertyDescriptors, p = Object.getOwnPropertySymbols, T = Object.prototype.hasOwnProperty, z$1 = Object.prototype.propertyIsEnumerable, f = (r, e, t) => e in r ? x$1(r, e, { enumerable: true, configurable: true, writable: true, value: t }) : r[e] = t, i = (r, e) => {
2422
- for (var t in e || (e = {})) T.call(e, t) && f(r, t, e[t]);
2422
+ for (var t in e) T.call(e, t) && f(r, t, e[t]);
2423
2423
  if (p) for (var t of p(e)) z$1.call(e, t) && f(r, t, e[t]);
2424
2424
  return r;
2425
2425
  }, g = (r, e) => S$1(r, _(e));
@@ -5948,6 +5948,9 @@ class HashinalsWalletConnectSDK {
5948
5948
  (signer_) => signer_.getAccountId().toString() === cachedAccountId
5949
5949
  );
5950
5950
  const accountId = (_b = cachedSigner == null ? void 0 : cachedSigner.getAccountId()) == null ? void 0 : _b.toString();
5951
+ if (!accountId) {
5952
+ return null;
5953
+ }
5951
5954
  const network = cachedSigner.getLedgerId();
5952
5955
  return {
5953
5956
  accountId,
@@ -5986,9 +5989,9 @@ class HashinalsWalletConnectSDK {
5986
5989
  let transaction = await new TokenMintTransaction().setTokenId(tokenId).setMetadata([Buffer$1.from(metadata, "utf-8")]).sign(supplyKey);
5987
5990
  return this.executeTransaction(transaction);
5988
5991
  }
5989
- async getMessages(topicId, lastTimestamp, disableTimestampFilter = false) {
5992
+ async getMessages(topicId, lastTimestamp, disableTimestampFilter = false, network) {
5990
5993
  var _a, _b;
5991
- const networkPrefix = this.getNetworkPrefix();
5994
+ const networkPrefix = network || this.getNetworkPrefix();
5992
5995
  const baseUrl = `https://${networkPrefix}.mirrornode.hedera.com`;
5993
5996
  const timestampQuery = Number(lastTimestamp) > 0 && !disableTimestampFilter ? `&timestamp=gt:${lastTimestamp}` : "";
5994
5997
  const url = `${baseUrl}/api/v1/topics/${topicId}/messages?limit=200${timestampQuery}`;
@@ -6107,7 +6110,12 @@ class HashinalsWalletConnectSDK {
6107
6110
  try {
6108
6111
  const defaultNetwork = savedNetwork === "mainnet" ? LedgerId.MAINNET : LedgerId.TESTNET;
6109
6112
  const network = networkOverride || defaultNetwork;
6110
- await this.init(PROJECT_ID, APP_METADATA, network, onSessionIframeCreated);
6113
+ await this.init(
6114
+ PROJECT_ID,
6115
+ APP_METADATA,
6116
+ network,
6117
+ onSessionIframeCreated
6118
+ );
6111
6119
  const balance = await this.getAccountBalance();
6112
6120
  return {
6113
6121
  accountId: savedAccountId,
@@ -6120,8 +6128,16 @@ class HashinalsWalletConnectSDK {
6120
6128
  }
6121
6129
  } else if (networkOverride) {
6122
6130
  try {
6123
- this.logger.info("initializing normally through override.", networkOverride);
6124
- await this.init(PROJECT_ID, APP_METADATA, networkOverride, onSessionIframeCreated);
6131
+ this.logger.info(
6132
+ "initializing normally through override.",
6133
+ networkOverride
6134
+ );
6135
+ await this.init(
6136
+ PROJECT_ID,
6137
+ APP_METADATA,
6138
+ networkOverride,
6139
+ onSessionIframeCreated
6140
+ );
6125
6141
  this.logger.info("initialized", networkOverride);
6126
6142
  await this.connectViaDappBrowser();
6127
6143
  this.logger.info("connected via dapp browser");
@@ -6141,7 +6157,9 @@ class HashinalsWalletConnectSDK {
6141
6157
  this.extensionCheckInterval = setInterval(() => {
6142
6158
  var _a;
6143
6159
  const extensions = ((_a = this.dAppConnector) == null ? void 0 : _a.extensions) || [];
6144
- const availableExtension = extensions.find((ext) => ext.availableInIframe);
6160
+ const availableExtension = extensions.find(
6161
+ (ext) => ext.availableInIframe
6162
+ );
6145
6163
  if (availableExtension && !this.hasCalledExtensionCallback) {
6146
6164
  this.hasCalledExtensionCallback = true;
6147
6165
  callback(availableExtension);