Author Topic: [API] Transaction IDs/unconfirmed transactions?  (Read 4517 times)

0 Members and 1 Guest are viewing this topic.

Offline monsterer

The transfer API returns the signed_transaction in JSON form.  Converting it to binary and hashing it will give you a transaction ID.

Any clue on how to do this through the API? When we send transactions in metaexchange, we need the TXID to be available instantly (so we can log the transaction and display to users), because that is how our coin abstraction layer works - every other crypto returns the TXID straight away when you send a transaction.

edit: what I'm after here is an ID which will also appear when we look up a transaction inside a block, or directly with a query - it has to be consistent; there is no point having a TXID hash if that never appears in the data anywhere else, because we need to look it up a bunch of times.
« Last Edit: October 21, 2015, 07:09:31 am by monsterer »
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline bytemaster

What are we supposed to use for a TXID for unconfirmed transaction?

Specifically, the transfer API call doesn't seem to return anything obvious?

The transfer API returns the signed_transaction in JSON form.  Converting it to binary and hashing it will give you a transaction ID.

Alternatively you can use the witness_node API to broadcast the transaction:

         /** this version of broadcast transaction registers a callback method that will be called when the transaction is
          * included into a block.  The callback method includes the transaction id, block number, and transaction number in the
          * block.
          */
         void broadcast_transaction_with_callback( confirmation_callback cb, const signed_transaction& trx);

In this case you will get a callback via websocket when the transaction has been included in a block.  The callback includes the transaction id, block number, and the trx # in the block.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline monsterer

What are we supposed to use for a TXID for unconfirmed transaction?

Specifically, the transfer API call doesn't seem to return anything obvious?
« Last Edit: October 20, 2015, 07:07:06 pm by monsterer »
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads