Skip to content

Instantly share code, notes, and snippets.

@amustafa
Last active August 3, 2017 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amustafa/6dd24be5b774f3e29a4d11d8593f48ed to your computer and use it in GitHub Desktop.
Save amustafa/6dd24be5b774f3e29a4d11d8593f48ed to your computer and use it in GitHub Desktop.
Create a Normal Shapeshift Transaction
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