squarefi-bff-api-module 1.32.3 → 1.32.4

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.
@@ -10,6 +10,6 @@ export declare const counterparties: {
10
10
  getById: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }: API.Counterparties.Destination.Detail.Request) => Promise<API.Counterparties.Destination.Detail.Response>;
11
11
  create: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Destination.Create.Request) => Promise<API.Counterparties.Destination.Create.Response>;
12
12
  update: ({ wallet_id, counterparty_account_id, counterparty_destination_id, ...data }: API.Counterparties.Destination.Update.Request) => Promise<API.Counterparties.Destination.Update.Response>;
13
- delete: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }: API.Counterparties.Destination.Delete.Request) => Promise<API.Counterparties.Destination.Delete.Response>;
13
+ delete: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }: API.Counterparties.Destination.Delete.Request) => Promise<void>;
14
14
  };
15
15
  };
@@ -10,14 +10,7 @@ export const counterparties = {
10
10
  destinations: {
11
11
  getAll: ({ wallet_id, counterparty_account_id, ...params }) => apiClientV2.getRequest(`/counterparties/${wallet_id}/${counterparty_account_id}/destinations`, { params }),
12
12
  getById: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }) => apiClientV2.getRequest(`/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`),
13
- create: ({ wallet_id, counterparty_account_id,
14
- // 'verification-request-id': verificationRequestId, // TODO:verify request id not implemented yet on the backend
15
- ...data }) => apiClientV2.postRequest(`/counterparties/${wallet_id}/${counterparty_account_id}/destinations`, {
16
- data,
17
- // headers: { TODO:verify request id not implemented yet on the backend
18
- // 'verification-request-id': verificationRequestId,
19
- // },
20
- }),
13
+ create: ({ wallet_id, counterparty_account_id, ...data }) => apiClientV2.postRequest(`/counterparties/${wallet_id}/${counterparty_account_id}/destinations`, { data }),
21
14
  update: ({ wallet_id, counterparty_account_id, counterparty_destination_id, ...data }) => apiClientV2.patchRequest(`/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`, { data }),
22
15
  delete: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }) => apiClientV2.deleteRequest(`/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`),
23
16
  },
@@ -4322,10 +4322,7 @@ export interface operations {
4322
4322
  CounterpartyDestinationsController_create: {
4323
4323
  parameters: {
4324
4324
  query?: never;
4325
- header: {
4326
- /** @description Verification request ID */
4327
- "verification-request-id": string;
4328
- };
4325
+ header?: never;
4329
4326
  path: {
4330
4327
  counterparty_account_id: string;
4331
4328
  wallet_id: unknown;
@@ -4346,13 +4343,6 @@ export interface operations {
4346
4343
  "application/json": components["schemas"]["CounterpartyDestinationDto"];
4347
4344
  };
4348
4345
  };
4349
- /** @description Verification request ID is required */
4350
- 400: {
4351
- headers: {
4352
- [name: string]: unknown;
4353
- };
4354
- content?: never;
4355
- };
4356
4346
  /** @description Unauthorized */
4357
4347
  401: {
4358
4348
  headers: {
@@ -1,4 +1,4 @@
1
- import { APIKeyRole, CardFormFactor, CardTransactionType, CardType, CurrencyType, IssuingProgramStatus, OrderPaymentMethod, OrderStatuses, OrderType, SortingDirection, SubAccountType, WalletTransactionMethod, WalletTransactionRecordType, WalletTransactionStatus, WalletTransactionType } from '../../constants';
1
+ import { APIKeyRole, CardFormFactor, CardTransactionType, CardType, CounterpartyDestinationType, CounterpartyType, CurrencyType, IssuingProgramStatus, OrderPaymentMethod, OrderStatuses, OrderType, SortingDirection, SubAccountType, WalletTransactionMethod, WalletTransactionRecordType, WalletTransactionStatus, WalletTransactionType } from '../../constants';
2
2
  import { WalletType } from '../..';
3
3
  import { components, operations } from './autogen/apiV2.types';
4
4
  export declare namespace API {
@@ -364,65 +364,183 @@ export declare namespace API {
364
364
  }
365
365
  }
366
366
  namespace Counterparties {
367
- type Counterparty = components['schemas']['CounterpartyAccountDto'];
368
- namespace List {
369
- type Request = {
370
- wallet_id: string;
371
- } & operations['CounterpartyAccountsController_findAll']['parameters']['query'];
372
- type Response = operations['CounterpartyAccountsController_findAll']['responses']['200']['content']['application/json'];
373
- }
374
- namespace GetById {
375
- type Request = operations['CounterpartyAccountsController_findOne']['parameters']['path'];
376
- type Response = operations['CounterpartyAccountsController_findOne']['responses']['200']['content']['application/json'];
377
- }
378
- namespace Create {
379
- type Request = {
380
- wallet_id: string;
381
- } & operations['CounterpartyAccountsController_create']['requestBody']['content']['application/json'];
382
- type Response = operations['CounterpartyAccountsController_create']['responses']['200']['content']['application/json'];
383
- }
384
- namespace Update {
385
- type Request = {
386
- wallet_id: string;
387
- counterparty_account_id: string;
388
- } & operations['CounterpartyAccountsController_update']['requestBody']['content']['application/json'];
389
- type Response = operations['CounterpartyAccountsController_update']['responses']['200']['content']['application/json'];
390
- }
391
- namespace Delete {
392
- type Request = operations['CounterpartyAccountsController_delete']['parameters']['path'];
393
- type Response = operations['CounterpartyAccountsController_delete']['responses']['200']['content']['application/json'];
367
+ interface Counterparty {
368
+ id: string;
369
+ email: string;
370
+ phone: string;
371
+ name: string;
372
+ nickname?: string | null;
373
+ type: CounterpartyType | string;
374
+ created_at: string;
394
375
  }
395
376
  namespace Destination {
396
377
  namespace List {
397
- type Request = {
378
+ interface DestinationListItemCommonFields {
379
+ id: string;
380
+ nickname: string;
381
+ type: CounterpartyDestinationType | string;
382
+ created_at: string;
383
+ }
384
+ interface DestinationListItemExternalBankingData {
385
+ account_number?: string;
386
+ routing_number?: string;
387
+ bank_name: string;
388
+ note: string;
389
+ swift_bic?: string;
390
+ address: {
391
+ city: string;
392
+ country_id: number;
393
+ state_id: number;
394
+ postcode: string;
395
+ street1: string;
396
+ street2?: string;
397
+ };
398
+ }
399
+ interface DestinationListItemExternalCryptoData {
400
+ address: string;
401
+ currency_id: string;
402
+ memo?: string;
403
+ }
404
+ interface DestinationListItemWithExternalBankingData extends DestinationListItemCommonFields {
405
+ type: CounterpartyDestinationType.DOMESTIC_WIRE | CounterpartyDestinationType.ACH | CounterpartyDestinationType.SWIFT | CounterpartyDestinationType.SEPA;
406
+ external_banking_data: DestinationListItemExternalBankingData;
407
+ external_crypto_data?: never;
408
+ }
409
+ interface DestinationListItemWithExternalCryptoData extends DestinationListItemCommonFields {
410
+ type: CounterpartyDestinationType.CRYPTO_EXTERNAL | CounterpartyDestinationType.CRYPTO_INTERNAL;
411
+ external_banking_data?: never;
412
+ external_crypto_data: DestinationListItemExternalCryptoData;
413
+ }
414
+ type CounterpartyDestinationListItem = DestinationListItemWithExternalBankingData | DestinationListItemWithExternalCryptoData;
415
+ interface Request {
398
416
  wallet_id: string;
399
417
  counterparty_account_id: string;
400
- } & operations['CounterpartyDestinationsController_findAll']['parameters']['query'];
401
- type Response = operations['CounterpartyDestinationsController_findAll']['responses']['200']['content']['application/json'];
418
+ limit?: number;
419
+ offset?: number;
420
+ search?: string;
421
+ type?: CounterpartyDestinationType | string;
422
+ sort_by?: 'created_at' | 'nickname' | 'type';
423
+ sort_order?: SortingDirection;
424
+ filter?: {
425
+ type?: CounterpartyDestinationType;
426
+ nickname?: string;
427
+ created_at?: string;
428
+ };
429
+ }
430
+ type Response = {
431
+ total: number;
432
+ data: CounterpartyDestinationListItem[];
433
+ };
402
434
  }
403
435
  namespace Detail {
404
- type Request = operations['CounterpartyDestinationsController_findOne']['parameters']['path'];
405
- type Response = operations['CounterpartyDestinationsController_findOne']['responses']['200']['content']['application/json'];
436
+ type DestinationDetailItemCommonFields = API.Counterparties.Destination.List.DestinationListItemCommonFields;
437
+ interface DestinationDetailItemExternalBankingData extends API.Counterparties.Destination.List.DestinationListItemExternalBankingData {
438
+ address: API.Counterparties.Destination.List.DestinationListItemExternalBankingData['address'] & {
439
+ country?: API.Location.Countries.Country;
440
+ state?: API.Location.States.State;
441
+ };
442
+ }
443
+ interface DestinationDetailItemExternalCryptoData extends API.Counterparties.Destination.List.DestinationListItemExternalCryptoData {
444
+ currency: API.Currencies.Currency;
445
+ }
446
+ interface DestinationDetailItemWithExternalBankingData extends DestinationDetailItemCommonFields {
447
+ type: CounterpartyDestinationType.DOMESTIC_WIRE | CounterpartyDestinationType.ACH | CounterpartyDestinationType.SWIFT | CounterpartyDestinationType.SEPA;
448
+ external_banking_data: DestinationDetailItemExternalBankingData;
449
+ external_crypto_data?: never;
450
+ }
451
+ interface DestinationDetailItemWithExternalCryptoData extends DestinationDetailItemCommonFields {
452
+ type: CounterpartyDestinationType.CRYPTO_EXTERNAL | CounterpartyDestinationType.CRYPTO_INTERNAL;
453
+ external_banking_data?: never;
454
+ external_crypto_data: DestinationDetailItemExternalCryptoData;
455
+ }
456
+ type DestinationDetailItem = DestinationDetailItemWithExternalBankingData | DestinationDetailItemWithExternalCryptoData;
457
+ interface Request {
458
+ wallet_id: string;
459
+ counterparty_account_id: string;
460
+ counterparty_destination_id: string;
461
+ }
462
+ type Response = DestinationDetailItem;
406
463
  }
407
464
  namespace Create {
408
- type Request = {
465
+ interface ExternalBankingData {
466
+ account_number: string;
467
+ routing_number: string;
468
+ bank_name: string;
469
+ note: string;
470
+ swift_bic: string;
471
+ }
472
+ interface Request {
473
+ wallet_id: string;
474
+ counterparty_account_id: string;
475
+ type: CounterpartyDestinationType;
476
+ nickname: string;
477
+ external_banking_data?: API.Counterparties.Destination.Detail.DestinationDetailItemExternalBankingData;
478
+ external_crypto_data?: Pick<API.Counterparties.Destination.Detail.DestinationDetailItemExternalCryptoData, 'currency_id' | 'address' | 'memo'>;
479
+ }
480
+ type Response = API.Counterparties.Destination.Detail.DestinationDetailItem;
481
+ }
482
+ namespace Delete {
483
+ interface Request {
409
484
  wallet_id: string;
410
485
  counterparty_account_id: string;
411
- } & operations['CounterpartyDestinationsController_create']['requestBody']['content']['application/json'];
412
- type Response = operations['CounterpartyDestinationsController_create']['responses']['200']['content']['application/json'];
486
+ counterparty_destination_id: string;
487
+ }
413
488
  }
414
489
  namespace Update {
415
- type Request = {
490
+ interface Request {
416
491
  wallet_id: string;
417
492
  counterparty_account_id: string;
418
493
  counterparty_destination_id: string;
419
- } & operations['CounterpartyDestinationsController_update']['requestBody']['content']['application/json'];
420
- type Response = operations['CounterpartyDestinationsController_update']['responses']['200']['content']['application/json'];
494
+ nickname: string;
495
+ }
496
+ type Response = API.Counterparties.Destination.Detail.DestinationDetailItemCommonFields;
421
497
  }
422
- namespace Delete {
423
- type Request = operations['CounterpartyDestinationsController_delete']['parameters']['path'];
424
- type Response = operations['CounterpartyDestinationsController_delete']['responses']['200']['content']['application/json'];
498
+ }
499
+ namespace GetById {
500
+ interface Request {
501
+ wallet_id: string;
502
+ counterparty_account_id: string;
503
+ }
504
+ type Response = Counterparty;
505
+ }
506
+ namespace List {
507
+ interface Request {
508
+ wallet_id: string;
509
+ offset?: number;
510
+ limit?: number;
511
+ sort_by?: 'created_at' | 'nickname' | 'type' | 'email' | 'phone';
512
+ sort_order?: SortingDirection;
513
+ filter?: {
514
+ type?: CounterpartyDestinationType;
515
+ nickname?: string;
516
+ created_at?: string;
517
+ search?: string;
518
+ };
519
+ }
520
+ type Response = {
521
+ total: number;
522
+ data: Counterparty[];
523
+ };
524
+ }
525
+ namespace Create {
526
+ type Request = Omit<Counterparty, 'id' | 'created_at'> & {
527
+ wallet_id: string;
528
+ };
529
+ type Response = Counterparty;
530
+ }
531
+ namespace Update {
532
+ type Request = Partial<Omit<Counterparty, 'id' | 'created_at'>> & {
533
+ wallet_id: string;
534
+ counterparty_account_id: string;
535
+ };
536
+ type Response = Counterparty;
537
+ }
538
+ namespace Delete {
539
+ interface Request {
540
+ wallet_id: string;
541
+ counterparty_account_id: string;
425
542
  }
543
+ type Response = Counterparty;
426
544
  }
427
545
  }
428
546
  namespace Currencies {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.32.3",
3
+ "version": "1.32.4",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",