squarefi-bff-api-module 1.36.31 → 1.36.33

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.
@@ -1 +1,4 @@
1
- export declare const bankData: {};
1
+ import { API } from './types/types';
2
+ export declare const bankData: {
3
+ getByCode: (params: API.BankData.GetByCode.Request) => Promise<API.BankData.GetByCode.Response>;
4
+ };
@@ -1,8 +1,6 @@
1
+ import { apiClientV1Frontend } from '../utils/apiClientFactory';
1
2
  export const bankData = {
2
- // getBankDataByAccountNumber: ( // TBD on backend
3
- // params: API.BankData.GetBankDataByAccountNumber.Request,
4
- // ): Promise<API.BankData.GetBankDataByAccountNumber.Response> =>
5
- // apiClientV2.getRequest<API.BankData.GetBankDataByAccountNumber.Response>(`/bank-data`, {
6
- // params,
7
- // }),
3
+ getByCode: (params) => apiClientV1Frontend.getRequest('/frontend/bank-data', {
4
+ params,
5
+ }),
8
6
  };
@@ -8,4 +8,14 @@ export declare const frontend: {
8
8
  revoke: (key_id: string) => Promise<API.Frontend.Access.Keys.Revoke.Response>;
9
9
  };
10
10
  };
11
+ issuing: {
12
+ cards: {
13
+ deposit: ({ card_id, ...data }: API.Frontend.Issuing.Cards.Deposit.Request) => Promise<API.Frontend.Issuing.Cards.Deposit.Response>;
14
+ withdraw: ({ card_id, ...data }: API.Frontend.Issuing.Cards.Withdraw.Request) => Promise<API.Frontend.Issuing.Cards.Withdraw.Response>;
15
+ };
16
+ subAccounts: {
17
+ deposit: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Deposit.Request) => Promise<API.Frontend.Issuing.SubAccounts.Deposit.Response>;
18
+ withdraw: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Withdraw.Request) => Promise<API.Frontend.Issuing.SubAccounts.Withdraw.Response>;
19
+ };
20
+ };
11
21
  };
@@ -1,4 +1,4 @@
1
- import { apiClientV1 } from '../utils/apiClientFactory';
1
+ import { apiClientV1, apiClientV1Frontend } from '../utils/apiClientFactory';
2
2
  export const frontend = {
3
3
  access: {
4
4
  keys: {
@@ -8,4 +8,20 @@ export const frontend = {
8
8
  revoke: (key_id) => apiClientV1.deleteRequest(`/frontend/access/keys/${key_id}`),
9
9
  },
10
10
  },
11
+ // Card money movement. Both card-level methods are thin wrappers the backend resolves to the
12
+ // card's sub-account, so they share the sub-account order types, validation and program routing.
13
+ // All four require the ADMIN role on the owning wallet — the card's wallet for `cards.*`, the
14
+ // sub-account's wallet for `subAccounts.*`.
15
+ issuing: {
16
+ cards: {
17
+ deposit: ({ card_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/cards/${card_id}/deposit`, { data }),
18
+ withdraw: ({ card_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/cards/${card_id}/withdraw`, { data }),
19
+ },
20
+ subAccounts: {
21
+ deposit: ({ sub_account_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/sub-accounts/${sub_account_id}/deposit`, { data }),
22
+ // Concurrent withdrawals on the same sub-account are rejected with `409`. The currency is
23
+ // taken from the sub-account, so only the amount is needed.
24
+ withdraw: ({ sub_account_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/sub-accounts/${sub_account_id}/withdraw`, { data }),
25
+ },
26
+ },
11
27
  };
@@ -65,7 +65,6 @@ export declare const orders: {
65
65
  swift: (data: API.Orders.Frontend.Create.Withdrawal.Swift.Request) => Promise<API.Orders.Frontend.Create.Withdrawal.Swift.Response>;
66
66
  chaps: (data: API.Orders.Frontend.Create.Withdrawal.Chaps.Request) => Promise<API.Orders.Frontend.Create.Withdrawal.Chaps.Response>;
67
67
  fps: (data: API.Orders.Frontend.Create.Withdrawal.Fps.Request) => Promise<API.Orders.Frontend.Create.Withdrawal.Fps.Response>;
68
- card: (data: API.Orders.Frontend.Create.Withdrawal.Card.Request) => Promise<API.Orders.Frontend.Create.Withdrawal.Card.Response>;
69
68
  };
70
69
  exchange: (data: API.Orders.Frontend.Create.Exchange.Request) => Promise<API.Orders.Frontend.Create.Exchange.Response>;
71
70
  };
@@ -111,7 +111,6 @@ export const orders = {
111
111
  swift: (data) => apiClientV1Frontend.postRequest('/frontend/orders/withdrawal/swift', { data }),
112
112
  chaps: (data) => apiClientV1Frontend.postRequest('/frontend/orders/withdrawal/chaps', { data }),
113
113
  fps: (data) => apiClientV1Frontend.postRequest('/frontend/orders/withdrawal/fps', { data }),
114
- card: (data) => apiClientV1Frontend.postRequest('/frontend/orders/withdrawal/card', { data }),
115
114
  },
116
115
  exchange: (data) => apiClientV1Frontend.postRequest('/frontend/orders/exchange', {
117
116
  data,