The library relies heavily on meta data in your Beancount file to find accounts and commodities. Please add these to your Beancount file:
If the commodity in your ledger differs from the symbol used by Wealthsimple, simply add
wealthsimple-symbol as meta data:
2011-10-18 commodity ACWVETF wealthsimple-symbol: "ACWV"
For Wealthsimple accounts themselves, you need to add this metadata:
importer-type: "wealthsimple" and
number: "XXX". If the account can hold more than one commodity (all accounts except chequing and saving), it needs to follow this structure:
Assets:X:Y:Z:OtherCommodityName. The name of the cash account does not matter, but all other account must end with the commodity symbol (see above). Add the
number only to the cash account.
For accounts used in transactions to and from your Wealthsimple accounts you need to provide meta data as well. These is in the form of
wealthsimple-key: "accountNumber1 accountNumber2". The account number is the same as above, and you can specify one or multiple per key. As keys use these values:
wealthsimple-feeon an expense account to track the wealthsimple fees
wealthsimple-non-resident-withholding-taxon an expense account for non resident withholding tax
wealthsimple-roundingwill get the difference
wealthsimple-contribution-roomon an asset and expense account (optional, if not set it will not create postings for the contribution room)
wealthsimple-payment-spend(optional, will use fallback account if not provided)
2020-07-31 open Assets:Checking:Wealthsimple CAD importer-type: "wealthsimple" number: "A001" 2020-07-31 open Assets:Investment:Wealthsimple:TFSA:Parking CAD importer-type: "wealthsimple" number: "B002" 2020-07-31 open Assets:Investment:Wealthsimple:TFSA:ACWV ACWV 2020-07-31 open Assets:Investment:Wealthsimple:TFSA:XGRO XGRO 2020-07-31 open Income:Capital:Dividend:ACWV USD wealthsimple-dividend-ACWV: "A001 B002" 2020-07-31 open Assets:Checking:Bank CAD wealthsimple-contribution: "A001 B002" 2020-07-31 open Expenses:FinancialInstitutions:Investment:NonRegistered:Fees wealthsimple-fee: "A001" 2020-07-31 open Expenses:FinancialInstitutions:Investment:Registered:Fees wealthsimple-fee: "B002" 2020-07-31 open Expenses:Tax:NRWT wealthsimple-non-resident-withholding-tax: "A001 B002" 2020-07-31 open Assets:TFSAContributionRoom TFSA.ROOM wealthsimple-contribution-room: "B002" 2020-07-31 open Expenses:TFSAContributionRoom TFSA.ROOM wealthsimple-contribution-room: "B002"
WealthsimpleLedgerMapper(ledger:), passing the ledger which contains the meta data discussed above.
accountsproperty on the mapper.
mapTransactionsToPriceAndTransactionsto map your downloaded positions / transactions to SwiftBeanCountModel Prices and Balances / Prices and Transactions.
The library supports the Swift Package Manger, so simply add a dependency in your
.package(url: "https://github.com/Nef10/SwiftBeanCountWealthsimpleMapper.git", .upToNextMajor(from: "X.Y.Z")),
Please note that I developed this library for my own needs and there may be bugs. It currently has some limitations:
Pull requests to extend the scope or remove limitations are very welcome.
|Last commit: 3 weeks ago|