rehive 2.0.0 → 2.1.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.
@@ -0,0 +1,2896 @@
1
+ declare module "rehive" {
2
+ interface RehiveConfig {
3
+ apiToken?: string;
4
+ customAPIURL?: string;
5
+ apiVersion?: string;
6
+ network?: "staging" | "production";
7
+ storageMethod?: "local" | "session" | undefined;
8
+ }
9
+
10
+ interface ApiResponse {
11
+ status_code?: number;
12
+ ok?: boolean;
13
+ status: "success" | "error";
14
+ message?: string;
15
+ data?: any;
16
+ [key: string]: any;
17
+ }
18
+
19
+ interface Filter {
20
+ [key: string]: string;
21
+ }
22
+ interface ApiFilter {
23
+ next?: string;
24
+ previous?: string;
25
+ }
26
+ interface Currency {
27
+ code: string;
28
+ display_code: string;
29
+ description: string;
30
+ symbol: string;
31
+ unit: string;
32
+ divisibility: number;
33
+ icon: string;
34
+ }
35
+
36
+ interface Group {
37
+ name: string;
38
+ label: string;
39
+ section: string;
40
+ }
41
+
42
+ interface Metadata {
43
+ additionalProp1?: string;
44
+ additionalProp2?: string;
45
+ additionalProp3?: string;
46
+ }
47
+
48
+ interface TransactionSubtype {
49
+ id: number;
50
+ name: string;
51
+ label: string;
52
+ tx_type: "credit" | "debit";
53
+ }
54
+
55
+ interface DisallowedTransactionSubtype {
56
+ subtype: TransactionSubtype | number;
57
+ currency: Currency | string;
58
+ }
59
+
60
+ interface Settings {
61
+ allow_transactions: boolean;
62
+ allow_debit_transactions: boolean;
63
+ allow_credit_transactions: boolean;
64
+ disallowed_transaction_subtypes: DisallowedTransactionSubtype[];
65
+ }
66
+ interface UpdateSettingResponse {
67
+ status: "success";
68
+ data: {
69
+ allow_transactions: boolean;
70
+ allow_debit_transactions: boolean;
71
+ allow_credit_transactions: boolean;
72
+ disallowed_transaction_subtypes: DisallowedTransactionSubtype[];
73
+ };
74
+ }
75
+
76
+ interface Verification {
77
+ email: boolean;
78
+ mobile: boolean;
79
+ }
80
+ interface User {
81
+ id: string;
82
+ username: string;
83
+ email: string;
84
+ mobile: string;
85
+ first_name: string;
86
+ middle_name: string;
87
+ last_name: string;
88
+ profile: string;
89
+ groups: Group[];
90
+ temporary: boolean;
91
+ id_number: string;
92
+ birth_date: string; // In YYYY-MM-DD format
93
+ currency: Currency;
94
+ account: string;
95
+ balance: number;
96
+ available_balance: number;
97
+ company: string;
98
+ owner: boolean;
99
+ language: string;
100
+ nationality: string;
101
+ residency: string;
102
+ gender: "male" | "female" | "other";
103
+ title: string; // Example: "mr", "ms", etc.
104
+ marital_status: "single" | "married" | "divorced" | "widowed";
105
+ fathers_name: string;
106
+ mothers_name: string;
107
+ grandfathers_name: string;
108
+ grandmothers_name: string;
109
+ central_bank_number: string;
110
+ metadata: Metadata;
111
+ timezone: string;
112
+ website: string;
113
+ business_name: string;
114
+ verification: Verification;
115
+ status: statusType;
116
+ created: number; // Unix timestamp
117
+ updated: number; // Unix timestamp
118
+ settings: Settings;
119
+ [key: string]: any;
120
+ }
121
+ interface PaginatedUserResponse {
122
+ status: "success";
123
+ data: {
124
+ count: number;
125
+ next: string;
126
+ previous: string;
127
+ results: UserInAdminData[];
128
+ };
129
+ }
130
+ interface UserResponse {
131
+ status: "success";
132
+ data: UserInAdminData;
133
+ }
134
+
135
+ interface UserInAdminData {
136
+ id: string;
137
+ username: string;
138
+ email: string;
139
+ mobile: string;
140
+ first_name: string;
141
+ middle_name: string;
142
+ last_name: string;
143
+ profile: string;
144
+ groups: Group[];
145
+ temporary: boolean;
146
+ id_number: string;
147
+ birth_date: string; // 'YYYY-MM-DD'
148
+ currency: Currency;
149
+ account: string;
150
+ balance: number;
151
+ available_balance: number;
152
+ company: string;
153
+ owner: boolean;
154
+ language: string;
155
+ nationality: string; // Country code
156
+ residency: string; // Country code
157
+ gender: "male" | "female" | "other";
158
+ title: "mr" | "mrs" | "ms" | "dr";
159
+ marital_status: "single" | "married" | "divorced" | "widowed";
160
+ fathers_name: string;
161
+ mothers_name: string;
162
+ grandfathers_name: string;
163
+ grandmothers_name: string;
164
+ central_bank_number: string;
165
+ metadata: {
166
+ property1: null;
167
+ property2: null;
168
+ };
169
+ timezone: string;
170
+ website: string;
171
+ business_name: string;
172
+ verified: boolean;
173
+ verification: Verification;
174
+ status: statusType;
175
+ created: number;
176
+ updated: number;
177
+ deactivated: boolean;
178
+ retention_state: string;
179
+ archived: boolean;
180
+ last_login: number;
181
+ }
182
+ interface RegisterCredentials {
183
+ first_name: string;
184
+ last_name: string;
185
+ email: string;
186
+ company: string;
187
+ password: string;
188
+ terms_and_conditions: boolean;
189
+ }
190
+ interface RegisterResponse {
191
+ status: string;
192
+ data: {
193
+ token: string;
194
+ user: User;
195
+ challenges: Challenge[];
196
+ expires: number;
197
+ created: number;
198
+ };
199
+ }
200
+ interface Challenge {
201
+ id: string;
202
+ type: "authentication";
203
+ durability: "ephemeral" | "persistent";
204
+ authenticator_types: string[];
205
+ created: number;
206
+ }
207
+
208
+ interface LoginResponse {
209
+ status: "success" | "error";
210
+ status_code?: number;
211
+ message?: string;
212
+ data?: {
213
+ token: string;
214
+ user: User;
215
+ challenges?: Challenge[];
216
+ };
217
+ }
218
+
219
+ interface LoginCredentials {
220
+ user: string;
221
+ company: string;
222
+ password: string;
223
+ }
224
+ interface changePassword {
225
+ old_password: string;
226
+ new_password: string;
227
+ }
228
+ interface ResetConfirmData {
229
+ new_password: string;
230
+ uid: string;
231
+ token: string;
232
+ }
233
+ interface ResendMobileVerificationData {
234
+ mobile: string;
235
+ company: string;
236
+ }
237
+ interface BankAccountData {
238
+ name: string;
239
+ number: string;
240
+ type: string;
241
+ bank_name: string;
242
+ bank_code: string;
243
+ branch_code: string;
244
+ swift?: string;
245
+ iban?: string;
246
+ bic?: string;
247
+ }
248
+ interface CryptoAccountData {
249
+ address: string;
250
+ crypto_type: string;
251
+ metadata?: Metadata;
252
+ }
253
+
254
+ interface DocumentData {
255
+ file: string;
256
+ document_type: number;
257
+ metadata: Metadata;
258
+ expires?: number;
259
+ }
260
+ interface TransactionFilters {
261
+ [key: string]: string | number | boolean;
262
+ }
263
+
264
+ interface GetTransactionParams {
265
+ id?: string;
266
+ filters?: TransactionFilters;
267
+ }
268
+ interface CreateDebitORCreditData {
269
+ amount: number;
270
+ currency: string;
271
+ account: string;
272
+ reference: string;
273
+ subtype: string;
274
+ note: string;
275
+ metadata: Metadata;
276
+ }
277
+ interface CreateUserData {
278
+ user: string;
279
+ document_type: string;
280
+ metadata: Metadata;
281
+ note: string;
282
+ status: string;
283
+ }
284
+
285
+ interface BankAccountCurrencyData {
286
+ currency: string;
287
+ [key: string]: any;
288
+ }
289
+ interface AuthResponse {
290
+ status: string;
291
+ status_code?: number;
292
+ message?: string;
293
+ data?: any;
294
+ }
295
+ type AuthMethod = "cookie" | "token";
296
+
297
+ interface CreateAuthTokenData {
298
+ password: string;
299
+ duration?: number | null;
300
+ auth_method?: AuthMethod;
301
+ }
302
+
303
+ interface AuthPasswordChangeData {
304
+ old_password: string;
305
+ new_password: string;
306
+ clear_session_option?: ClearSessionOption;
307
+ }
308
+
309
+ interface AuthPasswordResetData {
310
+ force?: boolean;
311
+ user: string;
312
+ company: string;
313
+ }
314
+
315
+ interface AuthPasswordResetConfirmData {
316
+ new_password: string;
317
+ uid: string;
318
+ token: string;
319
+ clear_session_option?: ClearSessionOption;
320
+ }
321
+
322
+ interface AuthEmailResendVerificationData {
323
+ email: string;
324
+ company: string;
325
+ }
326
+
327
+ interface AuthMobileResendVerificationData {
328
+ mobile: string;
329
+ company: string;
330
+ }
331
+
332
+ interface AuthMobileVerifyData {
333
+ otp: string;
334
+ }
335
+
336
+ interface AuthEmailVerifyData {
337
+ key: string;
338
+ }
339
+
340
+ interface AuthMFADeliverData {
341
+ challenge?: string;
342
+ authenticator?: string;
343
+ }
344
+ interface AuthMFAVerifyData {
345
+ token: string;
346
+ challenge?: string;
347
+ authenticator?: string;
348
+ }
349
+
350
+ interface AuthMFAStatus {
351
+ status: string;
352
+ }
353
+
354
+ interface AuthTokenGetResponse {
355
+ tokens: CreateAuthTokenData[];
356
+ }
357
+
358
+ interface AuthMFAResponse {
359
+ status: string;
360
+ data?: any;
361
+ }
362
+ interface AuthenticatorDetails {
363
+ name: string;
364
+ algorithm: string;
365
+ otpauth_url: string;
366
+ issuer: string;
367
+ account: string;
368
+ key: string;
369
+ }
370
+
371
+ interface AuthenticatorResponse {
372
+ status: string;
373
+ data: {
374
+ id: string;
375
+ type: AuthenticatorType;
376
+ details: AuthenticatorDetails;
377
+ verified: boolean;
378
+ created: number;
379
+ updated: number;
380
+ };
381
+ }
382
+
383
+ interface AuthMFAEnableData {
384
+ [key: string]: any;
385
+ }
386
+
387
+ interface AuthMFADisableData {
388
+ [key: string]: any;
389
+ }
390
+
391
+ type AuthenticatorType = "totp" | "sms" | "static";
392
+
393
+ interface UserFilters {
394
+ id?: string;
395
+ filters?: { [key: string]: string };
396
+ }
397
+ interface PaginatedUserPermissions {
398
+ status: "success";
399
+ data: {
400
+ count: number;
401
+ next: string | null;
402
+ previous: string | null;
403
+ results: AdminUserPermission[];
404
+ };
405
+ }
406
+
407
+ interface AdminUserPermission {
408
+ id: number;
409
+ section: "system" | "admin" | "user";
410
+ type:
411
+ | "accesscontrolrule"
412
+ | "account"
413
+ | "accountdefinition"
414
+ | "address"
415
+ | "currency"
416
+ | "bankaccount"
417
+ | "company"
418
+ | "cryptoaccount"
419
+ | "device"
420
+ | "document"
421
+ | "email"
422
+ | "group"
423
+ | "legalterm"
424
+ | "mfa"
425
+ | "mfarule"
426
+ | "mobile"
427
+ | "notification"
428
+ | "permission"
429
+ | "request"
430
+ | "service"
431
+ | "token"
432
+ | "transaction"
433
+ | "transactionsubtypes"
434
+ | "user"
435
+ | "webhook";
436
+ level: "view" | "add" | "change" | "delete";
437
+ properties?: { [key: string]: any } | null;
438
+ }
439
+ interface UserPermissionCreateResponse {
440
+ status: string;
441
+ data: {
442
+ permissions: AdminUserPermission[];
443
+ };
444
+ }
445
+ interface UserPermissionResponse {
446
+ status: string;
447
+ data: {
448
+ permissions: AdminUserPermission[];
449
+ };
450
+ }
451
+ interface AuthorGroup {
452
+ name: string;
453
+ label: string;
454
+ section: "system" | "admin" | "user";
455
+ }
456
+
457
+ interface Author {
458
+ id: string;
459
+ username: string;
460
+ email: string;
461
+ mobile: string;
462
+ first_name: string;
463
+ middle_name: string;
464
+ last_name: string;
465
+ profile: string;
466
+ groups: AuthorGroup[];
467
+ temporary: boolean;
468
+ }
469
+ type sectionType = "system" | "admin" | "user";
470
+ type levelType = "info" | "warning" | "error";
471
+ interface MessageResult {
472
+ id: number;
473
+ section: sectionType;
474
+ level: levelType;
475
+ message: string;
476
+ archived: boolean;
477
+ author: Author;
478
+ created: number;
479
+ updated: number;
480
+ }
481
+
482
+ interface PaginatedMessageResponse {
483
+ status: string;
484
+ data: {
485
+ count: number;
486
+ next: string | null;
487
+ previous: string | null;
488
+ results: MessageResult[];
489
+ };
490
+ }
491
+ interface MessageResponse {
492
+ status: string;
493
+ data: MessageResult;
494
+ }
495
+ interface MessageData {
496
+ section: sectionType;
497
+ level: levelType;
498
+ message: string;
499
+ archived: boolean;
500
+ }
501
+ interface TierLimit {
502
+ id: number;
503
+ value: number;
504
+ type: string; // "max" or others
505
+ tx_type: string; // "credit" or "debit"
506
+ subtype: string;
507
+ account_definition: string;
508
+ currency: string;
509
+ }
510
+
511
+ interface TierFee {
512
+ id: number;
513
+ name: string;
514
+ tx_type: string; // "credit" or "debit"
515
+ subtype: string;
516
+ account_definition: string;
517
+ currency: string;
518
+ value: number;
519
+ percentage: number;
520
+ description: string;
521
+ }
522
+
523
+ interface Subtype {
524
+ id: number;
525
+ name: string;
526
+ label: string;
527
+ tx_type: string; // "credit" or "debit"
528
+ }
529
+
530
+ interface Currency {
531
+ code: string;
532
+ display_code: string;
533
+ description: string;
534
+ symbol: string;
535
+ unit: string;
536
+ divisibility: number;
537
+ icon: string;
538
+ }
539
+
540
+ interface TierSettings {
541
+ allow_transactions: boolean;
542
+ allow_debit_transactions: boolean;
543
+ allow_credit_transactions: boolean;
544
+ disallowed_transaction_subtypes: DisallowedTransactionSubtype[];
545
+ }
546
+
547
+ interface Tier {
548
+ id: number;
549
+ level: number;
550
+ name: string;
551
+ description: string;
552
+ limits: TierLimit[];
553
+ fees: TierFee[];
554
+ settings: TierSettings;
555
+ archived: boolean;
556
+ created: number;
557
+ updated: number;
558
+ }
559
+
560
+ interface Settings {
561
+ allow_transactions: boolean;
562
+ allow_debit_transactions: boolean;
563
+ allow_credit_transactions: boolean;
564
+ disallowed_transaction_subtypes: DisallowedTransactionSubtype[];
565
+ password_reset_url: string;
566
+ password_set_url: string;
567
+ email_verification_url: string;
568
+ deactivate_verification_url: string;
569
+ request_delete_verification_url: string;
570
+ }
571
+
572
+ interface Data {
573
+ name: string;
574
+ label: string;
575
+ description: string;
576
+ icon: string;
577
+ default: boolean;
578
+ public: boolean;
579
+ listed: boolean;
580
+ permissions: number;
581
+ tier: Tier;
582
+ tiers: {
583
+ id: number;
584
+ level: number;
585
+ name: string;
586
+ description: string;
587
+ }[];
588
+ settings: Settings;
589
+ archived: boolean;
590
+ created: number;
591
+ updated: number;
592
+ }
593
+
594
+ interface GroupsResponse {
595
+ status: string;
596
+ data: Data;
597
+ }
598
+ interface PaginatedGroupsResponse {
599
+ status: string;
600
+ data: Data[];
601
+ }
602
+ interface Group {
603
+ name: string;
604
+ label: string;
605
+ section: string;
606
+ }
607
+
608
+ type addressType =
609
+ | "permanent"
610
+ | "contact"
611
+ | "shipping"
612
+ | "billing"
613
+ | "business";
614
+ type statusType =
615
+ | "obsolete"
616
+ | "declined"
617
+ | "pending"
618
+ | "incomplete"
619
+ | "verified";
620
+ interface AddressResult {
621
+ id: number;
622
+ type: addressType; // "permanent" or other types
623
+ user: User;
624
+ line_1: string;
625
+ line_2: string;
626
+ city: string;
627
+ state_province: string;
628
+ country: string; // ISO 3166 country code e.g., "AF"
629
+ postal_code: string;
630
+ status: statusType; // e.g., "obsolete"
631
+ archived: boolean;
632
+ created: number;
633
+ updated: number;
634
+ }
635
+
636
+ interface PaginatedAddressResponse {
637
+ count: number;
638
+ next: string | null;
639
+ previous: string | null;
640
+ results: AddressResult[];
641
+ }
642
+
643
+ interface AddressResponse {
644
+ status: string;
645
+ data: AddressResult;
646
+ }
647
+ interface Owner {
648
+ first_name: string;
649
+ middle_name?: string;
650
+ last_name: string;
651
+ phone_number: string;
652
+ email_address: string;
653
+ company_name: string;
654
+ ein_tin: string;
655
+ address: Address;
656
+ cpf_cpnj: string;
657
+ }
658
+
659
+ interface Currency {
660
+ code: string;
661
+ display_code: string;
662
+ description: string;
663
+ symbol: string;
664
+ unit: string;
665
+ divisibility: number;
666
+ icon: string;
667
+ }
668
+
669
+ interface BankAccount {
670
+ id: number;
671
+ user: User;
672
+ name: string;
673
+ owner: Owner;
674
+ number: string;
675
+ type: string;
676
+ beneficiary_type: "individual" | "company";
677
+ clabe: string;
678
+ bank_name: string;
679
+ bank_code: string;
680
+ branch_code: string;
681
+ branch_address: Address;
682
+ routing_number: string;
683
+ swift: string;
684
+ iban: string;
685
+ bic: string;
686
+ code: string;
687
+ status: statusType; // e.g., "obsolete"
688
+ metadata: Record<string, any>; // or specific metadata fields
689
+ archived: boolean;
690
+ currencies: Currency[];
691
+ action: string; // e.g., "withdraw"
692
+ created: number;
693
+ updated: number;
694
+ }
695
+
696
+ interface BankAccountListResponse {
697
+ status: string;
698
+ data: {
699
+ count: number;
700
+ next: string | null;
701
+ previous: string | null;
702
+ results: BankAccount[];
703
+ };
704
+ }
705
+
706
+ interface BankAccountResponse {
707
+ status: string;
708
+ data: BankAccount;
709
+ }
710
+
711
+ interface CreateBankAccountPayload {
712
+ user: string;
713
+ name: string;
714
+ owner: Owner;
715
+ number: string;
716
+ type: string;
717
+ beneficiary_type: string;
718
+ clabe: string;
719
+ bank_name: string;
720
+ bank_code: string;
721
+ branch_code: string;
722
+ branch_address: Address;
723
+ routing_number: string;
724
+ swift: string;
725
+ iban: string;
726
+ bic: string;
727
+ status: string;
728
+ metadata: Record<string, any>;
729
+ archived: boolean;
730
+ action: string;
731
+ }
732
+ interface Account {
733
+ reference: string;
734
+ name: string;
735
+ label: string;
736
+ primary: boolean;
737
+ }
738
+ interface BankAccountCurrency {
739
+ id: string;
740
+ balance: number;
741
+ available_balance: number;
742
+ account: Account;
743
+ currency: Currency;
744
+ active: boolean;
745
+ archived: boolean;
746
+ }
747
+ interface AllBankAccountCurrencyResponse {
748
+ status: string;
749
+ data: BankAccountCurrency[];
750
+ }
751
+ interface GetBankAccountCurrencyResponse {
752
+ status: string;
753
+ data: BankAccountCurrency;
754
+ }
755
+
756
+ interface CryptoAccount {
757
+ id: number;
758
+ address: string;
759
+ name: string;
760
+ code: string;
761
+ crypto_type: string;
762
+ network: string;
763
+ metadata: Metadata;
764
+ user: User;
765
+ status: string;
766
+ currencies: Currency[];
767
+ account_currencies: BankAccountCurrency[];
768
+ archived: boolean;
769
+ action: string;
770
+ created: number;
771
+ updated: number;
772
+ }
773
+
774
+ interface PaginatedCryptoAccountListResponse {
775
+ status: string;
776
+ data: {
777
+ count: number;
778
+ next: string | null;
779
+ previous: string | null;
780
+ results: CryptoAccount[];
781
+ };
782
+ }
783
+ interface CryptoAccountListResponse {
784
+ status: string;
785
+ data: CryptoAccount;
786
+ }
787
+ interface CryptoAccountData {
788
+ address: string;
789
+ name: string;
790
+ crypto_type: string;
791
+ network: string;
792
+ metadata?: Metadata;
793
+ user: string;
794
+ status: string;
795
+ archived: boolean;
796
+ action: string;
797
+ }
798
+ interface FileType {
799
+ id: number;
800
+ name: string;
801
+ description: string;
802
+ }
803
+ interface UserDocument {
804
+ id: number;
805
+ user: User;
806
+ file: string;
807
+ type: FileType;
808
+ status: statusType;
809
+ metadata: Metadata;
810
+ note: string;
811
+ archived: boolean;
812
+ expires: number;
813
+ created: number;
814
+ updated: number;
815
+ }
816
+ interface UserDocumentPayload {
817
+ user: string;
818
+ file: string;
819
+ type: number;
820
+ status: statusType;
821
+ metadata: Metadata;
822
+ note: string;
823
+ archived: boolean;
824
+ expires: number;
825
+ }
826
+ interface PaginatedUserDocuments {
827
+ status: string;
828
+ data: {
829
+ count: number;
830
+ next: string;
831
+ previous: string;
832
+ results: UserDocument[];
833
+ };
834
+ }
835
+ interface UserDocuments {
836
+ status: string;
837
+ data: UserDocument;
838
+ }
839
+ interface EmailResult {
840
+ user: User;
841
+ id: number;
842
+ email: string;
843
+ primary: boolean;
844
+ verified: boolean;
845
+ archived: boolean;
846
+ temporary: boolean;
847
+ created: number;
848
+ updated: number;
849
+ }
850
+ interface EmailCreatePayload {
851
+ user: string;
852
+ email: string;
853
+ primary: boolean;
854
+ verified: boolean;
855
+ }
856
+
857
+ interface PaginatedEmailListResponse {
858
+ status: string;
859
+ data: {
860
+ count: number;
861
+ next: string | null;
862
+ previous: string | null;
863
+ results: EmailResult[];
864
+ };
865
+ }
866
+ interface SingleEmailResponse {
867
+ status: string;
868
+ data: EmailResult;
869
+ }
870
+ interface MobileListResponse {
871
+ status: string;
872
+ data: {
873
+ count: number;
874
+ next: string | null;
875
+ previous: string | null;
876
+ results: MobileDetails[];
877
+ };
878
+ }
879
+ interface SingleMobileResponse {
880
+ status: string;
881
+ data: MobileDetails;
882
+ }
883
+ interface MobileNumberPayload {
884
+ user: string;
885
+ number: string;
886
+ primary: boolean;
887
+ verified: boolean;
888
+ archived: boolean;
889
+ }
890
+
891
+ interface MobileDetails {
892
+ user: User;
893
+ id: number;
894
+ number: string;
895
+ primary: boolean;
896
+ verified: boolean;
897
+ archived: boolean;
898
+ temporary: boolean;
899
+ created: number;
900
+ updated: number;
901
+ }
902
+ interface TransactionListResponse {
903
+ status: string;
904
+ data: {
905
+ count: number;
906
+ next: string;
907
+ previous: string;
908
+ results: Transaction[];
909
+ };
910
+ }
911
+ interface TransactionTotal {
912
+ status: string;
913
+ data: {
914
+ total_amount: number;
915
+ amount: number;
916
+ fees: number;
917
+ count: number;
918
+ currency: string;
919
+ };
920
+ }
921
+ interface SingleTransactionResponse {
922
+ status: string;
923
+ data: Transaction;
924
+ }
925
+
926
+ type TransactionStatus =
927
+ | "Initiating"
928
+ | "Quoted"
929
+ | "Pending"
930
+ | "Complete"
931
+ | "Failed";
932
+
933
+ interface TransactionPayload {
934
+ transactions: Transaction[];
935
+ }
936
+
937
+ interface Transaction {
938
+ id: string;
939
+ collection: string;
940
+ parent: string;
941
+ partner: Partner;
942
+ index: number;
943
+ tx_type: string;
944
+ subtype: string;
945
+ note: string;
946
+ metadata: Metadata;
947
+
948
+ status: TransactionStatus;
949
+ reference: string;
950
+ amount: number;
951
+ fee: number;
952
+ total_amount: number;
953
+ balance: number;
954
+ account: string;
955
+ label: string;
956
+ currency: Currency | string;
957
+ user: User;
958
+ inclusive: boolean;
959
+ archived: boolean;
960
+ executed: number;
961
+ expires: number;
962
+ created: number;
963
+ updated: number;
964
+ }
965
+ interface TransactionCreditOrDebitPayload {
966
+ id: string;
967
+ amount: number;
968
+ currency: string;
969
+ account: string;
970
+ subtype: string;
971
+ reference: string;
972
+ note: string;
973
+ metadata: Metadata;
974
+ user: string;
975
+ inclusive: boolean;
976
+ status: TransactionStatus;
977
+ fees: Array<{
978
+ description: string;
979
+ amount: number;
980
+ }>;
981
+ expires: number;
982
+ }
983
+
984
+ interface Partner {
985
+ id: string;
986
+ user: User;
987
+ account: string;
988
+ }
989
+
990
+ interface MetricObj {
991
+ id?: string;
992
+ filters?: Record<string, string>;
993
+ }
994
+ interface Filters {
995
+ [key: string]: any;
996
+ }
997
+
998
+ type ClearSessionOption = "all" | "temporary" | "none";
999
+ interface UpdateUserData {
1000
+ username: string;
1001
+ first_name?: string;
1002
+ middle_name?: string;
1003
+ last_name?: string;
1004
+ profile?: string;
1005
+ id_number?: string;
1006
+ birth_date?: string; // ISO format 'YYYY-MM-DD'
1007
+ language?: string;
1008
+ nationality?: string; // Country code (e.g., 'AF')
1009
+ residency?: string; // Country code (e.g., 'AF')
1010
+ gender?: "male" | "female" | "other";
1011
+ title?: "mr" | "mrs" | "ms" | "dr";
1012
+ marital_status?: "single" | "married" | "divorced" | "widowed";
1013
+ fathers_name?: string;
1014
+ mothers_name?: string;
1015
+ grandfathers_name?: string;
1016
+ grandmothers_name?: string;
1017
+ central_bank_number?: string;
1018
+ timezone?: string;
1019
+ website?: string;
1020
+ business_name?: string;
1021
+ }
1022
+ interface Address {
1023
+ id?: number;
1024
+ type: "permanent" | "temporary";
1025
+ line_1: string;
1026
+ line_2?: string;
1027
+ city: string;
1028
+ state_province: string;
1029
+ country: string;
1030
+ postal_code: string;
1031
+ status?: string;
1032
+ created?: number;
1033
+ updated?: number;
1034
+ }
1035
+
1036
+ interface GetAllAddressApiResponse {
1037
+ status: "success" | "error";
1038
+ data: Address[];
1039
+ }
1040
+ interface GetSingleAddressApiResponse {
1041
+ status: "success" | "error";
1042
+ data: Address;
1043
+ }
1044
+
1045
+ interface Owner {
1046
+ first_name: string;
1047
+ middle_name?: string; // Optional
1048
+ last_name: string;
1049
+ phone_number: string;
1050
+ email_address: string;
1051
+ company_name: string;
1052
+ ein_tin: string;
1053
+ address: Address;
1054
+ cpf_cpnj: string;
1055
+ }
1056
+
1057
+ interface Currency {
1058
+ code: string;
1059
+ display_code: string;
1060
+ description: string;
1061
+ symbol: string;
1062
+ unit: string;
1063
+ divisibility: number;
1064
+ icon: string;
1065
+ }
1066
+
1067
+ interface AccountCurrency {
1068
+ id: string;
1069
+ balance: number;
1070
+ available_balance: number;
1071
+ account: {
1072
+ reference: string;
1073
+ name: string;
1074
+ label: string;
1075
+ primary: boolean;
1076
+ };
1077
+ currency: Currency;
1078
+ active: boolean;
1079
+ }
1080
+
1081
+ interface BankAccount {
1082
+ id: number;
1083
+ name: string;
1084
+ number: string;
1085
+ type: string;
1086
+ beneficiary_type: "individual" | "company";
1087
+ clabe: string;
1088
+ owner: Owner;
1089
+ bank_name: string;
1090
+ bank_code: string;
1091
+ branch_code: string;
1092
+ branch_address: Address;
1093
+ routing_number: string;
1094
+ swift: string;
1095
+ iban: string;
1096
+ bic: string;
1097
+ code: string;
1098
+ metadata: Record<string, any>; // or specific metadata fields
1099
+ status: statusType;
1100
+ currencies: Currency[];
1101
+ account_currencies: AccountCurrency[];
1102
+ action: string;
1103
+ created: number;
1104
+ updated: number;
1105
+ }
1106
+ interface GetAllBankAccountsApiResponse {
1107
+ status: "success" | "error";
1108
+ data: BankAccount[];
1109
+ }
1110
+ interface GetSingleBankAccountApiResponse {
1111
+ status: "success" | "error";
1112
+ data: BankAccount;
1113
+ }
1114
+ interface DocumentCreateData {
1115
+ file: string;
1116
+ type: number;
1117
+ metadata?: Metadata;
1118
+ expires?: number;
1119
+ }
1120
+ interface FileType {
1121
+ id: number;
1122
+ name: string;
1123
+ description: string;
1124
+ }
1125
+
1126
+ interface DocumentCreateResponse {
1127
+ status: "success" | "error";
1128
+ data: {
1129
+ id: number;
1130
+ file: string;
1131
+ type: FileType;
1132
+ status: string;
1133
+ metadata: Metadata;
1134
+ note?: string;
1135
+ expires?: number;
1136
+ created?: number;
1137
+ updated?: number;
1138
+ };
1139
+ }
1140
+ interface Email {
1141
+ id: number;
1142
+ email: string;
1143
+ primary: boolean;
1144
+ verified: boolean;
1145
+ created: number;
1146
+ updated: number;
1147
+ }
1148
+ interface EmailResponse {
1149
+ status: string;
1150
+
1151
+ data: Email;
1152
+ }
1153
+ interface AllEmailResponse {
1154
+ status: "success" | "error";
1155
+
1156
+ data: Email[];
1157
+ }
1158
+ interface Mobile {
1159
+ id: number;
1160
+ number: string;
1161
+ primary: true;
1162
+ verified: true;
1163
+ created: number;
1164
+ updated: number;
1165
+ }
1166
+ interface MobileResponse {
1167
+ status: "success" | "error";
1168
+
1169
+ data: Mobile;
1170
+ }
1171
+ interface AllMobileResponse {
1172
+ status: "success" | "error";
1173
+
1174
+ data: Mobile[];
1175
+ }
1176
+
1177
+ interface LegalTerms {
1178
+ id: number;
1179
+ type: string;
1180
+ name: string;
1181
+ description: string;
1182
+ versions: {
1183
+ id: number;
1184
+ version: number;
1185
+ accepted: boolean;
1186
+ created: number;
1187
+ updated: number;
1188
+ }[];
1189
+ created: number;
1190
+ updated: number;
1191
+ }
1192
+ interface PaginatedLegalTermsResponse {
1193
+ status: "success" | "error";
1194
+ data: {
1195
+ count: number;
1196
+ next: string | null;
1197
+ previous: string | null;
1198
+ results: LegalTerms[];
1199
+ };
1200
+ }
1201
+ interface LegalTermResponse {
1202
+ status: "success" | "error";
1203
+ data: LegalTerms;
1204
+ }
1205
+ interface Version {
1206
+ id: number;
1207
+ version: number;
1208
+ accepted: boolean;
1209
+ accepted_date: number;
1210
+ note: string;
1211
+ content: string;
1212
+ created: number;
1213
+ updated: number;
1214
+ }
1215
+ interface VersionResponse {
1216
+ status: "success" | "error";
1217
+ data: Version;
1218
+ }
1219
+ interface PaginatedVersionResponse {
1220
+ status: "success" | "error";
1221
+ data: {
1222
+ count: number;
1223
+ next: string | null;
1224
+ previous: string | null;
1225
+ results: Version[];
1226
+ };
1227
+ }
1228
+
1229
+ interface TransactionCollection {
1230
+ id: string;
1231
+ transactions: Array<{
1232
+ id: string;
1233
+ parent: string;
1234
+ partner: string;
1235
+ index: number;
1236
+ inferred: boolean;
1237
+ tx_type: "credit" | "debit";
1238
+ subtype: string;
1239
+ note: string;
1240
+ metadata: Metadata;
1241
+ status: TransactionStatus;
1242
+ reference: string;
1243
+ amount: number;
1244
+ fee: number;
1245
+ total_amount: number;
1246
+ balance: number;
1247
+ account: string;
1248
+ label: string;
1249
+ currency: Currency;
1250
+ user: User;
1251
+ inclusive: boolean;
1252
+ archived: boolean;
1253
+ executed: number;
1254
+ created: number;
1255
+ updated: number;
1256
+ expires: number;
1257
+ }>;
1258
+ status: TransactionStatus;
1259
+ archived: boolean;
1260
+ created: number;
1261
+ updated: number;
1262
+ }
1263
+
1264
+ interface TransactionCollectionResponse {
1265
+ status: "success" | "error";
1266
+ data: {
1267
+ count: number;
1268
+ next: string | null;
1269
+ previous: string | null;
1270
+ results: TransactionCollection[];
1271
+ };
1272
+ }
1273
+ interface SingleTransactionCollectionResponse {
1274
+ status: "success" | "error";
1275
+ data: TransactionCollection;
1276
+ }
1277
+ interface UpdateCollectionPayload {
1278
+ status: "Quoted" | "Pending" | "Complete" | "Failed";
1279
+ checks: Array<"type" | "verification" | "limits" | "balance"> | null;
1280
+ archived: boolean;
1281
+ }
1282
+
1283
+ interface AccountResponse {
1284
+ status: "success";
1285
+ data: {
1286
+ count: number;
1287
+ next: string | null;
1288
+ previous: string | null;
1289
+ results: CurrencyAccount[];
1290
+ };
1291
+ }
1292
+ interface SingleAccountResponse {
1293
+ status: "success";
1294
+ data: CurrencyAccount;
1295
+ }
1296
+ interface Limit {
1297
+ id: number;
1298
+ value: number;
1299
+ type: string;
1300
+ tx_type: string;
1301
+ subtype: string;
1302
+ created: number;
1303
+ updated: number;
1304
+ }
1305
+
1306
+ interface Fee {
1307
+ id: number;
1308
+ name: string;
1309
+ description: string;
1310
+ value: number;
1311
+ percentage: number;
1312
+ tx_type: string;
1313
+ subtype: string;
1314
+ created: number;
1315
+ updated: number;
1316
+ account: string;
1317
+ asset: string;
1318
+ debit_account: string;
1319
+ credit_account: string;
1320
+ debit_subtype: string;
1321
+ credit_subtype: string;
1322
+ inferred: boolean;
1323
+ archived: boolean;
1324
+ }
1325
+
1326
+ interface AccountAdminCurrency {
1327
+ id: string;
1328
+ balance: number;
1329
+ available_balance: number;
1330
+ currency: Currency;
1331
+ limits: Limit[];
1332
+ fees: Fee[];
1333
+ active: boolean;
1334
+ settings: Settings;
1335
+ subtypes: Subtype[];
1336
+ archived: boolean;
1337
+ created: number;
1338
+ updated: number;
1339
+ }
1340
+ interface AllAdminCurrencyResponse {
1341
+ status: string;
1342
+ data: {
1343
+ count: number;
1344
+ next: string | null;
1345
+ previous: string | null;
1346
+ results: Account[];
1347
+ };
1348
+ }
1349
+ interface GetSingleAdminCurrencyResponse {
1350
+ status: string;
1351
+ data: Account;
1352
+ }
1353
+ interface CreateAdminCurrencyPayload {
1354
+ reference: string;
1355
+ name: string;
1356
+ label: string;
1357
+ primary: boolean;
1358
+ recon: boolean;
1359
+ user: string;
1360
+ metadata: {
1361
+ property1: any;
1362
+ property2: any;
1363
+ };
1364
+ archived: boolean;
1365
+ }
1366
+ interface UpdateAdminCurrencyPayload {
1367
+ name?: string;
1368
+ label?: string;
1369
+ primary?: boolean;
1370
+ recon?: boolean;
1371
+ user?: string;
1372
+ metadata?: {
1373
+ property1?: any;
1374
+ property2?: any;
1375
+ };
1376
+ archived?: boolean;
1377
+ }
1378
+ interface CurrencyLimit {
1379
+ id: number;
1380
+ value: number;
1381
+ type: string;
1382
+ tx_type: string;
1383
+ subtype: string;
1384
+ created: number;
1385
+ updated: number;
1386
+ }
1387
+
1388
+ interface AllCurrencyLimitResponse {
1389
+ status: string;
1390
+ data: {
1391
+ count: number;
1392
+ next: string | null;
1393
+ previous: string | null;
1394
+ results: CurrencyLimit[];
1395
+ };
1396
+ }
1397
+ interface SingleCurrencyLimitResponse {
1398
+ status: string;
1399
+ data: CurrencyLimit;
1400
+ }
1401
+ interface CurrencyLimitCreationPayload {
1402
+ value: number;
1403
+ type: string;
1404
+ tx_type: string;
1405
+ subtype: string;
1406
+ }
1407
+
1408
+ interface AccountCurrencyFee {
1409
+ id: number;
1410
+ name: string;
1411
+ description: string;
1412
+ value: number;
1413
+ percentage: number;
1414
+ tx_type: string;
1415
+ subtype: string;
1416
+ created: number;
1417
+ updated: number;
1418
+ account: string;
1419
+ asset: string;
1420
+ debit_account: string;
1421
+ credit_account: string;
1422
+ debit_subtype: string;
1423
+ credit_subtype: string;
1424
+ inferred: boolean;
1425
+ archived: boolean;
1426
+ }
1427
+
1428
+ interface AllAccountCurrencyFeesResponse {
1429
+ status: string;
1430
+ data: AccountCurrencyFee[];
1431
+ }
1432
+ interface SingleAccountCurrencyFeesResponse {
1433
+ status: string;
1434
+ data: AccountCurrencyFee;
1435
+ }
1436
+ interface AccountCurrencyFeeCreationPayload {
1437
+ name: string;
1438
+ value: number;
1439
+ percentage: number;
1440
+ tx_type: string;
1441
+ subtype: string;
1442
+ description: string;
1443
+ debit_account: string;
1444
+ credit_account: string;
1445
+ debit_subtype: string;
1446
+ credit_subtype: string;
1447
+ inferred: boolean;
1448
+ }
1449
+ interface DisallowedCurrencyTransactionSubtype {
1450
+ id: number;
1451
+ name: string;
1452
+ label: string;
1453
+ tx_type: string;
1454
+ }
1455
+ interface CurrencyListSettings {
1456
+ allow_transactions: boolean;
1457
+ allow_debit_transactions: boolean;
1458
+ allow_credit_transactions: boolean;
1459
+ disallowed_transaction_subtypes: DisallowedCurrencyTransactionSubtype[];
1460
+ }
1461
+
1462
+ interface CurrencyListSettingsResponse {
1463
+ status: string;
1464
+ data: CurrencyListSettings;
1465
+ }
1466
+ interface UpdateCurrencySettingsPayload {
1467
+ allow_transactions: boolean;
1468
+ allow_debit_transactions: boolean;
1469
+ allow_credit_transactions: boolean;
1470
+ disallowed_transaction_subtypes: number[];
1471
+ }
1472
+
1473
+ interface AccountGroup {
1474
+ group: {
1475
+ name: string;
1476
+ label: string;
1477
+ section: string;
1478
+ };
1479
+ default: boolean;
1480
+ primary: boolean;
1481
+ currencies: AccountCurrency[];
1482
+ archived: boolean;
1483
+ created: number;
1484
+ updated: number;
1485
+ }
1486
+
1487
+ interface AccountDefinition {
1488
+ name: string;
1489
+ label: string;
1490
+ recon: boolean;
1491
+ groups: AccountGroup[];
1492
+ archived: boolean;
1493
+ created: number;
1494
+ updated: number;
1495
+ }
1496
+
1497
+ interface AllAccountDefinitionResponse {
1498
+ status: string;
1499
+ data: {
1500
+ count: number;
1501
+ next: string | null;
1502
+ previous: string | null;
1503
+ results: AccountDefinition[];
1504
+ };
1505
+ }
1506
+ interface SingleAccountDefinitionResponse {
1507
+ status: string;
1508
+ data: AccountDefinition;
1509
+ }
1510
+ interface CreateDefinitionPayload {
1511
+ name: string;
1512
+ label: string;
1513
+ recon: boolean;
1514
+ archived: boolean;
1515
+ }
1516
+
1517
+ interface CurrencyInfo {
1518
+ currency: Currency;
1519
+ archived: boolean;
1520
+ created: number;
1521
+ updated: number;
1522
+ }
1523
+
1524
+ interface Group {
1525
+ name: string;
1526
+ label: string;
1527
+ section: string;
1528
+ }
1529
+
1530
+ interface AccountDefinitionGroup {
1531
+ group: Group;
1532
+ default: boolean;
1533
+ primary: boolean;
1534
+ currencies: CurrencyInfo[];
1535
+ archived: boolean;
1536
+ created: number;
1537
+ updated: number;
1538
+ }
1539
+
1540
+ interface AccountDefinitionsGroupsResponse {
1541
+ status: string;
1542
+ data: {
1543
+ count: number;
1544
+ next: string | null;
1545
+ previous: string | null;
1546
+ results: AccountDefinitionGroup[];
1547
+ };
1548
+ }
1549
+ interface SingleAccountDefinitionsGroupsResponse {
1550
+ status: string;
1551
+ data: AccountDefinitionGroup;
1552
+ }
1553
+ interface AccountGroupPayload {
1554
+ group: string;
1555
+ default: boolean;
1556
+ primary: boolean;
1557
+ currencies: string[];
1558
+ archived: boolean;
1559
+ }
1560
+
1561
+ interface GroupCurrency {
1562
+ currency: Currency;
1563
+ archived: boolean;
1564
+ created: number;
1565
+ updated: number;
1566
+ }
1567
+
1568
+ interface AccountDefinitionGroupCurrenciesResponse {
1569
+ status: string;
1570
+ data: {
1571
+ count: number;
1572
+ next: string | null;
1573
+ previous: string | null;
1574
+ results: GroupCurrency[];
1575
+ };
1576
+ }
1577
+ interface SingleAccountDefinitionGroupCurrenciesResponse {
1578
+ status: string;
1579
+ data: GroupCurrency;
1580
+ }
1581
+ interface Query {
1582
+ property1: any;
1583
+ property2: any;
1584
+ }
1585
+ interface Metric {
1586
+ id: string;
1587
+ name: string;
1588
+ slug: string;
1589
+ metadata: Metadata;
1590
+ type: string;
1591
+ currency: Currency;
1592
+ timezone: string;
1593
+ query: Query;
1594
+ method: string;
1595
+ created: number;
1596
+ updated: number;
1597
+ user: User;
1598
+ section: string;
1599
+ archived: boolean;
1600
+ }
1601
+
1602
+ interface AllAdminListMetricsResponse {
1603
+ status: string;
1604
+ data: {
1605
+ count: number;
1606
+ next: string | null;
1607
+ previous: string | null;
1608
+ results: Metric[];
1609
+ };
1610
+ }
1611
+ interface SingleAdminListMetricsResponse {
1612
+ status: string;
1613
+ data: Metric;
1614
+ }
1615
+ type methodType = "accumulate" | "set";
1616
+ type MetricType =
1617
+ | "account_count"
1618
+ | "transaction_count"
1619
+ | "transaction_complete_count"
1620
+ | "transaction_failed_count"
1621
+ | "transaction_pending_count"
1622
+ | "transaction_complete_sum"
1623
+ | "transaction_failed_sum"
1624
+ | "transaction_pending_sum"
1625
+ | "transaction_balance_sum"
1626
+ | "transaction_available_balance_sum"
1627
+ | "user_count"
1628
+ | "user_active_count"
1629
+ | "user_transacted_in_30days_count";
1630
+ interface CreateMetricsPayload {
1631
+ name: string;
1632
+ slug: string;
1633
+ type: MetricType;
1634
+ method: methodType;
1635
+ currency: string;
1636
+ timezone: string;
1637
+ query: Query;
1638
+ metadata: Metadata;
1639
+ user: string;
1640
+ section: "admin";
1641
+ }
1642
+ interface MetricPoint {
1643
+ id: number;
1644
+ value: number;
1645
+ date: number;
1646
+ }
1647
+
1648
+ interface MetricPointsListResponse {
1649
+ status: string;
1650
+ data: {
1651
+ count: number;
1652
+ next: string | null;
1653
+ previous: string | null;
1654
+ results: MetricPoint[];
1655
+ };
1656
+ }
1657
+
1658
+ interface ExportResult {
1659
+ id: string;
1660
+ section: string;
1661
+ resource: string;
1662
+ query: Query;
1663
+ status: string;
1664
+ progress: number;
1665
+ count: number;
1666
+ page_size: number;
1667
+ file_format: string;
1668
+ created: number;
1669
+ updated: number;
1670
+ user: User;
1671
+ archived: boolean;
1672
+ }
1673
+
1674
+ interface AllExportsResponse {
1675
+ status: string;
1676
+ data: {
1677
+ count: number;
1678
+ next: string | null;
1679
+ previous: string | null;
1680
+ results: ExportResult[];
1681
+ };
1682
+ }
1683
+ interface SingleExportsResponse {
1684
+ status: string;
1685
+ data: ExportResult;
1686
+ }
1687
+ type resourceType = "account" | "account_currency" | "transaction" | "user";
1688
+ interface CreateExportPayload {
1689
+ resource: resourceType;
1690
+ page_size: number;
1691
+ query: {
1692
+ property1: any | null;
1693
+ property2: any | null;
1694
+ };
1695
+ file_format: "json" | "csv";
1696
+ user: string;
1697
+ section: string; // Section name, e.g., "admin" or "user"
1698
+ }
1699
+ type actionType = "allow" | "deny";
1700
+ interface AccessControlRule {
1701
+ id: number;
1702
+ action: actionType;
1703
+ type: "ip" | string;
1704
+ value: string;
1705
+ label: string;
1706
+ user: User;
1707
+ group: Group;
1708
+ created: number;
1709
+ updated: number;
1710
+ }
1711
+ interface CreateAccessControlRulePayload {
1712
+ action: actionType;
1713
+ type: "ip" | string;
1714
+ value: string;
1715
+ label: string;
1716
+ user: string;
1717
+ group: string;
1718
+ }
1719
+
1720
+ interface AllAccessControlRulesResponse {
1721
+ status: string;
1722
+ data: {
1723
+ count: number;
1724
+ next: string | null;
1725
+ previous: string | null;
1726
+ results: AccessControlRule[];
1727
+ };
1728
+ }
1729
+ interface SingleAccessControlRulesResponse {
1730
+ status: string;
1731
+ data: {
1732
+ count: number;
1733
+ next: string | null;
1734
+ previous: string | null;
1735
+ results: AccessControlRule[];
1736
+ };
1737
+ }
1738
+ interface AdminCurrency {
1739
+ code: string;
1740
+ display_code: string;
1741
+ description: string;
1742
+ symbol: string;
1743
+ unit: string;
1744
+ divisibility: number;
1745
+ icon: string;
1746
+ manager: {
1747
+ id: string;
1748
+ first_name: string;
1749
+ middle_name?: string;
1750
+ last_name: string;
1751
+ service: {
1752
+ id: number;
1753
+ slug: string;
1754
+ name: string;
1755
+ url: string;
1756
+ type: "system" | "custom";
1757
+ };
1758
+ };
1759
+ manager_conditions: Array<{
1760
+ property1: any;
1761
+ property2: any;
1762
+ }>;
1763
+ metadata: {
1764
+ property1: any;
1765
+ property2: any;
1766
+ };
1767
+ archived: boolean;
1768
+ created: number;
1769
+ updated: number;
1770
+ }
1771
+
1772
+ interface AdminCurrencyListResponse {
1773
+ status: "success" | "error";
1774
+ data: {
1775
+ count: number;
1776
+ next: string | null;
1777
+ previous: string | null;
1778
+ results: AdminCurrency[];
1779
+ };
1780
+ }
1781
+ interface SingleAdminCurrencyResponse {
1782
+ status: "success" | "error";
1783
+ data: AdminCurrency;
1784
+ }
1785
+ interface CreateCurrencyPayload {
1786
+ code: string;
1787
+ display_code: string;
1788
+ description: string;
1789
+ symbol: string;
1790
+ unit: string;
1791
+ divisibility: number;
1792
+ icon: string;
1793
+ manager: string;
1794
+ manager_conditions: Metadata[];
1795
+ metadata: Metadata;
1796
+ archived: boolean;
1797
+ }
1798
+ interface CurrencyOverviewResponse {
1799
+ status: string;
1800
+ data: CurrencyOverviewData;
1801
+ }
1802
+
1803
+ interface CurrencyOverviewData {
1804
+ balance_total: number;
1805
+ available_balance_total: number;
1806
+ count_total: number;
1807
+ count_debits_pending: number;
1808
+ count_debits_complete: number;
1809
+ count_credits_pending: number;
1810
+ count_credits_complete: number;
1811
+ sum_debits_pending: number;
1812
+ sum_debits_complete: number;
1813
+ sum_credits_pending: number;
1814
+ sum_credits_complete: number;
1815
+ balance_24h: number;
1816
+ count_24h: number;
1817
+ sum_24h_debits_pending: number;
1818
+ sum_24h_debits_complete: number;
1819
+ sum_24h_credits_pending: number;
1820
+ sum_24h_credits_complete: number;
1821
+ }
1822
+ interface CurrencyAccount {
1823
+ reference: string;
1824
+ name: string;
1825
+ definition: string;
1826
+ label: string;
1827
+ primary: boolean;
1828
+ recon: boolean;
1829
+ user: User;
1830
+ currencies: Currency[];
1831
+ metadata: Record<string, any>;
1832
+ archived: boolean;
1833
+ created: number;
1834
+ updated: number;
1835
+ }
1836
+ interface CreateCurrencyAccountPayload {
1837
+ reference: string;
1838
+ name: string;
1839
+ label: string;
1840
+ primary: boolean;
1841
+ recon: boolean;
1842
+ user: string;
1843
+ metadata: Metadata;
1844
+ archived: boolean;
1845
+ }
1846
+
1847
+ class Rehive {
1848
+ constructor(config?: RehiveConfig);
1849
+ public: {
1850
+ companies: {
1851
+ get(id?: string): Promise<any>;
1852
+ };
1853
+ };
1854
+ auth: {
1855
+ register(
1856
+ credentials: RegisterCredentials,
1857
+ ): Promise<RegisterResponse>;
1858
+ registerCompany(
1859
+ credentials: RegisterCredentials,
1860
+ ): Promise<RegisterResponse>;
1861
+ login(credentials: {
1862
+ email: string;
1863
+ password: string;
1864
+ }): Promise<LoginResponse>;
1865
+ logout(
1866
+ clearSessionOption?: ClearSessionOption,
1867
+ ): Promise<AuthResponse>;
1868
+ logoutAll(): Promise<void>;
1869
+ password: {
1870
+ change(data: AuthPasswordChangeData): Promise<AuthResponse>;
1871
+ reset(data: AuthPasswordResetData): Promise<AuthResponse>;
1872
+ resetConfirm(
1873
+ data: AuthPasswordResetConfirmData,
1874
+ ): Promise<AuthResponse>;
1875
+ };
1876
+ email: {
1877
+ resendEmailVerification(
1878
+ data: AuthEmailResendVerificationData,
1879
+ ): Promise<AuthResponse>;
1880
+ verify(data: AuthEmailVerifyData): Promise<AuthResponse>;
1881
+ };
1882
+ mobile: {
1883
+ resendMobileVerification(
1884
+ data: AuthMobileResendVerificationData,
1885
+ ): Promise<AuthResponse>;
1886
+ verify(data: AuthMobileVerifyData): Promise<AuthResponse>;
1887
+ };
1888
+ tokens: {
1889
+ get(tokenKey: string): Promise<AuthTokenGetResponse>;
1890
+ create(data: CreateAuthTokenData): Promise<RegisterResponse>;
1891
+ delete(tokenKey: string): Promise<AuthResponse>;
1892
+ verify(token: string): Promise<AuthResponse>;
1893
+ };
1894
+ mfa: {
1895
+ verify(data: AuthMFAVerifyData): Promise<AuthResponse>;
1896
+ deliver(data: AuthMFADeliverData): Promise<AuthResponse>;
1897
+ authenticators: {
1898
+ get(obj?: {
1899
+ id?: string;
1900
+ filters?: any;
1901
+ }): Promise<AuthenticatorResponse>;
1902
+ getNext(): Promise<AuthMFAResponse>;
1903
+ getPrevious(): Promise<AuthMFAResponse>;
1904
+ create(data: {
1905
+ type: AuthenticatorType;
1906
+ }): Promise<AuthenticatorResponse>;
1907
+ delete(id: string): Promise<AuthenticatorResponse>;
1908
+ };
1909
+ status: {
1910
+ get(): Promise<AuthMFAStatus>;
1911
+ };
1912
+ sms: {
1913
+ get(): Promise<AuthResponse>;
1914
+ enable(data: AuthMFAEnableData): Promise<AuthResponse>;
1915
+ send(data: AuthMFAEnableData): Promise<AuthResponse>;
1916
+ disable(data: AuthMFADisableData): Promise<AuthResponse>;
1917
+ };
1918
+ token: {
1919
+ get(): Promise<{ token: string }>;
1920
+ enable(data: { token: string }): Promise<AuthResponse>;
1921
+ disable(): Promise<AuthResponse>;
1922
+ };
1923
+ };
1924
+ };
1925
+ user: {
1926
+ get(): Promise<ApiResponse>;
1927
+ update(id: string, data: UpdateUserData): Promise<ApiResponse>;
1928
+ addresses: {
1929
+ get(
1930
+ id?: string,
1931
+ ): Promise<
1932
+ GetAllAddressApiResponse | GetSingleAddressApiResponse
1933
+ >;
1934
+ update(
1935
+ id: string,
1936
+ data: Address,
1937
+ ): Promise<GetSingleAddressApiResponse>;
1938
+ create(data: Address): Promise<GetSingleAddressApiResponse>;
1939
+ delete(id: string): Promise<ApiResponse>;
1940
+ };
1941
+ bankAccounts: {
1942
+ get(
1943
+ bankId?: string,
1944
+ ): Promise<
1945
+ | GetSingleBankAccountApiResponse
1946
+ | GetAllBankAccountsApiResponse
1947
+ >;
1948
+ create(
1949
+ data: BankAccount,
1950
+ ): Promise<GetSingleBankAccountApiResponse>;
1951
+ update(
1952
+ bankId: string,
1953
+ data: BankAccount,
1954
+ ): Promise<GetSingleBankAccountApiResponse>;
1955
+ delete(bankId: string): Promise<ApiResponse>;
1956
+ };
1957
+ cryptoAccounts: {
1958
+ get(cryptoAccountId?: string): Promise<any>;
1959
+ create(data: any): Promise<any>;
1960
+ update(accountId: string, data: any): Promise<any>;
1961
+ delete(id: string): Promise<any>;
1962
+ };
1963
+ documents: {
1964
+ get(obj?: {
1965
+ id?: string;
1966
+ filters?: Record<string, any>;
1967
+ }): Promise<DocumentCreateResponse>;
1968
+ getPrevious(): Promise<DocumentCreateResponse>;
1969
+ create(
1970
+ data: DocumentCreateData,
1971
+ ): Promise<DocumentCreateResponse>;
1972
+ };
1973
+ emails: {
1974
+ get(id?: string): Promise<EmailResponse | AllEmailResponse>;
1975
+ create(data: {
1976
+ email: string;
1977
+ primary: boolean;
1978
+ }): Promise<EmailResponse>;
1979
+ update(
1980
+ emailId: string,
1981
+ data: { primary: boolean },
1982
+ ): Promise<EmailResponse>;
1983
+ delete(id: string): Promise<ApiResponse>;
1984
+ };
1985
+ mobiles: {
1986
+ get(id?: string): Promise<AllMobileResponse | MobileResponse>;
1987
+ create(data: { number: string }): Promise<MobileResponse>;
1988
+ update(
1989
+ mobileNumberId: string,
1990
+ data: { primary: boolean },
1991
+ ): Promise<MobileResponse>;
1992
+ delete(id: string): Promise<ApiResponse>;
1993
+ };
1994
+ legalTerms: {
1995
+ get(obj?: {
1996
+ id?: string;
1997
+ filters?: Record<string, any>;
1998
+ }): Promise<LegalTermResponse | PaginatedLegalTermsResponse>;
1999
+ getNext(): Promise<PaginatedLegalTermsResponse>;
2000
+ getPrevious(): Promise<PaginatedLegalTermsResponse>;
2001
+ versions: {
2002
+ get(
2003
+ termId: string,
2004
+ obj?: { id?: string; filters?: Record<string, any> },
2005
+ ): Promise<VersionResponse | PaginatedVersionResponse>;
2006
+ getNext(): Promise<PaginatedVersionResponse>;
2007
+ getPrevious(): Promise<PaginatedVersionResponse>;
2008
+ update(
2009
+ termId: string,
2010
+ versionId: string,
2011
+ data: {
2012
+ accepted: boolean;
2013
+ },
2014
+ ): Promise<VersionResponse>;
2015
+ };
2016
+ };
2017
+ };
2018
+
2019
+ admin: {
2020
+ users: {
2021
+ get: (obj?: {
2022
+ id?: string;
2023
+ filters?: Filters;
2024
+ }) => Promise<UserResponse | PaginatedUserResponse>;
2025
+ getNext: () => Promise<PaginatedUserResponse>;
2026
+ getPrevious: () => Promise<PaginatedUserResponse>;
2027
+ create: (data: UserInAdminData) => Promise<UserResponse>;
2028
+ update: (
2029
+ id: string,
2030
+ data: UserInAdminData,
2031
+ ) => Promise<UserResponse>;
2032
+ delete: (id: string) => Promise<ApiResponse>;
2033
+ overview: {
2034
+ get: (obj?: { filters?: Filters }) => Promise<ApiResponse>;
2035
+ };
2036
+ settings: {
2037
+ get: (id: string) => Promise<Settings>;
2038
+ update: (
2039
+ id: string,
2040
+ data: Settings,
2041
+ ) => Promise<UpdateSettingResponse>;
2042
+ };
2043
+ kyc: {
2044
+ get: (id: string) => Promise<any>;
2045
+ update: (id: string, data: any) => Promise<any>;
2046
+ };
2047
+
2048
+ permissions: {
2049
+ get: (
2050
+ per_id?: string,
2051
+ obj?: { id?: string; filters?: UserFilters },
2052
+ ) => Promise<
2053
+ PaginatedUserPermissions | UserPermissionResponse
2054
+ >;
2055
+ getNext: () => Promise<PaginatedUserPermissions>;
2056
+ getPrevious: () => Promise<PaginatedUserPermissions>;
2057
+ create: (
2058
+ uuid: string,
2059
+ data: AdminUserPermission,
2060
+ ) => Promise<UserPermissionResponse>;
2061
+ delete: (uuid: string, id: string) => Promise<any>;
2062
+ };
2063
+ messages: {
2064
+ get: (
2065
+ uuid: string,
2066
+ obj?: { id?: string; filters?: UserFilters },
2067
+ ) => Promise<PaginatedMessageResponse | MessageResponse>;
2068
+ getNext: () => Promise<PaginatedMessageResponse>;
2069
+ getPrevious: () => Promise<PaginatedMessageResponse>;
2070
+ create: (
2071
+ uuid: string,
2072
+ data: MessageData,
2073
+ ) => Promise<MessageResponse>;
2074
+ };
2075
+ groups: {
2076
+ get: (
2077
+ id: string,
2078
+ groupName?: string,
2079
+ ) => Promise<PaginatedGroupsResponse | GroupsResponse>;
2080
+ getNext: () => Promise<PaginatedGroupsResponse>;
2081
+ getPrevious: () => Promise<PaginatedGroupsResponse>;
2082
+ create: (
2083
+ uuid: string,
2084
+ data: any,
2085
+ ) => Promise<GroupsResponse>;
2086
+ delete: (
2087
+ uuid: string,
2088
+ name: string,
2089
+ ) => Promise<ApiResponse>;
2090
+ };
2091
+ addresses: {
2092
+ get: (obj?: {
2093
+ id?: string;
2094
+ filters?: UserFilters;
2095
+ }) => Promise<PaginatedAddressResponse | AddressResponse>;
2096
+ getNext: () => Promise<PaginatedAddressResponse>;
2097
+ getPrevious: () => Promise<PaginatedAddressResponse>;
2098
+ create: (data: AddressResult) => Promise<AddressResponse>;
2099
+ update: (
2100
+ id: string,
2101
+ data: AddressResult,
2102
+ ) => Promise<AddressResponse>;
2103
+ delete: (id: string) => Promise<ApiResponse>;
2104
+ };
2105
+ bankAccounts: {
2106
+ get(id: string): Promise<BankAccountListResponse>;
2107
+ create(
2108
+ data: CreateBankAccountPayload,
2109
+ ): Promise<BankAccountResponse>;
2110
+ update(
2111
+ id: string,
2112
+ data: Partial<CreateBankAccountPayload>,
2113
+ ): Promise<BankAccountResponse>;
2114
+ delete(id: string): Promise<ApiResponse>;
2115
+ currencies: {
2116
+ get(
2117
+ id: string,
2118
+ obj?: { code?: string; filters?: any },
2119
+ ): Promise<
2120
+ | AllBankAccountCurrencyResponse
2121
+ | GetBankAccountCurrencyResponse
2122
+ >;
2123
+ getNext(): Promise<AllBankAccountCurrencyResponse>;
2124
+ getPrevious(): Promise<AllBankAccountCurrencyResponse>;
2125
+ create(
2126
+ id: string,
2127
+ ): Promise<GetBankAccountCurrencyResponse>;
2128
+ delete(
2129
+ id: string,
2130
+ currCode: string,
2131
+ ): Promise<ApiResponse>;
2132
+ };
2133
+ };
2134
+ cryptoAccounts: {
2135
+ get: (obj?: {
2136
+ id?: string;
2137
+ filters?: any;
2138
+ }) => Promise<
2139
+ | PaginatedCryptoAccountListResponse
2140
+ | CryptoAccountListResponse
2141
+ >;
2142
+ getNext: () => Promise<PaginatedCryptoAccountListResponse>;
2143
+ getPrevious: () => Promise<PaginatedCryptoAccountListResponse>;
2144
+ create: (data: any) => Promise<CryptoAccountListResponse>;
2145
+ update: (
2146
+ id: string,
2147
+ data: CryptoAccountData,
2148
+ ) => Promise<CryptoAccountListResponse>;
2149
+ delete: (id: string) => Promise<ApiResponse>;
2150
+ };
2151
+ documents: {
2152
+ get: (obj?: {
2153
+ id?: string;
2154
+ filters?: any;
2155
+ }) => Promise<PaginatedUserDocuments | UserDocuments>;
2156
+ getNext: () => Promise<PaginatedUserDocuments>;
2157
+ getPrevious: () => Promise<PaginatedUserDocuments>;
2158
+ create: (
2159
+ data: UserDocumentPayload,
2160
+ ) => Promise<UserDocuments>;
2161
+ update: (
2162
+ id: string,
2163
+ data: UserDocumentPayload,
2164
+ ) => Promise<any>;
2165
+ delete: (id: string) => Promise<ApiResponse>;
2166
+ };
2167
+ emails: {
2168
+ get: (obj?: {
2169
+ id?: string;
2170
+ filters?: any;
2171
+ }) => Promise<
2172
+ PaginatedEmailListResponse | SingleEmailResponse
2173
+ >;
2174
+ getNext: () => Promise<PaginatedEmailListResponse>;
2175
+ getPrevious: () => Promise<PaginatedEmailListResponse>;
2176
+ create: (
2177
+ data: EmailCreatePayload,
2178
+ ) => Promise<SingleEmailResponse>;
2179
+ update: (
2180
+ id: string,
2181
+ data: EmailCreatePayload,
2182
+ ) => Promise<SingleEmailResponse>;
2183
+ delete: (id: string) => Promise<ApiResponse>;
2184
+ };
2185
+ mobiles: {
2186
+ get: (obj?: {
2187
+ id?: string;
2188
+ filters?: any;
2189
+ }) => Promise<MobileListResponse | SingleMobileResponse>;
2190
+ getNext: () => Promise<PaginatedMessageResponse>;
2191
+ getPrevious: () => Promise<PaginatedMessageResponse>;
2192
+ create: (
2193
+ data: MobileNumberPayload,
2194
+ ) => Promise<SingleMobileResponse>;
2195
+ update: (
2196
+ id: string,
2197
+ data: MobileNumberPayload,
2198
+ ) => Promise<SingleMobileResponse>;
2199
+ delete: (id: string) => Promise<ApiResponse>;
2200
+ };
2201
+ };
2202
+ transactions: {
2203
+ get(obj?: {
2204
+ id?: string;
2205
+ filters?: Record<string, string>;
2206
+ }): Promise<
2207
+ TransactionListResponse | SingleTransactionResponse
2208
+ >;
2209
+ getNext(): Promise<TransactionListResponse>;
2210
+ getPrevious(): Promise<TransactionListResponse>;
2211
+ totals: {
2212
+ get(obj?: {
2213
+ filters?: Record<string, string>;
2214
+ }): Promise<TransactionTotal>;
2215
+ };
2216
+ update(
2217
+ id: string,
2218
+ data: TransactionPayload,
2219
+ ): Promise<SingleTransactionResponse>;
2220
+ createCredit(
2221
+ data: TransactionCreditOrDebitPayload,
2222
+ ): Promise<SingleTransactionResponse>;
2223
+ createDebit(
2224
+ data: TransactionCreditOrDebitPayload,
2225
+ ): Promise<any>;
2226
+ createTransfer(data: Record<string, any>): Promise<any>;
2227
+ };
2228
+ transaction_collections: {
2229
+ get(obj?: {
2230
+ id?: string;
2231
+ filters?: Record<string, string>;
2232
+ }): Promise<
2233
+ | TransactionCollectionResponse
2234
+ | SingleTransactionCollectionResponse
2235
+ >;
2236
+ getNext(): Promise<TransactionCollectionResponse>;
2237
+ getPrevious(): Promise<TransactionCollectionResponse>;
2238
+ create(
2239
+ data: TransactionCollection,
2240
+ ): Promise<SingleTransactionCollectionResponse>;
2241
+ update(
2242
+ reference: string,
2243
+ data: UpdateCollectionPayload,
2244
+ ): Promise<SingleTransactionCollectionResponse>;
2245
+ delete(id: string): Promise<ApiResponse>;
2246
+ };
2247
+
2248
+ accounts: {
2249
+ create: (
2250
+ data: CreateCurrencyAccountPayload,
2251
+ ) => Promise<SingleAccountResponse | AccountResponse>;
2252
+ update: (
2253
+ reference: string,
2254
+ data: CreateCurrencyAccountPayload,
2255
+ ) => Promise<SingleAccountResponse>;
2256
+ get(obj?: {
2257
+ reference?: string;
2258
+ filters?: Record<string, string>;
2259
+ }): Promise<SingleAccountResponse | AccountResponse>;
2260
+ getNext(): Promise<AccountResponse>;
2261
+ getPrevious(): Promise<AccountResponse>;
2262
+ currencies: {
2263
+ get: (
2264
+ reference: string,
2265
+ obj?: any,
2266
+ ) => Promise<
2267
+ | GetSingleAdminCurrencyResponse
2268
+ | AllAdminCurrencyResponse
2269
+ >;
2270
+ getNext: () => Promise<AllAdminCurrencyResponse>;
2271
+ getPrevious: () => Promise<AllAdminCurrencyResponse>;
2272
+ create: (
2273
+ reference: string,
2274
+ data: CreateAdminCurrencyPayload,
2275
+ ) => Promise<GetSingleAdminCurrencyResponse>;
2276
+ update: (
2277
+ reference: string,
2278
+ code: string,
2279
+ data: UpdateAdminCurrencyPayload,
2280
+ ) => Promise<GetSingleAdminCurrencyResponse>;
2281
+ limits: {
2282
+ get: (
2283
+ reference: string,
2284
+ code: string,
2285
+ obj?: any,
2286
+ ) => Promise<
2287
+ | SingleCurrencyLimitResponse
2288
+ | AllCurrencyLimitResponse
2289
+ >;
2290
+ create: (
2291
+ reference: string,
2292
+ code: string,
2293
+ data: CurrencyLimitCreationPayload,
2294
+ ) => Promise<SingleCurrencyLimitResponse>;
2295
+ update: (
2296
+ reference: string,
2297
+ code: string,
2298
+ id: string,
2299
+ data: CurrencyLimitCreationPayload,
2300
+ ) => Promise<SingleCurrencyLimitResponse>;
2301
+ delete: (
2302
+ reference: string,
2303
+ code: string,
2304
+ id: string,
2305
+ ) => Promise<ApiResponse>;
2306
+ };
2307
+ fees: {
2308
+ get: (
2309
+ reference: string,
2310
+ code: string,
2311
+ obj?: any,
2312
+ ) => Promise<
2313
+ | SingleAccountCurrencyFeesResponse
2314
+ | AllAccountCurrencyFeesResponse
2315
+ >;
2316
+ create: (
2317
+ reference: string,
2318
+ code: string,
2319
+ data: AccountCurrencyFeeCreationPayload,
2320
+ ) => Promise<SingleAccountCurrencyFeesResponse>;
2321
+ update: (
2322
+ reference: string,
2323
+ code: string,
2324
+ id: string,
2325
+ data: AccountCurrencyFeeCreationPayload,
2326
+ ) => Promise<SingleAccountCurrencyFeesResponse>;
2327
+ delete: (
2328
+ reference: string,
2329
+ code: string,
2330
+ id: string,
2331
+ ) => Promise<ApiResponse>;
2332
+ };
2333
+ settings: {
2334
+ get: (
2335
+ reference: string,
2336
+ code: string,
2337
+ ) => Promise<CurrencyListSettingsResponse>;
2338
+ update: (
2339
+ reference: string,
2340
+ code: string,
2341
+ data: UpdateCurrencySettingsPayload,
2342
+ ) => Promise<CurrencyListSettingsResponse>;
2343
+ };
2344
+ };
2345
+ };
2346
+ account: {
2347
+ definitions: {
2348
+ get: (obj?: {
2349
+ name?: string;
2350
+ filters?: Record<string, string>;
2351
+ }) => Promise<
2352
+ | AllAccountDefinitionResponse
2353
+ | SingleAccountDefinitionResponse
2354
+ >;
2355
+ getNext: () => Promise<AllAccountDefinitionResponse>;
2356
+ getPrevious: () => Promise<AllAccountDefinitionResponse>;
2357
+ create: (
2358
+ data: CreateDefinitionPayload,
2359
+ ) => Promise<SingleAccountDefinitionResponse>;
2360
+ update: (
2361
+ accountName: string,
2362
+ data: CreateDefinitionPayload,
2363
+ ) => Promise<SingleAccountDefinitionResponse>;
2364
+ delete: (accountName: string) => Promise<ApiResponse>;
2365
+
2366
+ groups: {
2367
+ get: (
2368
+ accountName: string,
2369
+ obj?: {
2370
+ name?: string;
2371
+ filters?: Record<string, string>;
2372
+ },
2373
+ ) => Promise<
2374
+ | SingleAccountDefinitionsGroupsResponse
2375
+ | AccountDefinitionsGroupsResponse
2376
+ >;
2377
+ getNext: () => Promise<AccountDefinitionsGroupsResponse>;
2378
+ getPrevious: () => Promise<AccountDefinitionsGroupsResponse>;
2379
+ create: (
2380
+ accountName: string,
2381
+ data: AccountGroupPayload,
2382
+ ) => Promise<SingleAccountDefinitionsGroupsResponse>;
2383
+ update: (
2384
+ accountName: string,
2385
+ groupName: string,
2386
+ data: AccountGroupPayload,
2387
+ ) => Promise<SingleAccountDefinitionsGroupsResponse>;
2388
+ delete: (
2389
+ accountName: string,
2390
+ groupName: string,
2391
+ ) => Promise<ApiResponse>;
2392
+
2393
+ currencies: {
2394
+ get: (
2395
+ accountName: string,
2396
+ groupName: string,
2397
+ obj?: {
2398
+ code?: string;
2399
+ filters?: Record<string, string>;
2400
+ },
2401
+ ) => Promise<
2402
+ | AccountDefinitionGroupCurrenciesResponse
2403
+ | SingleAccountDefinitionGroupCurrenciesResponse
2404
+ >;
2405
+ getNext: () => Promise<AccountDefinitionGroupCurrenciesResponse>;
2406
+ getPrevious: () => Promise<AccountDefinitionGroupCurrenciesResponse>;
2407
+ create: (
2408
+ accountName: string,
2409
+ groupName: string,
2410
+ data: {
2411
+ currency: string;
2412
+ archived: boolean;
2413
+ },
2414
+ ) => Promise<SingleAccountDefinitionGroupCurrenciesResponse>;
2415
+ update: (
2416
+ accountName: string,
2417
+ groupName: string,
2418
+ currencyCode: string,
2419
+ data: {
2420
+ archived: boolean;
2421
+ },
2422
+ ) => Promise<SingleAccountDefinitionGroupCurrenciesResponse>;
2423
+ delete: (
2424
+ accountName: string,
2425
+ groupName: string,
2426
+ currencyCode: string,
2427
+ ) => Promise<ApiResponse>;
2428
+ };
2429
+ };
2430
+ };
2431
+ };
2432
+ auth: {
2433
+ login: (data: {
2434
+ email: string;
2435
+ password: string;
2436
+ session_duration: number;
2437
+ }) => Promise<LoginResponse>;
2438
+ register: (
2439
+ data: RegisterCredentials,
2440
+ ) => Promise<RegisterResponse>;
2441
+ };
2442
+ metrics: {
2443
+ get: (
2444
+ obj?: MetricObj,
2445
+ ) => Promise<
2446
+ AllAdminListMetricsResponse | SingleAdminListMetricsResponse
2447
+ >;
2448
+ getNext: () => Promise<AllAdminListMetricsResponse>;
2449
+ create: (
2450
+ data: CreateMetricsPayload,
2451
+ ) => Promise<SingleAdminListMetricsResponse>;
2452
+ delete: (id: string) => Promise<ApiResponse>;
2453
+ points: {
2454
+ get: (
2455
+ id: string,
2456
+ obj?: MetricObj,
2457
+ ) => Promise<MetricPointsListResponse>;
2458
+ getNext: () => Promise<MetricPointsListResponse>;
2459
+ getPrevious: () => Promise<MetricPointsListResponse>;
2460
+ };
2461
+ };
2462
+ exports: {
2463
+ sets: {
2464
+ get: (
2465
+ obj?: MetricObj,
2466
+ ) => Promise<AllExportsResponse | SingleExportsResponse>;
2467
+ getNext: () => Promise<AllExportsResponse>;
2468
+ getPrevious: () => Promise<AllExportsResponse>;
2469
+ create: (
2470
+ data: CreateExportPayload,
2471
+ ) => Promise<SingleExportsResponse>;
2472
+ delete: (id: string) => Promise<ApiResponse>;
2473
+ };
2474
+ };
2475
+ access_control_rules: {
2476
+ get: (
2477
+ obj?: MetricObj,
2478
+ ) => Promise<
2479
+ | SingleAccessControlRulesResponse
2480
+ | AllAccessControlRulesResponse
2481
+ >;
2482
+ getNext: () => Promise<AllAccessControlRulesResponse>;
2483
+ getPrevious: () => Promise<AllAccessControlRulesResponse>;
2484
+ create: (data: CreateAccessControlRulePayload) => Promise<any>;
2485
+ update: (
2486
+ id: string,
2487
+ data: CreateAccessControlRulePayload,
2488
+ ) => Promise<any>;
2489
+ delete: (id: string) => Promise<ApiResponse>;
2490
+ };
2491
+ currencies: {
2492
+ get: (
2493
+ obj?: any,
2494
+ ) => Promise<
2495
+ AdminCurrencyListResponse | SingleAdminCurrencyResponse
2496
+ >;
2497
+ getNext: () => Promise<AdminCurrencyListResponse>;
2498
+ getPrevious: () => Promise<AdminCurrencyListResponse>;
2499
+ create: (
2500
+ data: CreateCurrencyPayload,
2501
+ ) => Promise<SingleAdminCurrencyResponse>;
2502
+ update: (
2503
+ code: string,
2504
+ data: CreateCurrencyPayload,
2505
+ ) => Promise<SingleAdminCurrencyResponse>;
2506
+ delete: (code: string) => Promise<ApiResponse>;
2507
+ overview: {
2508
+ get: (code: string) => Promise<CurrencyOverviewResponse>;
2509
+ //done
2510
+ };
2511
+ bankAccounts: {
2512
+ get: (code: string, obj?: any) => Promise<any>;
2513
+ getNext: () => Promise<any>;
2514
+ getPrevious: () => Promise<any>;
2515
+ create: (code: string, data: any) => Promise<any>;
2516
+ delete: (code: string, id: string) => Promise<any>;
2517
+ };
2518
+ };
2519
+ company: {
2520
+ get: () => Promise<any>;
2521
+ update: (data: any) => Promise<any>;
2522
+ settings: {
2523
+ get: () => Promise<any>;
2524
+ update: (data: any) => Promise<any>;
2525
+ };
2526
+ address: {
2527
+ get: () => Promise<any>;
2528
+ update: (data: any) => Promise<any>;
2529
+ };
2530
+ links: {
2531
+ get: (obj?: any) => Promise<any>;
2532
+ getNext: () => Promise<any>;
2533
+ getPrevious: () => Promise<any>;
2534
+ create: (data: any) => Promise<any>;
2535
+ update: (id: string, data: any) => Promise<any>;
2536
+ delete: (id: string) => Promise<any>;
2537
+ };
2538
+ };
2539
+ bankAccounts: {
2540
+ get: (obj?: any) => Promise<any>;
2541
+ create: (data: any) => Promise<any>;
2542
+ update: (id: string, data: any) => Promise<any>;
2543
+ delete: (id: string) => Promise<any>;
2544
+ currencies: {
2545
+ get: (bankId: string, currency?: string) => Promise<any>;
2546
+ getNext: () => Promise<any>;
2547
+ getPrevious: () => Promise<any>;
2548
+ create: (bankId: string, data: any) => Promise<any>;
2549
+ delete: (bankId: string, currency: string) => Promise<any>;
2550
+ };
2551
+ };
2552
+ webhooks: {
2553
+ get: (obj?: any) => Promise<any>;
2554
+ getNext: () => Promise<any>;
2555
+ getPrevious: () => Promise<any>;
2556
+ create: (data: any) => Promise<any>;
2557
+ update: (webhooksId: string, data: any) => Promise<any>;
2558
+ delete: (id: string) => Promise<any>;
2559
+ };
2560
+ webhookTasks: {
2561
+ get: (obj?: any) => Promise<any>;
2562
+ getNext: () => Promise<any>;
2563
+ getPrevious: () => Promise<any>;
2564
+ create: (data: any) => Promise<any>;
2565
+ update: (webhooksId: string, data: any) => Promise<any>;
2566
+ delete: (id: string) => Promise<any>;
2567
+ requests: {
2568
+ get: (webhookTaskID: string, obj?: any) => Promise<any>;
2569
+ getNext: () => Promise<any>;
2570
+ getPrevious: () => Promise<any>;
2571
+ };
2572
+ };
2573
+ subtypes: {
2574
+ get: (obj?: any) => Promise<any>;
2575
+ getNext: () => Promise<any>;
2576
+ getPrevious: () => Promise<any>;
2577
+ create: (data: any) => Promise<any>;
2578
+ update: (id: string, data: any) => Promise<any>;
2579
+ delete: (id: string) => Promise<any>;
2580
+ };
2581
+ notifications: {
2582
+ get: (obj?: any) => Promise<any>;
2583
+ update: (notificationId: string, data: any) => Promise<any>;
2584
+ };
2585
+ services: {
2586
+ get: (obj?: any) => Promise<any>;
2587
+ getNext: () => Promise<any>;
2588
+ getPrevious: () => Promise<any>;
2589
+ update: (id: string, data: any) => Promise<any>;
2590
+ create: (data: any) => Promise<any>;
2591
+ delete: (id: string) => Promise<any>;
2592
+ };
2593
+ requests: {
2594
+ get: (obj?: any) => Promise<any>;
2595
+ getNext: () => Promise<any>;
2596
+ getPrevious: () => Promise<any>;
2597
+ };
2598
+ groups: {
2599
+ get(obj?: { name?: string; filters?: any }): Promise<any>;
2600
+ getNext(): Promise<any>;
2601
+ getPrevious(): Promise<any>;
2602
+ create(data: any): Promise<any>;
2603
+ update(name: string, data: any): Promise<any>;
2604
+ delete(name: string): Promise<any>;
2605
+ fees: {
2606
+ get(
2607
+ groupName: string,
2608
+ obj?: { id?: string; filters?: any },
2609
+ ): Promise<any>;
2610
+ getNext(): Promise<any>;
2611
+ getPrevious(): Promise<any>;
2612
+ create(groupName: string, data: any): Promise<any>;
2613
+ update(
2614
+ groupName: string,
2615
+ feeId: string,
2616
+ data: any,
2617
+ ): Promise<any>;
2618
+ delete(groupName: string, feeId: string): Promise<any>;
2619
+ };
2620
+ permissions: {
2621
+ get(
2622
+ name: string,
2623
+ obj?: { id?: string; filters?: any },
2624
+ ): Promise<any>;
2625
+ getNext(): Promise<any>;
2626
+ getPrevious(): Promise<any>;
2627
+ create(name: string, data: any): Promise<any>;
2628
+ delete(name: string, id: string): Promise<any>;
2629
+ };
2630
+
2631
+ settings: {
2632
+ get(name: string): Promise<any>;
2633
+ update(name: string, data: any): Promise<any>;
2634
+ };
2635
+
2636
+ tiers: {
2637
+ get(name: string, obj?: { id?: string }): Promise<any>;
2638
+ create(name: string, data: any): Promise<any>;
2639
+ update(
2640
+ name: string,
2641
+ tierId: string,
2642
+ data: any,
2643
+ ): Promise<any>;
2644
+ delete(name: string, tierId: string): Promise<any>;
2645
+ get(name: string, tierId: string): Promise<any>;
2646
+
2647
+ fees: {
2648
+ get(
2649
+ name: string,
2650
+ tierId: string,
2651
+ obj?: { id?: string },
2652
+ ): Promise<any>;
2653
+ create(
2654
+ name: string,
2655
+ tierId: string,
2656
+ data: any,
2657
+ ): Promise<any>;
2658
+ update(
2659
+ name: string,
2660
+ tierId: string,
2661
+ feeId: string,
2662
+ data: any,
2663
+ ): Promise<any>;
2664
+ delete(
2665
+ name: string,
2666
+ tierId: string,
2667
+ feeId: string,
2668
+ ): Promise<any>;
2669
+ };
2670
+
2671
+ limits: {
2672
+ get(
2673
+ name: string,
2674
+ tierId: string,
2675
+ obj?: { id?: string },
2676
+ ): Promise<any>;
2677
+ create(
2678
+ name: string,
2679
+ tierId: string,
2680
+ data: any,
2681
+ ): Promise<any>;
2682
+ update(
2683
+ name: string,
2684
+ tierId: string,
2685
+ limitId: string,
2686
+ data: any,
2687
+ ): Promise<any>;
2688
+ delete(
2689
+ name: string,
2690
+ tierId: string,
2691
+ limitId: string,
2692
+ ): Promise<any>;
2693
+ };
2694
+
2695
+ requirements: {
2696
+ get(
2697
+ name: string,
2698
+ tierId: string,
2699
+ obj?: { id?: string },
2700
+ ): Promise<any>;
2701
+ create(
2702
+ name: string,
2703
+ tierId: string,
2704
+ data: any,
2705
+ ): Promise<any>;
2706
+ update(
2707
+ name: string,
2708
+ tierId: string,
2709
+ requirementId: string,
2710
+ data: any,
2711
+ ): Promise<any>;
2712
+ delete(
2713
+ name: string,
2714
+ tierId: string,
2715
+ requirementId: string,
2716
+ ): Promise<any>;
2717
+ };
2718
+ requirementSets: {
2719
+ get(
2720
+ groupName: string,
2721
+ tierId: string,
2722
+ requirementSetId?: string,
2723
+ ): Promise<any>;
2724
+ create(
2725
+ groupName: string,
2726
+ tiersId: string,
2727
+ data: any,
2728
+ ): Promise<any>;
2729
+ update(
2730
+ groupName: string,
2731
+ tierId: string,
2732
+ requirementSetId: string,
2733
+ data: any,
2734
+ ): Promise<any>;
2735
+ delete(
2736
+ groupName: string,
2737
+ tierId: string,
2738
+ requirementSetId: string,
2739
+ ): Promise<any>;
2740
+ items: {
2741
+ get(
2742
+ groupName: string,
2743
+ tierId: string,
2744
+ requirementSetId?: string,
2745
+ itemId?: string,
2746
+ ): Promise<any>;
2747
+ create(
2748
+ groupName: string,
2749
+ tiersId: string,
2750
+ requirementSetId: string,
2751
+ data: any,
2752
+ ): Promise<any>;
2753
+ delete(
2754
+ groupName: string,
2755
+ tierId: string,
2756
+ requirementSetId: string,
2757
+ itemId: string,
2758
+ ): Promise<any>;
2759
+ };
2760
+ };
2761
+ settings: {
2762
+ get(name: string, tierId: string): Promise<any>;
2763
+ update(
2764
+ name: string,
2765
+ tierId: string,
2766
+ data: any,
2767
+ ): Promise<any>;
2768
+ };
2769
+ };
2770
+ accountConfigurations: {
2771
+ get(
2772
+ name: string,
2773
+ obj?: { name?: string; filters?: any },
2774
+ ): Promise<any>;
2775
+ getNext(): Promise<any>;
2776
+ getPrevious(): Promise<any>;
2777
+ create(name: string, data: any): Promise<any>;
2778
+ update(
2779
+ name: string,
2780
+ accConfigName: string,
2781
+ data: any,
2782
+ ): Promise<any>;
2783
+ currencies: {
2784
+ get(
2785
+ name: string,
2786
+ accConfigName: string,
2787
+ obj?: any,
2788
+ ): Promise<any>;
2789
+ getNext(): Promise<any>;
2790
+ getPrevious(): Promise<any>;
2791
+ create(
2792
+ name: string,
2793
+ accConfigName: string,
2794
+ data: any,
2795
+ ): Promise<any>;
2796
+ delete(
2797
+ name: string,
2798
+ accConfigName: string,
2799
+ currencyCode: string,
2800
+ ): Promise<any>;
2801
+ };
2802
+ };
2803
+ };
2804
+ accountCurrencies: {
2805
+ get(obj?: any): Promise<any>;
2806
+ };
2807
+ documentTypes: {
2808
+ get(obj?: { id?: string; filters?: any }): Promise<any>;
2809
+ create(data: any): Promise<any>;
2810
+ update(typeId: string, data: any): Promise<any>;
2811
+ delete(typeId: string): Promise<any>;
2812
+ };
2813
+ };
2814
+ documentTypes: {
2815
+ get(typeId: string): Promise<any>;
2816
+ };
2817
+ permissions: {
2818
+ get(obj: any): Promise<any>;
2819
+ getNext(): Promise<any>;
2820
+ getPrevious(): Promise<any>;
2821
+ };
2822
+ transactions: {
2823
+ transactions: {
2824
+ get(obj?: { id?: string; filters?: any }): Promise<any>;
2825
+ getNext(): Promise<any>;
2826
+ getPrevious(): Promise<any>;
2827
+ totals: {
2828
+ get(filters?: any): Promise<any>;
2829
+ };
2830
+ createDebit(data: any): Promise<any>;
2831
+ createCredit(data: any): Promise<any>;
2832
+ createTransfer(data: any): Promise<any>;
2833
+ };
2834
+ };
2835
+ transaction_collections: {
2836
+ get(obj?: { id?: string; filters?: any }): Promise<any>;
2837
+ getNext(): Promise<any>;
2838
+ getPrevious(): Promise<any>;
2839
+ create(data: any): Promise<any>;
2840
+ };
2841
+ accounts: {
2842
+ get(obj?: { reference?: string; filters?: any }): Promise<any>;
2843
+ getNext(): Promise<any>;
2844
+ getPrevious(): Promise<any>;
2845
+ create(data: any): Promise<any>;
2846
+ currencies: {
2847
+ get(
2848
+ reference: string,
2849
+ obj?: { code?: string; filters?: any },
2850
+ ): Promise<any>;
2851
+ getNext(): Promise<any>;
2852
+ getPrevious(): Promise<any>;
2853
+ update(
2854
+ reference: string,
2855
+ currencyCode: string,
2856
+ data: any,
2857
+ ): Promise<any>;
2858
+ };
2859
+ };
2860
+ company: {
2861
+ get(): Promise<any>;
2862
+ currencies: {
2863
+ get(obj?: { code?: string; filters?: any }): Promise<any>;
2864
+ getNext(): Promise<any>;
2865
+ getPrevious(): Promise<any>;
2866
+ };
2867
+ bankAccounts: {
2868
+ get(): Promise<any>;
2869
+ };
2870
+ };
2871
+ groups: {
2872
+ get(obj?: { name?: string; filters?: any }): Promise<any>;
2873
+ getNext(): Promise<any>;
2874
+ getPrevious(): Promise<any>;
2875
+ tiers: {
2876
+ requirementSets: {
2877
+ get(
2878
+ groupName: string,
2879
+ tierId: string,
2880
+ requirementSetId?: string,
2881
+ ): Promise<any>;
2882
+ items: {
2883
+ get(
2884
+ groupName: string,
2885
+ tierId: string,
2886
+ requirementSetId?: string,
2887
+ itemId?: string,
2888
+ ): Promise<any>;
2889
+ };
2890
+ };
2891
+ };
2892
+ };
2893
+ }
2894
+
2895
+ export = Rehive;
2896
+ }