squarefi-bff-api-module 1.18.0 → 1.18.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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.18.1] - 2025-05-20
9
+
10
+ ### Fixed
11
+
12
+ - Added return type annotations for various methods across multiple API modules
13
+
8
14
  ## [1.18.0] - 2025-05-19
9
15
 
10
16
  ### Added
@@ -626,3 +632,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
626
632
  - TypeScript support
627
633
  - Authentication methods
628
634
  - Core API endpoints support
635
+
636
+ ## [1.18.2] - 2025-05-21
637
+
638
+ ### Added
639
+
640
+ - Added entity retrieval functionality to KYC module with new endpoint and types
@@ -11,15 +11,15 @@ export declare const auth: {
11
11
  };
12
12
  signin: {
13
13
  omni: {
14
- email: (data: API.Auth.SignIn.Email.OTP.Request) => Promise<unknown>;
15
- phone: ({ phone, ...data }: API.Auth.SignIn.Phone.OTP.Request) => Promise<unknown>;
14
+ email: (data: API.Auth.SignIn.Email.OTP.Request) => Promise<API.Auth.Tokens>;
15
+ phone: ({ phone, ...data }: API.Auth.SignIn.Phone.OTP.Request) => Promise<API.Auth.Tokens>;
16
16
  };
17
17
  telegram: (data: API.Auth.Telegram.Signin) => Promise<API.Auth.Tokens>;
18
18
  password: (email: string, password: string) => Promise<API.Auth.Tokens>;
19
19
  };
20
20
  signup: {
21
21
  password: (email: string, password: string) => Promise<API.Auth.Tokens>;
22
- telegram: (data: API.Auth.Telegram.Signup) => Promise<unknown>;
22
+ telegram: (data: API.Auth.Telegram.Signup) => Promise<API.Auth.Tokens>;
23
23
  };
24
24
  refresh: {
25
25
  refresh_token: (refresh_token: string) => Promise<API.Auth.Tokens>;
@@ -1,14 +1,14 @@
1
1
  import { API } from './types/types';
2
2
  export declare const counterparties: {
3
3
  getAll: ({ wallet_id, ...params }: API.Counterparties.List.Request) => Promise<API.Counterparties.List.Response>;
4
- getById: ({ wallet_id, counterparty_account_id }: API.Counterparties.GetById.Request) => Promise<API.Counterparties.Counterparty>;
5
- create: ({ wallet_id, ...data }: API.Counterparties.Create.Request) => Promise<API.Counterparties.Counterparty>;
6
- update: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Update.Request) => Promise<API.Counterparties.Counterparty>;
4
+ getById: ({ wallet_id, counterparty_account_id, }: API.Counterparties.GetById.Request) => Promise<API.Counterparties.GetById.Response>;
5
+ create: ({ wallet_id, ...data }: API.Counterparties.Create.Request) => Promise<API.Counterparties.Create.Response>;
6
+ update: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Update.Request) => Promise<API.Counterparties.Update.Response>;
7
7
  destinations: {
8
8
  getAll: ({ wallet_id, counterparty_account_id, ...params }: API.Counterparties.Destination.List.Request) => Promise<API.Counterparties.Destination.List.Response>;
9
- getById: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }: API.Counterparties.Destination.Detail.Request) => Promise<API.Counterparties.Destination.Detail.DestinationDetailItem>;
10
- create: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Destination.Create.Request) => Promise<API.Counterparties.Destination.Detail.DestinationDetailItem>;
11
- update: ({ wallet_id, counterparty_account_id, counterparty_destination_id, ...data }: API.Counterparties.Destination.Update.Request) => Promise<API.Counterparties.Destination.List.DestinationListItemCommonFields>;
12
- delete: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }: API.Counterparties.Destination.Delete.Request) => Promise<any>;
9
+ getById: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }: API.Counterparties.Destination.Detail.Request) => Promise<API.Counterparties.Destination.Detail.Response>;
10
+ create: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Destination.Create.Request) => Promise<API.Counterparties.Destination.Create.Response>;
11
+ update: ({ wallet_id, counterparty_account_id, counterparty_destination_id, ...data }: API.Counterparties.Destination.Update.Request) => Promise<API.Counterparties.Destination.Update.Response>;
12
+ delete: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }: API.Counterparties.Destination.Delete.Request) => Promise<void>;
13
13
  };
14
14
  };
@@ -20,7 +20,7 @@ exports.counterparties = {
20
20
  params,
21
21
  });
22
22
  },
23
- getById: ({ wallet_id, counterparty_account_id }) => apiClientFactory_1.apiClientV2.getRequest(`/counterparties/${wallet_id}/${counterparty_account_id}`),
23
+ getById: ({ wallet_id, counterparty_account_id, }) => apiClientFactory_1.apiClientV2.getRequest(`/counterparties/${wallet_id}/${counterparty_account_id}`),
24
24
  create: (_a) => {
25
25
  var { wallet_id } = _a, data = __rest(_a, ["wallet_id"]);
26
26
  return apiClientFactory_1.apiClientV2.postRequest(`/counterparties/${wallet_id}`, { data });
@@ -4,7 +4,7 @@ export declare const developer: {
4
4
  getAll: () => Promise<API.Developer.ApiCode.ApiCode[]>;
5
5
  create: (data: API.Developer.ApiCode.Create.Request) => Promise<API.Developer.ApiCode.Create.Response>;
6
6
  rotate: (data: API.Developer.ApiCode.Rotate.Request) => Promise<API.Developer.ApiCode.Rotate.Response>;
7
- update: (data: API.Developer.ApiCode.Update.Request) => Promise<unknown>;
7
+ update: (data: API.Developer.ApiCode.Update.Request) => Promise<void>;
8
8
  };
9
9
  vendors: {
10
10
  list: () => Promise<API.Developer.Vendors.Vendor[]>;
@@ -3,10 +3,10 @@ export declare const issuing: {
3
3
  cards: {
4
4
  create: {
5
5
  standAloneCard: {
6
- prepaid: (data: API.Cards.Create.StandAloneRequest) => Promise<API.Cards.IssuingCardDetailItem>;
7
- balance: (data: API.Cards.Create.StandAloneRequest) => Promise<void>;
6
+ prepaid: (data: API.Cards.Create.StandAloneRequest) => Promise<API.Cards.Create.StandAloneResponse>;
7
+ balance: (data: API.Cards.Create.StandAloneRequest) => Promise<API.Cards.Create.SubAccountResponse>;
8
8
  };
9
- subAccountCard: (data: API.Cards.Create.SubAccountRequest) => Promise<API.Cards.IssuingCardDetailItem>;
9
+ subAccountCard: (data: API.Cards.Create.SubAccountRequest) => Promise<API.Cards.Create.SubAccountResponse>;
10
10
  };
11
11
  byWalletUuid: {
12
12
  getAll: (params: API.Cards.CardsList.Request.ByWalletUuid) => Promise<API.Cards.CardsList.Response>;
@@ -26,7 +26,7 @@ export declare const issuing: {
26
26
  };
27
27
  freeze: (card_id: string) => Promise<API.Cards.IssuingCardDetailItem>;
28
28
  unfreeze: (card_id: string) => Promise<API.Cards.IssuingCardDetailItem>;
29
- close: (card_id: string) => Promise<any>;
29
+ close: (card_id: string) => Promise<void>;
30
30
  limits: {
31
31
  update: (card_id: string, data: API.Cards.Limits.UpdateRequest) => Promise<API.Cards.IssuingCardDetailItem>;
32
32
  };
@@ -58,7 +58,7 @@ export declare const issuing: {
58
58
  };
59
59
  config: {
60
60
  programs: {
61
- getAll: () => Promise<API.Cards.Config.Program[]>;
61
+ getAll: () => Promise<API.Issuing.Programs.Response["data"]>;
62
62
  };
63
63
  };
64
64
  };
@@ -20,7 +20,7 @@ exports.issuing = {
20
20
  prepaid: (data) => apiClientFactory_1.apiClientV1.postRequest('/issuing/cards/create', { data }),
21
21
  balance: (data) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  const { id: sub_account_id } = yield exports.issuing.sub_accounts.create(data.wallet_id, data.program_id);
23
- apiClientFactory_1.apiClientV1.postRequest('/issuing/cards/balance', {
23
+ return apiClientFactory_1.apiClientV1.postRequest('/issuing/cards/balance', {
24
24
  data: Object.assign(Object.assign({}, data), { sub_account_id }),
25
25
  });
26
26
  }),
package/dist/api/kyc.d.ts CHANGED
@@ -3,13 +3,16 @@ export declare const kyc: {
3
3
  sumsub: {
4
4
  generate_token: (data: API.KYC.Sumsub.GenerateToken.Request) => Promise<API.KYC.Sumsub.GenerateToken.Response>;
5
5
  };
6
+ entity: {
7
+ get: ({ wallet_id }: API.KYC.Entity.Get.Request) => Promise<API.KYC.Entity.Get.Response>;
8
+ };
6
9
  rails: {
7
10
  info: {
8
11
  getAll: ({ wallet_id }: API.KYC.Rails.RailInfo.List.Request) => Promise<API.KYC.Rails.RailInfo.List.Response>;
9
- getSingle: ({ wallet_id, rail_id }: API.KYC.Rails.RailInfo.SingleRail.Request) => Promise<API.KYC.Rails.RailInfo.RailInfo>;
12
+ getSingle: ({ wallet_id, rail_id, }: API.KYC.Rails.RailInfo.SingleRail.Request) => Promise<API.KYC.Rails.RailInfo.SingleRail.Response>;
10
13
  };
11
14
  submit: {
12
- single: ({ wallet_id, rail_id }: API.KYC.Rails.Submit.Single.Request) => Promise<API.KYC.Rails.RailInfo.RailInfo>;
15
+ single: ({ wallet_id, rail_id, }: API.KYC.Rails.Submit.Single.Request) => Promise<API.KYC.Rails.Submit.Single.Response>;
13
16
  };
14
17
  };
15
18
  };
package/dist/api/kyc.js CHANGED
@@ -6,13 +6,16 @@ exports.kyc = {
6
6
  sumsub: {
7
7
  generate_token: (data) => apiClientFactory_1.apiClientV1.postRequest('/kyc/sumsub/generate_token', { data }),
8
8
  },
9
+ entity: {
10
+ get: ({ wallet_id }) => apiClientFactory_1.apiClientV2.getRequest(`/kyc/${wallet_id}/entity`),
11
+ },
9
12
  rails: {
10
13
  info: {
11
14
  getAll: ({ wallet_id }) => apiClientFactory_1.apiClientV2.getRequest(`/kyc/${wallet_id}/rails`),
12
- getSingle: ({ wallet_id, rail_id }) => apiClientFactory_1.apiClientV2.getRequest(`/kyc/${wallet_id}/rails/${rail_id}`),
15
+ getSingle: ({ wallet_id, rail_id, }) => apiClientFactory_1.apiClientV2.getRequest(`/kyc/${wallet_id}/rails/${rail_id}`),
13
16
  },
14
17
  submit: {
15
- single: ({ wallet_id, rail_id }) => apiClientFactory_1.apiClientV2.postRequest(`/kyc/${wallet_id}/rails/${rail_id}`),
18
+ single: ({ wallet_id, rail_id, }) => apiClientFactory_1.apiClientV2.postRequest(`/kyc/${wallet_id}/rails/${rail_id}`),
16
19
  },
17
20
  },
18
21
  };
@@ -9,7 +9,7 @@ export declare const orders: {
9
9
  WITHDRAWAL_CRYPTO: (data: API.Orders.Create.ByOrderType.WITHDRAWAL_CRYPTO.Request) => Promise<API.Orders.Create.ByOrderType.WITHDRAWAL_CRYPTO.Response>;
10
10
  TRANSFER_CARD_SUBACCOUNT: (data: API.Orders.Create.ByOrderType.TRANSFER_CARD_SUBACCOUNT.Request) => Promise<API.Orders.Create.ByOrderType.TRANSFER_CARD_SUBACCOUNT.Response>;
11
11
  TRANSFER_CARD_PREPAID: (data: API.Orders.Create.ByOrderType.TRANSFER_CARD_PREPAID.Request) => Promise<API.Orders.Create.ByOrderType.TRANSFER_CARD_PREPAID.Response>;
12
- TRANSFER_CARD_WHOLESALE: (data: API.Orders.Create.ByOrderType.TRANSFER_CARD_WHOLESALE.Request) => Promise<null>;
12
+ TRANSFER_CARD_WHOLESALE: (data: API.Orders.Create.ByOrderType.TRANSFER_CARD_WHOLESALE.Request) => Promise<API.Orders.Create.ByOrderType.TRANSFER_CARD_WHOLESALE.Response>;
13
13
  EXCHANGE_CRYPTO_INTERNAL: (data: API.Orders.Create.ByOrderType.EXCHANGE_CRYPTO_INTERNAL.Request) => Promise<API.Orders.Create.ByOrderType.EXCHANGE_CRYPTO_INTERNAL.Response>;
14
14
  HIFI_WIRE_ONRAMP: (data: API.Orders.Create.ByOrderType.HIFI_WIRE_ONRAMP.Request) => Promise<API.Orders.Create.ByOrderType.HIFI_WIRE_ONRAMP.Response>;
15
15
  HIFI_ACH_ONRAMP: (data: API.Orders.Create.ByOrderType.HIFI_ACH_ONRAMP.Request) => Promise<API.Orders.Create.ByOrderType.HIFI_ACH_ONRAMP.Response>;
@@ -1,9 +1,6 @@
1
1
  import { API } from './types/types';
2
2
  export declare const persona: {
3
3
  inquiries: {
4
- init: ({ wallet_id, type }: API.Persona.Inquiries.Init.Request) => Promise<{
5
- referenceId: string;
6
- templateId: string;
7
- }>;
4
+ init: ({ wallet_id, type }: API.Persona.Inquiries.Init.Request) => Promise<API.Persona.Inquiries.Init.Response>;
8
5
  };
9
6
  };
@@ -1,6 +1,6 @@
1
1
  import { APIKeyRole, CardFormFactor, CardTransactionType, CardType, CounterpartyDestinationType, CounterpartyType, CurrencyType, IssuingProgramStatus, KYCStatuses, OrderStatuses, OrderType, SortingDirection, SubAccountType, WalletTransactionMethod, WalletTransactionRecordType, WalletTransactionStatus, WalletTransactionType } from '../../constants';
2
2
  import { WalletType } from '../..';
3
- import { operations } from './autogen/apiV2.types';
3
+ import { components, operations } from './autogen/apiV2.types';
4
4
  export declare namespace API {
5
5
  namespace Auth {
6
6
  namespace Telegram {
@@ -845,6 +845,13 @@ export declare namespace API {
845
845
  }
846
846
  }
847
847
  }
848
+ namespace Entity {
849
+ type Entity = components['schemas']['KycEntityDto'];
850
+ namespace Get {
851
+ type Request = operations['KycEntitiesController_findOne']['parameters']['path'];
852
+ type Response = operations['KycEntitiesController_findOne']['responses']['200']['content']['application/json'];
853
+ }
854
+ }
848
855
  namespace Forms {
849
856
  namespace FormField {
850
857
  type FormFieldType = 'text' | 'email' | 'password' | 'radio' | 'select' | 'checkbox' | 'textarea' | 'number' | 'date' | 'switch' | 'file';
@@ -3,16 +3,16 @@ export declare const user: {
3
3
  get: () => Promise<API.User.User>;
4
4
  userData: {
5
5
  get: () => Promise<API.User.UserData.UserData>;
6
- update: (data: API.User.UserData.UpdateUserData.Request) => Promise<API.User.UserData.UserData>;
6
+ update: (data: API.User.UserData.UpdateUserData.Request) => Promise<API.User.UserData.UpdateUserData.Response>;
7
7
  };
8
8
  update: {
9
9
  phone: {
10
- request: (data: API.User.UpdateUser.Phone.RequestOTP.Request) => Promise<unknown>;
11
- confirm: (data: API.User.UpdateUser.Phone.Confirm.Request) => Promise<unknown>;
10
+ request: (data: API.User.UpdateUser.Phone.RequestOTP.Request) => Promise<void>;
11
+ confirm: (data: API.User.UpdateUser.Phone.Confirm.Request) => Promise<void>;
12
12
  };
13
13
  email: {
14
- request: (data: API.User.UpdateUser.Email.RequestOTP.Request) => Promise<unknown>;
15
- confirm: (data: API.User.UpdateUser.Email.Confirm.Request) => Promise<unknown>;
14
+ request: (data: API.User.UpdateUser.Email.RequestOTP.Request) => Promise<void>;
15
+ confirm: (data: API.User.UpdateUser.Email.Confirm.Request) => Promise<void>;
16
16
  };
17
17
  };
18
18
  };
@@ -1,11 +1,11 @@
1
1
  import { API } from './types/types';
2
2
  import { WalletTypeValues } from '../constants';
3
3
  export declare const wallets: {
4
- create: (type: WalletTypeValues) => Promise<unknown>;
4
+ create: (type: WalletTypeValues) => Promise<void>;
5
5
  getAll: () => Promise<API.Wallets.WalletsList.Response>;
6
6
  getByUuid: (uuid: string) => Promise<API.Wallets.Wallet>;
7
7
  addresses: {
8
- create: ({ wallet_uuid, chain, label }: API.Wallets.WalletChain.Create.Request) => Promise<API.Wallets.WalletChain.WalletChain>;
8
+ create: (data: API.Wallets.WalletChain.Create.Request) => Promise<API.Wallets.WalletChain.Create.Response>;
9
9
  get: {
10
10
  byWalletUuid: {
11
11
  byChainId: (wallet_uuid: string, chain_id: number) => Promise<API.Wallets.WalletChain.WalletChain>;
@@ -14,8 +14,8 @@ export declare const wallets: {
14
14
  };
15
15
  transactions: {
16
16
  byWalletUuid: {
17
- getAll: ({ wallet_uuid, limit, offset, ...params }: API.Wallets.WalletTransactions.TransactionList.Request) => Promise<API.Wallets.WalletTransactions.TransactionList.Response>;
18
- getByUuid: ({ wallet_uuid, uuid }: API.Wallets.WalletTransactions.GetByUuid.Request) => Promise<API.Wallets.WalletTransactions.DetailedTransaction>;
17
+ getAll: (data: API.Wallets.WalletTransactions.TransactionList.Request) => Promise<API.Wallets.WalletTransactions.TransactionList.Response>;
18
+ getByUuid: ({ wallet_uuid, uuid, }: API.Wallets.WalletTransactions.GetByUuid.Request) => Promise<API.Wallets.WalletTransactions.DetailedTransaction>;
19
19
  };
20
20
  csv: {
21
21
  getByWalletUuid: (wallet_uuid: string) => Promise<string>;
@@ -28,9 +28,10 @@ exports.wallets = {
28
28
  getAll: () => apiClientFactory_1.apiClientV2.getRequest('/wallets'),
29
29
  getByUuid: (uuid) => apiClientFactory_1.apiClientV2.getRequest(`/wallets/${uuid}`),
30
30
  addresses: {
31
- create: ({ wallet_uuid, chain, label }) => apiClientFactory_1.apiClientV2.postRequest(`/wallets/${wallet_uuid}/addresses/${chain}`, {
32
- data: { label },
33
- }),
31
+ create: (data) => {
32
+ const { wallet_uuid, chain, label } = data;
33
+ return apiClientFactory_1.apiClientV2.postRequest(`/wallets/${wallet_uuid}/addresses/${chain}`, { data: { label } });
34
+ },
34
35
  get: {
35
36
  byWalletUuid: {
36
37
  byChainId: (wallet_uuid, chain_id) => apiClientFactory_1.apiClientV2.getRequest(`/wallets/${wallet_uuid}/addresses/${chain_id}`),
@@ -39,13 +40,11 @@ exports.wallets = {
39
40
  },
40
41
  transactions: {
41
42
  byWalletUuid: {
42
- getAll: (_a) => __awaiter(void 0, void 0, void 0, function* () {
43
- var { wallet_uuid, limit = constants_1.defaultPaginationParams.limit, offset = constants_1.defaultPaginationParams.offset } = _a, params = __rest(_a, ["wallet_uuid", "limit", "offset"]);
44
- return apiClientFactory_1.apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions`, {
45
- params: Object.assign({ limit, offset }, params),
46
- });
43
+ getAll: (data) => __awaiter(void 0, void 0, void 0, function* () {
44
+ const { wallet_uuid, limit = constants_1.defaultPaginationParams.limit, offset = constants_1.defaultPaginationParams.offset } = data, params = __rest(data, ["wallet_uuid", "limit", "offset"]);
45
+ return apiClientFactory_1.apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions`, { params: Object.assign({ limit, offset }, params) });
47
46
  }),
48
- getByUuid: ({ wallet_uuid, uuid }) => apiClientFactory_1.apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions/${uuid}`),
47
+ getByUuid: ({ wallet_uuid, uuid, }) => apiClientFactory_1.apiClientV2.getRequest(`/wallets/${wallet_uuid}/transactions/${uuid}`),
49
48
  },
50
49
  csv: {
51
50
  getByWalletUuid: (wallet_uuid) => apiClientFactory_1.apiClientV1.getRequest(`/wallets/transactions/${wallet_uuid}/csv`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.18.0",
3
+ "version": "1.18.2",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/api/auth.ts CHANGED
@@ -12,11 +12,11 @@ export const refreshTokenPath = '/auth/refresh/refresh-token';
12
12
  export const auth = {
13
13
  otp: {
14
14
  verify: {
15
- email: (email: string, token: string) =>
15
+ email: (email: string, token: string): Promise<API.Auth.VerifyOtp.Response> =>
16
16
  apiClientV2.postRequest<API.Auth.VerifyOtp.Response>('/auth/verify/email/otp', {
17
17
  data: { email, token, type: 'email' },
18
18
  }),
19
- phone: (phone: string, token: string) =>
19
+ phone: (phone: string, token: string): Promise<API.Auth.VerifyOtp.Response> =>
20
20
  apiClientV2.postRequest<API.Auth.VerifyOtp.Response>('/auth/verify/phone/otp', {
21
21
  data: { phone: convertPhoneToSupabaseFormat(phone), token, type: 'sms' },
22
22
  }),
@@ -24,32 +24,33 @@ export const auth = {
24
24
  },
25
25
  signin: {
26
26
  omni: {
27
- email: (data: API.Auth.SignIn.Email.OTP.Request) =>
28
- apiClientV2.postRequest('/auth/sign-in/omni/email/otp', { data }),
29
- phone: ({ phone, ...data }: API.Auth.SignIn.Phone.OTP.Request) =>
30
- apiClientV2.postRequest('/auth/sign-in/omni/phone/otp', {
27
+ email: (data: API.Auth.SignIn.Email.OTP.Request): Promise<API.Auth.Tokens> =>
28
+ apiClientV2.postRequest<API.Auth.Tokens>('/auth/sign-in/omni/email/otp', { data }),
29
+ phone: ({ phone, ...data }: API.Auth.SignIn.Phone.OTP.Request): Promise<API.Auth.Tokens> =>
30
+ apiClientV2.postRequest<API.Auth.Tokens>('/auth/sign-in/omni/phone/otp', {
31
31
  data: { phone: convertPhoneToSupabaseFormat(phone), ...data },
32
32
  }),
33
33
  },
34
- telegram: (data: API.Auth.Telegram.Signin) =>
34
+ telegram: (data: API.Auth.Telegram.Signin): Promise<API.Auth.Tokens> =>
35
35
  apiClientV2.postRequest<API.Auth.Tokens>(telegramSignInPath, { data }),
36
36
  password: (
37
37
  email: string,
38
38
  password: string // check on backend V2
39
- ) =>
39
+ ): Promise<API.Auth.Tokens> =>
40
40
  apiClientV2.postRequest<API.Auth.Tokens>('/auth/sign-in/password/email', {
41
41
  data: { email, password },
42
42
  }),
43
43
  },
44
44
  signup: {
45
- password: (email: string, password: string) =>
45
+ password: (email: string, password: string): Promise<API.Auth.Tokens> =>
46
46
  apiClientV2.postRequest<API.Auth.Tokens>('/auth/sign-up/password/email', {
47
47
  data: { email, password },
48
48
  }),
49
- telegram: (data: API.Auth.Telegram.Signup) => apiClientV2.postRequest(telegramSignUpPath, { data }),
49
+ telegram: (data: API.Auth.Telegram.Signup): Promise<API.Auth.Tokens> =>
50
+ apiClientV2.postRequest<API.Auth.Tokens>(telegramSignUpPath, { data }),
50
51
  },
51
52
  refresh: {
52
- refresh_token: (refresh_token: string) =>
53
+ refresh_token: (refresh_token: string): Promise<API.Auth.Tokens> =>
53
54
  apiClientV2.postRequest<API.Auth.Tokens>(refreshTokenPath, { data: { refresh_token } }),
54
55
  },
55
56
  };
@@ -2,23 +2,34 @@ import { apiClientV2 } from '../utils/apiClientFactory';
2
2
  import { API } from './types/types';
3
3
 
4
4
  export const counterparties = {
5
- getAll: ({ wallet_id, ...params }: API.Counterparties.List.Request) =>
5
+ getAll: ({ wallet_id, ...params }: API.Counterparties.List.Request): Promise<API.Counterparties.List.Response> =>
6
6
  apiClientV2.getRequest<API.Counterparties.List.Response>(`/counterparties/${wallet_id}`, {
7
7
  params,
8
8
  }),
9
- getById: ({ wallet_id, counterparty_account_id }: API.Counterparties.GetById.Request) =>
9
+ getById: ({
10
+ wallet_id,
11
+ counterparty_account_id,
12
+ }: API.Counterparties.GetById.Request): Promise<API.Counterparties.GetById.Response> =>
10
13
  apiClientV2.getRequest<API.Counterparties.GetById.Response>(
11
14
  `/counterparties/${wallet_id}/${counterparty_account_id}`
12
15
  ),
13
- create: ({ wallet_id, ...data }: API.Counterparties.Create.Request) =>
16
+ create: ({ wallet_id, ...data }: API.Counterparties.Create.Request): Promise<API.Counterparties.Create.Response> =>
14
17
  apiClientV2.postRequest<API.Counterparties.Create.Response>(`/counterparties/${wallet_id}`, { data }),
15
- update: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Update.Request) =>
18
+ update: ({
19
+ wallet_id,
20
+ counterparty_account_id,
21
+ ...data
22
+ }: API.Counterparties.Update.Request): Promise<API.Counterparties.Update.Response> =>
16
23
  apiClientV2.patchRequest<API.Counterparties.Update.Response>(
17
24
  `/counterparties/${wallet_id}/${counterparty_account_id}`,
18
25
  { data }
19
26
  ),
20
27
  destinations: {
21
- getAll: ({ wallet_id, counterparty_account_id, ...params }: API.Counterparties.Destination.List.Request) =>
28
+ getAll: ({
29
+ wallet_id,
30
+ counterparty_account_id,
31
+ ...params
32
+ }: API.Counterparties.Destination.List.Request): Promise<API.Counterparties.Destination.List.Response> =>
22
33
  apiClientV2.getRequest<API.Counterparties.Destination.List.Response>(
23
34
  `/counterparties/${wallet_id}/${counterparty_account_id}/destinations`,
24
35
  { params }
@@ -27,11 +38,15 @@ export const counterparties = {
27
38
  wallet_id,
28
39
  counterparty_account_id,
29
40
  counterparty_destination_id,
30
- }: API.Counterparties.Destination.Detail.Request) =>
41
+ }: API.Counterparties.Destination.Detail.Request): Promise<API.Counterparties.Destination.Detail.Response> =>
31
42
  apiClientV2.getRequest<API.Counterparties.Destination.Detail.Response>(
32
43
  `/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`
33
44
  ),
34
- create: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Destination.Create.Request) =>
45
+ create: ({
46
+ wallet_id,
47
+ counterparty_account_id,
48
+ ...data
49
+ }: API.Counterparties.Destination.Create.Request): Promise<API.Counterparties.Destination.Create.Response> =>
35
50
  apiClientV2.postRequest<API.Counterparties.Destination.Create.Response>(
36
51
  `/counterparties/${wallet_id}/${counterparty_account_id}/destinations`,
37
52
  { data }
@@ -41,7 +56,7 @@ export const counterparties = {
41
56
  counterparty_account_id,
42
57
  counterparty_destination_id,
43
58
  ...data
44
- }: API.Counterparties.Destination.Update.Request) =>
59
+ }: API.Counterparties.Destination.Update.Request): Promise<API.Counterparties.Destination.Update.Response> =>
45
60
  apiClientV2.patchRequest<API.Counterparties.Destination.Update.Response>(
46
61
  `/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`,
47
62
  { data }
@@ -50,7 +65,7 @@ export const counterparties = {
50
65
  wallet_id,
51
66
  counterparty_account_id,
52
67
  counterparty_destination_id,
53
- }: API.Counterparties.Destination.Delete.Request) =>
68
+ }: API.Counterparties.Destination.Delete.Request): Promise<void> =>
54
69
  apiClientV2.deleteRequest(
55
70
  `/counterparties/${wallet_id}/${counterparty_account_id}/destinations/${counterparty_destination_id}`
56
71
  ),
@@ -4,15 +4,17 @@ import { apiClientV1 } from '../utils/apiClientFactory';
4
4
 
5
5
  export const developer = {
6
6
  apiKeys: {
7
- getAll: () => apiClientV1.getRequest<API.Developer.ApiCode.ApiCode[]>('/developer/access/list'),
8
- create: (data: API.Developer.ApiCode.Create.Request) =>
7
+ getAll: (): Promise<API.Developer.ApiCode.ApiCode[]> =>
8
+ apiClientV1.getRequest<API.Developer.ApiCode.ApiCode[]>('/developer/access/list'),
9
+ create: (data: API.Developer.ApiCode.Create.Request): Promise<API.Developer.ApiCode.Create.Response> =>
9
10
  apiClientV1.postRequest<API.Developer.ApiCode.Create.Response>('/developer/access/create', { data }),
10
- rotate: (data: API.Developer.ApiCode.Rotate.Request) =>
11
+ rotate: (data: API.Developer.ApiCode.Rotate.Request): Promise<API.Developer.ApiCode.Rotate.Response> =>
11
12
  apiClientV1.postRequest<API.Developer.ApiCode.Rotate.Response>(`/developer/access/rotate`, { data }),
12
- update: (data: API.Developer.ApiCode.Update.Request) =>
13
+ update: (data: API.Developer.ApiCode.Update.Request): Promise<void> =>
13
14
  apiClientV1.postRequest(`/developer/access/update`, { data }),
14
15
  },
15
16
  vendors: {
16
- list: () => apiClientV1.getRequest<API.Developer.Vendors.Vendor[]>('/developer/vendors/list'),
17
+ list: (): Promise<API.Developer.Vendors.Vendor[]> =>
18
+ apiClientV1.getRequest<API.Developer.Vendors.Vendor[]>('/developer/vendors/list'),
17
19
  },
18
20
  };
@@ -16,12 +16,12 @@ type IExchangeModule = {
16
16
  };
17
17
  };
18
18
 
19
- const createOrderTypeMethods = (orderType: OrderType) => ({
20
- getByFromCurrency: (from_uuid: string) =>
19
+ const createOrderTypeMethods = (orderType: OrderType): IExchangeByOrderType => ({
20
+ getByFromCurrency: (from_uuid: string): Promise<API.Exchange.Exchange[]> =>
21
21
  apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', { params: { from_uuid, order_type: orderType } }),
22
- getByToCurrency: (to_uuid: string) =>
22
+ getByToCurrency: (to_uuid: string): Promise<API.Exchange.Exchange[]> =>
23
23
  apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', { params: { to_uuid, order_type: orderType } }),
24
- getByOrderType: () =>
24
+ getByOrderType: (): Promise<API.Exchange.Exchange[]> =>
25
25
  apiClientV1.getRequest<API.Exchange.Exchange[]>('/exchange/', { params: { order_type: orderType } }),
26
26
  });
27
27
 
@@ -2,16 +2,17 @@ import { API } from './types/types';
2
2
  import { apiClientV1 } from '../utils/apiClientFactory';
3
3
  import { defaultPaginationParams } from '../constants';
4
4
  import { makeSecureRequest } from '../utils/encrypt';
5
+
5
6
  export const issuing = {
6
7
  cards: {
7
8
  create: {
8
9
  standAloneCard: {
9
- prepaid: (data: API.Cards.Create.StandAloneRequest) =>
10
+ prepaid: (data: API.Cards.Create.StandAloneRequest): Promise<API.Cards.Create.StandAloneResponse> =>
10
11
  apiClientV1.postRequest<API.Cards.Create.StandAloneResponse>('/issuing/cards/create', { data }),
11
- balance: async (data: API.Cards.Create.StandAloneRequest) => {
12
+ balance: async (data: API.Cards.Create.StandAloneRequest): Promise<API.Cards.Create.SubAccountResponse> => {
12
13
  const { id: sub_account_id } = await issuing.sub_accounts.create(data.wallet_id, data.program_id);
13
14
 
14
- apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>('/issuing/cards/balance', {
15
+ return apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>('/issuing/cards/balance', {
15
16
  data: {
16
17
  ...data,
17
18
  sub_account_id,
@@ -19,17 +20,21 @@ export const issuing = {
19
20
  });
20
21
  },
21
22
  },
22
- subAccountCard: (data: API.Cards.Create.SubAccountRequest) =>
23
+ subAccountCard: (data: API.Cards.Create.SubAccountRequest): Promise<API.Cards.Create.SubAccountResponse> =>
23
24
  apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>('/issuing/cards/balance', { data }),
24
25
  },
25
26
  byWalletUuid: {
26
- getAll: (params: API.Cards.CardsList.Request.ByWalletUuid) =>
27
+ getAll: (params: API.Cards.CardsList.Request.ByWalletUuid): Promise<API.Cards.CardsList.Response> =>
27
28
  apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', { params }),
28
- getBySubaccountType: (params: API.Cards.CardsList.Request.BySubaccountAndWalletUuid) =>
29
+ getBySubaccountType: (
30
+ params: API.Cards.CardsList.Request.BySubaccountAndWalletUuid
31
+ ): Promise<API.Cards.CardsList.Response> =>
29
32
  apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', {
30
33
  params,
31
34
  }),
32
- getBySubAccount: (params: API.Cards.CardsList.Request.BySubAccountAndWalletId) =>
35
+ getBySubAccount: (
36
+ params: API.Cards.CardsList.Request.BySubAccountAndWalletId
37
+ ): Promise<API.Cards.CardsList.Response> =>
33
38
  apiClientV1.getRequest<API.Cards.CardsList.Response>('/issuing/cards', { params }),
34
39
  },
35
40
  // getById: (card_id: string) => apiClientV1.getRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}`),
@@ -44,7 +49,7 @@ export const issuing = {
44
49
  secretKey: {
45
50
  get: async (card_id: string): Promise<API.Cards.SensitiveData> => {
46
51
  const serverPublicKeyEnv = process.env.SERVER_PUBLIC_KEY_BASE64;
47
- const callback = (props: API.Common.Encrypted.Request) =>
52
+ const callback = (props: API.Common.Encrypted.Request): Promise<API.Common.Encrypted.Response> =>
48
53
  apiClientV1.postRequest<API.Common.Encrypted.Response>(`/issuing/cards/${card_id}/sensitive/secretkey`, {
49
54
  data: props,
50
55
  });
@@ -64,25 +69,30 @@ export const issuing = {
64
69
  },
65
70
  otp: {
66
71
  // have to update
67
- get: (card_id: string) => apiClientV1.getRequest<API.Cards.OTP>(`/vcards/cards/${card_id}/sensitive/otp`),
72
+ get: (card_id: string): Promise<API.Cards.OTP> =>
73
+ apiClientV1.getRequest<API.Cards.OTP>(`/vcards/cards/${card_id}/sensitive/otp`),
68
74
  },
69
75
  },
70
- freeze: (card_id: string) =>
76
+ freeze: (card_id: string): Promise<API.Cards.IssuingCardDetailItem> =>
71
77
  apiClientV1.patchRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}/freeze`),
72
- unfreeze: (card_id: string) =>
78
+ unfreeze: (card_id: string): Promise<API.Cards.IssuingCardDetailItem> =>
73
79
  apiClientV1.patchRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}/unfreeze`),
74
- close: (card_id: string) => apiClientV1.deleteRequest(`/issuing/cards/${card_id}`),
80
+ close: (card_id: string): Promise<void> => apiClientV1.deleteRequest(`/issuing/cards/${card_id}`),
75
81
  limits: {
76
- update: (card_id: string, data: API.Cards.Limits.UpdateRequest) =>
82
+ update: (card_id: string, data: API.Cards.Limits.UpdateRequest): Promise<API.Cards.IssuingCardDetailItem> =>
77
83
  apiClientV1.patchRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}/limits`, { data }),
78
84
  },
79
- rename: (card_id: string, nick_name: string) =>
85
+ rename: (card_id: string, nick_name: string): Promise<API.Cards.IssuingCardDetailItem> =>
80
86
  apiClientV1.patchRequest<API.Cards.IssuingCardDetailItem>(`/issuing/cards/${card_id}/update`, {
81
87
  data: { nick_name, request_id: crypto.randomUUID() },
82
88
  }),
83
89
  },
84
90
  transactions: {
85
- getByCardId: (card_id: string, limit = defaultPaginationParams.limit, offset = defaultPaginationParams.offset) =>
91
+ getByCardId: (
92
+ card_id: string,
93
+ limit = defaultPaginationParams.limit,
94
+ offset = defaultPaginationParams.offset
95
+ ): Promise<API.Cards.TransactionsList> =>
86
96
  apiClientV1.getRequest<API.Cards.TransactionsList>(`/issuing/transactions/`, {
87
97
  params: { limit, offset, card_id, new_scheme: true },
88
98
  }),
@@ -90,30 +100,38 @@ export const issuing = {
90
100
  fiat_account_id: string,
91
101
  limit = defaultPaginationParams.limit,
92
102
  offset = defaultPaginationParams.offset
93
- ) =>
103
+ ): Promise<API.Cards.TransactionsList> =>
94
104
  apiClientV1.getRequest<API.Cards.TransactionsList>(`/issuing/transactions/`, {
95
105
  params: { limit, offset, fiat_account_id, new_scheme: true },
96
106
  }),
97
107
  csv: {
98
- getByCardId: (card_id: string) =>
108
+ getByCardId: (card_id: string): Promise<string> =>
99
109
  apiClientV1.getRequest<string>(`/issuing/transactions/csv`, {
100
110
  params: { card_id },
101
111
  }),
102
- getBySubAccountId: (sub_account_id: string) =>
112
+ getBySubAccountId: (sub_account_id: string): Promise<string> =>
103
113
  apiClientV1.getRequest<string>(`/issuing/sub_account/${sub_account_id}/transactions/csv`),
104
114
  },
105
115
  },
106
116
  sub_accounts: {
107
117
  list: {
108
118
  withCards: {
109
- getSinglecards: (wallet_uuid: string, limit: number, offset: number) =>
119
+ getSinglecards: (
120
+ wallet_uuid: string,
121
+ limit: number,
122
+ offset: number
123
+ ): Promise<API.Issuing.SubAccounts.WithCards.Response> =>
110
124
  apiClientV1.getRequest<API.Issuing.SubAccounts.WithCards.Response>(
111
125
  `/issuing/sub_account/list/${wallet_uuid}`,
112
126
  {
113
127
  params: { limit, offset, lt_cards_limit: 2, gt_cards_limit: 0, show_cards: true, pagination: true },
114
128
  }
115
129
  ),
116
- getAll: (wallet_uuid: string, limit: number, offset: number) =>
130
+ getAll: (
131
+ wallet_uuid: string,
132
+ limit: number,
133
+ offset: number
134
+ ): Promise<API.Issuing.SubAccounts.WithCards.Response> =>
117
135
  apiClientV1.getRequest<API.Issuing.SubAccounts.WithCards.Response>(
118
136
  `/issuing/sub_account/list/${wallet_uuid}`,
119
137
  {
@@ -122,7 +140,11 @@ export const issuing = {
122
140
  ),
123
141
  },
124
142
  withoutCards: {
125
- getAll: (wallet_uuid: string, limit: number, offset: number) =>
143
+ getAll: (
144
+ wallet_uuid: string,
145
+ limit: number,
146
+ offset: number
147
+ ): Promise<API.Issuing.SubAccounts.WithoutCards.Response> =>
126
148
  apiClientV1.getRequest<API.Issuing.SubAccounts.WithoutCards.Response>(
127
149
  `/issuing/sub_account/list/${wallet_uuid}`,
128
150
  {
@@ -132,14 +154,18 @@ export const issuing = {
132
154
  },
133
155
  },
134
156
 
135
- getByUuid: (uuid: string) =>
157
+ getByUuid: (uuid: string): Promise<API.Issuing.SubAccounts.SubAccount> =>
136
158
  apiClientV1.getRequest<API.Issuing.SubAccounts.SubAccount>(`/issuing/sub_account/${uuid}`),
137
- create: (wallet_id: string, program_id: string) =>
159
+ create: (wallet_id: string, program_id: string): Promise<API.Issuing.SubAccounts.SubAccount> =>
138
160
  apiClientV1.postRequest<API.Issuing.SubAccounts.SubAccount>(`/issuing/sub_account`, {
139
161
  data: { wallet_id, program_id },
140
162
  }),
141
163
  transactions: {
142
- get: (sub_account_id: string, limit?: number, offset?: number) =>
164
+ get: (
165
+ sub_account_id: string,
166
+ limit?: number,
167
+ offset?: number
168
+ ): Promise<API.Issuing.SubAccounts.TransactionList> =>
143
169
  apiClientV1.getRequest<API.Issuing.SubAccounts.TransactionList>(
144
170
  `/issuing/sub_account/${sub_account_id}/transactions`,
145
171
  {
@@ -150,7 +176,7 @@ export const issuing = {
150
176
  },
151
177
  config: {
152
178
  programs: {
153
- getAll: () =>
179
+ getAll: (): Promise<API.Issuing.Programs.Response['data']> =>
154
180
  apiClientV1.getRequest<API.Issuing.Programs.Response>('/issuing/config/programs').then(({ data }) => data),
155
181
  },
156
182
  },
package/src/api/kyc.ts CHANGED
@@ -4,18 +4,28 @@ import { apiClientV1, apiClientV2 } from '../utils/apiClientFactory';
4
4
 
5
5
  export const kyc = {
6
6
  sumsub: {
7
- generate_token: (data: API.KYC.Sumsub.GenerateToken.Request) =>
7
+ generate_token: (data: API.KYC.Sumsub.GenerateToken.Request): Promise<API.KYC.Sumsub.GenerateToken.Response> =>
8
8
  apiClientV1.postRequest<API.KYC.Sumsub.GenerateToken.Response>('/kyc/sumsub/generate_token', { data }),
9
9
  },
10
+ entity: {
11
+ get: ({ wallet_id }: API.KYC.Entity.Get.Request): Promise<API.KYC.Entity.Get.Response> =>
12
+ apiClientV2.getRequest<API.KYC.Entity.Get.Response>(`/kyc/${wallet_id}/entity`),
13
+ },
10
14
  rails: {
11
15
  info: {
12
- getAll: ({ wallet_id }: API.KYC.Rails.RailInfo.List.Request) =>
16
+ getAll: ({ wallet_id }: API.KYC.Rails.RailInfo.List.Request): Promise<API.KYC.Rails.RailInfo.List.Response> =>
13
17
  apiClientV2.getRequest<API.KYC.Rails.RailInfo.List.Response>(`/kyc/${wallet_id}/rails`),
14
- getSingle: ({ wallet_id, rail_id }: API.KYC.Rails.RailInfo.SingleRail.Request) =>
18
+ getSingle: ({
19
+ wallet_id,
20
+ rail_id,
21
+ }: API.KYC.Rails.RailInfo.SingleRail.Request): Promise<API.KYC.Rails.RailInfo.SingleRail.Response> =>
15
22
  apiClientV2.getRequest<API.KYC.Rails.RailInfo.SingleRail.Response>(`/kyc/${wallet_id}/rails/${rail_id}`),
16
23
  },
17
24
  submit: {
18
- single: ({ wallet_id, rail_id }: API.KYC.Rails.Submit.Single.Request) =>
25
+ single: ({
26
+ wallet_id,
27
+ rail_id,
28
+ }: API.KYC.Rails.Submit.Single.Request): Promise<API.KYC.Rails.Submit.Single.Response> =>
19
29
  apiClientV2.postRequest<API.KYC.Rails.Submit.Single.Response>(`/kyc/${wallet_id}/rails/${rail_id}`),
20
30
  },
21
31
  },
package/src/api/list.ts CHANGED
@@ -8,14 +8,15 @@ import { apiClientV2 } from '../utils/apiClientFactory';
8
8
 
9
9
  export const list = {
10
10
  currencies: {
11
- getAll: (params?: AxiosRequestConfig) =>
11
+ getAll: (params?: AxiosRequestConfig): Promise<API.Currencies.CurrencyList> =>
12
12
  apiClientV2.getRequest<API.Currencies.CurrencyList>('/system/currencies', params),
13
13
  },
14
14
  chains: {
15
- getAll: (params?: AxiosRequestConfig) => apiClientV2.getRequest<API.Chains.ChainList>('/system/chains', params),
15
+ getAll: (params?: AxiosRequestConfig): Promise<API.Chains.ChainList> =>
16
+ apiClientV2.getRequest<API.Chains.ChainList>('/system/chains', params),
16
17
  },
17
18
  countries: {
18
- getAll: (params?: AxiosRequestConfig) =>
19
+ getAll: (params?: AxiosRequestConfig): Promise<API.Location.Countries.List.Response> =>
19
20
  apiClientV2.getRequest<API.Location.Countries.List.Response>('/system/countries', params),
20
21
  },
21
22
  };
package/src/api/orders.ts CHANGED
@@ -5,24 +5,30 @@ import { apiClientV1 } from '../utils/apiClientFactory';
5
5
  import { OrderType } from '../constants';
6
6
 
7
7
  export const orders = {
8
- calc: ({ signal, ...params }: API.Orders.Calc.Request) =>
8
+ calc: ({ signal, ...params }: API.Orders.Calc.Request): Promise<API.Orders.Calc.Response> =>
9
9
  apiClientV1.getRequest<API.Orders.Calc.Response>('/orders/calc', { params, signal }),
10
10
 
11
- orderTypes: () => apiClientV1.getRequest<OrderType[]>('/orders/order_types'),
11
+ orderTypes: (): Promise<OrderType[]> => apiClientV1.getRequest<OrderType[]>('/orders/order_types'),
12
12
 
13
13
  create: {
14
14
  byOrderType: {
15
- [OrderType.INTERNAL_TRANSFER]: (data: API.Orders.Create.ByOrderType.INTERNAL_TRANSFER.Request) =>
15
+ [OrderType.INTERNAL_TRANSFER]: (
16
+ data: API.Orders.Create.ByOrderType.INTERNAL_TRANSFER.Request
17
+ ): Promise<API.Orders.Create.ByOrderType.INTERNAL_TRANSFER.Response> =>
16
18
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.INTERNAL_TRANSFER.Response>('/orders/INTERNAL_TRANSFER', {
17
19
  data,
18
20
  }),
19
21
 
20
- [OrderType.WITHDRAWAL_CRYPTO]: (data: API.Orders.Create.ByOrderType.WITHDRAWAL_CRYPTO.Request) =>
22
+ [OrderType.WITHDRAWAL_CRYPTO]: (
23
+ data: API.Orders.Create.ByOrderType.WITHDRAWAL_CRYPTO.Request
24
+ ): Promise<API.Orders.Create.ByOrderType.WITHDRAWAL_CRYPTO.Response> =>
21
25
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.WITHDRAWAL_CRYPTO.Response>('/orders/WITHDRAWAL_CRYPTO', {
22
26
  data,
23
27
  }),
24
28
 
25
- [OrderType.TRANSFER_CARD_SUBACCOUNT]: (data: API.Orders.Create.ByOrderType.TRANSFER_CARD_SUBACCOUNT.Request) =>
29
+ [OrderType.TRANSFER_CARD_SUBACCOUNT]: (
30
+ data: API.Orders.Create.ByOrderType.TRANSFER_CARD_SUBACCOUNT.Request
31
+ ): Promise<API.Orders.Create.ByOrderType.TRANSFER_CARD_SUBACCOUNT.Response> =>
26
32
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.TRANSFER_CARD_SUBACCOUNT.Response>(
27
33
  '/orders/TRANSFER_CARD_SUBACCOUNT',
28
34
  {
@@ -30,7 +36,9 @@ export const orders = {
30
36
  }
31
37
  ),
32
38
 
33
- [OrderType.TRANSFER_CARD_PREPAID]: (data: API.Orders.Create.ByOrderType.TRANSFER_CARD_PREPAID.Request) =>
39
+ [OrderType.TRANSFER_CARD_PREPAID]: (
40
+ data: API.Orders.Create.ByOrderType.TRANSFER_CARD_PREPAID.Request
41
+ ): Promise<API.Orders.Create.ByOrderType.TRANSFER_CARD_PREPAID.Response> =>
34
42
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.TRANSFER_CARD_PREPAID.Response>(
35
43
  '/orders/TRANSFER_CARD_PREPAID',
36
44
  {
@@ -38,7 +46,9 @@ export const orders = {
38
46
  }
39
47
  ),
40
48
 
41
- [OrderType.TRANSFER_CARD_WHOLESALE]: (data: API.Orders.Create.ByOrderType.TRANSFER_CARD_WHOLESALE.Request) =>
49
+ [OrderType.TRANSFER_CARD_WHOLESALE]: (
50
+ data: API.Orders.Create.ByOrderType.TRANSFER_CARD_WHOLESALE.Request
51
+ ): Promise<API.Orders.Create.ByOrderType.TRANSFER_CARD_WHOLESALE.Response> =>
42
52
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.TRANSFER_CARD_WHOLESALE.Response>(
43
53
  '/orders/TRANSFER_CARD_WHOLESALE',
44
54
  {
@@ -46,43 +56,59 @@ export const orders = {
46
56
  }
47
57
  ),
48
58
 
49
- [OrderType.EXCHANGE_CRYPTO_INTERNAL]: (data: API.Orders.Create.ByOrderType.EXCHANGE_CRYPTO_INTERNAL.Request) =>
59
+ [OrderType.EXCHANGE_CRYPTO_INTERNAL]: (
60
+ data: API.Orders.Create.ByOrderType.EXCHANGE_CRYPTO_INTERNAL.Request
61
+ ): Promise<API.Orders.Create.ByOrderType.EXCHANGE_CRYPTO_INTERNAL.Response> =>
50
62
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.EXCHANGE_CRYPTO_INTERNAL.Response>(
51
63
  '/orders/EXCHANGE_CRYPTO_INTERNAL',
52
64
  { data }
53
65
  ),
54
66
 
55
- [OrderType.HIFI_WIRE_ONRAMP]: (data: API.Orders.Create.ByOrderType.HIFI_WIRE_ONRAMP.Request) =>
67
+ [OrderType.HIFI_WIRE_ONRAMP]: (
68
+ data: API.Orders.Create.ByOrderType.HIFI_WIRE_ONRAMP.Request
69
+ ): Promise<API.Orders.Create.ByOrderType.HIFI_WIRE_ONRAMP.Response> =>
56
70
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.HIFI_WIRE_ONRAMP.Response>('/orders/HIFI_WIRE_ONRAMP', {
57
71
  data,
58
72
  }),
59
73
 
60
- [OrderType.HIFI_ACH_ONRAMP]: (data: API.Orders.Create.ByOrderType.HIFI_ACH_ONRAMP.Request) =>
74
+ [OrderType.HIFI_ACH_ONRAMP]: (
75
+ data: API.Orders.Create.ByOrderType.HIFI_ACH_ONRAMP.Request
76
+ ): Promise<API.Orders.Create.ByOrderType.HIFI_ACH_ONRAMP.Response> =>
61
77
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.HIFI_ACH_ONRAMP.Response>('/orders/HIFI_ACH_ONRAMP', {
62
78
  data,
63
79
  }),
64
80
 
65
- [OrderType.HIFI_SEPA_ONRAMP]: (data: API.Orders.Create.ByOrderType.HIFI_SEPA_ONRAMP.Request) =>
81
+ [OrderType.HIFI_SEPA_ONRAMP]: (
82
+ data: API.Orders.Create.ByOrderType.HIFI_SEPA_ONRAMP.Request
83
+ ): Promise<API.Orders.Create.ByOrderType.HIFI_SEPA_ONRAMP.Response> =>
66
84
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.HIFI_SEPA_ONRAMP.Response>('/orders/HIFI_SEPA_ONRAMP', {
67
85
  data,
68
86
  }),
69
87
 
70
- [OrderType.HIFI_WIRE_OFFRAMP]: (data: API.Orders.Create.ByOrderType.HIFI_WIRE_OFFRAMP.Request) =>
88
+ [OrderType.HIFI_WIRE_OFFRAMP]: (
89
+ data: API.Orders.Create.ByOrderType.HIFI_WIRE_OFFRAMP.Request
90
+ ): Promise<API.Orders.Create.ByOrderType.HIFI_WIRE_OFFRAMP.Response> =>
71
91
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.HIFI_WIRE_OFFRAMP.Response>('/orders/HIFI_WIRE_OFFRAMP', {
72
92
  data,
73
93
  }),
74
94
 
75
- [OrderType.HIFI_ACH_OFFRAMP]: (data: API.Orders.Create.ByOrderType.HIFI_ACH_OFFRAMP.Request) =>
95
+ [OrderType.HIFI_ACH_OFFRAMP]: (
96
+ data: API.Orders.Create.ByOrderType.HIFI_ACH_OFFRAMP.Request
97
+ ): Promise<API.Orders.Create.ByOrderType.HIFI_ACH_OFFRAMP.Response> =>
76
98
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.HIFI_ACH_OFFRAMP.Response>('/orders/HIFI_ACH_OFFRAMP', {
77
99
  data,
78
100
  }),
79
101
 
80
- [OrderType.HIFI_SEPA_OFFRAMP]: (data: API.Orders.Create.ByOrderType.HIFI_SEPA_OFFRAMP.Request) =>
102
+ [OrderType.HIFI_SEPA_OFFRAMP]: (
103
+ data: API.Orders.Create.ByOrderType.HIFI_SEPA_OFFRAMP.Request
104
+ ): Promise<API.Orders.Create.ByOrderType.HIFI_SEPA_OFFRAMP.Response> =>
81
105
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.HIFI_SEPA_OFFRAMP.Response>('/orders/HIFI_SEPA_OFFRAMP', {
82
106
  data,
83
107
  }),
84
108
 
85
- [OrderType.OMNIBUS_CRYPTO_WITHDRAWAL]: (data: API.Orders.Create.ByOrderType.OMNIBUS_CRYPTO_WITHDRAWAL.Request) =>
109
+ [OrderType.OMNIBUS_CRYPTO_WITHDRAWAL]: (
110
+ data: API.Orders.Create.ByOrderType.OMNIBUS_CRYPTO_WITHDRAWAL.Request
111
+ ): Promise<API.Orders.Create.ByOrderType.OMNIBUS_CRYPTO_WITHDRAWAL.Response> =>
86
112
  apiClientV1.postRequest<API.Orders.Create.ByOrderType.OMNIBUS_CRYPTO_WITHDRAWAL.Response>(
87
113
  '/orders/OMNIBUS_CRYPTO_WITHDRAWAL',
88
114
  {
@@ -3,7 +3,7 @@ import { API } from './types/types';
3
3
 
4
4
  export const persona = {
5
5
  inquiries: {
6
- init: ({ wallet_id, type }: API.Persona.Inquiries.Init.Request) =>
6
+ init: ({ wallet_id, type }: API.Persona.Inquiries.Init.Request): Promise<API.Persona.Inquiries.Init.Response> =>
7
7
  apiClientV2.postRequest<API.Persona.Inquiries.Init.Response>(`/persona/inquiries/init/${wallet_id}/${type}`),
8
8
  },
9
9
  };
@@ -19,7 +19,7 @@ import {
19
19
  WalletTransactionType,
20
20
  } from '../../constants';
21
21
  import { WalletType } from '../..';
22
- import { operations } from './autogen/apiV2.types';
22
+ import { components, operations } from './autogen/apiV2.types';
23
23
 
24
24
  export namespace API {
25
25
  export namespace Auth {
@@ -1002,6 +1002,15 @@ export namespace API {
1002
1002
  }
1003
1003
  }
1004
1004
  }
1005
+
1006
+ export namespace Entity {
1007
+ export type Entity = components['schemas']['KycEntityDto'];
1008
+ export namespace Get {
1009
+ export type Request = operations['KycEntitiesController_findOne']['parameters']['path'];
1010
+ export type Response =
1011
+ operations['KycEntitiesController_findOne']['responses']['200']['content']['application/json'];
1012
+ }
1013
+ }
1005
1014
  export namespace Forms {
1006
1015
  export namespace FormField {
1007
1016
  export type FormFieldType =
package/src/api/user.ts CHANGED
@@ -3,22 +3,25 @@ import { API } from './types/types';
3
3
  import { apiClientV2 } from '../utils/apiClientFactory';
4
4
 
5
5
  export const user = {
6
- get: () => apiClientV2.getRequest<API.User.User>('/user'),
6
+ get: (): Promise<API.User.User> => apiClientV2.getRequest<API.User.User>('/user'),
7
7
  userData: {
8
- get: () => apiClientV2.getRequest<API.User.UserData.UserData>('/user/user-data'),
9
- update: (data: API.User.UserData.UpdateUserData.Request) =>
8
+ get: (): Promise<API.User.UserData.UserData> =>
9
+ apiClientV2.getRequest<API.User.UserData.UserData>('/user/user-data'),
10
+ update: (data: API.User.UserData.UpdateUserData.Request): Promise<API.User.UserData.UpdateUserData.Response> =>
10
11
  apiClientV2.patchRequest<API.User.UserData.UpdateUserData.Response>('/user/user-data', { data }),
11
12
  },
12
13
  update: {
13
14
  phone: {
14
- request: (data: API.User.UpdateUser.Phone.RequestOTP.Request) =>
15
+ request: (data: API.User.UpdateUser.Phone.RequestOTP.Request): Promise<void> =>
15
16
  apiClientV2.patchRequest('/user/phone', { data }),
16
- confirm: (data: API.User.UpdateUser.Phone.Confirm.Request) => apiClientV2.postRequest('/user/phone', { data }),
17
+ confirm: (data: API.User.UpdateUser.Phone.Confirm.Request): Promise<void> =>
18
+ apiClientV2.postRequest('/user/phone', { data }),
17
19
  },
18
20
  email: {
19
- request: (data: API.User.UpdateUser.Email.RequestOTP.Request) =>
21
+ request: (data: API.User.UpdateUser.Email.RequestOTP.Request): Promise<void> =>
20
22
  apiClientV2.patchRequest('/user/email', { data }),
21
- confirm: (data: API.User.UpdateUser.Email.Confirm.Request) => apiClientV2.postRequest('/user/email', { data }),
23
+ confirm: (data: API.User.UpdateUser.Email.Confirm.Request): Promise<void> =>
24
+ apiClientV2.postRequest('/user/email', { data }),
22
25
  },
23
26
  },
24
27
  };
@@ -5,42 +5,54 @@ import { apiClientV1, apiClientV2 } from '../utils/apiClientFactory';
5
5
  import { defaultPaginationParams, WalletTypeValues } from '../constants';
6
6
 
7
7
  export const wallets = {
8
- create: (type: WalletTypeValues) => apiClientV2.postRequest('/wallets', { data: { type } }),
9
- getAll: () => apiClientV2.getRequest<API.Wallets.WalletsList.Response>('/wallets'),
10
- getByUuid: (uuid: string) => apiClientV2.getRequest<API.Wallets.Wallet>(`/wallets/${uuid}`),
8
+ create: (type: WalletTypeValues): Promise<void> => apiClientV2.postRequest('/wallets', { data: { type } }),
9
+ getAll: (): Promise<API.Wallets.WalletsList.Response> =>
10
+ apiClientV2.getRequest<API.Wallets.WalletsList.Response>('/wallets'),
11
+ getByUuid: (uuid: string): Promise<API.Wallets.Wallet> =>
12
+ apiClientV2.getRequest<API.Wallets.Wallet>(`/wallets/${uuid}`),
11
13
  addresses: {
12
- create: ({ wallet_uuid, chain, label }: API.Wallets.WalletChain.Create.Request) =>
13
- apiClientV2.postRequest<API.Wallets.WalletChain.Create.Response>(`/wallets/${wallet_uuid}/addresses/${chain}`, {
14
- data: { label },
15
- }),
14
+ create: (data: API.Wallets.WalletChain.Create.Request): Promise<API.Wallets.WalletChain.Create.Response> => {
15
+ const { wallet_uuid, chain, label } = data;
16
+
17
+ return apiClientV2.postRequest<API.Wallets.WalletChain.Create.Response>(
18
+ `/wallets/${wallet_uuid}/addresses/${chain}`,
19
+ { data: { label } }
20
+ );
21
+ },
16
22
  get: {
17
23
  byWalletUuid: {
18
- byChainId: (wallet_uuid: string, chain_id: number) =>
24
+ byChainId: (wallet_uuid: string, chain_id: number): Promise<API.Wallets.WalletChain.WalletChain> =>
19
25
  apiClientV2.getRequest<API.Wallets.WalletChain.WalletChain>(`/wallets/${wallet_uuid}/addresses/${chain_id}`),
20
26
  },
21
27
  },
22
28
  },
23
29
  transactions: {
24
30
  byWalletUuid: {
25
- getAll: async ({
26
- wallet_uuid,
27
- limit = defaultPaginationParams.limit,
28
- offset = defaultPaginationParams.offset,
29
- ...params
30
- }: API.Wallets.WalletTransactions.TransactionList.Request) =>
31
- apiClientV2.getRequest<API.Wallets.WalletTransactions.TransactionList.Response>(
31
+ getAll: async (
32
+ data: API.Wallets.WalletTransactions.TransactionList.Request
33
+ ): Promise<API.Wallets.WalletTransactions.TransactionList.Response> => {
34
+ const {
35
+ wallet_uuid,
36
+ limit = defaultPaginationParams.limit,
37
+ offset = defaultPaginationParams.offset,
38
+ ...params
39
+ } = data;
40
+
41
+ return apiClientV2.getRequest<API.Wallets.WalletTransactions.TransactionList.Response>(
32
42
  `/wallets/${wallet_uuid}/transactions`,
33
- {
34
- params: { limit, offset, ...params },
35
- }
36
- ),
37
- getByUuid: ({ wallet_uuid, uuid }: API.Wallets.WalletTransactions.GetByUuid.Request) =>
43
+ { params: { limit, offset, ...params } }
44
+ );
45
+ },
46
+ getByUuid: ({
47
+ wallet_uuid,
48
+ uuid,
49
+ }: API.Wallets.WalletTransactions.GetByUuid.Request): Promise<API.Wallets.WalletTransactions.DetailedTransaction> =>
38
50
  apiClientV2.getRequest<API.Wallets.WalletTransactions.DetailedTransaction>(
39
51
  `/wallets/${wallet_uuid}/transactions/${uuid}`
40
52
  ),
41
53
  },
42
54
  csv: {
43
- getByWalletUuid: (wallet_uuid: string) =>
55
+ getByWalletUuid: (wallet_uuid: string): Promise<string> =>
44
56
  apiClientV1.getRequest<string>(`/wallets/transactions/${wallet_uuid}/csv`),
45
57
  },
46
58
  },