@hashgraphonline/hashinal-wc 1.0.7-3.canary-7 → 1.0.7-3.canary-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.
@@ -1853,7 +1853,8 @@ class HashinalsWalletConnectSDK {
1853
1853
  projectId,
1854
1854
  Object.values(HederaJsonRpcMethod),
1855
1855
  [HederaSessionEvent.ChainChanged, HederaSessionEvent.AccountsChanged],
1856
- [isMainnet ? HederaChainId.Mainnet : HederaChainId.Testnet]
1856
+ [isMainnet ? HederaChainId.Mainnet : HederaChainId.Testnet],
1857
+ "debug"
1857
1858
  );
1858
1859
  await this.dAppConnector.init({ logger: "error" });
1859
1860
  this.dAppConnector.onSessionIframeCreated = (session) => {
@@ -1871,10 +1872,29 @@ class HashinalsWalletConnectSDK {
1871
1872
  return session;
1872
1873
  }
1873
1874
  async disconnect() {
1875
+ var _a, _b;
1876
+ try {
1877
+ this.ensureInitialized();
1878
+ const accountInfo = this.getAccountInfo();
1879
+ const accountId = accountInfo == null ? void 0 : accountInfo.accountId;
1880
+ const network = accountInfo == null ? void 0 : accountInfo.network;
1881
+ const signer = (_a = this == null ? void 0 : this.dAppConnector) == null ? void 0 : _a.signers.find(
1882
+ (signer_) => signer_.getAccountId().toString() === accountId
1883
+ );
1884
+ await ((_b = this.dAppConnector) == null ? void 0 : _b.disconnect(signer == null ? void 0 : signer.topic));
1885
+ this.logger.info(`Disconnected from ${accountId} on ${network}`);
1886
+ return true;
1887
+ } catch (e) {
1888
+ this.logger.error("Failed to disconnect", e);
1889
+ return false;
1890
+ }
1891
+ }
1892
+ async disconnectAll() {
1893
+ var _a;
1874
1894
  try {
1875
1895
  this.ensureInitialized();
1876
- await this.dAppConnector.disconnectAll();
1877
- this.logger.info("Disconnected from all wallets");
1896
+ await ((_a = this.dAppConnector) == null ? void 0 : _a.disconnectAll());
1897
+ this.logger.info(`Disconnected from all wallets`);
1878
1898
  return true;
1879
1899
  } catch (e) {
1880
1900
  this.logger.error("Failed to disconnect", e);