Would be grateful to be pointed to any resources that would allow me to do this. Thanks!
Asked
Active
Viewed 667 times
1 Answers
1
You need to first parse all the accounts in your HD wallet.
For example, if you have a Ledger Nano, there is a script here.
Or you can just generate addresses from a predefined mnemonic with ethereumjs-wallet as described here.
Finally, once you have the Nth address generated by the HD wallet you can just use:
web3.eth.sendTransaction ( { from: nthaddress, to: singleaddress, value: web3.eth.getBalanceOf( nthaddress ) - fee } )
to do the transaction
where nthaddress is the deriveAccount with the path m/xx'/yy'/0'/.. ( e.g.: "m/44'/60'/0'/0/0" )
Andy B.
- 66
- 7
infura.io, all I can suggest is to run your own node (eventually a light node like this https://redd.it/6lzw8y ), sorry... – Andy B. Mar 06 '18 at 11:00