@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.d.cts CHANGED
@@ -416,7 +416,6 @@ declare class WalletConnect extends BaseWallet {
416
416
  private modal;
417
417
  private modalOptions;
418
418
  private session;
419
- private chains;
420
419
  protected store: Store<State>;
421
420
  constructor({ id, store, subscribe, getAlgodClient, options, metadata }: WalletConstructor<WalletId.WALLETCONNECT>);
422
421
  static defaultMetadata: {
@@ -432,6 +431,7 @@ declare class WalletConnect extends BaseWallet {
432
431
  private initializeClient;
433
432
  private initializeModal;
434
433
  private onSessionConnected;
434
+ get activeChainId(): string;
435
435
  connect: () => Promise<WalletAccount[]>;
436
436
  disconnect: () => Promise<void>;
437
437
  resumeSession: () => Promise<void>;
package/dist/index.d.ts CHANGED
@@ -416,7 +416,6 @@ declare class WalletConnect extends BaseWallet {
416
416
  private modal;
417
417
  private modalOptions;
418
418
  private session;
419
- private chains;
420
419
  protected store: Store<State>;
421
420
  constructor({ id, store, subscribe, getAlgodClient, options, metadata }: WalletConstructor<WalletId.WALLETCONNECT>);
422
421
  static defaultMetadata: {
@@ -432,6 +431,7 @@ declare class WalletConnect extends BaseWallet {
432
431
  private initializeClient;
433
432
  private initializeModal;
434
433
  private onSessionConnected;
434
+ get activeChainId(): string;
435
435
  connect: () => Promise<WalletAccount[]>;
436
436
  disconnect: () => Promise<void>;
437
437
  resumeSession: () => Promise<void>;
package/dist/index.js CHANGED
@@ -3650,7 +3650,6 @@ var WalletConnect = class extends BaseWallet {
3650
3650
  modal = null;
3651
3651
  modalOptions;
3652
3652
  session = null;
3653
- chains;
3654
3653
  store;
3655
3654
  constructor({
3656
3655
  id,
@@ -3681,7 +3680,6 @@ var WalletConnect = class extends BaseWallet {
3681
3680
  metadata: clientMetadata
3682
3681
  };
3683
3682
  this.modalOptions = modalOptions;
3684
- this.chains = Object.values(caipChainId);
3685
3683
  this.store = store;
3686
3684
  }
3687
3685
  static defaultMetadata = {
@@ -3836,7 +3834,6 @@ var WalletConnect = class extends BaseWallet {
3836
3834
  const WalletConnectModal = (await import("@walletconnect/modal")).WalletConnectModal;
3837
3835
  const modal = new WalletConnectModal({
3838
3836
  projectId: this.options.projectId,
3839
- chains: this.chains,
3840
3837
  ...this.modalOptions
3841
3838
  });
3842
3839
  modal.subscribeModal((state) => this.logger.info(`Modal ${state.open ? "open" : "closed"}`));
@@ -3883,6 +3880,14 @@ var WalletConnect = class extends BaseWallet {
3883
3880
  this.session = session;
3884
3881
  return walletAccounts;
3885
3882
  }
3883
+ get activeChainId() {
3884
+ const chainId = caipChainId[this.activeNetwork];
3885
+ if (!chainId) {
3886
+ this.logger.warn(`No CAIP-2 chain ID found for network: ${this.activeNetwork}`);
3887
+ return "";
3888
+ }
3889
+ return chainId;
3890
+ }
3886
3891
  connect = async () => {
3887
3892
  this.logger.info("Connecting...");
3888
3893
  try {
@@ -3890,7 +3895,7 @@ var WalletConnect = class extends BaseWallet {
3890
3895
  const modal = this.modal || await this.initializeModal();
3891
3896
  const requiredNamespaces = {
3892
3897
  algorand: {
3893
- chains: this.chains,
3898
+ chains: [this.activeChainId],
3894
3899
  methods: ["algo_signTxn"],
3895
3900
  events: []
3896
3901
  }
@@ -4005,7 +4010,7 @@ var WalletConnect = class extends BaseWallet {
4005
4010
  this.logger.debug("Sending processed transactions to wallet...", [txnsToSign]);
4006
4011
  const request = formatJsonRpcRequest("algo_signTxn", [txnsToSign]);
4007
4012
  const signTxnsResult = await client.request({
4008
- chainId: caipChainId[this.activeNetwork],
4013
+ chainId: this.activeChainId,
4009
4014
  topic: this.session.topic,
4010
4015
  request
4011
4016
  });