Nacho Posted August 3, 2017 Report 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
Dr. McKay Posted August 3, 2017 Report Posted August 3, 2017 If that's supposed to be an error, you've cut off most of the useful part of it. Quote
Nacho Posted August 3, 2017 Author Report 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
Dr. McKay Posted August 3, 2017 Report 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
Nacho Posted August 3, 2017 Author Report 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
Nacho Posted August 5, 2017 Author Report Posted August 5, 2017 Please show your full code.That's the full code Quote
Nacho Posted August 5, 2017 Author Report Posted August 5, 2017 Or better. Could you do me a "getExchangeDetails" for getting the "receivedItems" please? Forget the code above Quote
Dr. McKay Posted August 5, 2017 Report Posted August 5, 2017 Surely there is more code in your application than just that snippet. Also, provide the entire output please. Quote
Nacho Posted August 6, 2017 Author Report 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
Dr. McKay Posted August 6, 2017 Report Posted August 6, 2017 Argument 3 is tradeInitTime Nacho 1 Quote
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.