Skip to main content

amoveo python client

Project description

Introduction

Amoveo 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 through https://amoveo.io – it’s community site, recently launched. Also, join the community at https://t.me/amoveo

Infrastructure

To work with API you need a running full node. Full node is written in Erlang and available from project repository at https://github.com/zack-bitcoin/amoveo

The full node can be set up using instructions from official repo: https://github.com/zack-bitcoin/amoveo/blob/master/docs/getting-started/build_intro.md

Once node’s up you need to sync it according to https://github.com/zack-bitcoin/amoveo/blob/master/docs/getting-started/sync.md

NB: it’s vital to switch sync_mode to normal after the first sync (and after every restart).

Also, take care of security, ‘cause epmd opens the maintenance port: https://github.com/zack-bitcoin/amoveo/blob/master/docs/getting-started/firewall.md

The full node opens two ports: 8080 for external api, it should be visible from internet too to sync, and 8081 on lo listening 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:8080

List of open full nodes is available on https://veoscan.io

Nice public block explorer (supporting tx hashes) is https://explorer.veopool.pw

Good reference of deposit/withdraw UI is on https://qtrade.io

Install and use

Install

pip install amoveo-client

Examples

Init

AMOVEO_CONF = {
  'EXPLORER': ...,
  'NODE': ...
}
amoveo_client = AmoveoClient(AMOVEO_CONF)

Create address and private key

address, private_key, passphrase = amoveo_client.generate_wallet()

Get current balance It can return 0 if account has never been funded

balance = amoveo_client.balance(address)
balance_in_satoshi = amoveo_client.balance(address, in_satoshi=True)

Get transaction by tx hash

amoveo.get_tx(tx_hash)

Get account transactions

amoveo.account_txs(address)

Send transaction. Call Amoveo.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 height

height = 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()

Other methods

amoveo_client.account(address)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amoveo-client-0.1.6.tar.gz (6.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page