Package: dposlib
dposlibpackage aims to provide a simple API to any blockchain.Support this projectBuy Ѧand:Send Ѧ toAUahWfkfr5J4tYakugRbfow7RWVTK35GPWVotearkyonArk blockchainandearn Ѧ weeklyQuick ViewDocumentationUbuntu dependencies installationsudoapt-getinstallpythonpython-devpython3python3-dev
sudoapt-getinstallpython-setuptoolspython3-setuptools
sudoapt-getinstallpython-pippython3-pipAvailable networksNetworkArkSolarCompendiamainnetarksxpnostestnet-tsxp-devnetdark-dnosMain featuresAn intuitive REST API>>>fromdposlibimportrest>>>rest.use("dark")True>>># ~/api/delegates/darktoons endpoint>>>rest.GET.api.delegates.darktoons(){'data':{'username':'darktoons','address':'D7seWn8JLVwX4nHd9hh2Lf7gvZNiRJ7qLk','publicKey':'03a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933','votes':9385785081642,'rank':45,'blocks':{'produced':32015,'last':{'id':'9d5085e503e09c656152b541bc243155f560347aa8b377d3f2f9a1cb71900d90','height':2544602,'timestamp':{'epoch':69406864,'unix':1559508064,'human':'2019-06-02T20:41:04.000Z'}}},'production':{'approval':0.07},'forged':{'fees':14640580130,'rewards':6403000000000,'total':6417640580130}}}>>># ~/api/node/fees endpoint>>>rest.GET.api.node.fees(){'meta':{'days':7},'data':[{'type':'0','min':'200000','max':'10000000','avg':'1089596','sum':'14887144978','median':'460000'},{'type':'1','min':'500000000','max':'500000000','avg':'500000000','sum':'313500000000','median':'500000000'},{'type':'3','min':'10000000','max':'100000000','avg':'58541781','sum':'1756253430','median':'61114510'}]}>>>rest.use("ark")True>>>delegate0=rest.GET.api.delegates(returnKey="data")[0]>>>delegate0["username"]u'binance_staking'Fast way to interact with blockchain>>>importdposlib>>>rest.use("dark")>>># send 1 token to D7seWn8JLVwX4nHd9hh2Lf7gvZNiRJ7qLk with a simple message>>>tx=dposlib.core.transfer(1,"D7seWn8JLVwX4nHd9hh2Lf7gvZNiRJ7qLk","message")>>># sign tx with secret and [optional second secret]>>>tx.finalize("first secret","second secret")>>>tx{"amount":100000000,"asset":{},"fee":1090241,"id":"1e967879eb134712afd2b2a606be8460468b80aab857fa99a88cf8da0d72bd5d","recipientId":"D7seWn8JLVwX4nHd9hh2Lf7gvZNiRJ7qLk","senderId":"D7seWn8JLVwX4nHd9hh2Lf7gvZNiRJ7qLk","senderPublicKey":"03a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933","signSignature":"3045022100a8dd9c50b18002bd6f8ffe9f1c0700cafb95de18670b48fa76afd85c3003a2d202200a1cc102c13857a38d8311a5c80a9222329f0c53f3305c70c91979efd5288d21","signature":"304402206576aee7893f3c038d58a6def5180881077531c4b1ebe87e835da2dbe40d0670022064ae37be3f160b0c969459e06912ee619997ccf303e6d919135cdf594a74b77d","timestamp":69407340,"type":0,"vendorField":"message"}>>># broadcast transaction>>>rest.POST.api.transactions(transactions=[tx]){'data':{'accept':['1e967879eb134712afd2b2a606be8460468b80aab857fa99a88cf8da0d72bd5d'],'broadcast':['1e967879eb134712afd2b2a606be8460468b80aab857fa99a88cf8da0d72bd5d'],'excess':[],'invalid':[]}}Network API>>>importdposlib>>>rest.use("ark")>>>dlgt=dposlib.core.api.Delegate("arky")# get delegate by username>>>dlgt.forged{'fees':3294.7,'forged':227230.7,'rewards':223936.0}>>>dlgt.address'ARfDVWZ7Zwkox3ZXtMQQY1HYSANMB88vWE'>>>blk=dlgt.lastBlock# get last forged block>>>blk{"blockSignature":"304402200a496a628c2741537538f0492f9d683d3c4f1b30c8dd03c33ad8fbe79d08b6eb02206cdec7e1210db53a3ca22da30912479ff3644d3a1ed1d878417d5965f34dfd6d","confirmations":68,"generatorId":"ARfDVWZ7Zwkox3ZXtMQQY1HYSANMB88vWE","generatorPublicKey":"030da05984d579395ce276c0dd6ca0a60140a3c3d964423a04e7abe110d60a15e9","height":5862354,"id":"1894085440657345411","numberOfTransactions":0,"payloadHash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","payloadLength":0,"previousBlock":"11181074894913507025","reward":2.0,"timestamp":47535768,"totalAmount":0.0,"totalFee":0.0,"totalForged":2.0,"version":0}>>>blk.transactions()[]>>>wlt=dlgt.wallet>>>wlt.balance2537.42979112>>>wlt.link("secret passphrase here")>>>wlt.send(1,"ARfDVWZ7Zwkox3ZXtMQQY1HYSANMB88vWE"){'transactionIds':['bbce72e7a76f5f71209c8ab29b4b4299a409241dfc77835150459a34bd5a5c16'],'success':True}Version1.1.0current work1.0.0removed python 2.x compliancyremovedpytzdependencyaddedsolartestnet and mainnetpySecp256k1replaced bycSecp256k1bip340schnorr signature implementedsolartransactionv3implementedark package simplificationark.api.WebhookimprovementmultiVotemoved toswitchVote0.3.5Ark-core v 3.0.x compliancyfee management improvementledger.com Ark app supportmultiVoteimplementationmagistrateimplementationCompendia network addedUnikname network addedpackaging improvementswitched fromsphinxtopydoc-markdowndoc builderOlder releases…0.3.4removedrequestsdependencymultisignature api and app run as system services0.3.3offline start fixedapi.Walletfixedadded pythonicdatetimeattribute toTransactionclass0.3.2bettervendorFieldHexfield  handlingdposlib.blockchain.Transactionbehaviour improvementtx versioning defined innetmodulebridge for ark-core 2.5 and 2.60.3.1multisignature client-server api0.3.0flake8compliancyArk 2.6 compatibilityremoved package resources dependenciesecdsalib replaced by builtinsecp256k1addedIopmainnet and devnetLisk and forks dev stoppedldgrimport now optionalsphinx doc added0.2.2Ark v2.5 headers fixArk v2.5 BigInt fixpackaging improvementrestreturnKeybehaviour improvement0.2.1addedliskblockchainaddedshift,t.shiftandqreditnetworkadded .cold data in package distributiontransaction types0,1and3added to lisk.v09 networkpython 2.x compliancy for util.data package0.2.0ark.v2 api improvementdposlib.util.misc module improvementupVote/downVote bugfix0.1.9travis-ciintegrationdposlib.core.Transaction interface improvementArk v1 and v2 cross-dependency removedoffline work feature added0.1.8added ark v2.4 compatibilityapi wallet link using getpass libraryadded ledger nano S support (transaction type 0, 1, 2 & 3)peer selection now checks syncing status0.1.7addedtransactionandrestMarkDown documentation filesdposlib.core.api is both python 2.x and 3.x compliantadded Webhook api (experimental)fee data initialisation improvementtransaction broadcasting improvementpeer selection improvementLisk blockchain and forks developpement frozen0.1.6Ark-core v 2.1.x compatibility0.1.5compatibility with both ark-core v2 devnet and mainnet0.1.4Python 2.x compatibility fixdposlib.core.Transaction.sign does not set fees anymoredposlib.core.Transaction.finalize set fees before signaturedposlib.core.Transaction fee management improved0.1.3REST requests header bugfix (ubuntu)0.1.2Packaging improvement0.1.1ARK packaging improvement (v1andv2)LISK packaging improvement (v09andv10)ARK dynamicFee implementationNetwork API created0.1.0First rebrand