Author

Topic: Python script to autotrade between wallets and shapeshift (Read 1216 times)

jza
full member
Activity: 126
Merit: 103
I think I did it the challenge is the wallets. Basically is the CLI interface to the local wallet. The web wallets varies a lot from one another and the blockchain.info api is a royal mess.
Too much configuration to make the API work.
legendary
Activity: 2114
Merit: 1040
A Great Time to Start Something!
A user-friendly version of this idea would be awesome, but I know it is not easy.
Thanks, for the effort so far. Are you still working on the project?
jza
full member
Activity: 126
Merit: 103
I still have this midway but so far I have been able to issue a transfer.
Code:
from shapeshiftio import ShapeShiftIO
s=ShapeShiftIO()
btc_wallet= 1AtaLyDaswekkERsatkV2kahHDVL4RU1hrmwia
alt_wallet = LZV6twmNyjE1zp45D2BefSVGxd1BJy7Cvx
transfer = {"amount":1, "withdrawal":btc_wallet, "pair":"btc_nbt", "returnAddress":alt_wallet}
s.send_amount(transfer)
s.send_amount(transfer)
{u'success': {u'withdrawalAmount': u'1', u'depositAmount': u'462.1022', u'returnAddress': u'LZV6twmNyjE1zp45D2BefSVGxd1BJy7Cvx ', u'maxLimit': 2098.04266676, u'apiPubKey': u'shapeshift', u'expiration': 1450147115967, u'withdrawal': u'1AtaLyDaswekkERsatkV2kahHDVL4RU1hrmwia', u'pair': u'nbt_btc', u'minerFee': u'0.0001', u'quotedRate': u'0.00216424', u'deposit': u'B8DFEFpxeY7jQMhPe9fq4QKcmroPfwBXqQ'}}

Is still pretty rough, obviously the method would change depending on the type of wallet, web wallet or desktop wallet but it should insert the target addresses of them both. So btc_walllet and alt_coin wallet should get their account addresses on each.

I am still not sure how to get the invoice email destination. Hopefully it could be cleared.
legendary
Activity: 1008
Merit: 1023
Democracy is the original 51% attack
Awesome!  If we can help in any way, please let us know. You can reach me directly at erik at shapeshift dot io
jza
full member
Activity: 126
Merit: 103
Not sure if this forum allows development outside of bitcoin Core. But I am trying to develop a script that does the following:
- Check wallet is running daemon mode, if not start it.
- Check the price of bitcoin and compare it with the target parameter.
- Get Shapeshift API to issue a trade
- If the price is close to the parameter connect to wallet and issue a payment from Shapeshift deposit address.

I am developing using python and have currently the API from ShapeShiftIO. However if someone have done this or will want to point me to a more robust development I am all ears.
Jump to: