@morpheusnephew/td-ameritrade
v1.1.1
Published
A client for TD Ameritrade
Downloads
62
Maintainers
Readme
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.