SwiftBeanCountTangerineMapper
public struct SwiftBeanCountTangerineMapper
Mapper to map downloaded accounts and transactions to BeanCoutModel objects
-
AccountName for the other leg of the transaction
Declaration
Swift
public let defaultAccountName: AccountName -
Creates a mapper
Declaration
Swift
public init(ledger: Ledger)Parameters
ledgerLedger which will be used to look up things like account names
-
Creates balance assertions from the downloaded account JSON
Declaration
Swift
public func createBalances(accounts: [[String : Any]], date: Date = Date()) throws -> [Balance]Parameters
accountsJSONs downloaded from the Tangerine API
dateDate to balance assertion should use, defaults to the current date
Return Value
Array of Balances
-
Creates Transactions from JSON objects downloaded from the API
Note: This method filters out transactions already existing in the ledger, so the count of the input and output arrays might be different
Declaration
Swift
public func createTransactions(_ rawTransactions: [String : [[String : Any]]]) throws -> [Transaction]Parameters
rawTransactionsArray of JSON objects
Return Value
Array of transactions
-
Gets the correct account from the ledger based on the downloaded account JSON
Declaration
Swift
public func ledgerAccountName(account: [String : Any]) throws -> AccountNameParameters
accountJSON from the API
Return Value
AccountName from the ledger
View on GitHub
Install in Dash
SwiftBeanCountTangerineMapper Structure Reference