Jump to content
McKay Development

Recommended Posts

Posted

I know theres a listener for new confirmations and all, I've tried making it myself but couldn't get it to work. Not at my main system right now so cant provide the code I had written. Help is appreciated :)

Posted
  On 2/20/2017 at 12:27 AM, Dr. McKay said:

You can use acceptConfirmationForObject.

I just tried and and used newConfirmation. Does the listener require checkConfirmations() to be fired to emit confirmations?

Posted

i use like this, but not work.

cb4fd363950d4b3da98457b5e1e0965d.png

 

// Create and send the offer
offer.addMyItems(inventory);
offer.setMessage("Here, have some items!");
offer.send(function(err, status) {
if (err) {
console.log(err);
return;
}
 
if (status == 'pending') {
// We need to confirm it
console.log('Offer ' + offer.id +' sent, but requires confirmation');
community.acceptConfirmationForObject("my identify_secret", offer.id, function(err) {
if (err) {
console.log(err);
} else {
console.log("Offer confirmed");
}
});
} else {
console.log('Offer '+ offer.id +' sent successfully');
}
});
Posted
  On 2/22/2017 at 9:32 AM, maraya said:

 

i use like this, but not work.

cb4fd363950d4b3da98457b5e1e0965d.png

 

// Create and send the offer
offer.addMyItems(inventory);
offer.setMessage("Here, have some items!");
offer.send(function(err, status) {
if (err) {
console.log(err);
return;
}
 
if (status == 'pending') {
// We need to confirm it
console.log('Offer ' + offer.id +' sent, but requires confirmation');
community.acceptConfirmationForObject("my identify_secret", offer.id, function(err) {
if (err) {
console.log(err);
} else {
console.log("Offer confirmed");
}
});
} else {
console.log('Offer '+ offer.id +' sent successfully');
}
});

 

 

The confirmation's ID isnt the same as the trade id. Make it check confirmations if the status is pending and use the newConfirmation listener which emits a confirmation object. Then use CConfimation.id as offer id and accept it using that.

Posted
  On 2/22/2017 at 2:22 PM, botsbytim said:

The confirmation's ID isnt the same as the trade id. Make it check confirmations if the status is pending and use the newConfirmation listener which emits a confirmation object. Then use CConfimation.id as offer id and accept it using that.

 

acceptConfirmationForObject takes care of finding the correct confirmation for a given offer ID.

 

@maraya: What's your output?

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...