python-bitshares: How to derive transaction idssteemCreated with Sketch.

in #bitshares4 years ago

Some developers might have noticed that python-graphene and python-bitshares are still pretty much in development.
That said, I finally got to figure out (thanks to @abitmore) how to derive transaction ids from a given transaction on the blockchain and quickly implemented this feature in python-bitshares.

From release 0.5.7 of python-graphene and with the next release of python-bitshares (currently in develop branch), you can obtain the transaction id of any transaction by simply:

from bitshares.block import Block
from bitsharesbase.signedtransactions import Signed_Transaction
block = Block(23743383)
tx = Signed_Transaction(**block["transactions"][2])

The Signed_Transaction expects keywords with identical names as on the blockchain, which explains the use of ** in front of the dictionary.

The attribute .id of tx is an internal method that derives the transaction id accordingly.
The resulting ids are similar to the ones derived by the cli_wallet and indexed by

In the future, I intend to put more updates on libraries whenever nice features are included (such as the proposal subsystem of pybitshares which was released without further announcements ;D)

Have fun.


Interesting, Hadn't realized python works with this kind of stuff. Maybe cuz I'm living under a rock..idk XD

I wish i understood this stuff better. Guess i just gotta keep digging

I really wanna know more about these. I'd tried creating a wallet some time back, I couldnt. lol

i really like your post and i enjoy it very with all post 👍

Excellent work! I'll integrate these changes into the HUG REST API in the near future, keep up the great work!

I appreciate your efforts to BTS community!

Congratulations @xeroc, this post is the second most rewarded post (based on pending payouts) in the last 12 hours written by a Superuser account holder (accounts that hold between 1 and 10 Mega Vests). The total number of posts by Superuser account holders during this period was 1599 and the total pending payments to posts in this category was $18847.10. To see the full list of highest paid posts across all accounts categories, click here.

If you do not wish to receive these messages in future, please reply stop to this comment.

Maximum work from python will certainly develop better bitshare and will support great progress

hmmm okay! thanks

Best post, hello @xeroc . Follow me and vote my post please

Coin Marketplace

STEEM 0.21
TRX 0.06
JST 0.026
BTC 18928.20
ETH 1018.72
USDT 1.00
SBD 2.93