Expose hardhat-ledger api to allow down stream plugins to control UI
Ignition clashes with the @nomicfoundation/hardhat-ledger plugin in that both manipulate the cli UI.
The goal is to support a command line deploy from Ignition using a ledger, without clashing UI displays (Ignition rewrites the terminal).
Potential Approach
Based on a quick look over the hardhat-ledger package, the UI manipulating elements come from a wrapper withSpinners. The ledger provider at the heart of the package acts as an event emitter, which withSpinner attaches to.
If withSpinners could be optionally disabled if operating within the context of an Ignition deploy run, and Ignition can hook into the events of the provider, then Ignition can fully control the UI display of the deploy while also customising for ledger interactions.
Open questions then are:
- How do we model "running in an Ignition deploy context" so that
withSpinnerscan be disabled only in that situation? - Can Ignition determine that it is dealing with a ledger provider (and should alter its UI behaviour appropriately)?