squarefi-bff-api-module 1.3.0 → 1.4.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/README.md CHANGED
@@ -1,36 +1,120 @@
1
1
  # Squarefi BFF API Module
2
2
 
3
- A TypeScript/JavaScript client for interacting with the Squarefi BFF API.
3
+ A professional TypeScript/JavaScript SDK for seamless integration with Squarefi BFF API.
4
4
 
5
- ## Installation
5
+ ## 📦 Installation
6
6
 
7
7
  ```bash
8
8
  npm install squarefi-bff-api-module
9
9
  ```
10
10
 
11
- ## Usage
11
+ ## 🔧 Usage
12
12
 
13
13
  ```typescript
14
- import { createApiClient } from 'squarefi-bff-api-module';
14
+ import { squarefi_bff_api_client } from 'squarefi-bff-api-module';
15
15
 
16
- const api = createApiClient({
17
- baseURL: 'YOUR_API_BASE_URL',
18
- tenantId: 'YOUR_TENANT_ID',
19
- isBearerToken: true,
20
- });
16
+ // Authentication
17
+ await squarefi_bff_api_client.auth.login(credentials);
21
18
 
22
- // Make API calls
23
- const response = await api.getRequest('/some-endpoint');
19
+ // Exchange operations
20
+ const rates = await squarefi_bff_api_client.exchange.getRates();
21
+
22
+ // Tenant operations
23
+ const tenantInfo = await squarefi_bff_api_client.tenants.getTenantInfo();
24
+
25
+ // Wallet operations
26
+ const balance = await squarefi_bff_api_client.wallets.getBalance();
27
+
28
+ // Fiat accounts
29
+ const accounts = await squarefi_bff_api_client.fiat_accounts.getAccounts();
24
30
  ```
25
31
 
26
- ## Features
32
+ ## 📚 Available API Modules
33
+
34
+ Access different API functionalities through the client:
35
+
36
+ - `squarefi_bff_api_client.auth` - Authentication and authorization
37
+ - `squarefi_bff_api_client.exchange` - Currency exchange operations
38
+ - `squarefi_bff_api_client.fiat_accounts` - Fiat account management
39
+ - `squarefi_bff_api_client.issuing` - Card issuing operations
40
+ - `squarefi_bff_api_client.kyc` - Know Your Customer procedures
41
+ - `squarefi_bff_api_client.list` - Listing and pagination utilities
42
+ - `squarefi_bff_api_client.orders` - Order management
43
+ - `squarefi_bff_api_client.tenants` - Tenant management operations
44
+ - `squarefi_bff_api_client.user` - User profile operations
45
+ - `squarefi_bff_api_client.wallets` - Crypto wallet operations
46
+
47
+ ## ⚙️ Environment Variables
48
+
49
+ | Variable | Description | Required | Example |
50
+ | ---------- | --------------------------------- | -------- | -------------------- |
51
+ | API_URL | Base URL for the Squarefi BFF API | Yes | `https://api-v1.url` |
52
+ | API_V2_URL | Base URL for the Squarefi BFF API | Yes | `https://api-v2.url` |
53
+ | TENANT_ID | Your tenant identifier | Yes | `tenant_12345` |
54
+
55
+ ## 🚀 Features
56
+
57
+ - 🔒 Built-in token management and authentication
58
+ - 📱 Telegram integration support
59
+ - 💪 Full TypeScript support with strict typing
60
+ - 🔄 Axios-based HTTP client
61
+ - 📦 Comprehensive constants and types
62
+ - 🛡️ Secure request handling
63
+ - 🔑 Multi-tenant support
64
+
65
+ ## 🛠️ Development
66
+
67
+ ### Prerequisites
68
+
69
+ - Node.js (Latest LTS version)
70
+ - npm or yarn
71
+
72
+ ### Setup
73
+
74
+ ```bash
75
+ # Install dependencies
76
+ npm install
77
+
78
+ # Build the package
79
+ npm run build
80
+
81
+ # Run tests
82
+ npm test
83
+ ```
84
+
85
+ ## 🔐 Security
86
+
87
+ The module implements industry-standard security practices:
88
+
89
+ - Secure token management
90
+ - Request signing
91
+ - Rate limiting protection
92
+ - HTTPS enforcement
93
+ - Multi-tenant isolation
94
+
95
+ ## Dependencies
96
+
97
+ ### Main Dependencies
98
+
99
+ - axios: 1.6.7
100
+ - @telegram-apps/sdk-react: 3.1.2
101
+
102
+ ### Peer Dependencies
103
+
104
+ - react: ^18.x.x
105
+
106
+ ## 📚 API Documentation
107
+
108
+ Each module provides a set of type-safe methods for interacting with specific API endpoints. For detailed API documentation, please refer to our [API Documentation](link-to-your-docs).
109
+
110
+ ## 🆘 Support
111
+
112
+ For support and questions, please [open an issue](link-to-issues) or contact our support team.
113
+
114
+ ## 🤝 Contributing
27
115
 
28
- - Full TypeScript support
29
- - Axios-based HTTP client
30
- - Token management
31
- - Telegram integration support
32
- - Comprehensive constants and types
116
+ We welcome contributions! Please see our [Contributing Guide](link-to-contributing) for details.
33
117
 
34
- ## License
118
+ ## 📄 License
35
119
 
36
120
  MIT
@@ -22,5 +22,5 @@ type Api = {
22
22
  user: typeof user;
23
23
  wallets: typeof wallets;
24
24
  };
25
- export declare const squarefiBffApiClient: Api;
25
+ export declare const squarefi_bff_api_client: Api;
26
26
  export {};
package/dist/api/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.squarefiBffApiClient = void 0;
3
+ exports.squarefi_bff_api_client = void 0;
4
4
  const auth_1 = require("./auth");
5
5
  const developer_1 = require("./developer");
6
6
  const exchange_1 = require("./exchange");
@@ -12,7 +12,7 @@ const orders_1 = require("./orders");
12
12
  const tenants_1 = require("./tenants");
13
13
  const user_1 = require("./user");
14
14
  const wallets_1 = require("./wallets");
15
- exports.squarefiBffApiClient = {
15
+ exports.squarefi_bff_api_client = {
16
16
  auth: auth_1.auth,
17
17
  developer: developer_1.developer,
18
18
  exchange: exchange_1.exchange,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './api';
1
+ export { squarefi_bff_api_client } from './api';
2
2
  export * from './utils/apiClientFactory';
3
3
  export * from './utils/tokensFactory';
4
4
  export * from './constants';
package/dist/index.js CHANGED
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./api"), exports);
17
+ exports.squarefi_bff_api_client = void 0;
18
+ var api_1 = require("./api");
19
+ Object.defineProperty(exports, "squarefi_bff_api_client", { enumerable: true, get: function () { return api_1.squarefi_bff_api_client; } });
18
20
  __exportStar(require("./utils/apiClientFactory"), exports);
19
21
  __exportStar(require("./utils/tokensFactory"), exports);
20
22
  __exportStar(require("./constants"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/api/index.ts CHANGED
@@ -24,7 +24,7 @@ type Api = {
24
24
  wallets: typeof wallets;
25
25
  };
26
26
 
27
- export const squarefiBffApiClient: Api = {
27
+ export const squarefi_bff_api_client: Api = {
28
28
  auth,
29
29
  developer,
30
30
  exchange,
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './api';
1
+ export { squarefi_bff_api_client } from './api';
2
2
  export * from './utils/apiClientFactory';
3
3
  export * from './utils/tokensFactory';
4
4
  export * from './constants';