Skip to content

Commit

Permalink
Dev v0.4.4 (#30)
Browse files Browse the repository at this point in the history
* impl clone on TDAClient

* remove leftover dbg

* add access to auth token in auth client

* doc update

* Added error checking in TDauth (#29)

* refactored auth module and added error capture

* Updated readme

* able to initiate TDAClientAuth with TDauth struct

* allow TDauth struct to be serialized

* don't allow new client if no token exists

* cargo clippy and fmt

* increment version

* updated time expiry buffer on tokens

* able to create new TDauth from api configuration

* updated auth module

* changed handling of client_id

* fixed bug in auth token when refresh not present

* added pricehistory model and tests

* Updated Readme

* implemented Quote Model

* added quote impl functions

* serde config on quotes model

* added default fields to Account Model

* managed client check if refresh avail

* version bump

* updated readme and changes
  • Loading branch information
jbertovic authored Jun 22, 2022
1 parent 3db49d7 commit 4205412
Show file tree
Hide file tree
Showing 14 changed files with 567 additions and 123 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "tdameritradeclient"
version = "0.4.3"
version = "0.4.4"
authors = ["Jas Bertovic <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
attohttpc = { version = "0.16.3", features = ["form"] }
attohttpc = { version = "0.19.1", features = ["form"] }
serde_json = "1.0"
serde = {version = "1.0", features = ["derive"]}
url = "2.1.1"
log = "0.4"

[dev-dependencies]
env_logger = "0.7"
env_logger = "0.9"
8 changes: 8 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v0.4.4
- Added visibility to `auth::TDauth` from `TDAClientAuth`. Easier to manage when running library from a server
- Added error checking in `auth::TDauth`
- Able to now initialize `TDAClientAuth` with `auth::TDauth`
- Refactoring in both `auth::TDauth` and `TDAClientAuth`, including a couple of bug fixes
- Added new models: PriceHistory, Quotes and modified Account model
- Doc corrections

# v0.4.3
- Added a new client (`TDAClientAuth`) that manages ungoing token requirements.
- `TDAClientAuth` is just a wrapper around `TDAClient` but includes token renewals as needed
Expand Down
10 changes: 6 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
**Disclaimer:** I'm not endorsing and am not affiliated with TD Ameritrade. Be careful using the API and understand that actual orders can be created through this library. Read and understand the TD Ameritrade's api terms of service and documentation before using.

## Note Version 0.4.3 Changes
- Added a new client (`TDAClientAuth`) that manages ungoing token requirements.
- `TDAClientAuth` is just a wrapper around `TDAClient` but includes token renewals as needed
- `auth::TDauth` was updated to include expire times of tokens
## Note Version 0.4.4 Changes
- Added error checking on TDauth module. Used when retrieving tokens.
- Gave TDAClientAuth acces to TDauth struct
- Managed TDAClientAuth has the ability to deal with no token returned due to some error in web retrieval or authorization
- Integrated TDauth module better with TDAClientAuth
- Added model::pricehistory, quotes and modified account model

## Note Version 0.4 Changes

Expand Down
2 changes: 1 addition & 1 deletion examples/accountmodel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn main() {
.unwrap();

// pull out positions
let positions = account_root.securities_account.positions;
let positions = account_root.securities_account.positions.unwrap();

// iterate through positions
for p in positions {
Expand Down
Loading

0 comments on commit 4205412

Please sign in to comment.