@pipsend/sdk 0.3.0 → 0.3.2

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/dist/index.d.mts CHANGED
@@ -182,7 +182,7 @@ interface Account {
182
182
  last_name: string;
183
183
  middle_name?: string;
184
184
  company?: string;
185
- state: 'active' | 'inactive' | 'archived';
185
+ state: "active" | "inactive" | "archived";
186
186
  balance: number;
187
187
  credit: number;
188
188
  leverage: number;
@@ -245,7 +245,8 @@ interface AccountStatisticsParams {
245
245
  trading_group?: string;
246
246
  }
247
247
  interface ChangePasswordRequest {
248
- new_password: string;
248
+ master?: string;
249
+ investor?: string;
249
250
  }
250
251
  /**
251
252
  * Create account request
@@ -284,14 +285,14 @@ interface CreateAccountRequest {
284
285
  /** Leverage (uses group default if not specified) */
285
286
  leverage?: number;
286
287
  /** Account state: "active" or "inactive" (default: "active") */
287
- state?: 'active' | 'inactive';
288
+ state?: "active" | "inactive";
288
289
  }
289
290
  /**
290
291
  * Create account response
291
292
  */
292
293
  interface CreateAccountResponse {
293
- status: 'success';
294
- status_code: 'CREATED';
294
+ status: "success";
295
+ status_code: "CREATED";
295
296
  data: Account;
296
297
  }
297
298
  /**
@@ -323,14 +324,14 @@ interface UpdateAccountRequest {
323
324
  /** Leverage */
324
325
  leverage?: number;
325
326
  /** Account state: "active" or "inactive" */
326
- state?: 'active' | 'inactive';
327
+ state?: "active" | "inactive";
327
328
  }
328
329
  /**
329
330
  * Update account response
330
331
  */
331
332
  interface UpdateAccountResponse {
332
- status: 'success';
333
- status_code: 'SUCCESS';
333
+ status: "success";
334
+ status_code: "SUCCESS";
334
335
  data: Account;
335
336
  }
336
337
  /**
@@ -338,7 +339,7 @@ interface UpdateAccountResponse {
338
339
  */
339
340
  interface AdjustBalanceRequest {
340
341
  /** Type of adjustment: "balance" or "credit" */
341
- type: 'balance' | 'credit';
342
+ type: "balance" | "credit";
342
343
  /** Amount to adjust (positive = add, negative = subtract) */
343
344
  amount: number;
344
345
  /** Descriptive comment (max 255 characters) */
@@ -348,8 +349,8 @@ interface AdjustBalanceRequest {
348
349
  * Adjust balance or credit response
349
350
  */
350
351
  interface AdjustBalanceResponse {
351
- status: 'success';
352
- status_code: 'SUCCESS';
352
+ status: "success";
353
+ status_code: "SUCCESS";
353
354
  data: Account;
354
355
  }
355
356
  /**
@@ -371,14 +372,14 @@ interface AccountStatus {
371
372
  * Account status response
372
373
  */
373
374
  interface AccountStatusResponse {
374
- status: 'success';
375
- status_code: 'SUCCESS';
375
+ status: "success";
376
+ status_code: "SUCCESS";
376
377
  data: AccountStatus;
377
378
  }
378
379
  /**
379
380
  * Account permission types
380
381
  */
381
- type AccountPermission = 'RIGHT_ENABLED' | 'RIGHT_LOGIN_ENABLED' | 'RIGHT_TRADE_ENABLED' | 'RIGHT_EA_ENABLED' | 'RIGHT_READONLY' | 'RIGHT_API_ACCESS_ENABLED' | 'RIGHT_BALANCE_READONLY' | 'RIGHT_DEPOSIT_ENABLED' | 'RIGHT_WITHDRAW_ENABLED' | 'RIGHT_PUSH_NOTIFICATIONS_ENABLED' | 'RIGHT_FORCE_PASSWORD_RESET';
382
+ type AccountPermission = "RIGHT_ENABLED" | "RIGHT_LOGIN_ENABLED" | "RIGHT_TRADE_ENABLED" | "RIGHT_EA_ENABLED" | "RIGHT_READONLY" | "RIGHT_API_ACCESS_ENABLED" | "RIGHT_BALANCE_READONLY" | "RIGHT_DEPOSIT_ENABLED" | "RIGHT_WITHDRAW_ENABLED" | "RIGHT_PUSH_NOTIFICATIONS_ENABLED" | "RIGHT_FORCE_PASSWORD_RESET";
382
383
  /**
383
384
  * Account rights/permissions
384
385
  */
@@ -534,12 +535,17 @@ interface GroupsParams {
534
535
  */
535
536
  interface Position {
536
537
  id: number;
538
+ order_id: number;
537
539
  login: number;
540
+ first_name?: string;
541
+ last_name?: string;
542
+ symbol_id?: number;
538
543
  symbol: string;
539
- type: 'buy' | 'sell';
544
+ type: "buy" | "sell";
540
545
  volume: number;
541
- entry_price: number;
542
- current_price: number;
546
+ open_price: number;
547
+ entry_price?: number;
548
+ current_price?: number;
543
549
  profit: number;
544
550
  commission: number;
545
551
  swap: number;
@@ -547,8 +553,8 @@ interface Position {
547
553
  stop_loss?: number;
548
554
  take_profit?: number;
549
555
  opened_at: string;
550
- updated_at: string;
551
- state: 'open' | 'closed';
556
+ updated_at?: string;
557
+ state: "open" | "closed";
552
558
  }
553
559
  interface PositionsListParams extends PaginationParams {
554
560
  /** Position IDs (comma-separated) */
@@ -582,7 +588,7 @@ interface PositionsListParams extends PaginationParams {
582
588
  /** Sort by field (default: "id") */
583
589
  sort_by?: string;
584
590
  /** Sort order: "asc", "desc" (default: "desc") */
585
- sort_order?: 'asc' | 'desc';
591
+ sort_order?: "asc" | "desc";
586
592
  }
587
593
  interface PositionStatsParams {
588
594
  /** Account logins (comma-separated) */
@@ -1151,13 +1157,9 @@ declare class AccountsAPI {
1151
1157
  */
1152
1158
  getStatistics(params?: AccountStatisticsParams): Promise<AccountStatistics>;
1153
1159
  /**
1154
- * Change master password for an account
1155
- */
1156
- changeMasterPassword(login: number, request: ChangePasswordRequest): Promise<void>;
1157
- /**
1158
- * Change investor password for an account
1160
+ * Change account passwords (master and/or investor)
1159
1161
  */
1160
- changeInvestorPassword(login: number, request: ChangePasswordRequest): Promise<void>;
1162
+ changePassword(login: number, request: ChangePasswordRequest): Promise<void>;
1161
1163
  /**
1162
1164
  * Archive an account
1163
1165
  */
package/dist/index.d.ts CHANGED
@@ -182,7 +182,7 @@ interface Account {
182
182
  last_name: string;
183
183
  middle_name?: string;
184
184
  company?: string;
185
- state: 'active' | 'inactive' | 'archived';
185
+ state: "active" | "inactive" | "archived";
186
186
  balance: number;
187
187
  credit: number;
188
188
  leverage: number;
@@ -245,7 +245,8 @@ interface AccountStatisticsParams {
245
245
  trading_group?: string;
246
246
  }
247
247
  interface ChangePasswordRequest {
248
- new_password: string;
248
+ master?: string;
249
+ investor?: string;
249
250
  }
250
251
  /**
251
252
  * Create account request
@@ -284,14 +285,14 @@ interface CreateAccountRequest {
284
285
  /** Leverage (uses group default if not specified) */
285
286
  leverage?: number;
286
287
  /** Account state: "active" or "inactive" (default: "active") */
287
- state?: 'active' | 'inactive';
288
+ state?: "active" | "inactive";
288
289
  }
289
290
  /**
290
291
  * Create account response
291
292
  */
292
293
  interface CreateAccountResponse {
293
- status: 'success';
294
- status_code: 'CREATED';
294
+ status: "success";
295
+ status_code: "CREATED";
295
296
  data: Account;
296
297
  }
297
298
  /**
@@ -323,14 +324,14 @@ interface UpdateAccountRequest {
323
324
  /** Leverage */
324
325
  leverage?: number;
325
326
  /** Account state: "active" or "inactive" */
326
- state?: 'active' | 'inactive';
327
+ state?: "active" | "inactive";
327
328
  }
328
329
  /**
329
330
  * Update account response
330
331
  */
331
332
  interface UpdateAccountResponse {
332
- status: 'success';
333
- status_code: 'SUCCESS';
333
+ status: "success";
334
+ status_code: "SUCCESS";
334
335
  data: Account;
335
336
  }
336
337
  /**
@@ -338,7 +339,7 @@ interface UpdateAccountResponse {
338
339
  */
339
340
  interface AdjustBalanceRequest {
340
341
  /** Type of adjustment: "balance" or "credit" */
341
- type: 'balance' | 'credit';
342
+ type: "balance" | "credit";
342
343
  /** Amount to adjust (positive = add, negative = subtract) */
343
344
  amount: number;
344
345
  /** Descriptive comment (max 255 characters) */
@@ -348,8 +349,8 @@ interface AdjustBalanceRequest {
348
349
  * Adjust balance or credit response
349
350
  */
350
351
  interface AdjustBalanceResponse {
351
- status: 'success';
352
- status_code: 'SUCCESS';
352
+ status: "success";
353
+ status_code: "SUCCESS";
353
354
  data: Account;
354
355
  }
355
356
  /**
@@ -371,14 +372,14 @@ interface AccountStatus {
371
372
  * Account status response
372
373
  */
373
374
  interface AccountStatusResponse {
374
- status: 'success';
375
- status_code: 'SUCCESS';
375
+ status: "success";
376
+ status_code: "SUCCESS";
376
377
  data: AccountStatus;
377
378
  }
378
379
  /**
379
380
  * Account permission types
380
381
  */
381
- type AccountPermission = 'RIGHT_ENABLED' | 'RIGHT_LOGIN_ENABLED' | 'RIGHT_TRADE_ENABLED' | 'RIGHT_EA_ENABLED' | 'RIGHT_READONLY' | 'RIGHT_API_ACCESS_ENABLED' | 'RIGHT_BALANCE_READONLY' | 'RIGHT_DEPOSIT_ENABLED' | 'RIGHT_WITHDRAW_ENABLED' | 'RIGHT_PUSH_NOTIFICATIONS_ENABLED' | 'RIGHT_FORCE_PASSWORD_RESET';
382
+ type AccountPermission = "RIGHT_ENABLED" | "RIGHT_LOGIN_ENABLED" | "RIGHT_TRADE_ENABLED" | "RIGHT_EA_ENABLED" | "RIGHT_READONLY" | "RIGHT_API_ACCESS_ENABLED" | "RIGHT_BALANCE_READONLY" | "RIGHT_DEPOSIT_ENABLED" | "RIGHT_WITHDRAW_ENABLED" | "RIGHT_PUSH_NOTIFICATIONS_ENABLED" | "RIGHT_FORCE_PASSWORD_RESET";
382
383
  /**
383
384
  * Account rights/permissions
384
385
  */
@@ -534,12 +535,17 @@ interface GroupsParams {
534
535
  */
535
536
  interface Position {
536
537
  id: number;
538
+ order_id: number;
537
539
  login: number;
540
+ first_name?: string;
541
+ last_name?: string;
542
+ symbol_id?: number;
538
543
  symbol: string;
539
- type: 'buy' | 'sell';
544
+ type: "buy" | "sell";
540
545
  volume: number;
541
- entry_price: number;
542
- current_price: number;
546
+ open_price: number;
547
+ entry_price?: number;
548
+ current_price?: number;
543
549
  profit: number;
544
550
  commission: number;
545
551
  swap: number;
@@ -547,8 +553,8 @@ interface Position {
547
553
  stop_loss?: number;
548
554
  take_profit?: number;
549
555
  opened_at: string;
550
- updated_at: string;
551
- state: 'open' | 'closed';
556
+ updated_at?: string;
557
+ state: "open" | "closed";
552
558
  }
553
559
  interface PositionsListParams extends PaginationParams {
554
560
  /** Position IDs (comma-separated) */
@@ -582,7 +588,7 @@ interface PositionsListParams extends PaginationParams {
582
588
  /** Sort by field (default: "id") */
583
589
  sort_by?: string;
584
590
  /** Sort order: "asc", "desc" (default: "desc") */
585
- sort_order?: 'asc' | 'desc';
591
+ sort_order?: "asc" | "desc";
586
592
  }
587
593
  interface PositionStatsParams {
588
594
  /** Account logins (comma-separated) */
@@ -1151,13 +1157,9 @@ declare class AccountsAPI {
1151
1157
  */
1152
1158
  getStatistics(params?: AccountStatisticsParams): Promise<AccountStatistics>;
1153
1159
  /**
1154
- * Change master password for an account
1155
- */
1156
- changeMasterPassword(login: number, request: ChangePasswordRequest): Promise<void>;
1157
- /**
1158
- * Change investor password for an account
1160
+ * Change account passwords (master and/or investor)
1159
1161
  */
1160
- changeInvestorPassword(login: number, request: ChangePasswordRequest): Promise<void>;
1162
+ changePassword(login: number, request: ChangePasswordRequest): Promise<void>;
1161
1163
  /**
1162
1164
  * Archive an account
1163
1165
  */
package/dist/index.js CHANGED
@@ -695,7 +695,10 @@ var AccountsAPI = class {
695
695
  * List all accounts with optional filters and pagination
696
696
  */
697
697
  async list(params) {
698
- return this.http.get("/api/v1/accounts", params);
698
+ return this.http.get(
699
+ "/api/v1/accounts",
700
+ params
701
+ );
699
702
  }
700
703
  /**
701
704
  * Get all account logins
@@ -707,25 +710,24 @@ var AccountsAPI = class {
707
710
  * Get account status/metrics (balance, equity, credit, margin)
708
711
  */
709
712
  async getStatus(login) {
710
- return this.http.get(`/api/v1/accounts/${login}/status`);
713
+ return this.http.get(
714
+ `/api/v1/accounts/${login}/status`
715
+ );
711
716
  }
712
717
  /**
713
718
  * Get account statistics with optional filters
714
719
  */
715
720
  async getStatistics(params) {
716
- return this.http.get("/api/v1/accounts/statistics", params);
717
- }
718
- /**
719
- * Change master password for an account
720
- */
721
- async changeMasterPassword(login, request) {
722
- return this.http.put(`/api/v1/accounts/${login}/password/master`, request);
721
+ return this.http.get(
722
+ "/api/v1/accounts/statistics",
723
+ params
724
+ );
723
725
  }
724
726
  /**
725
- * Change investor password for an account
727
+ * Change account passwords (master and/or investor)
726
728
  */
727
- async changeInvestorPassword(login, request) {
728
- return this.http.put(`/api/v1/accounts/${login}/password/investor`, request);
729
+ async changePassword(login, request) {
730
+ return this.http.put(`/api/v1/accounts/${login}/password`, request);
729
731
  }
730
732
  /**
731
733
  * Archive an account
@@ -744,14 +746,20 @@ var AccountsAPI = class {
744
746
  * All fields are optional, only send the ones you want to update
745
747
  */
746
748
  async update(login, request) {
747
- return this.http.put(`/api/v1/accounts/${login}`, request);
749
+ return this.http.put(
750
+ `/api/v1/accounts/${login}`,
751
+ request
752
+ );
748
753
  }
749
754
  /**
750
755
  * Adjust balance or credit for an account
751
756
  * The adjustment is relative: amount is added or subtracted from current value
752
757
  */
753
758
  async balance(login, request) {
754
- return this.http.put(`/api/v1/accounts/${login}/adjust`, request);
759
+ return this.http.put(
760
+ `/api/v1/accounts/${login}/adjust`,
761
+ request
762
+ );
755
763
  }
756
764
  /**
757
765
  * Get account permissions