@master-chief/alpaca
Advanced tools
Comparing version 3.4.0 to 3.4.1
{ | ||
"name": "@master-chief/alpaca", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "a TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams", | ||
@@ -5,0 +5,0 @@ "author": "master-chief", |
@@ -261,2 +261,6 @@ import qs from 'qs' | ||
): Promise<Activity[]> { | ||
if (params.activity_types && Array.isArray(params.activity_types)) { | ||
params.activity_types = params.activity_types.join(',') | ||
} | ||
return this.parser.parseActivities( | ||
@@ -266,3 +270,5 @@ await this.request<RawActivity[]>( | ||
urls.rest.account, | ||
`account/activities/${params.activity_type}?${qs.stringify(params)}`, | ||
`account/activities${ | ||
params.activity_type ? '/'.concat(params.activity_type) : '' | ||
}?${qs.stringify(params)}`, | ||
), | ||
@@ -269,0 +275,0 @@ ) |
@@ -26,3 +26,4 @@ import { OrderSide, OrderType, OrderTimeInForce } from './entities.js' | ||
export interface GetAccountActivities { | ||
activity_type: string | ||
activity_type?: string | ||
activity_types?: string | string[] | ||
date?: string | ||
@@ -29,0 +30,0 @@ until?: string |
@@ -39,3 +39,3 @@ import { | ||
daytrading_buying_power: this.parseNumber( | ||
rawAccount.daytrading_buying_power | ||
rawAccount.daytrading_buying_power, | ||
), | ||
@@ -53,3 +53,3 @@ cash: this.parseNumber(rawAccount.cash), | ||
last_maintenance_margin: this.parseNumber( | ||
rawAccount.last_maintenance_margin | ||
rawAccount.last_maintenance_margin, | ||
), | ||
@@ -139,6 +139,6 @@ sma: this.parseNumber(rawAccount.sma), | ||
unrealized_intraday_pl: this.parseNumber( | ||
rawPosition.unrealized_intraday_pl | ||
rawPosition.unrealized_intraday_pl, | ||
), | ||
unrealized_intraday_plpc: this.parseNumber( | ||
rawPosition.unrealized_intraday_plpc | ||
rawPosition.unrealized_intraday_plpc, | ||
), | ||
@@ -182,3 +182,3 @@ current_price: this.parseNumber(rawPosition.current_price), | ||
parseNonTradeActivity( | ||
rawNonTradeActivity: RawNonTradeActivity | ||
rawNonTradeActivity: RawNonTradeActivity, | ||
): NonTradeActivity { | ||
@@ -196,3 +196,3 @@ if (!rawNonTradeActivity) { | ||
per_share_amount: this.parseNumber( | ||
rawNonTradeActivity.per_share_amount | ||
rawNonTradeActivity.per_share_amount, | ||
), | ||
@@ -214,3 +214,3 @@ } | ||
? this.parseTradeActivity(rawActivity) | ||
: this.parseNonTradeActivity(rawActivity) | ||
: this.parseNonTradeActivity(rawActivity), | ||
) | ||
@@ -217,0 +217,0 @@ } catch (err) { |
@@ -20,3 +20,4 @@ import { OrderSide, OrderType, OrderTimeInForce } from './entities.js'; | ||
export interface GetAccountActivities { | ||
activity_type: string; | ||
activity_type?: string; | ||
activity_types?: string | string[]; | ||
date?: string; | ||
@@ -23,0 +24,0 @@ until?: string; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
158325
4809