Add IndexedChain trait and implement for Esplora & Electrum
Description
This PR introduces the trait IndexedChain that Blockchains can implement if they have access to chain data. There are lots of methods that could be added to this trait (the entire esplora/electrum apis) but I started with the data I needed to provide LDK with the chain data it needs to function.
I have implemented the trait for Esplora and Electrum blockchains.
All Submissions:
- [x] I've signed all my commits
- [x] I followed the contribution guidelines
- [x] I ran
cargo fmtandcargo clippybefore committing
New Features:
- [ ] I've added tests for the new feature
- [x] I've added docs for the new feature
- [x] I've updated
CHANGELOG.md
Now that #501 is in you'll need to rebase on master to fix the CI issue.
Concept ACK - would love to see this functionality get merged.
FWIW my plan is not to merge this PR or something similar but rather to reduce the surface area that the main BDK lib has with blockchain interactions. I have got feedback that people really want a fully featured rust interface to esplora's http api though. The question to me is do we really need traits in BDK that define this behaviour? It seems like a small thing to leave up to the application developer if they indeed want to have blockchain data polymorphism.