squarefi-bff-api-module 1.24.13 → 1.24.14

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.
@@ -4,9 +4,9 @@ export declare const issuing: {
4
4
  create: {
5
5
  standAloneCard: {
6
6
  prepaid: (data: API.Cards.Create.StandAloneRequest) => Promise<API.Cards.Create.StandAloneResponse>;
7
- balance: (data: API.Cards.Create.StandAloneRequest) => Promise<API.Cards.Create.SubAccountResponse>;
7
+ balance: (data: API.Cards.Create.StandAloneRequest) => Promise<API.Cards.Create.ExtendedSubAccountResponse>;
8
8
  };
9
- subAccountCard: (data: API.Cards.Create.SubAccountRequest) => Promise<API.Cards.Create.SubAccountResponse>;
9
+ subAccountCard: (data: API.Cards.Create.SubAccountRequest) => Promise<API.Cards.Create.ExtendedSubAccountResponse>;
10
10
  };
11
11
  byWalletUuid: {
12
12
  getAll: (params: API.Cards.CardsList.Request.ByWalletUuid) => Promise<API.Cards.CardsList.Response>;
@@ -37,7 +37,12 @@ exports.issuing = {
37
37
  return Object.assign(Object.assign({}, response), { sub_account_id });
38
38
  }),
39
39
  },
40
- subAccountCard: (data) => apiClientFactory_1.apiClientV1.postRequest('/issuing/cards/balance', { data }),
40
+ subAccountCard: (data) => __awaiter(void 0, void 0, void 0, function* () {
41
+ const response = yield apiClientFactory_1.apiClientV1.postRequest('/issuing/cards/balance', {
42
+ data,
43
+ });
44
+ return Object.assign(Object.assign({}, response), { sub_account_id: data.sub_account_id });
45
+ }),
41
46
  },
42
47
  byWalletUuid: {
43
48
  getAll: (params) => apiClientFactory_1.apiClientV1.getRequest('/issuing/cards', { params }),
@@ -324,6 +324,8 @@ export declare namespace API {
324
324
  type SubAccountResponse = {
325
325
  card_id: string;
326
326
  status: string;
327
+ };
328
+ type ExtendedSubAccountResponse = SubAccountResponse & {
327
329
  sub_account_id: string;
328
330
  };
329
331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.24.13",
3
+ "version": "1.24.14",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,7 +9,9 @@ export const issuing = {
9
9
  standAloneCard: {
10
10
  prepaid: (data: API.Cards.Create.StandAloneRequest): Promise<API.Cards.Create.StandAloneResponse> =>
11
11
  apiClientV1.postRequest<API.Cards.Create.StandAloneResponse>('/issuing/cards/create', { data }),
12
- balance: async (data: API.Cards.Create.StandAloneRequest): Promise<API.Cards.Create.SubAccountResponse> => {
12
+ balance: async (
13
+ data: API.Cards.Create.StandAloneRequest
14
+ ): Promise<API.Cards.Create.ExtendedSubAccountResponse> => {
13
15
  const { id: sub_account_id } = await issuing.sub_accounts.create(data.wallet_id, data.program_id);
14
16
 
15
17
  const response = await apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>(
@@ -28,8 +30,17 @@ export const issuing = {
28
30
  };
29
31
  },
30
32
  },
31
- subAccountCard: (data: API.Cards.Create.SubAccountRequest): Promise<API.Cards.Create.SubAccountResponse> =>
32
- apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>('/issuing/cards/balance', { data }),
33
+ subAccountCard: async (
34
+ data: API.Cards.Create.SubAccountRequest
35
+ ): Promise<API.Cards.Create.ExtendedSubAccountResponse> => {
36
+ const response = await apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>('/issuing/cards/balance', {
37
+ data,
38
+ });
39
+ return {
40
+ ...response,
41
+ sub_account_id: data.sub_account_id,
42
+ };
43
+ },
33
44
  },
34
45
  byWalletUuid: {
35
46
  getAll: (params: API.Cards.CardsList.Request.ByWalletUuid): Promise<API.Cards.CardsList.Response> =>
@@ -380,6 +380,9 @@ export namespace API {
380
380
  export type SubAccountResponse = {
381
381
  card_id: string;
382
382
  status: string;
383
+ };
384
+
385
+ export type ExtendedSubAccountResponse = SubAccountResponse & {
383
386
  sub_account_id: string;
384
387
  };
385
388
  }