@hashgraphonline/hashinal-wc 1.0.7-3.canary-9 → 1.0.7-3.canary-10

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.
@@ -1810,6 +1810,9 @@ var Result = /* @__PURE__ */ ((Result2) => {
1810
1810
  return Result2;
1811
1811
  })(Result || {});
1812
1812
  class HashinalsWalletConnectSDK {
1813
+ get dAppConnector() {
1814
+ return HashinalsWalletConnectSDK.dAppConnectorInstance;
1815
+ }
1813
1816
  constructor(logger, network) {
1814
1817
  this.logger = logger || new DefaultLogger();
1815
1818
  this.network = network || LedgerId.MAINNET;
@@ -1847,7 +1850,10 @@ class HashinalsWalletConnectSDK {
1847
1850
  async init(projectId, metadata, network) {
1848
1851
  const chosenNetwork = network || this.network;
1849
1852
  const isMainnet = chosenNetwork.toString() === "mainnet";
1850
- this.dAppConnector = new DAppConnector(
1853
+ if (HashinalsWalletConnectSDK.dAppConnectorInstance) {
1854
+ return HashinalsWalletConnectSDK.dAppConnectorInstance;
1855
+ }
1856
+ HashinalsWalletConnectSDK.dAppConnectorInstance = new DAppConnector(
1851
1857
  metadata,
1852
1858
  chosenNetwork,
1853
1859
  projectId,
@@ -1856,14 +1862,14 @@ class HashinalsWalletConnectSDK {
1856
1862
  [isMainnet ? HederaChainId.Mainnet : HederaChainId.Testnet],
1857
1863
  "debug"
1858
1864
  );
1859
- await this.dAppConnector.init({ logger: "error" });
1860
- this.dAppConnector.onSessionIframeCreated = (session) => {
1865
+ await HashinalsWalletConnectSDK.dAppConnectorInstance.init({ logger: "error" });
1866
+ HashinalsWalletConnectSDK.dAppConnectorInstance.onSessionIframeCreated = (session) => {
1861
1867
  this.handleNewSession(session);
1862
1868
  };
1863
1869
  this.logger.info(
1864
1870
  `Hedera Wallet Connect SDK initialized on ${chosenNetwork}`
1865
1871
  );
1866
- return this.dAppConnector;
1872
+ return HashinalsWalletConnectSDK.dAppConnectorInstance;
1867
1873
  }
1868
1874
  async connect() {
1869
1875
  this.ensureInitialized();