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
Added options object to WalletManagerConfig interface
Implemented resetNetwork as the first option in the options object
Updated WalletManager constructor to handle the resetNetwork option
Added and updated tests to cover the new resetNetwork behavior
Ensured backward compatibility with existing configurations
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.
Description
This PR enhances the
WalletManager
by introducing anoptions
object in its configuration. The first option implemented isresetNetwork
, which allows users to reset the network to the configured value on each initialization, overriding any persisted network state.Details
options
object toWalletManagerConfig
interfaceresetNetwork
as the first option in theoptions
objectWalletManager
constructor to handle theresetNetwork
optionresetNetwork
behaviorThis 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 totrue
, allows applications to enforce a specific network configuration.