python-bitshares: How to derive transaction ids
bitshares·@xeroc·
0.000 HBDpython-bitshares: How to derive transaction ids
 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: ```python from bitshares.block import Block from bitsharesbase.signedtransactions import Signed_Transaction block = Block(23743383) tx = Signed_Transaction(**block["transactions"][2]) print(tx.id) ``` 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 cryptofresh.com. 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.
👍 xeroc, tommysnello, eval, ajvest, academix87, suitablybored, kenny-crane, cm-steem, exec, helene, blackbunny, janiceting, uruloce, midnightoil, magicstone1412, mondeja, solarsherpa, ethansteem, artistannie, thundersam, somebody, taylor.swift, laoyao, fminer05, lalala, oflyhigh, sunhwa, bravenewcoin, chris4210, vortac, lukestokes, visky, lingfei, billbutler, rogerwilson, devilwsy, deanliu, chinadaily, mauricemikkers, xiaohui, xiaokongcom, roland.haynes, yulan, alexis555, yyyy, ericarthurblair, arama, kaneyung, garethnelsonuk, beomelda, neptun, ethanthefighter, apolinarcastro, ripperone, kilojo, sdavignon, arrowj, bowstar, mintberrycrunch, nicke, hjerth, ramdacu49, embutv, spalser, steemav, warofcraft, inertia, inesmar, andyjaypowell, chryspano, lokya12, subversion, ipman62, ppitonak, cryptogram, blockchained, zaebars, rusteemitblog, spacecowboy, whalepunk, takry, vikx, cptnsolo, wackou, fer01, xochicotta, daycrypter, proyectox, buy-bitcoin, meonline, steempower, teamsteem, turymenecier, nicknick, gandalfthewhite, diogogomes, fortunee, enki, ausbitbank, arifmunandar72, tombstone, bryan18, cultura.bitcoin, berkah, mrs.agsexplorer, pnc, bitcoiner, greenstar, hitmeasap, payger, fractalnode, parmesotto, yury-vas, majestik, nickonator, dochoul22, faridrizkia, erik121101, seniorman8484, lrbitcoinguy, marcedf, shashiprabha, steemblogger, roadscape, carlosbrittor, brokendreams, mf-tzo, schererf, team, peekaboo1971, arykurniawan11, netdragonx, kanchana, schase, wannis, python-think,