squarefi-bff-api-module 1.17.31 → 1.18.0

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.0] - 2025-05-19
9
+
10
+ ### Added
11
+
12
+ - Enhanced card creation functionality with prepaid and balance options for standalone cards
13
+
8
14
  ## [1.17.30] - 2025-05-18
9
15
 
10
16
  ### Fixed
@@ -2,7 +2,10 @@ import { API } from './types/types';
2
2
  export declare const issuing: {
3
3
  cards: {
4
4
  create: {
5
- standAloneCard: (data: API.Cards.Create.StandAloneRequest) => Promise<API.Cards.IssuingCardDetailItem>;
5
+ standAloneCard: {
6
+ prepaid: (data: API.Cards.Create.StandAloneRequest) => Promise<API.Cards.IssuingCardDetailItem>;
7
+ balance: (data: API.Cards.Create.StandAloneRequest) => Promise<void>;
8
+ };
6
9
  subAccountCard: (data: API.Cards.Create.SubAccountRequest) => Promise<API.Cards.IssuingCardDetailItem>;
7
10
  };
8
11
  byWalletUuid: {
@@ -16,7 +16,15 @@ const encrypt_1 = require("../utils/encrypt");
16
16
  exports.issuing = {
17
17
  cards: {
18
18
  create: {
19
- standAloneCard: (data) => apiClientFactory_1.apiClientV1.postRequest('/issuing/cards/create', { data }),
19
+ standAloneCard: {
20
+ prepaid: (data) => apiClientFactory_1.apiClientV1.postRequest('/issuing/cards/create', { data }),
21
+ balance: (data) => __awaiter(void 0, void 0, void 0, function* () {
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', {
24
+ data: Object.assign(Object.assign({}, data), { sub_account_id }),
25
+ });
26
+ }),
27
+ },
20
28
  subAccountCard: (data) => apiClientFactory_1.apiClientV1.postRequest('/issuing/cards/balance', { data }),
21
29
  },
22
30
  byWalletUuid: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.17.31",
3
+ "version": "1.18.0",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -5,8 +5,20 @@ import { makeSecureRequest } from '../utils/encrypt';
5
5
  export const issuing = {
6
6
  cards: {
7
7
  create: {
8
- standAloneCard: (data: API.Cards.Create.StandAloneRequest) =>
9
- apiClientV1.postRequest<API.Cards.Create.StandAloneResponse>('/issuing/cards/create', { data }),
8
+ standAloneCard: {
9
+ prepaid: (data: API.Cards.Create.StandAloneRequest) =>
10
+ apiClientV1.postRequest<API.Cards.Create.StandAloneResponse>('/issuing/cards/create', { data }),
11
+ balance: async (data: API.Cards.Create.StandAloneRequest) => {
12
+ const { id: sub_account_id } = await issuing.sub_accounts.create(data.wallet_id, data.program_id);
13
+
14
+ apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>('/issuing/cards/balance', {
15
+ data: {
16
+ ...data,
17
+ sub_account_id,
18
+ },
19
+ });
20
+ },
21
+ },
10
22
  subAccountCard: (data: API.Cards.Create.SubAccountRequest) =>
11
23
  apiClientV1.postRequest<API.Cards.Create.SubAccountResponse>('/issuing/cards/balance', { data }),
12
24
  },