feat: add operations list

This commit is contained in:
2026-08-14 13:43:02 +03:00
parent e77ebc6e8f
commit 326fb67def
10 changed files with 653 additions and 0 deletions
+38
View File
@@ -47,6 +47,37 @@ export type TbankPortfolio = {
};
export type TbankPositions = { money?: TbankMoney[] };
export type TbankInstrument = { ticker?: string; name?: string };
export type TbankTimestamp = { seconds?: string | number; nanos?: number };
export type TbankOperationItem = {
cursor?: string;
id?: string;
name?: string;
date?: TbankTimestamp;
type?: string;
description?: string;
figi?: string;
instrumentUid?: string;
instrumentType?: string;
ticker?: string;
payment?: TbankMoney;
price?: TbankMoney;
commission?: TbankMoney;
accruedInt?: TbankMoney;
quantity?: string | number;
};
export type TbankOperationsByCursorRequest = {
accountId: string;
from?: TbankTimestamp;
to?: TbankTimestamp;
cursor?: string;
limit?: number;
state: 'OPERATION_STATE_EXECUTED';
};
export type TbankOperationsByCursorResponse = {
hasNext?: boolean;
nextCursor?: string;
items?: TbankOperationItem[];
};
type TbankNamespace = {
tinkoff: {
public: { invest: { api: { contract: { v1: Record<string, unknown> } } } };
@@ -172,6 +203,13 @@ export class TbankClient {
return this.call(token, this.operations, 'getPositions', { accountId });
}
getOperationsByCursor(
token: string,
request: TbankOperationsByCursorRequest,
): Promise<TbankOperationsByCursorResponse> {
return this.call(token, this.operations, 'getOperationsByCursor', request);
}
getInstrumentByFigi(
token: string,
figi: string,