spacebudz / lucid

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
https://lucid.spacebudz.io
MIT License
339 stars 139 forks source link

switchProvider() clears out the wallet #200

Open mttmzr opened 1 year ago

mttmzr commented 1 year ago

When switching the provider, the wallet gets cleared. I think that happens unintentionally and I don't really see a reason for clearing the wallet here. The current wallet gets replaced by the new Lucid instance's wallet (which is of course undefined).

It happens here: https://github.com/spacebudz/lucid/blob/501c5b0139bbad25687bfbed47c93b96c4b65bf5/src/lucid/lucid.ts#L136

By simply removing this line, the issue should be fixed.