@oumla/sdk 0.0.1
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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.prettierrc +7 -0
- package/README.md +16 -0
- package/dist/index.d.ts +690 -0
- package/dist/index.js +4146 -0
- package/dist/index.mjs +4120 -0
- package/package.json +30 -0
- package/tsconfig.json +12 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const NetworkSchema: z.ZodEnum<["BTC", "ETH"]>;
|
|
4
|
+
declare const ProfileTypeSchema: z.ZodEnum<["User", "Department", "Merchant"]>;
|
|
5
|
+
declare const GetWalletsSchema: z.ZodObject<{
|
|
6
|
+
reference: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
reference: string;
|
|
9
|
+
}, {
|
|
10
|
+
reference: string;
|
|
11
|
+
}>;
|
|
12
|
+
declare const GetProfileWalletsSchema: z.ZodObject<{
|
|
13
|
+
reference: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
reference: string;
|
|
16
|
+
}, {
|
|
17
|
+
reference: string;
|
|
18
|
+
}>;
|
|
19
|
+
declare const GenerateWalletSchema: z.ZodObject<{
|
|
20
|
+
network: z.ZodEnum<["BTC", "ETH"]>;
|
|
21
|
+
reference: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
reference: string;
|
|
24
|
+
network: "BTC" | "ETH";
|
|
25
|
+
}, {
|
|
26
|
+
reference: string;
|
|
27
|
+
network: "BTC" | "ETH";
|
|
28
|
+
}>;
|
|
29
|
+
declare const GetTransactionsByAddressSchema: z.ZodObject<{
|
|
30
|
+
baseUrl: z.ZodString;
|
|
31
|
+
address: z.ZodString;
|
|
32
|
+
apiKey: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
baseUrl: string;
|
|
35
|
+
address: string;
|
|
36
|
+
apiKey: string;
|
|
37
|
+
}, {
|
|
38
|
+
baseUrl: string;
|
|
39
|
+
address: string;
|
|
40
|
+
apiKey: string;
|
|
41
|
+
}>;
|
|
42
|
+
declare const GetTransactionsByWalletSchema: z.ZodObject<{
|
|
43
|
+
baseUrl: z.ZodString;
|
|
44
|
+
wallet: z.ZodString;
|
|
45
|
+
apiKey: z.ZodString;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
baseUrl: string;
|
|
48
|
+
apiKey: string;
|
|
49
|
+
wallet: string;
|
|
50
|
+
}, {
|
|
51
|
+
baseUrl: string;
|
|
52
|
+
apiKey: string;
|
|
53
|
+
wallet: string;
|
|
54
|
+
}>;
|
|
55
|
+
declare const GetTransactionsByReferenceSchema: z.ZodObject<{
|
|
56
|
+
baseUrl: z.ZodString;
|
|
57
|
+
reference: z.ZodString;
|
|
58
|
+
apiKey: z.ZodString;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
reference: string;
|
|
61
|
+
baseUrl: string;
|
|
62
|
+
apiKey: string;
|
|
63
|
+
}, {
|
|
64
|
+
reference: string;
|
|
65
|
+
baseUrl: string;
|
|
66
|
+
apiKey: string;
|
|
67
|
+
}>;
|
|
68
|
+
declare const GetTransactionsSchema: z.ZodObject<{
|
|
69
|
+
address: z.ZodOptional<z.ZodString>;
|
|
70
|
+
wallet: z.ZodOptional<z.ZodString>;
|
|
71
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
address?: string | undefined;
|
|
74
|
+
wallet?: string | undefined;
|
|
75
|
+
reference?: string | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
address?: string | undefined;
|
|
78
|
+
wallet?: string | undefined;
|
|
79
|
+
reference?: string | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
declare const GenerateAddressSchema: z.ZodObject<{
|
|
82
|
+
network: z.ZodEnum<["BTC", "ETH"]>;
|
|
83
|
+
reference: z.ZodString;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
reference: string;
|
|
86
|
+
network: "BTC" | "ETH";
|
|
87
|
+
}, {
|
|
88
|
+
reference: string;
|
|
89
|
+
network: "BTC" | "ETH";
|
|
90
|
+
}>;
|
|
91
|
+
declare const GetAddressesSchema: z.ZodObject<{
|
|
92
|
+
baseUrl: z.ZodString;
|
|
93
|
+
apiKey: z.ZodString;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
baseUrl: string;
|
|
96
|
+
apiKey: string;
|
|
97
|
+
}, {
|
|
98
|
+
baseUrl: string;
|
|
99
|
+
apiKey: string;
|
|
100
|
+
}>;
|
|
101
|
+
declare const GetProfileAddressesSchema: z.ZodObject<{
|
|
102
|
+
reference: z.ZodString;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
reference: string;
|
|
105
|
+
}, {
|
|
106
|
+
reference: string;
|
|
107
|
+
}>;
|
|
108
|
+
declare const GetAddressSchema: z.ZodObject<{
|
|
109
|
+
reference: z.ZodString;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
reference: string;
|
|
112
|
+
}, {
|
|
113
|
+
reference: string;
|
|
114
|
+
}>;
|
|
115
|
+
declare const CreateProfileSchema: z.ZodObject<{
|
|
116
|
+
reference: z.ZodString;
|
|
117
|
+
type: z.ZodEnum<["User", "Department", "Merchant"]>;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
reference: string;
|
|
120
|
+
type: "User" | "Department" | "Merchant";
|
|
121
|
+
}, {
|
|
122
|
+
reference: string;
|
|
123
|
+
type: "User" | "Department" | "Merchant";
|
|
124
|
+
}>;
|
|
125
|
+
declare const GetProfilesSchema: z.ZodObject<{
|
|
126
|
+
baseUrl: z.ZodString;
|
|
127
|
+
apiKey: z.ZodString;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
baseUrl: string;
|
|
130
|
+
apiKey: string;
|
|
131
|
+
}, {
|
|
132
|
+
baseUrl: string;
|
|
133
|
+
apiKey: string;
|
|
134
|
+
}>;
|
|
135
|
+
declare const GetVolumeSchema: z.ZodObject<{
|
|
136
|
+
baseUrl: z.ZodString;
|
|
137
|
+
apiKey: z.ZodString;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
baseUrl: string;
|
|
140
|
+
apiKey: string;
|
|
141
|
+
}, {
|
|
142
|
+
baseUrl: string;
|
|
143
|
+
apiKey: string;
|
|
144
|
+
}>;
|
|
145
|
+
declare const GetInsightsSchema: z.ZodObject<{
|
|
146
|
+
baseUrl: z.ZodString;
|
|
147
|
+
apiKey: z.ZodString;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
baseUrl: string;
|
|
150
|
+
apiKey: string;
|
|
151
|
+
}, {
|
|
152
|
+
baseUrl: string;
|
|
153
|
+
apiKey: string;
|
|
154
|
+
}>;
|
|
155
|
+
declare const CreateTransactionSchema: z.ZodObject<{
|
|
156
|
+
to: z.ZodString;
|
|
157
|
+
amount: z.ZodNumber;
|
|
158
|
+
from: z.ZodArray<z.ZodString, "many">;
|
|
159
|
+
network: z.ZodEnum<["BTC", "ETH"]>;
|
|
160
|
+
}, "strip", z.ZodTypeAny, {
|
|
161
|
+
network: "BTC" | "ETH";
|
|
162
|
+
to: string;
|
|
163
|
+
amount: number;
|
|
164
|
+
from: string[];
|
|
165
|
+
}, {
|
|
166
|
+
network: "BTC" | "ETH";
|
|
167
|
+
to: string;
|
|
168
|
+
amount: number;
|
|
169
|
+
from: string[];
|
|
170
|
+
}>;
|
|
171
|
+
declare const GetOrganizationSchema: z.ZodObject<{
|
|
172
|
+
baseUrl: z.ZodString;
|
|
173
|
+
apiKey: z.ZodString;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
baseUrl: string;
|
|
176
|
+
apiKey: string;
|
|
177
|
+
}, {
|
|
178
|
+
baseUrl: string;
|
|
179
|
+
apiKey: string;
|
|
180
|
+
}>;
|
|
181
|
+
declare const GetOrganizationDashboardSchema: z.ZodObject<{
|
|
182
|
+
baseUrl: z.ZodString;
|
|
183
|
+
apiKey: z.ZodString;
|
|
184
|
+
}, "strip", z.ZodTypeAny, {
|
|
185
|
+
baseUrl: string;
|
|
186
|
+
apiKey: string;
|
|
187
|
+
}, {
|
|
188
|
+
baseUrl: string;
|
|
189
|
+
apiKey: string;
|
|
190
|
+
}>;
|
|
191
|
+
|
|
192
|
+
type TBaseConfigs = {
|
|
193
|
+
apiKey: string;
|
|
194
|
+
baseUrl?: string;
|
|
195
|
+
env?: EnvType;
|
|
196
|
+
};
|
|
197
|
+
type THttpRequestArgs = {
|
|
198
|
+
path: string;
|
|
199
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
200
|
+
body?: Record<string, unknown>;
|
|
201
|
+
schema?: z.Schema<unknown>;
|
|
202
|
+
pagination?: TPagination;
|
|
203
|
+
};
|
|
204
|
+
type TPagination = {
|
|
205
|
+
totalElements?: number;
|
|
206
|
+
totalPages?: number;
|
|
207
|
+
skip?: number;
|
|
208
|
+
take?: number;
|
|
209
|
+
};
|
|
210
|
+
type THttpError = {
|
|
211
|
+
status?: number;
|
|
212
|
+
message: string;
|
|
213
|
+
success?: boolean;
|
|
214
|
+
path: string;
|
|
215
|
+
};
|
|
216
|
+
declare enum ProfileType {
|
|
217
|
+
User = "User",
|
|
218
|
+
Department = "Department",
|
|
219
|
+
Merchant = "Merchant"
|
|
220
|
+
}
|
|
221
|
+
declare enum Network {
|
|
222
|
+
BTC = "BTC",
|
|
223
|
+
ETH = "ETH"
|
|
224
|
+
}
|
|
225
|
+
type PaymentType = 'Withdraw' | 'Deposit';
|
|
226
|
+
type PaymentStatus = 'Pending' | 'Confirmed';
|
|
227
|
+
type AssetType = 'Token' | 'NFT';
|
|
228
|
+
type TransactionType = 'withdraw' | 'deposit';
|
|
229
|
+
type TransactionStatus = 'pending' | 'confirmed';
|
|
230
|
+
type Tags = {
|
|
231
|
+
name: string;
|
|
232
|
+
address: Address[];
|
|
233
|
+
};
|
|
234
|
+
type Organization = {
|
|
235
|
+
name: string;
|
|
236
|
+
email: string;
|
|
237
|
+
};
|
|
238
|
+
type Profile = {
|
|
239
|
+
reference: string;
|
|
240
|
+
userIndex: number;
|
|
241
|
+
currentIndex: number;
|
|
242
|
+
organizationId: string;
|
|
243
|
+
type: ProfileType;
|
|
244
|
+
label?: string;
|
|
245
|
+
};
|
|
246
|
+
type MiniWallet = {
|
|
247
|
+
date: Date;
|
|
248
|
+
organizationId: string;
|
|
249
|
+
reference: string;
|
|
250
|
+
index: number;
|
|
251
|
+
currentDeepIndex: number;
|
|
252
|
+
address: Address[];
|
|
253
|
+
transaction: Transaction[];
|
|
254
|
+
type: ProfileType;
|
|
255
|
+
WalletCoinType: Network;
|
|
256
|
+
};
|
|
257
|
+
type Address = {
|
|
258
|
+
address: string;
|
|
259
|
+
date: Date;
|
|
260
|
+
index: number;
|
|
261
|
+
label?: string;
|
|
262
|
+
Transaction: Transaction[];
|
|
263
|
+
Tags: Tags[];
|
|
264
|
+
network: Network;
|
|
265
|
+
balance: number;
|
|
266
|
+
reference: string;
|
|
267
|
+
};
|
|
268
|
+
type Transaction = {
|
|
269
|
+
date: Date;
|
|
270
|
+
amount: number;
|
|
271
|
+
txid: string;
|
|
272
|
+
addressTo?: string;
|
|
273
|
+
addressFrom?: string;
|
|
274
|
+
type: PaymentType;
|
|
275
|
+
isSpent: boolean;
|
|
276
|
+
isMempool: boolean;
|
|
277
|
+
status: PaymentStatus;
|
|
278
|
+
organizationId?: string;
|
|
279
|
+
addressId: string;
|
|
280
|
+
};
|
|
281
|
+
type Insights = {
|
|
282
|
+
totalVolume: number;
|
|
283
|
+
organizationId: string;
|
|
284
|
+
volumeByDay: VolumeByDay[];
|
|
285
|
+
};
|
|
286
|
+
type VolumeByDay = {
|
|
287
|
+
totalVolume: number;
|
|
288
|
+
organizationId: string;
|
|
289
|
+
insightsId?: string;
|
|
290
|
+
};
|
|
291
|
+
type TGetWalletsResponse = {
|
|
292
|
+
wallets: {
|
|
293
|
+
type: z.infer<typeof ProfileTypeSchema>;
|
|
294
|
+
date: Date;
|
|
295
|
+
reference: string;
|
|
296
|
+
organizationId: string;
|
|
297
|
+
WalletCoinType: z.infer<typeof NetworkSchema>;
|
|
298
|
+
currentDeepIndex: number;
|
|
299
|
+
index: number;
|
|
300
|
+
label: string | null;
|
|
301
|
+
profile: {
|
|
302
|
+
createdAt: Date;
|
|
303
|
+
updated_at: Date;
|
|
304
|
+
isActive: boolean;
|
|
305
|
+
reference: string;
|
|
306
|
+
userIndex: number;
|
|
307
|
+
currentIndex: number;
|
|
308
|
+
organizationId: string;
|
|
309
|
+
bitcoin_balance: {
|
|
310
|
+
id: string;
|
|
311
|
+
balance: number;
|
|
312
|
+
organizationId: string;
|
|
313
|
+
reference: string;
|
|
314
|
+
createdAt: Date;
|
|
315
|
+
updatedAt: Date;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
}[];
|
|
319
|
+
} & TPagination;
|
|
320
|
+
type Wallet = {
|
|
321
|
+
id: string;
|
|
322
|
+
date: Date;
|
|
323
|
+
organizationId: string;
|
|
324
|
+
reference: string;
|
|
325
|
+
index: number;
|
|
326
|
+
currentDeepIndex: number;
|
|
327
|
+
type: z.infer<typeof ProfileTypeSchema>;
|
|
328
|
+
WalletCoinType: z.infer<typeof NetworkSchema>;
|
|
329
|
+
createdAt: Date;
|
|
330
|
+
updatedAt: Date;
|
|
331
|
+
};
|
|
332
|
+
type TGetProfileWalletsResponse = {
|
|
333
|
+
reference: string;
|
|
334
|
+
};
|
|
335
|
+
type TGenerateAddressResponse = {
|
|
336
|
+
address?: string;
|
|
337
|
+
message: string;
|
|
338
|
+
};
|
|
339
|
+
type TGetAddressesResponse = {
|
|
340
|
+
addresses: {
|
|
341
|
+
id: string;
|
|
342
|
+
date: Date;
|
|
343
|
+
address: string;
|
|
344
|
+
label: string | null;
|
|
345
|
+
network: z.infer<typeof NetworkSchema>;
|
|
346
|
+
balance: number;
|
|
347
|
+
}[];
|
|
348
|
+
} & TPagination;
|
|
349
|
+
type TGetOrganizationResponse = {
|
|
350
|
+
id: string;
|
|
351
|
+
name: string;
|
|
352
|
+
email: string;
|
|
353
|
+
};
|
|
354
|
+
type TCreateProfileResponse = {
|
|
355
|
+
message: string;
|
|
356
|
+
profile: {
|
|
357
|
+
reference: string;
|
|
358
|
+
type: string;
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
type TGetProfilesResponse = {
|
|
362
|
+
profiles: {
|
|
363
|
+
organizationId: string;
|
|
364
|
+
reference: string;
|
|
365
|
+
type: z.infer<typeof ProfileTypeSchema>;
|
|
366
|
+
createdAt: Date;
|
|
367
|
+
updated_at: Date;
|
|
368
|
+
label: string | null;
|
|
369
|
+
bitcoin_balance: {
|
|
370
|
+
balance: number;
|
|
371
|
+
} | null;
|
|
372
|
+
miniWallets: {
|
|
373
|
+
date: Date;
|
|
374
|
+
organizationId: string;
|
|
375
|
+
reference: string;
|
|
376
|
+
type: z.infer<typeof ProfileTypeSchema>;
|
|
377
|
+
WalletCoinType: z.infer<typeof NetworkSchema>;
|
|
378
|
+
currentDeepIndex: number;
|
|
379
|
+
index: number;
|
|
380
|
+
}[];
|
|
381
|
+
}[];
|
|
382
|
+
} & TPagination;
|
|
383
|
+
type TGetVolumeResponse = {
|
|
384
|
+
createdAt: Date;
|
|
385
|
+
updatedAt: Date;
|
|
386
|
+
totalVolume: number;
|
|
387
|
+
organizationId: string;
|
|
388
|
+
insightsId: string | null;
|
|
389
|
+
}[];
|
|
390
|
+
type TGetInsightsResponse = {
|
|
391
|
+
volumeByDay: {
|
|
392
|
+
createdAt: Date;
|
|
393
|
+
totalVolume: number;
|
|
394
|
+
}[];
|
|
395
|
+
totalVolume: number;
|
|
396
|
+
} | null;
|
|
397
|
+
type TGetTransactionsResponse = {
|
|
398
|
+
id: string;
|
|
399
|
+
date: Date;
|
|
400
|
+
type: TransactionType;
|
|
401
|
+
status: TransactionStatus;
|
|
402
|
+
amount: number;
|
|
403
|
+
txid: string;
|
|
404
|
+
addressTo: string | null;
|
|
405
|
+
addressFrom: string | null;
|
|
406
|
+
isSpent: boolean;
|
|
407
|
+
isMempool: boolean;
|
|
408
|
+
}[] & TPagination;
|
|
409
|
+
type TTransferResponse = {
|
|
410
|
+
id: string;
|
|
411
|
+
status: string;
|
|
412
|
+
};
|
|
413
|
+
type TGenerateWalletResponse = {
|
|
414
|
+
id: string;
|
|
415
|
+
date: Date;
|
|
416
|
+
organizationId: string;
|
|
417
|
+
reference: string;
|
|
418
|
+
index: number;
|
|
419
|
+
currentDeepIndex: number;
|
|
420
|
+
type: z.infer<typeof ProfileTypeSchema>;
|
|
421
|
+
WalletCoinType: z.infer<typeof NetworkSchema>;
|
|
422
|
+
createdAt: Date;
|
|
423
|
+
updatedAt: Date;
|
|
424
|
+
};
|
|
425
|
+
type TGenerateWalletArgs = z.infer<typeof GenerateWalletSchema>;
|
|
426
|
+
type TGetProfileWalletsArgs = z.infer<typeof GetProfileWalletsSchema>;
|
|
427
|
+
type TGetTransactionsByAddressArgs = z.infer<typeof GetTransactionsByAddressSchema>;
|
|
428
|
+
type TGetTransactionsByReferenceArgs = z.infer<typeof GetTransactionsByReferenceSchema>;
|
|
429
|
+
type TGetTransactionsByWalletArgs = z.infer<typeof GetTransactionsByWalletSchema>;
|
|
430
|
+
type TGetTransactionsArgs = z.infer<typeof GetTransactionsSchema>;
|
|
431
|
+
type TGenerateAddressArgs = z.infer<typeof GenerateAddressSchema>;
|
|
432
|
+
type TGetAddressesArgs = z.infer<typeof GetAddressesSchema>;
|
|
433
|
+
type TGetProfileAddressesArgs = z.infer<typeof GetProfileAddressesSchema>;
|
|
434
|
+
type TGetAddresses = z.infer<typeof GetAddressSchema>;
|
|
435
|
+
type TCreateProfileArgs = z.infer<typeof CreateProfileSchema>;
|
|
436
|
+
type TGetProfilesArgs = z.infer<typeof GetProfilesSchema>;
|
|
437
|
+
type TGetVolumeArgs = z.infer<typeof GetVolumeSchema>;
|
|
438
|
+
type TGetInsightsArgs = z.infer<typeof GetInsightsSchema>;
|
|
439
|
+
type TCreateTransactionArgs = z.infer<typeof CreateTransactionSchema>;
|
|
440
|
+
type TGetOrganizationArgs = z.infer<typeof GetOrganizationSchema>;
|
|
441
|
+
type TGetOrganizationDashboardArgs = z.infer<typeof GetOrganizationDashboardSchema>;
|
|
442
|
+
type TGetWallets = z.infer<typeof GetWalletsSchema>;
|
|
443
|
+
type EnvType = 'testnet' | 'mainnet';
|
|
444
|
+
|
|
445
|
+
declare abstract class Base {
|
|
446
|
+
protected apiKey: string;
|
|
447
|
+
protected baseUrl: string;
|
|
448
|
+
protected env: string;
|
|
449
|
+
constructor(configs: TBaseConfigs);
|
|
450
|
+
/**
|
|
451
|
+
*
|
|
452
|
+
* A generic method to make requests to the Oumla API.
|
|
453
|
+
* Keep it simple for now, could be enhanced later.
|
|
454
|
+
*
|
|
455
|
+
*/
|
|
456
|
+
protected httpRequest<T>(args: THttpRequestArgs): Promise<T>;
|
|
457
|
+
private parseInput;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Oumla SDK
|
|
462
|
+
* @param apiKey - Your API key
|
|
463
|
+
* @param baseUrl - The base URL of the API
|
|
464
|
+
* @param env - The environment of the API
|
|
465
|
+
* @example
|
|
466
|
+
* ```ts
|
|
467
|
+
*
|
|
468
|
+
* const client = new Oumla({
|
|
469
|
+
* apiKey: 'YOUR_API_KEY',
|
|
470
|
+
* baseUrl: 'https://sandbox.oumla.com',
|
|
471
|
+
* env: 'testnet',
|
|
472
|
+
* })
|
|
473
|
+
* ```
|
|
474
|
+
*/
|
|
475
|
+
declare class Oumla extends Base {
|
|
476
|
+
constructor(configs: TBaseConfigs);
|
|
477
|
+
/**
|
|
478
|
+
*
|
|
479
|
+
* Generate a wallet for a profile
|
|
480
|
+
*
|
|
481
|
+
* @param {string} args.reference - The reference of the profile
|
|
482
|
+
* @param {string} args.network - The network to generate a wallet for
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* ``` ts
|
|
486
|
+
*
|
|
487
|
+
* const wallet = await client.generateWallet({
|
|
488
|
+
* reference: 'PROFILE_REFERENCE',
|
|
489
|
+
* network: 'BTC',
|
|
490
|
+
* });
|
|
491
|
+
*
|
|
492
|
+
* ```
|
|
493
|
+
*
|
|
494
|
+
* @returns {Types.TGenerateWalletResponse} - The generated wallet or an error
|
|
495
|
+
*
|
|
496
|
+
*/
|
|
497
|
+
generateWallet(args: TGenerateWalletArgs): Promise<TGenerateWalletResponse>;
|
|
498
|
+
/**
|
|
499
|
+
*
|
|
500
|
+
* Get wallets for an organization
|
|
501
|
+
*
|
|
502
|
+
* @param {string} args.reference - The reference of the profile
|
|
503
|
+
* @param {Types.TPagination} [pagination] - Pagination options
|
|
504
|
+
*
|
|
505
|
+
* @example
|
|
506
|
+
* ``` ts
|
|
507
|
+
*
|
|
508
|
+
* const wallets = await client.getWallets({
|
|
509
|
+
* skip: 0,
|
|
510
|
+
* take: 3,
|
|
511
|
+
* });
|
|
512
|
+
*
|
|
513
|
+
* ```
|
|
514
|
+
*
|
|
515
|
+
* @returns {Types.TGetWalletsResponse} - The wallets for the organization
|
|
516
|
+
*
|
|
517
|
+
*/
|
|
518
|
+
getWallets(args?: TGetWallets, pagination?: TPagination): Promise<TGetWalletsResponse>;
|
|
519
|
+
/**
|
|
520
|
+
*
|
|
521
|
+
* Generate an address for a profile
|
|
522
|
+
*
|
|
523
|
+
* @param {string} args.reference - The reference of the profile
|
|
524
|
+
* @param {string} args.network - The network to generate an address for
|
|
525
|
+
*
|
|
526
|
+
* @example
|
|
527
|
+
* ``` ts
|
|
528
|
+
*
|
|
529
|
+
* const address = await client.generateAddress({
|
|
530
|
+
* reference: 'PROFILE_REFERENCE',
|
|
531
|
+
* network: 'BTC',
|
|
532
|
+
* });
|
|
533
|
+
*
|
|
534
|
+
* ```
|
|
535
|
+
*
|
|
536
|
+
* @returns {Types.TGenerateAddressResponse} - The generated address
|
|
537
|
+
*/
|
|
538
|
+
generateAddress(args: TGenerateAddressArgs): Promise<TGenerateAddressResponse>;
|
|
539
|
+
/**
|
|
540
|
+
*
|
|
541
|
+
* Get addresses
|
|
542
|
+
*
|
|
543
|
+
* @param {string} args.reference - The reference of the profile, Optional
|
|
544
|
+
* @param {Types.TPagination} [pagination] - Pagination options
|
|
545
|
+
* @example
|
|
546
|
+
* ``` ts
|
|
547
|
+
*
|
|
548
|
+
* const addresses = await client.getAddresses({
|
|
549
|
+
* reference: 'PROFILE_REFERENCE',
|
|
550
|
+
* },
|
|
551
|
+
* {
|
|
552
|
+
* skip: 0,
|
|
553
|
+
* take: 3,
|
|
554
|
+
* }
|
|
555
|
+
* );
|
|
556
|
+
*
|
|
557
|
+
* ```
|
|
558
|
+
*
|
|
559
|
+
* @returns {Types.TGetProfileAddressesResponse} - The addresses for the profile
|
|
560
|
+
*/
|
|
561
|
+
getAddresses(args?: TGetAddresses, pagination?: TPagination): Promise<TGetAddressesResponse>;
|
|
562
|
+
/**
|
|
563
|
+
*
|
|
564
|
+
* Get the organization's information
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* ``` ts
|
|
568
|
+
*
|
|
569
|
+
* const organization = await client.getOrganization();
|
|
570
|
+
*
|
|
571
|
+
* ```
|
|
572
|
+
*
|
|
573
|
+
* @returns {Types.TGetOrganizationResponse} - The organization's information
|
|
574
|
+
*/
|
|
575
|
+
getOrganization(): Promise<TGetOrganizationResponse>;
|
|
576
|
+
/**
|
|
577
|
+
*
|
|
578
|
+
* Create a profile
|
|
579
|
+
*
|
|
580
|
+
* @param {string} args.reference - The reference of the profile
|
|
581
|
+
* @param {Types.TCreateProfileArgs['type']} args.type - The type of the profile
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* ``` ts
|
|
585
|
+
*
|
|
586
|
+
* const profile = await client.createProfile({
|
|
587
|
+
* reference: 'PROFILE_REFERENCE',
|
|
588
|
+
* type: 'User',
|
|
589
|
+
* });
|
|
590
|
+
*
|
|
591
|
+
* ```
|
|
592
|
+
*
|
|
593
|
+
* @returns {Types.TCreateProfileResponse} - The created profile
|
|
594
|
+
*/
|
|
595
|
+
createProfile(args: TCreateProfileArgs): Promise<TCreateProfileResponse>;
|
|
596
|
+
/**
|
|
597
|
+
*
|
|
598
|
+
* Get the profiles for an organization
|
|
599
|
+
*
|
|
600
|
+
* @param {Types.TPagination} [pagination] - Pagination options
|
|
601
|
+
*
|
|
602
|
+
* @example
|
|
603
|
+
* ``` ts
|
|
604
|
+
*
|
|
605
|
+
* const profiles = await client.getProfiles({
|
|
606
|
+
* skip: 0,
|
|
607
|
+
* take: 3,
|
|
608
|
+
* });
|
|
609
|
+
*
|
|
610
|
+
* ```
|
|
611
|
+
*
|
|
612
|
+
* @returns {Types.TGetProfilesResponse} - The profiles for the organization
|
|
613
|
+
*/
|
|
614
|
+
getProfiles(pagination?: TPagination): Promise<TGetProfilesResponse>;
|
|
615
|
+
/**
|
|
616
|
+
*
|
|
617
|
+
* Get the volume for an organization
|
|
618
|
+
*
|
|
619
|
+
* @example
|
|
620
|
+
* ``` ts
|
|
621
|
+
*
|
|
622
|
+
* const volume = await client.getVolume();
|
|
623
|
+
*
|
|
624
|
+
* ```
|
|
625
|
+
*
|
|
626
|
+
* @returns {Types.TGetVolumeResponse} - The volume of the organization
|
|
627
|
+
*/
|
|
628
|
+
getVolume(): Promise<TGetVolumeResponse>;
|
|
629
|
+
/**
|
|
630
|
+
*
|
|
631
|
+
* Get the insights for an organization
|
|
632
|
+
*
|
|
633
|
+
* @example
|
|
634
|
+
* ``` ts
|
|
635
|
+
*
|
|
636
|
+
* const insights = await client.getInsights();
|
|
637
|
+
*
|
|
638
|
+
* ```
|
|
639
|
+
*
|
|
640
|
+
* @returns {Types.TGetInsightsResponse} - The insights of the organization
|
|
641
|
+
*/
|
|
642
|
+
getInsights(): Promise<TGetInsightsResponse>;
|
|
643
|
+
/**
|
|
644
|
+
*
|
|
645
|
+
* Get the all the transactions or transactions for an address, wallet or reference
|
|
646
|
+
*
|
|
647
|
+
* By providing more than one option, only one will be used.
|
|
648
|
+
*
|
|
649
|
+
* @param {string} [args.address] - The address to get transactions for
|
|
650
|
+
* @param {string} [args.wallet] - The wallet to get transactions for
|
|
651
|
+
* @param {string} [args.reference] - The reference to get transactions for
|
|
652
|
+
* @param {Types.TPagination} [pagination] - Pagination options
|
|
653
|
+
*
|
|
654
|
+
* @example
|
|
655
|
+
* ``` ts
|
|
656
|
+
*
|
|
657
|
+
* const transactionsByAddress = await client.getTransactions({
|
|
658
|
+
* address: 'ADDRESS',
|
|
659
|
+
* });
|
|
660
|
+
*
|
|
661
|
+
* ```
|
|
662
|
+
*
|
|
663
|
+
* @returns {Types.TGetTransactionsResponse} - The transactions
|
|
664
|
+
*
|
|
665
|
+
*/
|
|
666
|
+
getTransactions(args?: TGetTransactionsArgs, pagination?: TPagination): Promise<TGetTransactionsResponse>;
|
|
667
|
+
/**
|
|
668
|
+
* create transaction
|
|
669
|
+
*
|
|
670
|
+
* @param args.from - the address or addresses to transfer from
|
|
671
|
+
* @param args.to - The desired address to transfer to
|
|
672
|
+
* @param args.amount - The amount to transfer
|
|
673
|
+
*
|
|
674
|
+
* @example
|
|
675
|
+
*
|
|
676
|
+
* ``` ts
|
|
677
|
+
*
|
|
678
|
+
* const transfer = await client.transfer({
|
|
679
|
+
* from: '0x...',
|
|
680
|
+
* to: '0x...',
|
|
681
|
+
* reference: '0x...',
|
|
682
|
+
* amount: 100,
|
|
683
|
+
* });
|
|
684
|
+
*
|
|
685
|
+
* ```
|
|
686
|
+
*/
|
|
687
|
+
createTransaction(args: TCreateTransactionArgs): Promise<TTransferResponse>;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export { Address, AssetType, EnvType, Insights, MiniWallet, Network, Organization, Oumla, PaymentStatus, PaymentType, Profile, ProfileType, TBaseConfigs, TCreateProfileArgs, TCreateProfileResponse, TCreateTransactionArgs, TGenerateAddressArgs, TGenerateAddressResponse, TGenerateWalletArgs, TGenerateWalletResponse, TGetAddresses, TGetAddressesArgs, TGetAddressesResponse, TGetInsightsArgs, TGetInsightsResponse, TGetOrganizationArgs, TGetOrganizationDashboardArgs, TGetOrganizationResponse, TGetProfileAddressesArgs, TGetProfileWalletsArgs, TGetProfileWalletsResponse, TGetProfilesArgs, TGetProfilesResponse, TGetTransactionsArgs, TGetTransactionsByAddressArgs, TGetTransactionsByReferenceArgs, TGetTransactionsByWalletArgs, TGetTransactionsResponse, TGetVolumeArgs, TGetVolumeResponse, TGetWallets, TGetWalletsResponse, THttpError, THttpRequestArgs, TPagination, TTransferResponse, Tags, Transaction, TransactionStatus, TransactionType, VolumeByDay, Wallet };
|