|
|
|
@ -13,7 +13,7 @@ class GenericCommands(object):
|
|
|
|
|
Get details of open trades and post on IRC.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
trades = caller.get_dashboard()
|
|
|
|
|
trades = caller.get_dashboard_irc()
|
|
|
|
|
|
|
|
|
|
if not trades:
|
|
|
|
|
msg("No open trades.")
|
|
|
|
@ -771,13 +771,17 @@ class IRCCommands(object):
|
|
|
|
|
helptext = "Get a list of acccounts from Nordigen. Usage: naccounts"
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, tx, ux):
|
|
|
|
|
if length == 1:
|
|
|
|
|
accounts = tx.sinks.nordigen.get_all_account_info()
|
|
|
|
|
def got_accounts(accounts, msg):
|
|
|
|
|
for name, accounts in accounts.items():
|
|
|
|
|
for account in accounts:
|
|
|
|
|
msg(dumps(account))
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, tx, ux):
|
|
|
|
|
if length == 1:
|
|
|
|
|
accounts = tx.sinks.nordigen.get_all_account_info()
|
|
|
|
|
accounts.addCallback(IRCCommands.naccounts.got_accounts, msg)
|
|
|
|
|
|
|
|
|
|
class transactions(object):
|
|
|
|
|
name = "transactions"
|
|
|
|
|
authed = True
|
|
|
|
@ -805,10 +809,7 @@ class IRCCommands(object):
|
|
|
|
|
helptext = "Get a list of transactions from Nordigen. Usage: ntransactions <account_id>"
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, tx, ux):
|
|
|
|
|
if length == 2:
|
|
|
|
|
account_id = spl[1]
|
|
|
|
|
transactions = tx.sinks.nordigen.get_transactions(account_id)
|
|
|
|
|
def got_transactions(transactions, msg):
|
|
|
|
|
for transaction in transactions:
|
|
|
|
|
if "transaction_id" in transaction:
|
|
|
|
|
txid = transaction["transaction_id"]
|
|
|
|
@ -820,20 +821,31 @@ class IRCCommands(object):
|
|
|
|
|
reference = transaction["reference"]
|
|
|
|
|
msg(f"{timestamp} {txid} {amount}{currency} {reference}")
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, tx, ux):
|
|
|
|
|
if length == 2:
|
|
|
|
|
account_id = spl[1]
|
|
|
|
|
transactions = tx.sinks.nordigen.get_transactions(account_id)
|
|
|
|
|
transactions.addCallback(IRCCommands.ntransactions.got_transactions, msg)
|
|
|
|
|
|
|
|
|
|
class nreqs(object):
|
|
|
|
|
name = "nreqs"
|
|
|
|
|
authed = True
|
|
|
|
|
helptext = "Get a list of requisitions from Nordigen."
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, tx, ux):
|
|
|
|
|
reqs = tx.sinks.nordigen.get_requisitions()
|
|
|
|
|
def got_requisitions(reqs, msg):
|
|
|
|
|
for req in reqs:
|
|
|
|
|
id = req["id"]
|
|
|
|
|
institution_id = req["institution_id"]
|
|
|
|
|
redirect = req["link"]
|
|
|
|
|
msg(f"{id} {institution_id} {redirect}")
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, tx, ux):
|
|
|
|
|
reqs = tx.sinks.nordigen.get_requisitions()
|
|
|
|
|
reqs.addCallback(IRCCommands.nreqs.got_requisitions, msg)
|
|
|
|
|
|
|
|
|
|
class ndelreq(object):
|
|
|
|
|
name = "ndelreq"
|
|
|
|
|
authed = True
|
|
|
|
|