Doichain / js-doichain

the Doichain js library
MIT License
0 stars 2 forks source link

Porting listTransactions to Electrum #11

Closed silkroadnomad closed 1 month ago

silkroadnomad commented 3 years ago

Instead of calling the RPC of a Doichain dApp we want to call Electrum Server for the transactions of an address in future:

Rewrite (port) this function to use Electrum: https://github.com/Doichain/js-doichain/blob/master/lib/listTransactions.js

  1. Write Test find out what return listtransactions at the moment in Mainnet for an address. (1h)
  2. Copy listtransactions.js to listTransactionsElectrum.js remove all code inside (except the function name) (0,5)
  3. You implement history_get as done in this test https://github.com/inspiraluna/doiContacts/issues/100 (1h)
  4. Decode the transactions -https://github.com/bitcoinjs/bitcoinjs-lib/issues/760 (1h)
  5. so you see the inputs and outputs etc. and have to find out the addresses of the inptus and outputs https://github.com/bitcoinjs/bitcoinjs-lib/issues/762 (you probably don't need to decrypt it) (1h)
  6. When returning the inputs and the outputs we need to have a function which can identify our addresses from addresses of different wallts. Write a function here: (2h)
  7. Return a correct new list of json array with the transactions as before (3h)
leKg1 commented 3 years ago

Here the reference with my commit for this issue: https://github.com/Doichain/js-doichain/commit/a10be49ca08ad46cf7245a60a68822bb81b1d5ef