Implement mapping and transaction fetching

This commit is contained in:
2022-03-07 19:59:30 +00:00
parent 878a261295
commit cbb7294f23
3 changed files with 122 additions and 29 deletions

View File

@@ -485,3 +485,19 @@ class IRCCommands(object):
currency = transaction["currency"]
description = transaction["description"]
msg(f"{timestamp} {txid} {ptxid} {txtype} {amount}{currency} {description}")
class mapaccount(object):
name = "mapaccount"
authed = True
helptext = "Enable an account_id at a bank for use. Usage: mapaccount <bank> <account_id>"
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
if length == 3:
bank = spl[1]
account_id = spl[2]
account_name = tx.sinks.truelayer.map_account(bank, account_id)
if not account_name:
msg(f"Failed to map the account")
return
msg(f"Mapped account ID {account_id} at bank {bank} to {account_name}")