TxnLab / use-wallet

A framework agnostic wallet integration library for Algorand dApps
https://txnlab.gitbook.io/use-wallet
MIT License
81 stars 32 forks source link

feat: add resetNetwork option to WalletManager #260

Closed drichar closed 3 weeks ago

drichar commented 3 weeks ago

Description

This PR enhances the WalletManager by introducing an options object in its configuration. The first option implemented is resetNetwork, which allows users to reset the network to the configured value on each initialization, overriding any persisted network state.

const walletManager = new WalletManager({
  wallets: [...],
  network: NetworkId.TESTNET,
  algod: {...},
  options: {
    resetNetwork: true  // App will always start connected to TestNet
  }
})

Details

This change provides a flexible framework for adding more configuration options in the future, while addressing the immediate need for network reset functionality. The resetNetwork option, when set to true, allows applications to enforce a specific network configuration.