monime-package 0.0.1 → 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 +166 -108
- 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 +5 -3
package/README.md
CHANGED
|
@@ -1,163 +1,218 @@
|
|
|
1
1
|
|
|
2
2
|
# monime-package
|
|
3
3
|
|
|
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.
|
|
5
|
+
|
|
4
6
|

|
|
5
7
|

|
|
8
|
+

|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Package name: `monime-package`
|
|
10
|
+
Package: `monime-package`
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
---
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
- [Features](#features)
|
|
15
|
-
- [Installation](#installation)
|
|
16
|
-
- [Quick start](#quick-start)
|
|
17
|
-
- [API reference](#api-reference)
|
|
18
|
-
- [Examples](#examples)
|
|
19
|
-
- [Folder structure](#folder-structure)
|
|
20
|
-
- [Configuration & env](#configuration--env)
|
|
21
|
-
- [Troubleshooting](#troubleshooting)
|
|
22
|
-
- [Contributing](#contributing)
|
|
23
|
-
- [License](#license)
|
|
14
|
+
## Table of Contents
|
|
24
15
|
|
|
25
|
-
|
|
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)
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
---
|
|
28
29
|
|
|
29
30
|
## Features
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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)
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
---
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
## Installation
|
|
39
41
|
|
|
40
42
|
```bash
|
|
41
43
|
npm install monime-package
|
|
44
|
+
# or
|
|
45
|
+
pnpm add monime-package
|
|
42
46
|
```
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Environment Variables
|
|
51
|
+
|
|
52
|
+
Recommended to store credentials in `.env`:
|
|
45
53
|
|
|
46
54
|
```bash
|
|
47
|
-
|
|
55
|
+
MONIME_SPACE_ID=space_XXXXXXXX
|
|
56
|
+
MONIME_ACCESS_TOKEN=sk_live_xxx
|
|
48
57
|
```
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
You can also pass credentials directly when creating the client.
|
|
51
60
|
|
|
52
|
-
|
|
53
|
-
2. Import the helpers and call them.
|
|
61
|
+
---
|
|
54
62
|
|
|
55
|
-
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
### Create a client
|
|
56
66
|
|
|
57
67
|
```ts
|
|
58
|
-
import {
|
|
59
|
-
createFinancialAccount,
|
|
60
|
-
createPaymentCode,
|
|
61
|
-
createInternalTransfer,
|
|
62
|
-
getFinancialAccount,
|
|
63
|
-
deletePaymentCode,
|
|
64
|
-
CreatePayoutMobileMoney,
|
|
65
|
-
} from 'monime-package'
|
|
66
|
-
|
|
67
|
-
async function demo() {
|
|
68
|
-
const MONIME_SPACE_ID = process.env.MONIME_SPACE_ID!
|
|
69
|
-
const MONIME_ACCESS_TOKEN = process.env.MONIME_ACCESS_TOKEN!
|
|
70
|
-
|
|
71
|
-
// Create a financial account
|
|
72
|
-
const createRes = await createFinancialAccount('My App Account', MONIME_SPACE_ID, MONIME_ACCESS_TOKEN)
|
|
73
|
-
if (!createRes.success) throw createRes.error
|
|
74
|
-
|
|
75
|
-
const accountId = createRes.data?.result?.id
|
|
76
|
-
console.log('Created account id', accountId)
|
|
77
|
-
}
|
|
68
|
+
import { createClient } from 'monime-package'
|
|
78
69
|
|
|
79
|
-
|
|
70
|
+
const client = createClient({
|
|
71
|
+
monimeSpaceeId: process.env.MONIME_SPACE_ID!,
|
|
72
|
+
accessToken: process.env.MONIME_ACCESS_TOKEN!,
|
|
73
|
+
})
|
|
80
74
|
```
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
Now all methods automatically use the client’s credentials.
|
|
83
77
|
|
|
84
|
-
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Client API
|
|
81
|
+
|
|
82
|
+
All methods return:
|
|
85
83
|
|
|
86
84
|
```ts
|
|
87
85
|
type Result<T> = {
|
|
88
86
|
success: boolean
|
|
89
87
|
data?: T
|
|
90
|
-
error?:
|
|
88
|
+
error?: Error
|
|
91
89
|
}
|
|
92
90
|
```
|
|
93
91
|
|
|
94
|
-
|
|
92
|
+
### Financial Accounts
|
|
95
93
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
+
```
|
|
102
122
|
|
|
103
|
-
|
|
123
|
+
### Payouts
|
|
104
124
|
|
|
105
|
-
|
|
125
|
+
```ts
|
|
126
|
+
client.createPayout(
|
|
127
|
+
amount: number,
|
|
128
|
+
phoneNumber: string,
|
|
129
|
+
sourceAccount: string
|
|
130
|
+
): Promise<Result<CreatePayout>>
|
|
131
|
+
```
|
|
106
132
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
- 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
|
+
---
|
|
111
136
|
|
|
112
137
|
## Examples
|
|
113
138
|
|
|
114
|
-
Create a
|
|
139
|
+
### Create a financial account
|
|
115
140
|
|
|
116
141
|
```ts
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const res = await createPaymentCode('Order-001', 5, 'financial-account-id', 'Alice', '0771234567', process.env.MONIME_ACCESS_TOKEN!, process.env.MONIME_SPACE_ID!)
|
|
121
|
-
if (!res.success) {
|
|
122
|
-
console.error('Failed to create payment code', res.error)
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
console.log('USSD code:', res.code)
|
|
126
|
-
}
|
|
142
|
+
const account = await client.createFinancialAccount('App Wallet')
|
|
143
|
+
if (!account.success) throw account.error
|
|
144
|
+
console.log(account.data)
|
|
127
145
|
```
|
|
128
146
|
|
|
129
|
-
|
|
147
|
+
### Get account details
|
|
130
148
|
|
|
131
149
|
```ts
|
|
132
|
-
|
|
150
|
+
const details = await client.getFinancialAccount(account.data!.result.id)
|
|
151
|
+
console.log(details)
|
|
152
|
+
```
|
|
133
153
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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)
|
|
137
183
|
```
|
|
138
184
|
|
|
139
|
-
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Migration from Old Helpers
|
|
188
|
+
|
|
189
|
+
Previously, you had to pass `monimeSpaceId` and `accessToken` into every function:
|
|
140
190
|
|
|
141
191
|
```ts
|
|
142
|
-
|
|
192
|
+
createFinancialAccount('name', MONIME_SPACE_ID, MONIME_ACCESS_TOKEN)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Now, create a client once:
|
|
143
196
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
197
|
+
```ts
|
|
198
|
+
const client = createClient({ monimeSpaceeId, accessToken })
|
|
199
|
+
client.createFinancialAccount('name') // credentials auto-applied
|
|
147
200
|
```
|
|
148
201
|
|
|
149
|
-
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Folder Structure
|
|
150
205
|
|
|
151
206
|
```
|
|
152
|
-
.
|
|
207
|
+
.
|
|
153
208
|
├── LICENSE
|
|
154
209
|
├── README.md
|
|
155
210
|
├── package.json
|
|
156
211
|
├── tsconfig.json
|
|
157
212
|
├── tsup.config.ts
|
|
158
213
|
├── src
|
|
159
|
-
│ ├── index.ts
|
|
160
|
-
│ └──
|
|
214
|
+
│ ├── index.ts # entry point
|
|
215
|
+
│ └── modules
|
|
161
216
|
│ ├── financialAccount.ts
|
|
162
217
|
│ ├── financialAccountTypes.ts
|
|
163
218
|
│ ├── internalTransfer.ts
|
|
@@ -168,31 +223,34 @@ else console.log('payout', p.data)
|
|
|
168
223
|
│ └── payoutTypes.ts
|
|
169
224
|
```
|
|
170
225
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
Recommended environment variables (you can store them in `.env` during development):
|
|
226
|
+
---
|
|
174
227
|
|
|
175
|
-
|
|
176
|
-
MONIME_SPACE_ID=space_XXXXXXXX
|
|
177
|
-
MONIME_ACCESS_TOKEN=sk_live_xxx
|
|
178
|
-
```
|
|
228
|
+
## Error Handling
|
|
179
229
|
|
|
180
|
-
|
|
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.
|
|
181
232
|
|
|
182
|
-
|
|
183
|
-
- Network errors: axios errors are returned directly in some functions. Use `axios.isAxiosError` to inspect `error.response` and `error.response.data`.
|
|
184
|
-
- Payouts: if payout calls fail unexpectedly, check `src/functions/payout.ts` — its `URL` constant is empty and must be configured.
|
|
233
|
+
---
|
|
185
234
|
|
|
186
235
|
## Contributing
|
|
187
236
|
|
|
188
|
-
Contributions appreciated. Suggested small first PRs:
|
|
189
237
|
|
|
190
|
-
|
|
191
|
-
- Add tests using `vitest` or `jest` with `nock` or axios mocking.
|
|
192
|
-
- Normalize returned errors to a consistent shape.
|
|
238
|
+
We welcome contributions.
|
|
193
239
|
|
|
194
|
-
|
|
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
|
+
---
|
|
195
251
|
|
|
196
252
|
## License
|
|
197
253
|
|
|
198
|
-
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 };
|