spaark-payapi-sdk 1.2.0 → 1.2.2

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.
Files changed (2) hide show
  1. package/README.md +56 -5
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -47,8 +47,9 @@ console.log(deposit.depositId, deposit.status);
47
47
  - **Toolkit**: Predict Provider, Active Configuration, Provider Availability
48
48
  - **Finances**: Wallet Balances, Statement Generation
49
49
  - **Webhooks**: Signature verification, Event parsing
50
- - **React Component**: Test dashboard with demo mode
50
+ - **React Components**: Test dashboard + Finance dashboard
51
51
  - **Full TypeScript**: Complete type definitions
52
+ - **i18n**: French/English support
52
53
 
53
54
  ## Supported Providers
54
55
 
@@ -284,12 +285,12 @@ const provider = sdk.utils.detectCorrespondent('237670000000');
284
285
  const limits = await sdk.utils.getTransactionLimits('MTN_MOMO_CMR');
285
286
  ```
286
287
 
287
- ## React Dashboard Component
288
+ ## React Components
288
289
 
289
- ```tsx
290
- 'use client';
290
+ ### Test Dashboard
291
291
 
292
- import { PawapayTestDashboard } from 'spaark-payapi-sdk';
292
+ ```tsx
293
+ import { PawapayTestDashboard } from 'spaark-payapi-sdk/react';
293
294
 
294
295
  export default function TestPage() {
295
296
  return (
@@ -307,6 +308,54 @@ export default function TestPage() {
307
308
 
308
309
  Use `demoMode={true}` to test without API key.
309
310
 
311
+ ### Finance Dashboard
312
+
313
+ ```tsx
314
+ import {
315
+ SpaarkPaySdkFinanceDashboard,
316
+ type Transaction
317
+ } from 'spaark-payapi-sdk/react';
318
+
319
+ const transactions: Transaction[] = [
320
+ {
321
+ id: 'tx-001',
322
+ type: 'deposit',
323
+ amount: 5000,
324
+ currency: 'XAF',
325
+ status: 'COMPLETED',
326
+ provider: 'MTN_MOMO_CMR',
327
+ phoneNumber: '237670000000',
328
+ createdAt: '2025-01-15T10:00:00Z',
329
+ },
330
+ // ... more transactions
331
+ ];
332
+
333
+ export default function FinancePage() {
334
+ return (
335
+ <SpaarkPaySdkFinanceDashboard
336
+ transactions={transactions}
337
+ title="My Finance Dashboard" // Customizable
338
+ locale="fr" // 'fr' | 'en'
339
+ onRefresh={() => fetchData()} // Refresh button handler
340
+ onTransactionClick={(tx) => {}} // Row click handler
341
+ onExpertModeClick={() => {}} // Expert mode button
342
+ showExpertMode={true} // Show/hide expert button
343
+ isLoading={false} // Loading state
344
+ />
345
+ );
346
+ }
347
+ ```
348
+
349
+ **Features:**
350
+ - 5 KPI cards (Total Volume, Deposits, Payouts, Failed, Refunds)
351
+ - Search by transaction ID or phone number
352
+ - Filter by type (deposit/payout/refund) and status
353
+ - Paginated transactions table
354
+ - Copy transaction ID to clipboard
355
+ - i18n support (French/English)
356
+ - Customizable title
357
+ - Expert Mode button integration
358
+
310
359
  ## TypeScript Types
311
360
 
312
361
  ```typescript
@@ -320,6 +369,8 @@ import type {
320
369
  TransactionStatusResponse,
321
370
  Correspondent,
322
371
  Currency,
372
+ Transaction,
373
+ TransactionType,
323
374
  // ... and more
324
375
  } from 'spaark-payapi-sdk';
325
376
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spaark-payapi-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "TypeScript SDK for Pawapay Mobile Money API (V2) - Deposits, Payouts, Refunds for Africa",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -48,7 +48,7 @@
48
48
  "lucide-react": "^0.469.0",
49
49
  "react": "^18.0.0 || ^19.0.0",
50
50
  "react-dom": "^18.0.0 || ^19.0.0",
51
- "tailwind-merge": "^2.0.0"
51
+ "tailwind-merge": "^3.4.0"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
54
  "react": {
@@ -102,7 +102,7 @@
102
102
  "lucide-react": "^0.469.0",
103
103
  "react": "^18.0.0",
104
104
  "standard-version": "^9.5.0",
105
- "tailwind-merge": "^2.0.0",
105
+ "tailwind-merge": "^3.4.0",
106
106
  "ts-jest": "^29.1.0",
107
107
  "tsup": "^8.0.0",
108
108
  "typescript": "^5.3.0"