monime-package 1.0.0 → 1.0.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.
- package/README.md +165 -109
- package/dist/index.d.mts +116 -38
- package/dist/index.d.ts +116 -38
- package/dist/index.js +99 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +97 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,165 +1,218 @@
|
|
|
1
1
|
|
|
2
2
|
# monime-package
|
|
3
3
|
|
|
4
|
-
A
|
|
5
|
-
|
|
4
|
+
A **TypeScript SDK for Monime**, providing a lightweight, typed client for common Monime endpoints. Simplifies requests, headers, and error handling so your code stays clean and type-safe.
|
|
6
5
|
|
|
7
6
|

|
|
8
7
|

|
|
8
|
+

|
|
9
9
|
|
|
10
|
+
Package: `monime-package`
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Table of contents
|
|
12
|
+
---
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
- [Features](#features)
|
|
17
|
-
- [Installation](#installation)
|
|
18
|
-
- [Quick start](#quick-start)
|
|
19
|
-
- [API reference](#api-reference)
|
|
20
|
-
- [Examples](#examples)
|
|
21
|
-
- [Folder structure](#folder-structure)
|
|
22
|
-
- [Configuration & env](#configuration--env)
|
|
23
|
-
- [Troubleshooting](#troubleshooting)
|
|
24
|
-
- [Contributing](#contributing)
|
|
25
|
-
- [License](#license)
|
|
14
|
+
## Table of Contents
|
|
26
15
|
|
|
27
|
-
|
|
16
|
+
* [Features](#features)
|
|
17
|
+
* [Installation](#installation)
|
|
18
|
+
* [Environment Variables](#environment-variables)
|
|
19
|
+
* [Quick Start](#quick-start)
|
|
20
|
+
* [Client API](#client-api)
|
|
21
|
+
* [Examples](#examples)
|
|
22
|
+
* [Migration from Old Helpers](#migration-from-old-helpers)
|
|
23
|
+
* [Folder Structure](#folder-structure)
|
|
24
|
+
* [Error Handling](#error-handling)
|
|
25
|
+
* [Contributing](#contributing)
|
|
26
|
+
* [License](#license)
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
---
|
|
30
29
|
|
|
31
30
|
## Features
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
* Full **TypeScript support** with typed request/response objects
|
|
33
|
+
* Lightweight client wrapper around Monime endpoints
|
|
34
|
+
* Predictable return shape: `{ success: boolean, data?, error? }`
|
|
35
|
+
* Single client instance handles credentials automatically
|
|
36
|
+
* Minimal dependencies (`axios` only)
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
---
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
## Installation
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
npm install monime-package
|
|
44
|
+
# or
|
|
45
|
+
pnpm add monime-package
|
|
44
46
|
```
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Environment Variables
|
|
51
|
+
|
|
52
|
+
Recommended to store credentials in `.env`:
|
|
47
53
|
|
|
48
54
|
```bash
|
|
49
|
-
|
|
55
|
+
MONIME_SPACE_ID=space_XXXXXXXX
|
|
56
|
+
MONIME_ACCESS_TOKEN=sk_live_xxx
|
|
50
57
|
```
|
|
51
58
|
|
|
52
|
-
|
|
59
|
+
You can also pass credentials directly when creating the client.
|
|
53
60
|
|
|
54
|
-
|
|
55
|
-
2. Import the helpers and call them.
|
|
61
|
+
---
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
### Create a client
|
|
58
66
|
|
|
59
67
|
```ts
|
|
60
|
-
import {
|
|
61
|
-
createFinancialAccount,
|
|
62
|
-
createPaymentCode,
|
|
63
|
-
createInternalTransfer,
|
|
64
|
-
getFinancialAccount,
|
|
65
|
-
deletePaymentCode,
|
|
66
|
-
CreatePayoutMobileMoney,
|
|
67
|
-
} from 'monime-package'
|
|
68
|
-
|
|
69
|
-
async function demo() {
|
|
70
|
-
const MONIME_SPACE_ID = process.env.MONIME_SPACE_ID!
|
|
71
|
-
const MONIME_ACCESS_TOKEN = process.env.MONIME_ACCESS_TOKEN!
|
|
72
|
-
|
|
73
|
-
// Create a financial account
|
|
74
|
-
const createRes = await createFinancialAccount('My App Account', MONIME_SPACE_ID, MONIME_ACCESS_TOKEN)
|
|
75
|
-
if (!createRes.success) throw createRes.error
|
|
76
|
-
|
|
77
|
-
const accountId = createRes.data?.result?.id
|
|
78
|
-
console.log('Created account id', accountId)
|
|
79
|
-
}
|
|
68
|
+
import { createClient } from 'monime-package'
|
|
80
69
|
|
|
81
|
-
|
|
70
|
+
const client = createClient({
|
|
71
|
+
monimeSpaceeId: process.env.MONIME_SPACE_ID!,
|
|
72
|
+
accessToken: process.env.MONIME_ACCESS_TOKEN!,
|
|
73
|
+
})
|
|
82
74
|
```
|
|
83
75
|
|
|
84
|
-
|
|
76
|
+
Now all methods automatically use the client’s credentials.
|
|
85
77
|
|
|
86
|
-
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Client API
|
|
81
|
+
|
|
82
|
+
All methods return:
|
|
87
83
|
|
|
88
84
|
```ts
|
|
89
85
|
type Result<T> = {
|
|
90
86
|
success: boolean
|
|
91
87
|
data?: T
|
|
92
|
-
error?:
|
|
88
|
+
error?: Error
|
|
93
89
|
}
|
|
94
90
|
```
|
|
95
91
|
|
|
96
|
-
|
|
92
|
+
### Financial Accounts
|
|
97
93
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
```ts
|
|
95
|
+
client.createFinancialAccount(name: string): Promise<Result<CreateFinancialAccount>>
|
|
96
|
+
client.getFinancialAccount(financialAccountId: string): Promise<Result<GetFinancialAccount>>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Internal Transfers
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
client.createInternalTransfer(
|
|
103
|
+
sourceAccount: string,
|
|
104
|
+
destinationAccount: string,
|
|
105
|
+
amount: number
|
|
106
|
+
): Promise<Result<CreateInternalTransfer>>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Payment Codes
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
client.createPaymentCode(
|
|
113
|
+
paymentName: string,
|
|
114
|
+
amount: number,
|
|
115
|
+
financialAccount: string,
|
|
116
|
+
username: string,
|
|
117
|
+
phoneNumber: string
|
|
118
|
+
): Promise<Result<CreatePaymentCode>>
|
|
119
|
+
|
|
120
|
+
client.deletePaymentCode(paymentCodeId: string): Promise<Result<DeletePaymentCode>>
|
|
121
|
+
```
|
|
104
122
|
|
|
105
|
-
|
|
123
|
+
### Payouts
|
|
106
124
|
|
|
107
|
-
|
|
125
|
+
```ts
|
|
126
|
+
client.createPayout(
|
|
127
|
+
amount: number,
|
|
128
|
+
phoneNumber: string,
|
|
129
|
+
sourceAccount: string
|
|
130
|
+
): Promise<Result<CreatePayout>>
|
|
131
|
+
```
|
|
108
132
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- Error responses: network/API errors may come back as axios error objects or the remote response body — handle both.
|
|
133
|
+
> Provider is inferred automatically from the phone number prefix.
|
|
134
|
+
|
|
135
|
+
---
|
|
113
136
|
|
|
114
137
|
## Examples
|
|
115
138
|
|
|
116
|
-
Create a
|
|
139
|
+
### Create a financial account
|
|
117
140
|
|
|
118
141
|
```ts
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const res = await createPaymentCode('Order-001', 5, 'financial-account-id', 'Alice', '0771234567', process.env.MONIME_ACCESS_TOKEN!, process.env.MONIME_SPACE_ID!)
|
|
123
|
-
if (!res.success) {
|
|
124
|
-
console.error('Failed to create payment code', res.error)
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
console.log('USSD code:', res.code)
|
|
128
|
-
}
|
|
142
|
+
const account = await client.createFinancialAccount('App Wallet')
|
|
143
|
+
if (!account.success) throw account.error
|
|
144
|
+
console.log(account.data)
|
|
129
145
|
```
|
|
130
146
|
|
|
131
|
-
|
|
147
|
+
### Get account details
|
|
132
148
|
|
|
133
149
|
```ts
|
|
134
|
-
|
|
150
|
+
const details = await client.getFinancialAccount(account.data!.result.id)
|
|
151
|
+
console.log(details)
|
|
152
|
+
```
|
|
135
153
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
### Internal transfer
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
const transfer = await client.createInternalTransfer('acc-src', 'acc-dest', 5000)
|
|
158
|
+
if (!transfer.success) console.error(transfer.error)
|
|
159
|
+
else console.log(transfer.data)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Create payment code
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
const code = await client.createPaymentCode('Order-001', 5, 'financial-account-id', 'Alice', '0771234567')
|
|
166
|
+
if (!code.success) console.error(code.error)
|
|
167
|
+
else console.log('Payment code:', code.data)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Delete payment code
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
const deleted = await client.deletePaymentCode('payment-code-id')
|
|
174
|
+
console.log(deleted.success)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Payout (mobile money)
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
const payout = await client.createPayout(1000, '0771234567', 'source-account-id')
|
|
181
|
+
if (!payout.success) console.error(payout.error)
|
|
182
|
+
else console.log('Payout:', payout.data)
|
|
139
183
|
```
|
|
140
184
|
|
|
141
|
-
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Migration from Old Helpers
|
|
188
|
+
|
|
189
|
+
Previously, you had to pass `monimeSpaceId` and `accessToken` into every function:
|
|
142
190
|
|
|
143
191
|
```ts
|
|
144
|
-
|
|
192
|
+
createFinancialAccount('name', MONIME_SPACE_ID, MONIME_ACCESS_TOKEN)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Now, create a client once:
|
|
145
196
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
197
|
+
```ts
|
|
198
|
+
const client = createClient({ monimeSpaceeId, accessToken })
|
|
199
|
+
client.createFinancialAccount('name') // credentials auto-applied
|
|
149
200
|
```
|
|
150
201
|
|
|
151
|
-
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Folder Structure
|
|
152
205
|
|
|
153
206
|
```
|
|
154
|
-
.
|
|
207
|
+
.
|
|
155
208
|
├── LICENSE
|
|
156
209
|
├── README.md
|
|
157
210
|
├── package.json
|
|
158
211
|
├── tsconfig.json
|
|
159
212
|
├── tsup.config.ts
|
|
160
213
|
├── src
|
|
161
|
-
│ ├── index.ts
|
|
162
|
-
│ └──
|
|
214
|
+
│ ├── index.ts # entry point
|
|
215
|
+
│ └── modules
|
|
163
216
|
│ ├── financialAccount.ts
|
|
164
217
|
│ ├── financialAccountTypes.ts
|
|
165
218
|
│ ├── internalTransfer.ts
|
|
@@ -170,31 +223,34 @@ else console.log('payout', p.data)
|
|
|
170
223
|
│ └── payoutTypes.ts
|
|
171
224
|
```
|
|
172
225
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Recommended environment variables (you can store them in `.env` during development):
|
|
226
|
+
---
|
|
176
227
|
|
|
177
|
-
|
|
178
|
-
MONIME_SPACE_ID=space_XXXXXXXX
|
|
179
|
-
MONIME_ACCESS_TOKEN=sk_live_xxx
|
|
180
|
-
```
|
|
228
|
+
## Error Handling
|
|
181
229
|
|
|
182
|
-
|
|
230
|
+
* Network/API errors are returned as `error` in the `{ success, data?, error? }` object.
|
|
231
|
+
* Use `axios.isAxiosError(error)` to inspect response details if needed.
|
|
183
232
|
|
|
184
|
-
|
|
185
|
-
- Network errors: axios errors are returned directly in some functions. Use `axios.isAxiosError` to inspect `error.response` and `error.response.data`.
|
|
186
|
-
- Payouts: if payout calls fail unexpectedly, check `src/functions/payout.ts` — its `URL` constant is empty and must be configured.
|
|
233
|
+
---
|
|
187
234
|
|
|
188
235
|
## Contributing
|
|
189
236
|
|
|
190
|
-
Contributions appreciated. Suggested small first PRs:
|
|
191
237
|
|
|
192
|
-
|
|
193
|
-
- Add tests using `vitest` or `jest` with `nock` or axios mocking.
|
|
194
|
-
- Normalize returned errors to a consistent shape.
|
|
238
|
+
We welcome contributions.
|
|
195
239
|
|
|
196
|
-
|
|
240
|
+
### Getting Started
|
|
241
|
+
1. **Fork the repository** on GitHub
|
|
242
|
+
2. **Clone your fork** locally
|
|
243
|
+
3. **Create a feature branch** from `main`
|
|
244
|
+
4. **Make your changes** following our coding conventions
|
|
245
|
+
5. **Test your changes** thoroughly
|
|
246
|
+
6. **Submit a pull request** with a clear description
|
|
247
|
+
|
|
248
|
+
For detailed contribution guidelines, see [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
249
|
+
|
|
250
|
+
---
|
|
197
251
|
|
|
198
252
|
## License
|
|
199
253
|
|
|
200
|
-
MIT — see
|
|
254
|
+
MIT — see [LICENSE](./LICENSE).
|
|
255
|
+
|
|
256
|
+
---
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
interface CreateFinancialAccount {
|
|
2
2
|
success: boolean;
|
|
3
3
|
messages: string[];
|
|
4
|
-
result: Result$
|
|
4
|
+
result: Result$3;
|
|
5
5
|
}
|
|
6
6
|
interface GetFinancialAccount {
|
|
7
7
|
success: boolean;
|
|
8
8
|
messages: string[];
|
|
9
|
-
result: Result$
|
|
9
|
+
result: Result$3;
|
|
10
10
|
}
|
|
11
|
-
interface Result$
|
|
11
|
+
interface Result$3 {
|
|
12
12
|
id: string;
|
|
13
13
|
uvan: string;
|
|
14
14
|
name: string;
|
|
@@ -20,7 +20,7 @@ interface Result$2 {
|
|
|
20
20
|
updateTime: string;
|
|
21
21
|
metadata: Metadata$2;
|
|
22
22
|
}
|
|
23
|
-
interface Result$
|
|
23
|
+
interface Result$3 {
|
|
24
24
|
id: string;
|
|
25
25
|
uvan: string;
|
|
26
26
|
name: string;
|
|
@@ -51,25 +51,12 @@ interface Available {
|
|
|
51
51
|
value: number;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
interface createFinancialAccountReturn {
|
|
55
|
-
data?: CreateFinancialAccount;
|
|
56
|
-
error?: Error;
|
|
57
|
-
success: boolean;
|
|
58
|
-
}
|
|
59
|
-
declare function createFinancialAccount(accountName: string, monime_space_id: string, monime_access_token: string): Promise<createFinancialAccountReturn>;
|
|
60
|
-
interface GetFinancialAccountReturn {
|
|
61
|
-
data?: GetFinancialAccount;
|
|
62
|
-
error?: Error;
|
|
63
|
-
success: boolean;
|
|
64
|
-
}
|
|
65
|
-
declare function getFinancialAccount(financialAccountId: string, monime_access_token: string, monime_space_id: string): Promise<GetFinancialAccountReturn>;
|
|
66
|
-
|
|
67
54
|
interface CreateInternalTransfer {
|
|
68
55
|
success: boolean;
|
|
69
56
|
messages: string[];
|
|
70
|
-
result: Result$
|
|
57
|
+
result: Result$2;
|
|
71
58
|
}
|
|
72
|
-
interface Result$
|
|
59
|
+
interface Result$2 {
|
|
73
60
|
id: string;
|
|
74
61
|
status: string;
|
|
75
62
|
amount: Amount$1;
|
|
@@ -78,12 +65,12 @@ interface Result$1 {
|
|
|
78
65
|
financialTransactionReference: string;
|
|
79
66
|
description: string;
|
|
80
67
|
failureDetail: FailureDetail$1;
|
|
81
|
-
ownershipGraph: OwnershipGraph$
|
|
68
|
+
ownershipGraph: OwnershipGraph$2;
|
|
82
69
|
createTime: string;
|
|
83
70
|
updateTime: string;
|
|
84
71
|
metadata: Metadata$1;
|
|
85
72
|
}
|
|
86
|
-
interface OwnershipGraph$
|
|
73
|
+
interface OwnershipGraph$2 {
|
|
87
74
|
owner: Owner2$1;
|
|
88
75
|
}
|
|
89
76
|
interface Owner2$1 {
|
|
@@ -112,20 +99,72 @@ interface Amount$1 {
|
|
|
112
99
|
value: number;
|
|
113
100
|
}
|
|
114
101
|
|
|
115
|
-
interface
|
|
116
|
-
data?: CreateInternalTransfer;
|
|
117
|
-
error?: Error;
|
|
102
|
+
interface CreatePaymentCode {
|
|
118
103
|
success: boolean;
|
|
104
|
+
messages: string[];
|
|
105
|
+
result: Result$1;
|
|
119
106
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
107
|
+
interface Result$1 {
|
|
108
|
+
id: string;
|
|
109
|
+
mode: string;
|
|
110
|
+
status: string;
|
|
111
|
+
name: string;
|
|
112
|
+
amount: {
|
|
113
|
+
currency: string;
|
|
114
|
+
value: number;
|
|
115
|
+
};
|
|
116
|
+
enable: boolean;
|
|
117
|
+
expireTime: string;
|
|
118
|
+
customer: {
|
|
119
|
+
name: string;
|
|
120
|
+
};
|
|
121
|
+
ussdCode: string;
|
|
122
|
+
reference: string;
|
|
123
|
+
authorizedProviders: string[];
|
|
124
|
+
authorizedPhoneNumber: string;
|
|
125
|
+
recurrentPaymentTarget: {
|
|
126
|
+
expectedPaymentCount: number;
|
|
127
|
+
expectedPaymentTotal: {
|
|
128
|
+
currency: string;
|
|
129
|
+
value: number;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
financialAccountId: string;
|
|
133
|
+
processedPaymentData: ProcessedPaymentData;
|
|
134
|
+
createTime: string;
|
|
135
|
+
updateTime: string;
|
|
136
|
+
ownershipGraph: OwnershipGraph$1;
|
|
137
|
+
metadata: {};
|
|
138
|
+
}
|
|
139
|
+
interface OwnershipGraph$1 {
|
|
140
|
+
owner: {
|
|
141
|
+
id: string;
|
|
142
|
+
type: string;
|
|
143
|
+
metadata: {};
|
|
144
|
+
owner: {
|
|
145
|
+
id: string;
|
|
146
|
+
type: string;
|
|
147
|
+
metadata: {};
|
|
148
|
+
owner: {};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
interface ProcessedPaymentData {
|
|
153
|
+
amount: {
|
|
154
|
+
currency: string;
|
|
155
|
+
value: number;
|
|
156
|
+
};
|
|
157
|
+
orderId: string;
|
|
158
|
+
paymentId: string;
|
|
159
|
+
orderNumber: string;
|
|
160
|
+
channelData: {
|
|
161
|
+
providerId: string;
|
|
162
|
+
accountId: string;
|
|
163
|
+
reference: string;
|
|
164
|
+
};
|
|
165
|
+
financialTransactionReference: string;
|
|
166
|
+
metadata: {};
|
|
126
167
|
}
|
|
127
|
-
declare function createPaymentCode(paymentName: string, amount: number, financialAccountId: string | null, name: string, phoneNumber: string, monime_access_token: string, monime_space_id: string): Promise<Return$1>;
|
|
128
|
-
declare function deletePaymentCode(paymentCodeId: string, monime_access_token: string, monime_space_id: string): Promise<Return$1>;
|
|
129
168
|
|
|
130
169
|
interface CreatePayout {
|
|
131
170
|
success: boolean;
|
|
@@ -186,11 +225,50 @@ interface Amount {
|
|
|
186
225
|
value: number;
|
|
187
226
|
}
|
|
188
227
|
|
|
189
|
-
interface
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
228
|
+
interface ClientOptions {
|
|
229
|
+
monimeSpaceeId: string;
|
|
230
|
+
accessToken: string;
|
|
231
|
+
}
|
|
232
|
+
declare class MonimeClient {
|
|
233
|
+
private monimeSpaceId;
|
|
234
|
+
private accessToken;
|
|
235
|
+
createFinancialAccount: (name: string) => Promise<{
|
|
236
|
+
success: boolean;
|
|
237
|
+
data?: CreateFinancialAccount;
|
|
238
|
+
error?: Error;
|
|
239
|
+
}>;
|
|
240
|
+
getFinancialAccount: (financialAccountId: string) => Promise<{
|
|
241
|
+
success: boolean;
|
|
242
|
+
data?: GetFinancialAccount;
|
|
243
|
+
error?: Error;
|
|
244
|
+
}>;
|
|
245
|
+
createInternalTransfer: (sourceAccount: string, destinationAccount: string, amount: number) => Promise<{
|
|
246
|
+
success: boolean;
|
|
247
|
+
data?: CreateInternalTransfer;
|
|
248
|
+
error?: Error;
|
|
249
|
+
}>;
|
|
250
|
+
createPaymentCode: (paymentName: string, amount: number, financialAccount: string, username: string, phoneNumber: string) => Promise<{
|
|
251
|
+
success: boolean;
|
|
252
|
+
error?: Error;
|
|
253
|
+
data?: CreatePaymentCode;
|
|
254
|
+
}>;
|
|
255
|
+
deletePaymentCode: (paymentCodeId: string) => Promise<{
|
|
256
|
+
success: boolean;
|
|
257
|
+
error?: Error;
|
|
258
|
+
data?: CreatePaymentCode;
|
|
259
|
+
}>;
|
|
260
|
+
createPayout: (amount: number, phoneNumber: string, sourceAccount: string) => Promise<{
|
|
261
|
+
success: boolean;
|
|
262
|
+
error?: Error;
|
|
263
|
+
data?: CreatePayout;
|
|
264
|
+
}>;
|
|
265
|
+
constructor(options: ClientOptions);
|
|
266
|
+
_getConfig(): {
|
|
267
|
+
monimeSpaceId: string;
|
|
268
|
+
accessToken: string;
|
|
269
|
+
};
|
|
193
270
|
}
|
|
194
|
-
declare function CreatePayoutMobileMoney(amount: number, phoneNumber: string, sourceAccount: string, monime_access_token: string, monime_space_id: string): Promise<Return>;
|
|
195
271
|
|
|
196
|
-
|
|
272
|
+
declare function createClient(options: ClientOptions): MonimeClient;
|
|
273
|
+
|
|
274
|
+
export { type ClientOptions, MonimeClient, createClient };
|