Created
August 13, 2017 11:34
-
-
Save johannesostling/77d844fb06fb0457396ab0b2dae05c38 to your computer and use it in GitHub Desktop.
The problem with /account/getdepositaddress
This file contains hidden or 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
-Goal, transfer steem (same issue with several others, NXT for instance) | |
https://bittrex.com/api/v1.1/account/getdepositaddress?apikey=API_KEY¤cy=VTC | |
Response | |
{ | |
"success" : true, | |
"message" : "", | |
"result" : { | |
"Currency" : "STEEM", | |
"Address" : "longHexStringOrWhateverTheFormatIs" | |
} | |
} | |
Well that's not right deposit address. | |
The real address in steems case is: bittrex:longHexStringOrWhateverTheFormatIs | |
Ok so let's use https://bittrex.com/api/v1.1/public/getcurrencies | |
{ | |
"success" : true, | |
"message" : "", | |
"result" : [{ | |
"Currency" : "STEEM", | |
"CurrencyLong" : "STEEM", | |
"MinConfirmation" : 2, | |
"TxFee" : 0.00020000, | |
"IsActive" : true, | |
"CoinType" : "BITCOIN", | |
"BaseAddress" : bittrex //LOOK AT ME | |
}, | |
... | |
} | |
ok great we can use that to piece it together! | |
But wait, BaseAddress can mean different things. | |
For all other currencies it's populated with the normal address not the prefix. | |
Even worse, sometimes it's a different address but still same format | |
(probably in cases where each transaction have different deposit address not sure) | |
Current Workaround? | |
Check if baseaddress has the prefix string "bittrex" (not kidding) if so address=baseaddress:address otherwise address=address | |
So far NXT fails with this ugly workaround but it's brittle and prone to errors. | |
Help me James please. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I haven't dealt with STEEM much but when I go into the UI to create a new address there is info on proper account and memo usage should be handled. You are correct in that all currencies don't behave the same way and require different information when moving funds around. NXT appears similar with the base address and message, but not the same.