@morpheusnephew/td-ameritrade
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

TD Ameritrade

This project is a typescript wrapper for TD Ameritrade's API

Usage

The default class of clients is the TdAmeritradeClient. It must be initialized with your client id and each client sub-client is a property of the TdAmeritradeClient for example the accounts client.

import TdAmeritradeClient from '@morpheusnephew/td-ameritrade/clients';

(async () => {
  // Initializing TD Ameritrade client with your client id and access token
  const client = new TdAmeritradeClient({
    accessToken: 'yourAccessToken',
  });

  // Makes request to get all accounts associated with your access token
  const { data: allAccounts } = await client.accounts.getAllAccounts();
})();

Responses

As you may notice from the return signatures of client methods and in regards to the unit tests, the response data nor the status code of some of the endpoints are known just from looking at the documentation. So what you see in the unit tests specifically for CUD operations is me taking my best guess as to what the status code should be.

Package Sidebar

Install

npm i @morpheusnephew/td-ameritrade

Weekly Downloads

3

Version

1.1.1

License

MIT

Unpacked Size

84.8 kB

Total Files

64

Last publish

Collaborators

  • morpheusnephew