@finatic/client 0.0.142 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/LICENSE +39 -0
- package/README.md +54 -425
- package/dist/index.d.ts +7329 -1579
- package/dist/index.js +8110 -6114
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8047 -6085
- package/dist/index.mjs.map +1 -1
- package/package.json +77 -33
- package/dist/types/core/client/ApiClient.d.ts +0 -270
- package/dist/types/core/client/FinaticConnect.d.ts +0 -332
- package/dist/types/core/portal/PortalUI.d.ts +0 -37
- package/dist/types/index.d.ts +0 -12
- package/dist/types/lib/logger/index.d.ts +0 -2
- package/dist/types/lib/logger/logger.d.ts +0 -4
- package/dist/types/lib/logger/logger.types.d.ts +0 -28
- package/dist/types/mocks/MockApiClient.d.ts +0 -171
- package/dist/types/mocks/MockDataProvider.d.ts +0 -139
- package/dist/types/mocks/MockFactory.d.ts +0 -53
- package/dist/types/mocks/utils.d.ts +0 -24
- package/dist/types/themes/portalPresets.d.ts +0 -9
- package/dist/types/types/api/auth.d.ts +0 -93
- package/dist/types/types/api/broker.d.ts +0 -421
- package/dist/types/types/api/core.d.ts +0 -46
- package/dist/types/types/api/errors.d.ts +0 -31
- package/dist/types/types/api/orders.d.ts +0 -39
- package/dist/types/types/api/portfolio.d.ts +0 -55
- package/dist/types/types/common/pagination.d.ts +0 -33
- package/dist/types/types/connect.d.ts +0 -58
- package/dist/types/types/index.d.ts +0 -13
- package/dist/types/types/portal.d.ts +0 -204
- package/dist/types/types/ui/theme.d.ts +0 -104
- package/dist/types/utils/brokerUtils.d.ts +0 -30
- package/dist/types/utils/errors.d.ts +0 -45
- package/dist/types/utils/events.d.ts +0 -12
- package/dist/types/utils/themeUtils.d.ts +0 -34
- package/src/core/client/ApiClient.ts +0 -2004
- package/src/core/client/FinaticConnect.ts +0 -1606
- package/src/core/portal/PortalUI.ts +0 -335
- package/src/index.d.ts +0 -23
- package/src/index.ts +0 -100
- package/src/lib/logger/index.ts +0 -3
- package/src/lib/logger/logger.ts +0 -332
- package/src/lib/logger/logger.types.ts +0 -34
- package/src/mocks/MockApiClient.ts +0 -1058
- package/src/mocks/MockDataProvider.ts +0 -986
- package/src/mocks/MockFactory.ts +0 -97
- package/src/mocks/utils.ts +0 -133
- package/src/themes/portalPresets.ts +0 -1307
- package/src/types/api/auth.ts +0 -112
- package/src/types/api/broker.ts +0 -461
- package/src/types/api/core.ts +0 -53
- package/src/types/api/errors.ts +0 -35
- package/src/types/api/orders.ts +0 -45
- package/src/types/api/portfolio.ts +0 -59
- package/src/types/common/pagination.ts +0 -164
- package/src/types/connect.ts +0 -56
- package/src/types/index.ts +0 -25
- package/src/types/portal.ts +0 -214
- package/src/types/ui/theme.ts +0 -105
- package/src/utils/brokerUtils.ts +0 -104
- package/src/utils/errors.ts +0 -104
- package/src/utils/events.ts +0 -66
- package/src/utils/themeUtils.ts +0 -165
package/package.json
CHANGED
|
@@ -1,64 +1,108 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finatic/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Finatic Client SDK for browser integration",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
|
-
"main": "./dist/index.js",
|
|
10
|
-
"module": "./dist/index.mjs",
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"import": "./dist/index.mjs",
|
|
15
|
-
"require": "./dist/index.js",
|
|
16
|
-
"types": "./dist/index.d.ts"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=16.0.0"
|
|
21
|
-
},
|
|
22
|
-
"workspaces": [
|
|
23
|
-
"demo-app"
|
|
24
|
-
],
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
25
7
|
"files": [
|
|
26
|
-
"
|
|
27
|
-
"
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"CHANGELOG.md"
|
|
28
11
|
],
|
|
29
12
|
"scripts": {
|
|
30
13
|
"build": "rollup -c",
|
|
31
|
-
"watch": "
|
|
32
|
-
"
|
|
14
|
+
"build:watch": "tsc --watch",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"test:watch": "jest --watch",
|
|
17
|
+
"test:coverage": "jest --coverage",
|
|
33
18
|
"lint": "eslint src --ext .ts,.tsx",
|
|
34
|
-
"
|
|
19
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
20
|
+
"format": "prettier --write src/**/*.{ts,tsx}",
|
|
21
|
+
"format:check": "prettier --check src/**/*.ts",
|
|
22
|
+
"clean": "rimraf dist",
|
|
23
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
24
|
+
"watch": "rollup -c -w"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"finatic",
|
|
28
|
+
"trading",
|
|
29
|
+
"finance",
|
|
30
|
+
"api",
|
|
31
|
+
"sdk",
|
|
32
|
+
"typescript",
|
|
33
|
+
"typescript"
|
|
34
|
+
],
|
|
35
|
+
"author": {
|
|
36
|
+
"name": "Finatic",
|
|
37
|
+
"email": "support@finatic.dev"
|
|
38
|
+
},
|
|
39
|
+
"license": "PROPRIETARY",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/FinaticORG/FinaticClientSDK.git"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=16.0.0"
|
|
35
46
|
},
|
|
36
47
|
"dependencies": {
|
|
48
|
+
"axios": "^1.0.0",
|
|
37
49
|
"crypto-js": "^4.2.0",
|
|
38
|
-
"
|
|
50
|
+
"node-cache": "^1.0.0",
|
|
51
|
+
"p-retry": "^1.0.0",
|
|
52
|
+
"pino": "^1.0.0",
|
|
53
|
+
"uuid": "^9.0.1",
|
|
54
|
+
"zod": "^1.0.0"
|
|
39
55
|
},
|
|
40
56
|
"devDependencies": {
|
|
57
|
+
"@eslint/js": "^9.35.0",
|
|
41
58
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
42
59
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
43
60
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
44
61
|
"@types/crypto-js": "^4.2.1",
|
|
62
|
+
"@types/jest": "^29.5.0",
|
|
63
|
+
"@types/node": "^24.5.0",
|
|
64
|
+
"@types/node-cache": "^4.2.5",
|
|
65
|
+
"@types/pino": "^7.0.5",
|
|
45
66
|
"@types/uuid": "^9.0.7",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
47
|
-
"@typescript-eslint/parser": "^
|
|
48
|
-
"eslint": "^
|
|
49
|
-
"eslint-config-prettier": "^
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
68
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
69
|
+
"eslint": "^9.35.0",
|
|
70
|
+
"eslint-config-prettier": "^10.1.8",
|
|
71
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
50
72
|
"eslint-plugin-react": "^7.33.0",
|
|
51
73
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
74
|
+
"jest": "^30.1.3",
|
|
52
75
|
"prettier": "^3.0.0",
|
|
53
|
-
"rimraf": "^
|
|
76
|
+
"rimraf": "^6.0.1",
|
|
54
77
|
"rollup": "^4.9.1",
|
|
55
78
|
"rollup-plugin-dts": "^6.1.0",
|
|
79
|
+
"ts-jest": "^29.0.0",
|
|
56
80
|
"tslib": "^2.8.1",
|
|
57
|
-
"typescript": "^5.
|
|
81
|
+
"typescript": "^5.0.0",
|
|
82
|
+
"typescript-eslint": "^8.44.0"
|
|
58
83
|
},
|
|
84
|
+
"type": "module",
|
|
85
|
+
"publishConfig": {
|
|
86
|
+
"access": "public"
|
|
87
|
+
},
|
|
88
|
+
"module": "./dist/index.mjs",
|
|
89
|
+
"exports": {
|
|
90
|
+
".": {
|
|
91
|
+
"import": "./dist/index.mjs",
|
|
92
|
+
"require": "./dist/index.js",
|
|
93
|
+
"types": "./dist/index.d.ts"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"workspaces": [
|
|
97
|
+
"demo-app"
|
|
98
|
+
],
|
|
59
99
|
"peerDependencies": {
|
|
60
100
|
"react": ">=16.8.0",
|
|
61
101
|
"react-dom": ">=16.8.0"
|
|
62
102
|
},
|
|
103
|
+
"bugs": {
|
|
104
|
+
"url": "https://github.com/FinaticORG/FinaticClientSDK/issues"
|
|
105
|
+
},
|
|
106
|
+
"homepage": "https://github.com/FinaticORG/FinaticClientSDK#readme",
|
|
63
107
|
"packageManager": "yarn@4.9.4+sha512.7b1cb0b62abba6a537b3a2ce00811a843bea02bcf53138581a6ae5b1bf563f734872bd47de49ce32a9ca9dcaff995aa789577ffb16811da7c603dcf69e73750b"
|
|
64
108
|
}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { Order } from '../../types/api/orders';
|
|
2
|
-
import { BrokerInfo, BrokerAccount, BrokerOrder, BrokerPosition, BrokerBalance, BrokerDataOptions, DisconnectCompanyResponse } from '../../types/api/broker';
|
|
3
|
-
import { BrokerOrderParams, BrokerExtras } from '../../types/api/broker';
|
|
4
|
-
import { CryptoOrderOptions, OptionsOrderOptions, OrderResponse } from '../../types/api/orders';
|
|
5
|
-
import { BrokerConnection } from '../../types/api/broker';
|
|
6
|
-
import { OrdersFilter, PositionsFilter, AccountsFilter, BalancesFilter, OrderFill, OrderEvent, OrderGroup, PositionLot, PositionLotFill, OrderFillsFilter, OrderEventsFilter, OrderGroupsFilter, PositionLotsFilter, PositionLotFillsFilter } from '../../types/api/broker';
|
|
7
|
-
import { PaginatedResult } from '../../types/common/pagination';
|
|
8
|
-
import { PortalUrlResponse } from '../../types/api/core';
|
|
9
|
-
import { DeviceInfo, SessionState, SessionResponse, OtpRequestResponse, OtpVerifyResponse, SessionAuthenticateResponse, UserToken } from '../../types/api/auth';
|
|
10
|
-
import { ApiError } from '../../utils/errors';
|
|
11
|
-
export declare class ApiClient {
|
|
12
|
-
private readonly baseUrl;
|
|
13
|
-
protected readonly deviceInfo?: DeviceInfo;
|
|
14
|
-
protected currentSessionState: SessionState | null;
|
|
15
|
-
protected currentSessionId: string | null;
|
|
16
|
-
private tradingContext;
|
|
17
|
-
private companyId;
|
|
18
|
-
private csrfToken;
|
|
19
|
-
private readonly logger;
|
|
20
|
-
private buildLoggerExtra;
|
|
21
|
-
constructor(baseUrl: string, deviceInfo?: DeviceInfo);
|
|
22
|
-
/**
|
|
23
|
-
* Set session context (session ID, company ID, CSRF token)
|
|
24
|
-
*/
|
|
25
|
-
setSessionContext(sessionId: string, companyId: string, csrfToken?: string): void;
|
|
26
|
-
/**
|
|
27
|
-
* Get the current session ID
|
|
28
|
-
*/
|
|
29
|
-
getCurrentSessionId(): string | null;
|
|
30
|
-
/**
|
|
31
|
-
* Get the current company ID
|
|
32
|
-
*/
|
|
33
|
-
getCurrentCompanyId(): string | null;
|
|
34
|
-
/**
|
|
35
|
-
* Get the current CSRF token
|
|
36
|
-
*/
|
|
37
|
-
getCurrentCsrfToken(): string | null;
|
|
38
|
-
/**
|
|
39
|
-
* Get a valid access token (session-based auth - no tokens needed)
|
|
40
|
-
*/
|
|
41
|
-
getValidAccessToken(): Promise<string>;
|
|
42
|
-
/**
|
|
43
|
-
* Perform the actual Supabase session refresh
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* Clear session tokens (useful for logout)
|
|
47
|
-
*/
|
|
48
|
-
clearTokens(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Get current session info (for debugging/testing) - session-based auth
|
|
51
|
-
*/
|
|
52
|
-
getTokenInfo(): {
|
|
53
|
-
accessToken: string;
|
|
54
|
-
refreshToken: string;
|
|
55
|
-
expiresAt: number;
|
|
56
|
-
} | null;
|
|
57
|
-
/**
|
|
58
|
-
* Make a request to the API.
|
|
59
|
-
*/
|
|
60
|
-
protected request<T>(path: string, options: {
|
|
61
|
-
method: string;
|
|
62
|
-
headers?: Record<string, string>;
|
|
63
|
-
body?: any;
|
|
64
|
-
params?: Record<string, string>;
|
|
65
|
-
}): Promise<T>;
|
|
66
|
-
/**
|
|
67
|
-
* Handle API errors. This method can be overridden by language-specific implementations.
|
|
68
|
-
*/
|
|
69
|
-
protected handleError(status: number, error: any): ApiError;
|
|
70
|
-
startSession(token: string, userId?: string): Promise<SessionResponse>;
|
|
71
|
-
requestOtp(sessionId: string, email: string): Promise<OtpRequestResponse>;
|
|
72
|
-
verifyOtp(sessionId: string, otp: string): Promise<OtpVerifyResponse>;
|
|
73
|
-
authenticateDirectly(sessionId: string, userId: string): Promise<SessionAuthenticateResponse>;
|
|
74
|
-
/**
|
|
75
|
-
* Get the portal URL for an active session
|
|
76
|
-
* @param sessionId The session identifier
|
|
77
|
-
* @returns Portal URL response
|
|
78
|
-
* @throws SessionError if session is not in ACTIVE state
|
|
79
|
-
*/
|
|
80
|
-
getPortalUrl(sessionId: string): Promise<PortalUrlResponse>;
|
|
81
|
-
completePortalSession(sessionId: string): Promise<PortalUrlResponse>;
|
|
82
|
-
getOrders(): Promise<{
|
|
83
|
-
data: Order[];
|
|
84
|
-
}>;
|
|
85
|
-
placeBrokerOrder(params: Partial<BrokerOrderParams> & {
|
|
86
|
-
symbol: string;
|
|
87
|
-
orderQty: number;
|
|
88
|
-
action: 'Buy' | 'Sell';
|
|
89
|
-
orderType: 'Market' | 'Limit' | 'Stop' | 'StopLimit';
|
|
90
|
-
assetType: 'equity' | 'equity_option' | 'crypto' | 'forex' | 'future' | 'future_option';
|
|
91
|
-
}, extras?: BrokerExtras, connection_id?: string): Promise<OrderResponse>;
|
|
92
|
-
cancelBrokerOrder(orderId: string, broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', extras?: any, connection_id?: string): Promise<OrderResponse>;
|
|
93
|
-
modifyBrokerOrder(orderId: string, params: Partial<BrokerOrderParams>, broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', extras?: any, connection_id?: string): Promise<OrderResponse>;
|
|
94
|
-
setBroker(broker: 'robinhood' | 'tasty_trade' | 'ninja_trader'): void;
|
|
95
|
-
setAccount(accountNumber: string, accountId?: string): void;
|
|
96
|
-
placeStockMarketOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras, connection_id?: string): Promise<OrderResponse>;
|
|
97
|
-
placeStockLimitOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', price: number, timeInForce?: 'day' | 'gtc', broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras, connection_id?: string): Promise<OrderResponse>;
|
|
98
|
-
placeStockStopOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', stopPrice: number, timeInForce?: 'day' | 'gtc', broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras, connection_id?: string): Promise<OrderResponse>;
|
|
99
|
-
placeCryptoMarketOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', options?: CryptoOrderOptions, broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras): Promise<OrderResponse>;
|
|
100
|
-
placeCryptoLimitOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', price: number, timeInForce?: 'day' | 'gtc', options?: CryptoOrderOptions, broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras): Promise<OrderResponse>;
|
|
101
|
-
placeOptionsMarketOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', options: OptionsOrderOptions, broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras): Promise<OrderResponse>;
|
|
102
|
-
placeOptionsLimitOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', price: number, options: OptionsOrderOptions, timeInForce?: 'day' | 'gtc', broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras): Promise<OrderResponse>;
|
|
103
|
-
placeFuturesMarketOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras): Promise<OrderResponse>;
|
|
104
|
-
placeFuturesLimitOrder(symbol: string, orderQty: number, action: 'Buy' | 'Sell', price: number, timeInForce?: 'day' | 'gtc', broker?: 'robinhood' | 'tasty_trade' | 'ninja_trader', accountNumber?: string, extras?: BrokerExtras): Promise<OrderResponse>;
|
|
105
|
-
private buildOrderRequestBody;
|
|
106
|
-
private buildModifyRequestBody;
|
|
107
|
-
private applyBrokerDefaults;
|
|
108
|
-
getUserToken(sessionId: string): Promise<UserToken>;
|
|
109
|
-
/**
|
|
110
|
-
* Get the current session state
|
|
111
|
-
*/
|
|
112
|
-
getCurrentSessionState(): SessionState | null;
|
|
113
|
-
/**
|
|
114
|
-
* Refresh the current session to extend its lifetime
|
|
115
|
-
* Note: This now uses Supabase session refresh instead of custom endpoint
|
|
116
|
-
*/
|
|
117
|
-
refreshSession(): Promise<{
|
|
118
|
-
success: boolean;
|
|
119
|
-
response_data: {
|
|
120
|
-
session_id: string;
|
|
121
|
-
company_id: string;
|
|
122
|
-
status: string;
|
|
123
|
-
expires_at: string;
|
|
124
|
-
user_id: string;
|
|
125
|
-
auto_login: boolean;
|
|
126
|
-
};
|
|
127
|
-
message: string;
|
|
128
|
-
status_code: number;
|
|
129
|
-
}>;
|
|
130
|
-
getBrokerList(): Promise<{
|
|
131
|
-
_id: string;
|
|
132
|
-
response_data: BrokerInfo[];
|
|
133
|
-
message: string;
|
|
134
|
-
status_code: number;
|
|
135
|
-
warnings: null;
|
|
136
|
-
errors: null;
|
|
137
|
-
}>;
|
|
138
|
-
getBrokerAccounts(options?: BrokerDataOptions): Promise<{
|
|
139
|
-
_id: string;
|
|
140
|
-
response_data: BrokerAccount[];
|
|
141
|
-
message: string;
|
|
142
|
-
status_code: number;
|
|
143
|
-
warnings: null;
|
|
144
|
-
errors: null;
|
|
145
|
-
}>;
|
|
146
|
-
getBrokerOrders(options?: BrokerDataOptions): Promise<{
|
|
147
|
-
_id: string;
|
|
148
|
-
response_data: BrokerOrder[];
|
|
149
|
-
message: string;
|
|
150
|
-
status_code: number;
|
|
151
|
-
warnings: null;
|
|
152
|
-
errors: null;
|
|
153
|
-
}>;
|
|
154
|
-
getBrokerPositions(options?: BrokerDataOptions): Promise<{
|
|
155
|
-
_id: string;
|
|
156
|
-
response_data: BrokerPosition[];
|
|
157
|
-
message: string;
|
|
158
|
-
status_code: number;
|
|
159
|
-
warnings: null;
|
|
160
|
-
errors: null;
|
|
161
|
-
}>;
|
|
162
|
-
getBrokerBalances(options?: BrokerDataOptions): Promise<{
|
|
163
|
-
_id: string;
|
|
164
|
-
response_data: BrokerBalance[];
|
|
165
|
-
message: string;
|
|
166
|
-
status_code: number;
|
|
167
|
-
warnings: null;
|
|
168
|
-
errors: null;
|
|
169
|
-
}>;
|
|
170
|
-
getBrokerConnections(): Promise<{
|
|
171
|
-
_id: string;
|
|
172
|
-
response_data: BrokerConnection[];
|
|
173
|
-
message: string;
|
|
174
|
-
status_code: number;
|
|
175
|
-
warnings: null;
|
|
176
|
-
errors: null;
|
|
177
|
-
}>;
|
|
178
|
-
getBalances(filters?: any): Promise<{
|
|
179
|
-
_id: string;
|
|
180
|
-
response_data: any[];
|
|
181
|
-
message: string;
|
|
182
|
-
status_code: number;
|
|
183
|
-
warnings: null;
|
|
184
|
-
errors: null;
|
|
185
|
-
}>;
|
|
186
|
-
getBrokerOrdersPage(page?: number, perPage?: number, filters?: OrdersFilter): Promise<PaginatedResult<BrokerOrder[]>>;
|
|
187
|
-
getBrokerAccountsPage(page?: number, perPage?: number, filters?: AccountsFilter): Promise<PaginatedResult<BrokerAccount[]>>;
|
|
188
|
-
getBrokerPositionsPage(page?: number, perPage?: number, filters?: PositionsFilter): Promise<PaginatedResult<BrokerPosition[]>>;
|
|
189
|
-
getBrokerBalancesPage(page?: number, perPage?: number, filters?: BalancesFilter): Promise<PaginatedResult<BrokerBalance[]>>;
|
|
190
|
-
getNextPage<T>(previousResult: PaginatedResult<T>, fetchFunction: (offset: number, limit: number) => Promise<PaginatedResult<T>>): Promise<PaginatedResult<T> | null>;
|
|
191
|
-
/**
|
|
192
|
-
* Check if this is a mock client
|
|
193
|
-
* @returns false for real API client
|
|
194
|
-
*/
|
|
195
|
-
isMockClient(): boolean;
|
|
196
|
-
/**
|
|
197
|
-
* Disconnect a company from a broker connection
|
|
198
|
-
* @param connectionId - The connection ID to disconnect
|
|
199
|
-
* @returns Promise with disconnect response
|
|
200
|
-
*/
|
|
201
|
-
disconnectCompany(connectionId: string): Promise<DisconnectCompanyResponse>;
|
|
202
|
-
/**
|
|
203
|
-
* Get order fills for a specific order
|
|
204
|
-
* @param orderId - The order ID
|
|
205
|
-
* @param filter - Optional filter parameters
|
|
206
|
-
* @returns Promise with order fills response
|
|
207
|
-
*/
|
|
208
|
-
getOrderFills(orderId: string, filter?: OrderFillsFilter): Promise<{
|
|
209
|
-
_id: string;
|
|
210
|
-
response_data: OrderFill[];
|
|
211
|
-
message: string;
|
|
212
|
-
status_code: number;
|
|
213
|
-
warnings: null;
|
|
214
|
-
errors: null;
|
|
215
|
-
}>;
|
|
216
|
-
/**
|
|
217
|
-
* Get order events for a specific order
|
|
218
|
-
* @param orderId - The order ID
|
|
219
|
-
* @param filter - Optional filter parameters
|
|
220
|
-
* @returns Promise with order events response
|
|
221
|
-
*/
|
|
222
|
-
getOrderEvents(orderId: string, filter?: OrderEventsFilter): Promise<{
|
|
223
|
-
_id: string;
|
|
224
|
-
response_data: OrderEvent[];
|
|
225
|
-
message: string;
|
|
226
|
-
status_code: number;
|
|
227
|
-
warnings: null;
|
|
228
|
-
errors: null;
|
|
229
|
-
}>;
|
|
230
|
-
/**
|
|
231
|
-
* Get order groups
|
|
232
|
-
* @param filter - Optional filter parameters
|
|
233
|
-
* @returns Promise with order groups response
|
|
234
|
-
*/
|
|
235
|
-
getOrderGroups(filter?: OrderGroupsFilter): Promise<{
|
|
236
|
-
_id: string;
|
|
237
|
-
response_data: OrderGroup[];
|
|
238
|
-
message: string;
|
|
239
|
-
status_code: number;
|
|
240
|
-
warnings: null;
|
|
241
|
-
errors: null;
|
|
242
|
-
}>;
|
|
243
|
-
/**
|
|
244
|
-
* Get position lots (tax lots for positions)
|
|
245
|
-
* @param filter - Optional filter parameters
|
|
246
|
-
* @returns Promise with position lots response
|
|
247
|
-
*/
|
|
248
|
-
getPositionLots(filter?: PositionLotsFilter): Promise<{
|
|
249
|
-
_id: string;
|
|
250
|
-
response_data: PositionLot[];
|
|
251
|
-
message: string;
|
|
252
|
-
status_code: number;
|
|
253
|
-
warnings: null;
|
|
254
|
-
errors: null;
|
|
255
|
-
}>;
|
|
256
|
-
/**
|
|
257
|
-
* Get position lot fills for a specific lot
|
|
258
|
-
* @param lotId - The position lot ID
|
|
259
|
-
* @param filter - Optional filter parameters
|
|
260
|
-
* @returns Promise with position lot fills response
|
|
261
|
-
*/
|
|
262
|
-
getPositionLotFills(lotId: string, filter?: PositionLotFillsFilter): Promise<{
|
|
263
|
-
_id: string;
|
|
264
|
-
response_data: PositionLotFill[];
|
|
265
|
-
message: string;
|
|
266
|
-
status_code: number;
|
|
267
|
-
warnings: null;
|
|
268
|
-
errors: null;
|
|
269
|
-
}>;
|
|
270
|
-
}
|