WealthsimpleDownloader

2.0.1

Swift library to download data from Wealthsimple using the API
Nef10/WealthsimpleDownloader

What's New

2.0.1 Cashback

2021-11-05T06:46:11Z

Changes

📈 Enhancements

🧰 Maintenance

  • Bump marocchino/sticky-pull-request-comment from 2.1.1 to 2.2.0 @dependabot (#80)
  • Remove automerge workflow @Nef10 @file-sync-app (#78)
  • Update reference to app @Nef10 (#77)
  • Adjust release drafter template @Nef10 @file-sync-app (#76)
  • Save coverage info even if coverage threshold is not met @Nef10 @file-sync-app (#75)
  • Bump actions/github-script from 4.1.0 to 5.0.0 @Nef10 @file-sync-app (#74)

WealthsimpleDownloader

CI Status Documentation percentage License: MIT Latest version platforms supported: linux | macOS | iOS | watchOS | tvOS SPM compatible

What

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.

How

  1. Implement a CredentialStore
Example using the KeychainAccess library
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]
  }

}
  1. Implement an AuthenticationCallback which will ask the user for their username, password and one time password.
  2. Initialize WealthsimpleDownloader with your two implementations: let wealthsimpleDownloader = WealthsimpleDownloader(authenticationCallback: myAuthenticationCallback, credentialStorage: myCredentialStorage)
  3. Call wealthsimpleDownloader.authenticate() { } and wait for the callback
  4. Now you can start retreiving data with the other methods provided on WealthsimpleDownloader 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

Usage

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")),

Limitations

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:

  • Paging is not supported
  • Only works on Accounts with 2FA enabled

Pull requests to extend the scope or remove limitations are very welcome.

Copyright

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.

Description

  • Swift Tools 5.2.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Nov 18 2024 10:40:06 GMT-1000 (Hawaii-Aleutian Standard Time)