Last active
August 3, 2017 02:25
-
-
Save amustafa/6dd24be5b774f3e29a4d11d8593f48ed to your computer and use it in GitHub Desktop.
Create a Normal Shapeshift Transaction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_normal_tx(withdrawal_address, input_coin, output_coin, | |
return_address=None, | |
destination_tag=None, | |
rs_address=None, | |
api_key=None): | |
url_path = "shift" | |
url = BASE_URL % url_path | |
payload = { | |
'withdrawal': withdrawal_address, | |
'pair': "{}_{}".format(input_coin, output_coin), | |
'returnAddress': return_address, | |
'destTag': destination_tag, | |
'rsAddress': rs_address, | |
'apiKey': api_key | |
} | |
# Filter out values that are None | |
payload = {k: v for k, v in payload.items() if v is not None} | |
response = requests.post(url, data=payload) | |
return response.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment