API to check Tx status of createandsendtransaction?

If my understanding is correct, createandsendtransaction is used for sending PRVs from one account to another. It is different than createandsendtxwithprvtradereq, which is used to exchange PRV (native token) with privacy tokens (pBTC, etc).

Both return a TxId when the requests are submitted successfully. However, there doesn’t seem to be an API to check whether the transaction submitted by createandsendtransaction eventually was accepted or not.

For those submitted by createandsendtxwithprvtradereq, I can use getpdetradestatus to check if the transaction’s TxId eventually was eventually accepted and included on chain. But it doesn’t seem to understand TxIds created from createandsendtransaction.

What is the right way of doing this? Any help is greatly appreciated! Thanks!

1 Like

You can use the method “gettransactionbyhash”

1 Like

But gettransactionbyhash seems to be just a list of data contained by the transaction. Is there a field that is supposed to indicate if the transaction is successful?

1 Like

Yes.

 "IsInMempool": (True/False) 

if True it has not been mined. If false, then it either failed to broadcast or it has been mined.

  "IsInBlock": (True/False)

if True it was successful and has been mined. If false, then it either failed to broadcast or it is in the Mempool.

2 Likes

Very cool! Thanks! I must have overlooked these.

2 Likes

@cusdt.eth Hope you don’t mind me asking one more question…

For pdex transactions, sometimes I get Result: 1 back from getpdetradestatus on a TxID, sometimes I get Result: 2 back. I take it that 1 means success, and 2 means not?

But even when I get Result: 2, I checked that the transaction has IsInMempool: false and IsInBlock: true. So I’m confused as to whether this transaction was successful or not…

1 Like

1 = Accepted

2 = Refunded

2 Likes

Thanks! Does it imply that the “Refunded” result is only relevant to pdex, and therefore not applicable to createandsendtransaction?

Also, gettransactionbyhash seems to return every Tx details in the clear, amount, address, etc. How do I make a transaction that can have address hidden?

I’m not so sure about this. The documentation that is available is very limited. Maybe @duc could provide some insight?

2 Likes

As of now, you cannot. To keep your address anonymous, first, you have to transfer your assets to another unknown address and then you should trade. Please read the discussion starting from here (App v.4).

(App v.4 ) seems to be talking about pdex transaction. What I referred to above was about this createandsendtransaction API. Is there a way to make such transactions (i.e. sending PRV from one address to another) private?