27 lines
670 B
Python
27 lines
670 B
Python
from xcoin_api_client import *
|
|
import sched
|
|
import time
|
|
|
|
api_key = "api_connect_key"
|
|
api_secret = "api_secret_key"
|
|
api = XCoinAPI(api_key, api_secret)
|
|
|
|
rgParams = {
|
|
"order_currency": "xrp",
|
|
"payment_currency": "KRW"
|
|
}
|
|
|
|
scheduler = sched.scheduler(time.time, time.sleep)
|
|
timer_delay = 0.2
|
|
|
|
|
|
def main(arg):
|
|
result = api.xcoinApiCall("/public/recent_transactions/" + rgParams["order_currency"], rgParams)
|
|
if result is not None:
|
|
print("["+time.strftime("%H:%M:%S")+"]" + " status: " + result["status"] + " last: " + result["data"]["closing_price"])
|
|
|
|
scheduler.enter(timer_delay, 1, main, (arg, ))
|
|
|
|
scheduler.enter(timer_delay, 1, main, (scheduler, ))
|
|
scheduler.run()
|