We are pleased to announce our first public release of pybitshares in version 0.1.0! This library has been built following the success of pysteem.
BitShares is a blockchain-based autonomous company (i.e. a DAC) that offers decentralized exchanging as well as sophisticated financial instruments as products.
It is based on Graphene (tm), a blockchain technology stack (i.e. software) that allows for fast transactions and ascalable blockchain solution. In case of BitShares, it comes with decentralized trading of assets as well as customized on-chain smart contracts.
The purpose of pybitshares is to simplify development of products and services that use the BitShares blockchain. It comes with
Transfers:
from bitshares import BitShares
bitshares = BitShares()
bitshares.transfer("<to>", "<amount>", "<asset>", "[<memo>]", account="<from>")
Monitoring the Blockchain:
from bitshares.blockchain import Blockchain
blockchain = Blockchain()
for op in Blockchain.ops():
print(op)
Obtaining a Block:
from bitshares.block import Block
print(Block(1))
Obtaining an Account:
from bitshares.account import Account
account = Account("init0")
print(account.balances)
print(account.openorders)
for h in account.history():
print(h)
Dealing with the markets:
from bitshares.market import Market
market = Market("USD:BTS")
print(market.ticker())
print(market.sell(300, 100) # sell 100 USD for 300 BTS/USD
Dealing with call positions/collateral:
from bitshares.dex import Dex
dex = Dex()
dex.adjust_collateral_ratio("SILVER", 3.5)
Keep in mind that this library is tightly connected to uptick, which is a command line tool similar to piston. Even though the library can be used without uptick, it still makes your live easier when it comes to dealing with your wallet. There will be a separate announcement for uptick shortly.
If you like the services offered by ChainSquad GmbH, please consider approving our new witness: chainsquad.com
Thanks you!