Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decodeTransfer doesn't return all the outputs in case of multiple outputs in a transaction #5

Open
achal-lala opened this issue Oct 4, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@achal-lala
Copy link

Hi @antoncoding
I am facing an issue with decodeTransfer() function in which the data hex of a transaction with multiple outputs doesn't return all the outputs but just the first one, I am trying to view both the outputs of this transaction (https://testnet-explorer.binance.org/tx/E78C83F2FC9089486ECD55F9DE48E9DAB164A9004C2302754D63465AC8601D44). I tried going through the code too, but couldn't find a solution.
Could you please help me with this?
You can get data hex of the transaction I am trying to get the data of by visiting this url:
https://testnet-dex.binance.org/api/v1/tx/E78C83F2FC9089486ECD55F9DE48E9DAB164A9004C2302754D63465AC8601D44

{"msg":[{"inputs":[{"address":"tbnb138u9djee6fwphhd2a3628q2h0j5w97yx48zqex","coins":[{"denom":"BNB","amount":40000000000}]}],"outputs":[{"address":"tbnb18u4mzgv403uxvh5249wlzxueejah8eagp7j7hs","coins":[{"den om":"BNB","amount":20000000000}]}],"msgType":"MsgSend"}],"signatures":[{"pub_key":{"type":"Buffer","data":[193,35,154,82,160,189,207,229,205,111,52,202,98,183,255,129,131,245,66,69]},"signature":{"type":"Buf fer","data":[10,3,66,78,66,16,128,144,223,192,74]},"account_number":112,"sequence":38}],"memo":"","source":0,"data":"","msgType":"StdTx"}

@antoncoding antoncoding self-assigned this Jan 2, 2020
@antoncoding antoncoding added the bug Something isn't working label Jan 2, 2020
@alexspark21
Copy link

@antoncoding do you have any news about it?

@antoncoding
Copy link
Owner

@alexspark21 Unfortunately, no for now.
Under the current scheme, the decoder will return the exact same structure as the type we passed in, which only contain 1 input and 1 output.

I wanted to make the decoding process recursive for arrays, but more bugs are coming...

@alexspark21
Copy link

alexspark21 commented Jan 16, 2020

@antoncoding oy( bad news, tell me pls may be you know, is it possible decode TX using the main sdk https://github.com/binance-chain/javascript-sdk? yesterday I tried to find some method or functional but could not

@antoncoding
Copy link
Owner

@alexspark21 can you give that a try and tell us about it?
The last time I used the official sdk, it failed. I haven't tried out the official implementation since then because I don't see any update on the decode function, but of course I could be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants