Author Topic: Best way to tell if transaction is a deposit via RPC?  (Read 5177 times)

0 Members and 1 Guest are viewing this topic.

Xeldal

  • Guest
the toaccount of wallet_account_transaction_history will tell you it was sent to you (thus deposit). This list will only update if wallet is unlocked.
+5%  I must not understand the problem, because this^ seems to answer it as far as I can tell.


the toaccount of wallet_account_transaction_history will tell you it was sent to you (thus deposit). This list will only update if wallet is unlocked.

If you register your own account the to and from are both you inside the transaction, so this rule doesn't quite work :)
I think you could say this still applies, the registration is a fee, and is burned.  The transaction is all fees and zero is deposited in the to_account

Offline monsterer

Depends what you mean by deposit?

The individual operations you see from something like blockchain_get_transaction represent exactly what happened to the DAC.

My difficulty was in understanding which was a deposit to my account (deposit from their account) and which was a withdraw from my account (withdraw from their account).
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline vikram

Depends what you mean by deposit?

The individual operations you see from something like blockchain_get_transaction represent exactly what happened to the DAC.

Offline monsterer

the toaccount of wallet_account_transaction_history will tell you it was sent to you (thus deposit). This list will only update if wallet is unlocked.

If you register your own account the to and from are both you inside the transaction, so this rule doesn't quite work :)
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline jsidhu

  • Hero Member
  • *****
  • Posts: 1335
    • View Profile
the toaccount of wallet_account_transaction_history will tell you it was sent to you (thus deposit). This list will only update if wallet is unlocked.
« Last Edit: December 09, 2014, 06:24:17 pm by jsidhu »
Hired by blockchain | Developer
delegate: dev.sidhujag

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Isnt there a call like
wallet_verify_titan_tx .. or so?

Offline bytemaster

I'm trying to find the best way to determine whether a given transaction is a deposit.

Using wallet_account_transaction_history, we have a structure returned which contains multiple ledger entries and I'm not sure if you could have both a deposit and a withdraw inside that array?

Using blockchain_get_transaction we have an array of 'operations' inside the 'trx' field which typically contains both withdraw_op_type and deposit_op_type.

Is there an easy way to tell whether a given transaction is a deposit? Just some clarity on the subject would be great :)

Cheers, Paul.

It is of course a matter of perspective, for one user it is a deposit the other it is a withdraw.  For what you are doing it is probably safe to simply check the owner address of the claim_with_signature deposit operation belongs to your account:

wallet_account_list_public_keys ACCOUNT_NAME
wallet_dump_private_key BTS_ADDRESS


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

I'm trying to find the best way to determine whether a given transaction is a deposit.

Using wallet_account_transaction_history, we have a structure returned which contains multiple ledger entries and I'm not sure if you could have both a deposit and a withdraw inside that array?

Using blockchain_get_transaction we have an array of 'operations' inside the 'trx' field which typically contains both withdraw_op_type and deposit_op_type.

Is there an easy way to tell whether a given transaction is a deposit? Just some clarity on the subject would be great :)

Cheers, Paul.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads