Python3 DUCO API module

To build your own Duino-Coin apps we've created Duino-Coin API for python3. Here's the documentation for the module.

Getting Started

import duco_api

Initialize the connection to the server

api_connection = duco_api.api_actions() #creates the api connection instance

The next step is to Login/Register Note: login and register do not require you to init but they close the connection after use

Login

api_connection.login(username="username", password="password")

Register

api_connection.register(username="username", password="password", email="user@example.com")

Functions

These functions require user being loged-in.

Balance

Gets the current balance of the logged-in user

api_connection.balance() # takes no args

Transfer

Transfers Duco from logged-in user to the specified username

api_connection.transfer(recipient_username='test_user1', amount=1)

reset password

Resets the password of the logged-in user

api_connection.reset_pass(old_password='123', new_password='abc')

Other Functions

Use of this functions does not require being loged-in.

Get Duco Price

starts a thread with a loop that runs every 15 seconds

duco_api.GetDucoPrice() # access the value by using the global variable <ducofiat>

Example API script

import duco_api
api_connection = duco_api.api_actions()
api_connection.login(username='YourUsername', password='YourPassword')
current_balance = api_connection.balance()
print(current_balance)
api_connection.close()