@txnlab/use-wallet 3.7.1 → 3.7.2

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/dist/index.cjs CHANGED
@@ -3694,7 +3694,6 @@ var WalletConnect = class extends BaseWallet {
3694
3694
  modal = null;
3695
3695
  modalOptions;
3696
3696
  session = null;
3697
- chains;
3698
3697
  store;
3699
3698
  constructor({
3700
3699
  id,
@@ -3725,7 +3724,6 @@ var WalletConnect = class extends BaseWallet {
3725
3724
  metadata: clientMetadata
3726
3725
  };
3727
3726
  this.modalOptions = modalOptions;
3728
- this.chains = Object.values(caipChainId);
3729
3727
  this.store = store;
3730
3728
  }
3731
3729
  static defaultMetadata = {
@@ -3880,7 +3878,6 @@ var WalletConnect = class extends BaseWallet {
3880
3878
  const WalletConnectModal = (await import("@walletconnect/modal")).WalletConnectModal;
3881
3879
  const modal = new WalletConnectModal({
3882
3880
  projectId: this.options.projectId,
3883
- chains: this.chains,
3884
3881
  ...this.modalOptions
3885
3882
  });
3886
3883
  modal.subscribeModal((state) => this.logger.info(`Modal ${state.open ? "open" : "closed"}`));
@@ -3927,6 +3924,14 @@ var WalletConnect = class extends BaseWallet {
3927
3924
  this.session = session;
3928
3925
  return walletAccounts;
3929
3926
  }
3927
+ get activeChainId() {
3928
+ const chainId = caipChainId[this.activeNetwork];
3929
+ if (!chainId) {
3930
+ this.logger.warn(`No CAIP-2 chain ID found for network: ${this.activeNetwork}`);
3931
+ return "";
3932
+ }
3933
+ return chainId;
3934
+ }
3930
3935
  connect = async () => {
3931
3936
  this.logger.info("Connecting...");
3932
3937
  try {
@@ -3934,7 +3939,7 @@ var WalletConnect = class extends BaseWallet {
3934
3939
  const modal = this.modal || await this.initializeModal();
3935
3940
  const requiredNamespaces = {
3936
3941
  algorand: {
3937
- chains: this.chains,
3942
+ chains: [this.activeChainId],
3938
3943
  methods: ["algo_signTxn"],
3939
3944
  events: []
3940
3945
  }
@@ -4049,7 +4054,7 @@ var WalletConnect = class extends BaseWallet {
4049
4054
  this.logger.debug("Sending processed transactions to wallet...", [txnsToSign]);
4050
4055
  const request = formatJsonRpcRequest("algo_signTxn", [txnsToSign]);
4051
4056
  const signTxnsResult = await client.request({
4052
- chainId: caipChainId[this.activeNetwork],
4057
+ chainId: this.activeChainId,
4053
4058
  topic: this.session.topic,
4054
4059
  request
4055
4060
  });