Implement mapping and transaction fetching
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user