Coder Social home page Coder Social logo

tasty-api's Introduction

Tasty Trade Open API CLI Written in Golang

I'm experimenting with the Tasty Trade Open API and writing a CLI in golang. I'm doing this with a couple of goals in mind:

  • Use the Tasty Trade API to look for trading opportunities by automating some of the evaluation criteria I do manually
  • Learn to write go code

Go is compiled, so it should be portable and able to run on most computers. The 1Password implentation is a bit trickier, and less universal. I'll get that to work in my environment and leave the portability for later.

Security

I'm using 1Password to store my credentials and using the 1Password CLI to update and retrieve the credentials in my code. There are no secrets hardcoded in the code or in environment variables.

Session flow

  1. Login to your 1Password desktop application
  2. In your terminal, login to your 1Password cli op signin
  3. Run tasty login env [sbx | prod] <username> to login. Your credentials will be saved to your 1Password vault
  4. Run tasty me to verify that you've logged in sucessfully, and to see a list of your accounts
  5. You're set to interact with your accounts using any of the commands below
  6. Logout when you want to close your session by running tasty logout

Commands

Command Description
tasty login Gets session and remember tokens for environment. Defaults to sbx environment. Run tasty set-env money before runing tasty login to interact with your money account
tasty logout Deactivates your session and remember tokens
tasty set-env [sbx | money] Sets the environment that you'll login to and interact with. The default is sbx
tasty me Your customer information
tasty accounts List of your customer accounts
tasty set-account Sets the account id that you want to interact with in subsequent commands
tasty get-account Returns the account number you set previously
tasty positions <account_number> Gets a list of your account postions. You must reference an account number if you haven't set one using tasty set-account
tasty balances <account_number> Returns the monetary value of your account. You must reference an account number if you haven't set one using tasty set-account
tasty vol-data <watchlist_name> Returns volatility data for each equity in the list included in the command
tasty watchlist create <watchlist_name> Creates a user watchlist
tasty watchlist <watchlist_name> <JSON list of instruments to include in the list> Updates the watchlist with the list of entities passed in the command
tasty watchlist get [all | <watchlist_name>] Returns a list of all watchlists or the specific list by name. Defaults to all
tasty watchlist delete <watchlist_name> Deletes the watchlist

tasty-api's People

Contributors

beckitrue avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.