I'm trying to build a service where I import a bunch of pirvate keys into bitcoin core or some other software if you recommend a better solution. Once the private keys are imported, I want to monitor these addresses and if anything is positive have it send it to another wallet address I own.
I thought aboout importing the private keys with importprivkey api call. Does it take multiple private keys or do I have to loop through them?
Once these private keys are imported into my wallet I want to be able to detect the occurrence of any of the following:
- if the entire wallet balance is greater than .001
- or if 1 hour passes
Then, send all coins in the wallet to another address. My questions are:
- Is there a service to monitor the bitcoin balance, or do I just have to make a cron job to query it every second?
- When using sendtoaddress api call, do I have to specify a change address?
- How do other people usually solve this problem?