This is a small library to download data from Wealthsimple. It does not support Wealthsimple Trade and currently only supports downloading accounts, positions and transactions. The documentation of the Wealthsimple API I am using can be found at https://developers.wealthsimple.com/. To authenticate I am using the same client id as their web site, which uses the same API as backend.
CredentialStore
import KeychainAccess
class KeyChainCredentialStorage: CredentialStorage {
let keychain = Keychain(service: "XYZ")
func save(_ value: String, for key: String) {
keychain[key] = value
}
func read(_ key: String) -> String? {
keychain[key]
}
}
AuthenticationCallback
which will ask the user for their username, password and one time password.WealthsimpleDownloader
with your two implementations: let wealthsimpleDownloader = WealthsimpleDownloader(authenticationCallback: myAuthenticationCallback, credentialStorage: myCredentialStorage)
wealthsimpleDownloader.authenticate() { }
and wait for the callbackWealthsimpleDownloader
like getAccounts
or getPositions
Please check out the complete documentation here. You can also have a look at the SwiftBeanCountImporterApp which uses this library. If you want to convert the downloaded data into Beancount format, also check out SwiftBeanCountWealthsimpleMapper
The library supports the Swift Package Manger, so simply add a dependency in your Package.swift
:
.package(url: "https://github.com/Nef10/WealthsimpleDownloader.git", .upToNextMajor(from: "X.Y.Z")),
Please note that I developed this library for my own needs and there may be bugs. It currently only accesses a very limited scope of the API. Even for the endpoints it implements, there are further limitations:
Pull requests to extend the scope or remove limitations are very welcome.
While my code is licensed under the MIT License, the source repository may include names or other trademarks of Wealthsimple or other entities; potential usage restrictions for these elements still apply and are not touched by the software license. Same applies for the API design. I am in no way affilliated with Wealthsimple other than beeing customer.
link |
Stars: 1 |
Last commit: 2 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics