-
Notifications
You must be signed in to change notification settings - Fork 0
Home
beckitrue edited this page Jan 6, 2024
·
9 revisions
Welcome to the tasty-api wiki!
Making notes for myself...
- I'm going to have a config file to store the information for the working environment
- set the environment
sbx
ormoney
- set the account number
- set the environment
- Need to refactor login
- Need to set environment with its own command rather than use a flag on login
-
set-env
will need to be run before logging in tomoney
environment
-
During development and testing I'm going to hardcode the 1Password references in code. That could change to a config file later, but it's not worth the effort right now.
-
Create a vault in your 1Password account named "SBX" with the following items:
Value | 1Password location | Purpose |
---|---|---|
sbx login username | "op://SBX/Tasty_sbx/username" | initial login |
sbx login password | "op://SBX/Tasty_sbx/credential" | initial login |
sbx api username | "op://SBX/tastytrade-sbx-api/username" | api calls |
sbx api credential | "op://SBX/tastytrade-sbx-api/credential" | api calls |
- The initial login gets the session token that are used to authenticate the subsequent API calls
- The code saves the session token in your sbx api credential item so you can leave it blank when you create it.
You'll start out with a sandbox account to interact with, and then at some point you'll work with your live account (money
).
- Run
set-env [sbx | money]
to set which environment you'll be working with
Many of the API commands use the account number as an argument, so I am making a command that you can use to set the account number once. The account number will be written to the config/environment.json file
- Run
set-account <account number>
to set your account