squarefi-bff-api-module 1.2.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 +102 -18
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/package.json +5 -6
- package/src/api/index.ts +1 -1
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -1,36 +1,120 @@
|
|
|
1
1
|
# Squarefi BFF API Module
|
|
2
2
|
|
|
3
|
-
A TypeScript/JavaScript
|
|
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 {
|
|
14
|
+
import { squarefi_bff_api_client } from 'squarefi-bff-api-module';
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
tenantId: 'YOUR_TENANT_ID',
|
|
19
|
-
isBearerToken: true,
|
|
20
|
-
});
|
|
16
|
+
// Authentication
|
|
17
|
+
await squarefi_bff_api_client.auth.login(credentials);
|
|
21
18
|
|
|
22
|
-
//
|
|
23
|
-
const
|
|
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
|
-
##
|
|
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
|
-
-
|
|
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
|
package/dist/api/index.d.ts
CHANGED
package/dist/api/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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.
|
|
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
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
|
-
|
|
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
|
+
"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",
|
|
@@ -18,16 +18,15 @@
|
|
|
18
18
|
"author": "Your Name",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"axios": "1.6.7",
|
|
22
21
|
"@telegram-apps/sdk-react": "3.1.2",
|
|
23
|
-
"
|
|
22
|
+
"axios": "1.6.7"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"@types/node": "^20.x.x",
|
|
27
|
-
"typescript": "^5.x.x",
|
|
28
25
|
"@types/jest": "^29.x.x",
|
|
26
|
+
"@types/node": "^20.x.x",
|
|
29
27
|
"jest": "^29.x.x",
|
|
30
|
-
"ts-jest": "^29.x.x"
|
|
28
|
+
"ts-jest": "^29.x.x",
|
|
29
|
+
"typescript": "^5.x.x"
|
|
31
30
|
},
|
|
32
31
|
"peerDependencies": {
|
|
33
32
|
"react": "^18.x.x"
|
package/src/api/index.ts
CHANGED
package/src/index.ts
CHANGED