Nacho Posted August 3, 2017 Report Share Posted August 3, 2017 Hello, I'm using this to get "getExchangeDetails" but it always give me undefined:1 [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] ^ This is the code, thank you! offer.getExchangeDetails(function(err, status, tradeInitTime, receivedItems, sentItems) { if(!err){ console.log("Trade status is " + status + ", init time " + tradeInitTime + ", and we received " + receivedItems.length + " items and sent " + sentItems.length + " items."); }else{ err; } }); Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted August 3, 2017 Report Share Posted August 3, 2017 If that's supposed to be an error, you've cut off most of the useful part of it. Quote Link to comment Share on other sites More sharing options...
Nacho Posted August 3, 2017 Author Report Share Posted August 3, 2017 If that's supposed to be an error, you've cut off most of the useful part of it.Thank you for your answer, but I really don't know how to use it. It was an example what I have used. I only want to get the receivedItems as an array, but I don't know how to use getExchangeDetails, can you give me an example? Thanks Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted August 3, 2017 Report Share Posted August 3, 2017 The way you've used it looks correct to me (although you probably want to console.log that err). I'd need to see more (like more of the error). Quote Link to comment Share on other sites More sharing options...
Nacho Posted August 3, 2017 Author Report Share Posted August 3, 2017 (edited) The way you've used it looks correct to me (although you probably want to console.log that err). I'd need to see more (like more of the error). undefined:1 [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] ^ SyntaxError: Unexpected token o in JSON at position 1 Only logs this. Thanks <3 Edited August 3, 2017 by Nacho Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted August 5, 2017 Report Share Posted August 5, 2017 Please show your full code. Quote Link to comment Share on other sites More sharing options...
Nacho Posted August 5, 2017 Author Report Share Posted August 5, 2017 Please show your full code.That's the full code Quote Link to comment Share on other sites More sharing options...
Nacho Posted August 5, 2017 Author Report Share Posted August 5, 2017 Or better. Could you do me a "getExchangeDetails" for getting the "receivedItems" please? Forget the code above Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted August 5, 2017 Report Share Posted August 5, 2017 Surely there is more code in your application than just that snippet. Also, provide the entire output please. Quote Link to comment Share on other sites More sharing options...
Nacho Posted August 6, 2017 Author Report Share Posted August 6, 2017 Surely there is more code in your application than just that snippet. Also, provide the entire output please.It was an error that was before getExchangeDetails, I fix it. But now getExchangeDetails, if I print the receivedItems it only print the hour. Here is the code and the output: offer.getExchangeDetails(function (err, status, receivedItems){ if(err){ console.log("probando error"); } else{ console.log(receivedItems); } });Output 2017-08-06T13:50:17.000Z Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted August 6, 2017 Report Share Posted August 6, 2017 Argument 3 is tradeInitTime Nacho 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.