Package: amoveo-client
IntroductionAmoveo is a pretty new blockchain, the mainnet was launched on March,
2nd.it’s not a fork of any existing coin, but it implements number of
interesting concepts: on-chain governance, oracles working on top of the
coin itself, lightning channels, turing-complete smart-contracts on top
of channels, and last but not least – prediction markets, they’re one
of main purposes of the project.Amoveo shows steady growth of userbase and has number of services,
implemented by 3rd parties, working with this coin: there’re mobile
wallets, desktop app, mining pools etc.Right now it’s trading on two small exchanges not listed on CMC, and
trade volume including OTC deals is like tens of BTCs per day.The project itself is open source and community-driven, its main
developer is Zack Hess, former CTO of Augur and Aeternity.To find more information you can look throughhttps://amoveo.io– it’s
community site, recently launched. Also, join the community athttps://t.me/amoveoInfrastructureTo work with API you need a running full node. Full node is written in
Erlang and available from project repository athttps://github.com/zack-bitcoin/amoveoThe full node can be set up using instructions from official repo:https://github.com/zack-bitcoin/amoveo/blob/master/docs/getting-started/build_intro.mdOnce node’s up you need to sync it according tohttps://github.com/zack-bitcoin/amoveo/blob/master/docs/getting-started/sync.mdNB: it’s vital to switchsync_modetonormalafter the first
sync (and after every restart).Also, take care of security, ‘causeepmdopens the maintenance port:https://github.com/zack-bitcoin/amoveo/blob/master/docs/getting-started/firewall.mdThe full node opens two ports: 8080 for external api, it should be
visible from internet too to sync, and 8081 onlolistening for
internal api (which is effectively erlang methods calls via HTTP).In case of troubles with sync, etc. you can use our own full node at
88.99.245.31:8080List of open full nodes is available onhttps://veoscan.ioNice public block explorer (supporting tx hashes) ishttps://explorer.veopool.pwGood reference of deposit/withdraw UI is onhttps://qtrade.ioInstall and useInstallpip install amoveo-clientExamplesInitAMOVEO_CONF = {
  'EXPLORER': ...,
  'NODE': ...
}
amoveo_client = AmoveoClient(AMOVEO_CONF)Create address and private keyaddress, private_key, passphrase = amoveo_client.generate_wallet()Get current balance It can return 0 if account has never been fundedbalance = amoveo_client.balance(address)
balance_in_satoshi = amoveo_client.balance(address, in_satoshi=True)Get transaction by tx hashamoveo.get_tx(tx_hash)Get account transactionsamoveo.account_txs(address)Send transaction. CallAmoveo.send. It determines tx type needed,
forms the transaction payload, serializes it and sends to full node.
Please note, there should be at least 1 satoshi left on the account to
make spending transaction correct (i.e. you can’t transfer the whole
amount, just amount - 1 satoshi, excluding fee).acc = amoveo.account(_to)
tx_typ = "create_account_tx" if acc == "empty" else "spend_tx"
fee = 152168 if acc == "empty" else 61657
tx = amoveo_client.prepare_tx(tx_typ, amount, fee, _from, _to)
sign = amoveo.sign(tx, private_key)
transaction_id = amoveo_client.send_tx(tx, sign)Get current blockchain heightheight = amoveo_client.last_block()Get block and its tx’s. Response contains several nested arrays, first
with transactions and theirs signatures (MQ…) and the second with theirs
hashes in the corresponding order.block_data = amoveo_client.last_block(block_height)Pending transactions. Response contains current pending transactions.
Unfortunately, they have no hashes included in response but one can map
them using theirs signatures.amoveo_client.pending_tx()curl --request GET \
        --url http://amoveo.node/ \
        --header 'content-type: application/json' \
        --data '["mempool"]'Other methodsamoveo_client.account(address)account not fundedcurl --request GET \
    --url http://amoveo.node/ \
    --header 'content-type: application/json' \
    --data '["account", "BIkj6yP84pYqRP8LDjKnO6Ae4cQSP5NiX6x5jRpWUcYWyR87uM6pf90ZhAH/J0g3Fm35O+Kf6a0mAqzsuvTPmyU="]'
> ["ok",0]  # account not funded yet.account fundedcurl --request GET \
    --url http://amoveo.node/ \
    --header 'content-type: application/json' \
    --data '["account", "BH8sPvGR4DqpnasL3zVJ9C068bPHbtBEOLV4rhEQvqt1Y8NH9ceXFozaFctuSaAtgb0SZ5kiuPxZZY6jGM+BDHw="]'
> ["ok",["acc",74679577,25,"BH8sPvGR4DqpnasL3zVJ9C068bPHbtBEOLV4rhEQvqt1Y8NH9ceXFozaFctuSaAtgb0SZ5kiuPxZZY6jGM+BDHw=",0,"B2onx55azio9R/ndLoPk/26ohys8Ihj2bJK4m1XzZWA="]]
[result, [request type, balance, ...]]