Python

Python installation

Python can be downloaded here.

For further informations on how to install Python on your operating system :

Windows guide

Unix guide

OSx guide

Installation

$ pip install arkecosystem-client

Usage

Accounts - V1

from client import ArkClient

client = ArkClient('http://127.0.0.1:4002/api', api_version='v1')

print(client.accounts.balance(address='AUDud8tvyVZa67p3QY7XPRUTjRGnWQQ9Xv'))

>> {'success': True, 'balance': '2039101835000000', 'unconfirmedBalance': '2039101835000000'}

Blocks - V1 and V2

from client import ArkClient

client = ArkClient('http://127.0.0.1:4002/api', api_version='v1')

print(client.blocks.all(limit=10))

>> {'success': True, 'blocks': [...]}
from client import ArkClient

client = ArkClient('http://127.0.0.1:4003/api')

print(client.blocks.all(page=5, limit=10))

>> {'meta': {'count': 10, ... }}

Delegates - V1 and V2

from client import ArkClient

client = ArkClient('http://127.0.0.1:4002/api', api_version='v1')

print(client.delegates.all(limit=51))

>> {'success': True, 'delegates': []}
from client import ArkClient

client = ArkClient('http://127.0.0.1:4003/api')

print(client.delegates.all(page=5, limit=20))

>> {'meta': {'count': 20, ... }}

Loader - V1

from client import ArkClient

client = ArkClient('http://127.0.0.1:4002/api', api_version='v1')

print(client.loader.sync_status())

>> {'success': True, 'syncing': False, 'blocks': -8, 'height': 6485835, 'id': '16405273597815729306'}

Node - V2

from client import ArkClient

client = ArkClient('http://127.0.0.1:4003/api')

print(client.node.syncing())

>> {'data': {'syncing': False, 'blocks': -22, 'height': 820355, 'id': '2134055295567604949'}}

Peers - V1 and V2

from client import ArkClient

client = ArkClient('http://127.0.0.1:4002/api', api_version='v1')

print(client.peers.all(limit=10))

>> {'success': True, 'peers': []}
from client import ArkClient

client = ArkClient('http://127.0.0.1:4003/api')

print(client.peers.all())

>> {'meta': {'count': 5, ...}}

Signatures - V1

from client import ArkClient

client = ArkClient('http://127.0.0.1:4002/api', api_version='v1')

print(client.signatures.fee())

>> {'success': True, 'fee': 500000000}

Transactions - V1 and V2

from client import ArkClient

client = ArkClient('http://127.0.0.1:4002/api', api_version='v1')

print(client.transactions.all(limit=10))

>> {'success': True, 'transactions': []}
from client import ArkClient

client = ArkClient('http://127.0.0.1:4003/api')

print(client.transactions.all(limit=5))

>> {'meta': {'count': 5, ...}}

Votes - V2

from client import ArkClient

client = ArkClient('http://127.0.0.1:4003/api')

print(client.votes.all(limit=5))

>> {'meta': {'count': 5, ...}}

Wallets - V2

from client import ArkClient

client = ArkClient('http://127.0.0.1:4003/api')

print(client.wallets.all(limit=5))

>> {'meta': {'count': 5, ...}}
Last Updated: 11/26/2018, 12:51:20 AM