Skip to content

Commit

Permalink
v0.4.5 (#34)
Browse files Browse the repository at this point in the history
* removed unwrap expect on TDAClient

* updated readme

* fixed cargo clippy issues

* run cargo fmt

* updated Readme

* cargo docs and cargo update. bumped attohttpc 0.22

* deleted extra directory in docs

* updated readme
  • Loading branch information
jbertovic authored Aug 25, 2022
1 parent e2ed4e2 commit b3f2824
Show file tree
Hide file tree
Showing 92 changed files with 779 additions and 497 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.4"
version = "0.4.5"
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.19.1", features = ["form"] }
attohttpc = { version = "0.22.0", features = ["form"] }
serde_json = "1.0"
serde = {version = "1.0", features = ["derive"]}
url = "2.1.1"
log = "0.4"

[dev-dependencies]
env_logger = "0.9"
env_logger = "0.9"
15 changes: 12 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
**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.5 Changes
- (BREAKING CHANGE) all reqests (get, post, put, patch and delete) will now return `Result<T, TDAClientError>` instead of just `T`
- Added library errors `crate::error`
- Removed all expect and unwrap on requests from `TDAClient`
- updated option chain model
- cleaned up code with `cargo clippy` and `cargo fmt`

## Note Version 0.4.4 Changes
- Added error checking on TDauth module. Used when retrieving tokens.
- Gave TDAClientAuth acces to TDauth struct
Expand Down Expand Up @@ -33,11 +40,11 @@ For the examples and tests to work you will need to set environmental variables

```
use std::env;
use tdameritradeclient::{TDAClient, Endpoint, param};
use tdameritradeclient::{TDAClient, Endpoint, param, error::TDAClient};
// Will need to set TDAUTHTOKEN as environmental variable containing a valid token
fn main() {
fn main() -> Result<(), TDAClientError> {
//set token from environment variables
let token = env::var("TDAUTHTOKEN").unwrap();
Expand All @@ -46,10 +53,12 @@ fn main() {
let c = TDAClient::new(token);
// get quotes for 3 symbols and execute
let resptxt: String = c.get(&Endpoint::Quotes, &[param::Quotes::Symbol("F,SPY,INTC,IWM")]);
let resptxt: String = c.get(&Endpoint::Quotes, &[param::Quotes::Symbol("F,SPY,INTC,IWM")])?;
// output will be text string in json format
println!("{:?}", resptxt);
Ok(())
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/doc/implementors/core/clone/trait.Clone.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/doc/implementors/core/cmp/trait.PartialEq.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/doc/implementors/core/convert/trait.From.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3f2824

Please sign in to comment.