monime-package 1.1.1 → 1.1.3

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/dist/index.d.mts CHANGED
@@ -4,13 +4,18 @@ interface ClientConfig {
4
4
  monimeVersion?: string | undefined;
5
5
  }
6
6
  interface Pagination {
7
- count?: number;
8
- next: string | null;
7
+ count: number;
8
+ next: string;
9
+ }
10
+ interface Result<T> {
11
+ data?: T;
12
+ success: boolean;
13
+ error?: Error;
9
14
  }
10
15
 
11
16
  interface AllCheckout {
12
17
  result: CheckoutSession[];
13
- pagination: Pagination;
18
+ Pagination: Pagination;
14
19
  }
15
20
  interface CheckoutSession {
16
21
  id: string;
@@ -161,25 +166,10 @@ interface Price {
161
166
  }
162
167
 
163
168
  declare function CheckoutSessionAPI(config: ClientConfig): {
164
- create: (name: string, amount: number, quantity: number, successUrl: string, cancelUrl: string, description?: string, financialAccountId?: string, primaryColor?: string, images?: string[]) => Promise<{
165
- success: boolean;
166
- error?: Error;
167
- data: CreateCheckout;
168
- }>;
169
- get: () => Promise<{
170
- success: boolean;
171
- error?: Error;
172
- data: AllCheckout;
173
- }>;
174
- getOne: (checkoutId: string) => Promise<{
175
- success: boolean;
176
- error?: Error;
177
- data: OneCheckout;
178
- }>;
179
- delete: (checkoutId: string) => Promise<{
180
- success: boolean;
181
- error?: Error;
182
- }>;
169
+ create: (name: string, amount: number, quantity: number, successUrl: string, cancelUrl: string, description?: string, financialAccountId?: string, primaryColor?: string, images?: string[]) => Promise<Result<CreateCheckout>>;
170
+ get: () => Promise<Result<AllCheckout>>;
171
+ getOne: (checkoutId: string) => Promise<Result<OneCheckout>>;
172
+ delete: (checkoutId: string) => Promise<Result<OneCheckout>>;
183
173
  };
184
174
 
185
175
  interface CreateFinancialAccount {
@@ -241,16 +231,163 @@ interface Available {
241
231
  value: number;
242
232
  }
243
233
 
234
+ interface BankFeature {
235
+ canPayTo?: boolean;
236
+ canPayFrom?: boolean;
237
+ canVerifyAccount?: boolean;
238
+ schemes?: string[];
239
+ metadata: Record<string, unknown>;
240
+ }
241
+ interface BankFeatureSet {
242
+ payout: BankFeature;
243
+ payment: BankFeature;
244
+ kycVerification: BankFeature;
245
+ }
246
+ interface Bank {
247
+ providerId: string;
248
+ name: string;
249
+ country: string;
250
+ status: {
251
+ active: boolean;
252
+ };
253
+ featureSet: BankFeatureSet;
254
+ createTime: string;
255
+ updateTime: string;
256
+ }
257
+ interface ListBanksResponse {
258
+ result: Bank[];
259
+ pagination: Pagination;
260
+ }
261
+ interface GetBankResponse extends Bank {
262
+ }
263
+
264
+ interface MomoFeature {
265
+ canPayTo?: boolean;
266
+ canPayFrom?: boolean;
267
+ canVerifyAccount?: boolean;
268
+ schemes?: string[];
269
+ metadata: Record<string, unknown>;
270
+ }
271
+ interface MomoFeatureSet {
272
+ payout: MomoFeature;
273
+ payment: MomoFeature;
274
+ kycVerification: MomoFeature;
275
+ }
276
+ interface Momo {
277
+ providerId: string;
278
+ name: string;
279
+ country: string;
280
+ status: {
281
+ active: boolean;
282
+ };
283
+ featureSet: MomoFeatureSet;
284
+ createTime: string;
285
+ updateTime: string;
286
+ }
287
+ interface ListMomosResponse {
288
+ result: Momo[];
289
+ pagination: Pagination;
290
+ }
291
+ interface GetMomoResponse extends Momo {
292
+ }
293
+
294
+ interface GetTransaction {
295
+ id: string;
296
+ type: string;
297
+ amount: Amount$3;
298
+ timestamp: string;
299
+ reference: string;
300
+ financialAccount: FinancialAccount;
301
+ originatingReversal: OriginatingReversal;
302
+ originatingFee: OriginatingFee;
303
+ ownershipGraph: OwnershipGraph$3;
304
+ }
305
+ interface AllTransaction {
306
+ result: Transaction[];
307
+ pagination: Pagination;
308
+ }
309
+ interface Transaction {
310
+ id: string;
311
+ type: string;
312
+ amount: Amount$3;
313
+ timestamp: string;
314
+ reference: string;
315
+ financialAccount: FinancialAccount;
316
+ originatingReversal: OriginatingReversal;
317
+ originatingFee: OriginatingFee;
318
+ ownershipGraph: OwnershipGraph$3;
319
+ }
320
+ interface OwnershipGraph$3 {
321
+ owner: Owner2$3;
322
+ }
323
+ interface OwnershipGraph$3 {
324
+ owner: Owner2$3;
325
+ }
326
+ interface Owner2$3 {
327
+ id: string;
328
+ type: string;
329
+ owner: Owner$3;
330
+ }
331
+ interface Owner2$3 {
332
+ id: string;
333
+ type: string;
334
+ owner: Owner$3;
335
+ }
336
+ interface Owner$3 {
337
+ id: string;
338
+ type: string;
339
+ }
340
+ interface Owner$3 {
341
+ id: string;
342
+ type: string;
343
+ }
344
+ interface OriginatingFee {
345
+ code: string;
346
+ }
347
+ interface OriginatingFee {
348
+ code: string;
349
+ }
350
+ interface OriginatingReversal {
351
+ originTxnId: string;
352
+ originTxnRef: string;
353
+ }
354
+ interface OriginatingReversal {
355
+ originTxnId: string;
356
+ originTxnRef: string;
357
+ }
358
+ interface FinancialAccount {
359
+ id: string;
360
+ balance: Balance;
361
+ }
362
+ interface FinancialAccount {
363
+ id: string;
364
+ balance: Balance;
365
+ }
366
+ interface Balance {
367
+ after: Amount$3;
368
+ }
369
+ interface Balance {
370
+ after: Amount$3;
371
+ }
372
+ interface Amount$3 {
373
+ currency: string;
374
+ value: number;
375
+ }
376
+ interface Amount$3 {
377
+ currency: string;
378
+ value: number;
379
+ }
380
+
244
381
  interface CreateInternalTransfer {
245
382
  id: string;
246
383
  status: string;
247
- amount: Amount$3;
384
+ amount: Amount$2;
248
385
  sourceFinancialAccount: SourceFinancialAccount;
249
386
  destinationFinancialAccount: SourceFinancialAccount;
250
387
  financialTransactionReference: string;
251
388
  description: string;
252
389
  failureDetail: FailureDetail$1;
253
- ownershipGraph: OwnershipGraph$3;
390
+ ownershipGraph: OwnershipGraph$2;
254
391
  createTime: string;
255
392
  updateTime: string;
256
393
  }
@@ -261,62 +398,62 @@ interface AllInternalTransfers {
261
398
  interface Transfer {
262
399
  id: string;
263
400
  status: string;
264
- amount: Amount$3;
401
+ amount: Amount$2;
265
402
  sourceFinancialAccount: SourceFinancialAccount;
266
403
  destinationFinancialAccount: SourceFinancialAccount;
267
404
  financialTransactionReference: string;
268
405
  description: string;
269
406
  failureDetail: FailureDetail$1;
270
- ownershipGraph: OwnershipGraph$3;
407
+ ownershipGraph: OwnershipGraph$2;
271
408
  createTime: string;
272
409
  updateTime: string;
273
410
  }
274
411
  interface InternalTransfer {
275
412
  id: string;
276
413
  status: string;
277
- amount: Amount$3;
414
+ amount: Amount$2;
278
415
  sourceFinancialAccount: SourceFinancialAccount;
279
416
  destinationFinancialAccount: SourceFinancialAccount;
280
417
  financialTransactionReference: string;
281
418
  description: string;
282
419
  failureDetail: FailureDetail$1;
283
- ownershipGraph: OwnershipGraph$3;
420
+ ownershipGraph: OwnershipGraph$2;
284
421
  createTime: string;
285
422
  updateTime: string;
286
423
  }
287
- interface OwnershipGraph$3 {
288
- owner: Owner2$3;
424
+ interface OwnershipGraph$2 {
425
+ owner: Owner2$2;
289
426
  }
290
- interface OwnershipGraph$3 {
291
- owner: Owner2$3;
427
+ interface OwnershipGraph$2 {
428
+ owner: Owner2$2;
292
429
  }
293
- interface OwnershipGraph$3 {
294
- owner: Owner2$3;
430
+ interface OwnershipGraph$2 {
431
+ owner: Owner2$2;
295
432
  }
296
- interface Owner2$3 {
433
+ interface Owner2$2 {
297
434
  id: string;
298
435
  type: string;
299
- owner: Owner$3;
436
+ owner: Owner$2;
300
437
  }
301
- interface Owner2$3 {
438
+ interface Owner2$2 {
302
439
  id: string;
303
440
  type: string;
304
- owner: Owner$3;
441
+ owner: Owner$2;
305
442
  }
306
- interface Owner2$3 {
443
+ interface Owner2$2 {
307
444
  id: string;
308
445
  type: string;
309
- owner: Owner$3;
446
+ owner: Owner$2;
310
447
  }
311
- interface Owner$3 {
448
+ interface Owner$2 {
312
449
  id: string;
313
450
  type: string;
314
451
  }
315
- interface Owner$3 {
452
+ interface Owner$2 {
316
453
  id: string;
317
454
  type: string;
318
455
  }
319
- interface Owner$3 {
456
+ interface Owner$2 {
320
457
  id: string;
321
458
  type: string;
322
459
  }
@@ -341,15 +478,15 @@ interface SourceFinancialAccount {
341
478
  interface SourceFinancialAccount {
342
479
  id: string;
343
480
  }
344
- interface Amount$3 {
481
+ interface Amount$2 {
345
482
  currency: string;
346
483
  value: number;
347
484
  }
348
- interface Amount$3 {
485
+ interface Amount$2 {
349
486
  currency: string;
350
487
  value: number;
351
488
  }
352
- interface Amount$3 {
489
+ interface Amount$2 {
353
490
  currency: string;
354
491
  value: number;
355
492
  }
@@ -425,7 +562,7 @@ interface CreatePaymentCode {
425
562
  processedPaymentData: ProcessedPaymentData;
426
563
  createTime: string;
427
564
  updateTime: string;
428
- ownershipGraph: OwnershipGraph$2;
565
+ ownershipGraph: OwnershipGraph$1;
429
566
  }
430
567
  interface GetAllPaymentCode {
431
568
  result: PaymentCode[];
@@ -436,7 +573,7 @@ interface PaymentCode {
436
573
  mode: string;
437
574
  status: string;
438
575
  name: string;
439
- amount: Amount$2;
576
+ amount: Amount$1;
440
577
  enable: boolean;
441
578
  expireTime: string;
442
579
  customer: Customer;
@@ -449,14 +586,14 @@ interface PaymentCode {
449
586
  processedPaymentData: ProcessedPaymentData;
450
587
  createTime: string;
451
588
  updateTime: string;
452
- ownershipGraph: OwnershipGraph$2;
589
+ ownershipGraph: OwnershipGraph$1;
453
590
  }
454
591
  interface GetOne {
455
592
  id: string;
456
593
  mode: string;
457
594
  status: string;
458
595
  name: string;
459
- amount: Amount$2;
596
+ amount: Amount$1;
460
597
  enable: boolean;
461
598
  expireTime: string;
462
599
  customer: Customer;
@@ -469,9 +606,9 @@ interface GetOne {
469
606
  processedPaymentData: ProcessedPaymentData;
470
607
  createTime: string;
471
608
  updateTime: string;
472
- ownershipGraph: OwnershipGraph$2;
609
+ ownershipGraph: OwnershipGraph$1;
473
610
  }
474
- interface OwnershipGraph$2 {
611
+ interface OwnershipGraph$1 {
475
612
  owner: {
476
613
  id: string;
477
614
  type: string;
@@ -481,27 +618,27 @@ interface OwnershipGraph$2 {
481
618
  };
482
619
  };
483
620
  }
484
- interface OwnershipGraph$2 {
485
- owner: Owner2$2;
621
+ interface OwnershipGraph$1 {
622
+ owner: Owner2$1;
486
623
  }
487
- interface OwnershipGraph$2 {
488
- owner: Owner2$2;
624
+ interface OwnershipGraph$1 {
625
+ owner: Owner2$1;
489
626
  }
490
- interface Owner2$2 {
627
+ interface Owner2$1 {
491
628
  id: string;
492
629
  type: string;
493
- owner: Owner$2;
630
+ owner: Owner$1;
494
631
  }
495
- interface Owner2$2 {
632
+ interface Owner2$1 {
496
633
  id: string;
497
634
  type: string;
498
- owner: Owner$2;
635
+ owner: Owner$1;
499
636
  }
500
- interface Owner$2 {
637
+ interface Owner$1 {
501
638
  id: string;
502
639
  type: string;
503
640
  }
504
- interface Owner$2 {
641
+ interface Owner$1 {
505
642
  id: string;
506
643
  type: string;
507
644
  }
@@ -521,7 +658,7 @@ interface ProcessedPaymentData {
521
658
  financialTransactionReference: string;
522
659
  }
523
660
  interface ProcessedPaymentData {
524
- amount: Amount$2;
661
+ amount: Amount$1;
525
662
  orderId: string;
526
663
  paymentId: string;
527
664
  orderNumber: string;
@@ -529,7 +666,7 @@ interface ProcessedPaymentData {
529
666
  financialTransactionReference: string;
530
667
  }
531
668
  interface ProcessedPaymentData {
532
- amount: Amount$2;
669
+ amount: Amount$1;
533
670
  orderId: string;
534
671
  paymentId: string;
535
672
  orderNumber: string;
@@ -548,11 +685,11 @@ interface ChannelData {
548
685
  }
549
686
  interface RecurrentPaymentTarget {
550
687
  expectedPaymentCount: number;
551
- expectedPaymentTotal: Amount$2;
688
+ expectedPaymentTotal: Amount$1;
552
689
  }
553
690
  interface RecurrentPaymentTarget {
554
691
  expectedPaymentCount: number;
555
- expectedPaymentTotal: Amount$2;
692
+ expectedPaymentTotal: Amount$1;
556
693
  }
557
694
  interface Customer {
558
695
  name: string;
@@ -560,11 +697,11 @@ interface Customer {
560
697
  interface Customer {
561
698
  name: string;
562
699
  }
563
- interface Amount$2 {
700
+ interface Amount$1 {
564
701
  currency: string;
565
702
  value: number;
566
703
  }
567
- interface Amount$2 {
704
+ interface Amount$1 {
568
705
  currency: string;
569
706
  value: number;
570
707
  }
@@ -585,14 +722,14 @@ type DestinationOption = {
585
722
  interface CreatePayout {
586
723
  id: string;
587
724
  status: string;
588
- amount: Amount$1;
725
+ amount: Amount;
589
726
  source: Source;
590
727
  destination: Destination;
591
728
  fees: Fee[];
592
729
  failureDetail: FailureDetail;
593
730
  createTime: string;
594
731
  updateTime: string;
595
- ownershipGraph: OwnershipGraph$1;
732
+ ownershipGraph: OwnershipGraph;
596
733
  }
597
734
  interface GetAll {
598
735
  result: Payout[];
@@ -601,60 +738,60 @@ interface GetAll {
601
738
  interface Payout {
602
739
  id: string;
603
740
  status: string;
604
- amount: Amount$1;
741
+ amount: Amount;
605
742
  source: Source;
606
743
  destination: Destination;
607
744
  fees: Fee[];
608
745
  failureDetail: FailureDetail;
609
746
  createTime: string;
610
747
  updateTime: string;
611
- ownershipGraph: OwnershipGraph$1;
748
+ ownershipGraph: OwnershipGraph;
612
749
  }
613
750
  interface GetOnePayout {
614
751
  id: string;
615
752
  status: string;
616
- amount: Amount$1;
753
+ amount: Amount;
617
754
  source: Source;
618
755
  destination: Destination;
619
756
  fees: Fee[];
620
757
  failureDetail: FailureDetail;
621
758
  createTime: string;
622
759
  updateTime: string;
623
- ownershipGraph: OwnershipGraph$1;
760
+ ownershipGraph: OwnershipGraph;
624
761
  }
625
- interface OwnershipGraph$1 {
626
- owner: Owner2$1;
762
+ interface OwnershipGraph {
763
+ owner: Owner2;
627
764
  }
628
- interface OwnershipGraph$1 {
629
- owner: Owner2$1;
765
+ interface OwnershipGraph {
766
+ owner: Owner2;
630
767
  }
631
- interface OwnershipGraph$1 {
632
- owner: Owner2$1;
768
+ interface OwnershipGraph {
769
+ owner: Owner2;
633
770
  }
634
- interface Owner2$1 {
771
+ interface Owner2 {
635
772
  id: string;
636
773
  type: string;
637
- owner: Owner$1;
774
+ owner: Owner;
638
775
  }
639
- interface Owner2$1 {
776
+ interface Owner2 {
640
777
  id: string;
641
778
  type: string;
642
- owner: Owner$1;
779
+ owner: Owner;
643
780
  }
644
- interface Owner2$1 {
781
+ interface Owner2 {
645
782
  id: string;
646
783
  type: string;
647
- owner: Owner$1;
784
+ owner: Owner;
648
785
  }
649
- interface Owner$1 {
786
+ interface Owner {
650
787
  id: string;
651
788
  type: string;
652
789
  }
653
- interface Owner$1 {
790
+ interface Owner {
654
791
  id: string;
655
792
  type: string;
656
793
  }
657
- interface Owner$1 {
794
+ interface Owner {
658
795
  id: string;
659
796
  type: string;
660
797
  }
@@ -672,15 +809,15 @@ interface FailureDetail {
672
809
  }
673
810
  interface Fee {
674
811
  code: string;
675
- amount: Amount$1;
812
+ amount: Amount;
676
813
  }
677
814
  interface Fee {
678
815
  code: string;
679
- amount: Amount$1;
816
+ amount: Amount;
680
817
  }
681
818
  interface Fee {
682
819
  code: string;
683
- amount: Amount$1;
820
+ amount: Amount;
684
821
  }
685
822
  interface Destination {
686
823
  type: string;
@@ -712,15 +849,15 @@ interface Source {
712
849
  financialAccountId: string;
713
850
  transactionReference: string;
714
851
  }
715
- interface Amount$1 {
852
+ interface Amount {
716
853
  currency: string;
717
854
  value: number;
718
855
  }
719
- interface Amount$1 {
856
+ interface Amount {
720
857
  currency: string;
721
858
  value: number;
722
859
  }
723
- interface Amount$1 {
860
+ interface Amount {
724
861
  currency: string;
725
862
  value: number;
726
863
  }
@@ -808,261 +945,72 @@ interface UpdateWebhookResponse extends Webhook {
808
945
  type Currency = "USD" | "SLE";
809
946
 
810
947
  declare function FinancialAccountAPI(config: ClientConfig): {
811
- create: (name: string, currency: Currency) => Promise<{
812
- success: boolean;
813
- data?: CreateFinancialAccount;
814
- error?: Error;
815
- }>;
816
- get: (financialAccountId: string) => Promise<{
817
- success: boolean;
818
- data?: GetFinancialAccount;
819
- error?: Error;
820
- }>;
821
- getAll: () => Promise<{
822
- success: boolean;
823
- data?: AllFinancialAccount;
824
- error?: Error;
825
- }>;
948
+ create: (name: string, currency: Currency) => Promise<Result<CreateFinancialAccount>>;
949
+ get: (financialAccountId: string) => Promise<Result<GetFinancialAccount>>;
950
+ getAll: () => Promise<Result<AllFinancialAccount>>;
826
951
  };
827
952
 
828
- interface GetTransaction {
829
- id: string;
830
- type: string;
831
- amount: Amount;
832
- timestamp: string;
833
- reference: string;
834
- financialAccount: FinancialAccount;
835
- originatingReversal: OriginatingReversal;
836
- originatingFee: OriginatingFee;
837
- ownershipGraph: OwnershipGraph;
838
- }
839
- interface AllTransaction {
840
- result: Transaction[];
841
- pagination: Pagination;
842
- }
843
- interface Transaction {
844
- id: string;
845
- type: string;
846
- amount: Amount;
847
- timestamp: string;
848
- reference: string;
849
- financialAccount: FinancialAccount;
850
- originatingReversal: OriginatingReversal;
851
- originatingFee: OriginatingFee;
852
- ownershipGraph: OwnershipGraph;
853
- }
854
- interface OwnershipGraph {
855
- owner: Owner2;
856
- }
857
- interface OwnershipGraph {
858
- owner: Owner2;
859
- }
860
- interface Owner2 {
861
- id: string;
862
- type: string;
863
- owner: Owner;
864
- }
865
- interface Owner2 {
866
- id: string;
867
- type: string;
868
- owner: Owner;
869
- }
870
- interface Owner {
871
- id: string;
872
- type: string;
873
- }
874
- interface Owner {
875
- id: string;
876
- type: string;
877
- }
878
- interface OriginatingFee {
879
- code: string;
880
- }
881
- interface OriginatingFee {
882
- code: string;
883
- }
884
- interface OriginatingReversal {
885
- originTxnId: string;
886
- originTxnRef: string;
887
- }
888
- interface OriginatingReversal {
889
- originTxnId: string;
890
- originTxnRef: string;
891
- }
892
- interface FinancialAccount {
893
- id: string;
894
- balance: Balance;
895
- }
896
- interface FinancialAccount {
897
- id: string;
898
- balance: Balance;
899
- }
900
- interface Balance {
901
- after: Amount;
902
- }
903
- interface Balance {
904
- after: Amount;
905
- }
906
- interface Amount {
907
- currency: string;
908
- value: number;
909
- }
910
- interface Amount {
911
- currency: string;
912
- value: number;
913
- }
953
+ declare function BankAPI(config: ClientConfig): {
954
+ get: (providerId: string) => Promise<Result<GetBankResponse>>;
955
+ getAll: (params?: Record<string, unknown>) => Promise<Result<ListBanksResponse>>;
956
+ };
957
+
958
+ declare function MomoAPI(config: ClientConfig): {
959
+ get: (providerId: string) => Promise<Result<GetMomoResponse>>;
960
+ getAll: (params?: Record<string, unknown>) => Promise<Result<ListMomosResponse>>;
961
+ };
914
962
 
915
963
  declare function FinancialTransactionAPI(config: ClientConfig): {
916
- get: (transactionId: string) => Promise<{
917
- success: boolean;
918
- error?: Error;
919
- data?: GetTransaction;
920
- }>;
921
- getAll: () => Promise<{
922
- success: boolean;
923
- error?: Error;
924
- data?: AllTransaction;
925
- }>;
964
+ get: (transactionId: string) => Promise<Result<GetTransaction>>;
965
+ getAll: () => Promise<Result<AllTransaction>>;
926
966
  };
927
967
 
928
968
  declare function InternalTransferAPI(config: ClientConfig): {
929
- create: (sourceAccount: string, destinationAccount: string, amount: number) => Promise<{
930
- success: boolean;
931
- data?: CreateInternalTransfer;
932
- error?: Error;
933
- }>;
934
- get: (internalTransferId: string) => Promise<{
935
- success: boolean;
936
- data?: InternalTransfer;
937
- error?: Error;
938
- }>;
939
- getAll: () => Promise<{
940
- success: boolean;
941
- error?: Error;
942
- data?: AllInternalTransfers;
943
- }>;
944
- delete: (internalTransferId: string) => Promise<{
945
- success: boolean;
946
- error?: Error;
947
- }>;
969
+ create: (sourceAccount: string, destinationAccount: string, amount: number) => Promise<Result<CreateInternalTransfer>>;
970
+ get: (internalTransferId: string) => Promise<Result<InternalTransfer>>;
971
+ getAll: () => Promise<Result<AllInternalTransfers>>;
972
+ delete: (internalTransferId: string) => Promise<Result<void>>;
948
973
  };
949
974
 
950
975
  declare function PaymentAPI(config: ClientConfig): {
951
- get: (paymentId: string) => Promise<{
952
- success: boolean;
953
- data?: GetPayment;
954
- error?: Error;
955
- }>;
956
- getAll: (params?: Record<string, unknown>) => Promise<{
957
- success: boolean;
958
- data?: ListPayments;
959
- error?: Error;
960
- }>;
961
- patch: (paymentId: string, body: Record<string, unknown>) => Promise<{
962
- success: boolean;
963
- data?: PatchPayment;
964
- error?: Error;
965
- }>;
976
+ get: (paymentId: string) => Promise<Result<GetPayment>>;
977
+ getAll: (params?: Record<string, unknown>) => Promise<Result<ListPayments>>;
978
+ patch: (paymentId: string, body: Record<string, unknown>) => Promise<Result<PatchPayment>>;
966
979
  };
967
980
 
968
981
  declare function PaymentCodeAPI(config: ClientConfig): {
969
- create: (paymentName: string, amount: number, financialAccount: string, username: string, phoneNumber: string) => Promise<{
970
- success: boolean;
971
- data?: CreatePaymentCode;
972
- error?: Error;
973
- }>;
974
- delete: (paymentCodeId: string) => Promise<{
975
- success: boolean;
976
- error?: Error;
977
- }>;
978
- getAll: () => Promise<{
979
- success: boolean;
980
- data?: GetAllPaymentCode;
981
- error?: Error;
982
- }>;
983
- get: (paymentCodeId: string) => Promise<{
984
- success: boolean;
985
- data?: GetOne;
986
- error?: Error;
987
- }>;
982
+ create: (paymentName: string, amount: number, financialAccount: string, username: string, phoneNumber: string) => Promise<Result<CreatePaymentCode>>;
983
+ delete: (paymentCodeId: string) => Promise<Result<void>>;
984
+ getAll: () => Promise<Result<GetAllPaymentCode>>;
985
+ get: (paymentCodeId: string) => Promise<Result<GetOne>>;
988
986
  };
989
987
 
990
988
  declare function PayoutAPI(config: ClientConfig): {
991
- create: (amount: number, destination: DestinationOption, sourceAccount: string) => Promise<{
992
- success: boolean;
993
- data?: CreatePayout;
994
- error?: Error;
995
- }>;
996
- get: () => Promise<{
997
- success: boolean;
998
- data?: GetAll;
999
- error?: Error;
1000
- }>;
1001
- getOne: (payoutId: string) => Promise<{
1002
- success: boolean;
1003
- data?: GetOnePayout;
1004
- error?: Error;
1005
- }>;
1006
- delete: (payoutId: string) => Promise<{
1007
- success: boolean;
1008
- error?: Error;
1009
- }>;
989
+ create: (amount: number, destination: DestinationOption, sourceAccount: string) => Promise<Result<CreatePayout>>;
990
+ get: () => Promise<Result<GetAll>>;
991
+ getOne: (payoutId: string) => Promise<Result<GetOnePayout>>;
992
+ delete: (payoutId: string) => Promise<Result<void>>;
1010
993
  };
1011
994
 
1012
995
  declare function ProviderKycAPI(config: ClientConfig): {
1013
- get: (providerId: string) => Promise<{
1014
- success: boolean;
1015
- data?: GetProviderKycResponse;
1016
- error?: Error;
1017
- }>;
996
+ get: (providerId: string) => Promise<Result<GetProviderKycResponse>>;
1018
997
  };
1019
998
 
1020
999
  declare function ReceiptAPI(config: ClientConfig): {
1021
- get: (orderNumber: string) => Promise<{
1022
- success: boolean;
1023
- data?: GetReceiptResponse;
1024
- error?: Error;
1025
- }>;
1026
- redeem: (orderNumber: string, body?: Record<string, unknown>) => Promise<{
1027
- success: boolean;
1028
- data?: RedeemReceiptResponse;
1029
- error?: Error;
1030
- }>;
1000
+ get: (orderNumber: string) => Promise<Result<GetReceiptResponse>>;
1001
+ redeem: (orderNumber: string, body?: Record<string, unknown>) => Promise<Result<RedeemReceiptResponse>>;
1031
1002
  };
1032
1003
 
1033
1004
  declare function UssdOtpAPI(config: ClientConfig): {
1034
- create: (body: CreateUssdOtpRequest) => Promise<{
1035
- success: boolean;
1036
- data?: CreateUssdOtpResponse;
1037
- error?: Error;
1038
- }>;
1005
+ create: (body: CreateUssdOtpRequest) => Promise<Result<CreateUssdOtpResponse>>;
1039
1006
  };
1040
1007
 
1041
1008
  declare function WebhookAPI(config: ClientConfig): {
1042
- create: (body: CreateWebhookRequest) => Promise<{
1043
- success: boolean;
1044
- data?: CreateWebhookResponse;
1045
- error?: Error;
1046
- }>;
1047
- get: (webhookId: string) => Promise<{
1048
- success: boolean;
1049
- data?: GetWebhookResponse;
1050
- error?: Error;
1051
- }>;
1052
- getAll: () => Promise<{
1053
- success: boolean;
1054
- data?: ListWebhooksResponse;
1055
- error?: Error;
1056
- }>;
1057
- update: (webhookId: string, body: UpdateWebhookRequest) => Promise<{
1058
- success: boolean;
1059
- data?: UpdateWebhookResponse;
1060
- error?: Error;
1061
- }>;
1062
- delete: (webhookId: string) => Promise<{
1063
- success: boolean;
1064
- error?: Error;
1065
- }>;
1009
+ create: (body: CreateWebhookRequest) => Promise<Result<CreateWebhookResponse>>;
1010
+ get: (webhookId: string) => Promise<Result<GetWebhookResponse>>;
1011
+ getAll: () => Promise<Result<ListWebhooksResponse>>;
1012
+ update: (webhookId: string, body: UpdateWebhookRequest) => Promise<Result<UpdateWebhookResponse>>;
1013
+ delete: (webhookId: string) => Promise<Result<void>>;
1066
1014
  };
1067
1015
 
1068
1016
  interface ClientOptions {
@@ -1085,9 +1033,13 @@ declare class MonimeClient {
1085
1033
  webhook: ReturnType<typeof WebhookAPI>;
1086
1034
  financialTransaction: ReturnType<typeof FinancialTransactionAPI>;
1087
1035
  checkoutSession: ReturnType<typeof CheckoutSessionAPI>;
1036
+ financialProvider: {
1037
+ bank: ReturnType<typeof BankAPI>;
1038
+ momo: ReturnType<typeof MomoAPI>;
1039
+ };
1088
1040
  constructor(options: ClientOptions);
1089
1041
  }
1090
1042
 
1091
1043
  declare function createClient(options: ClientOptions): MonimeClient;
1092
1044
 
1093
- export { type AllFinancialAccount, type AllInternalTransfers, type ClientOptions, type CreateFinancialAccount, type CreateInternalTransfer, type CreatePaymentCode, type CreatePayout, type CreateUssdOtpRequest, type CreateUssdOtpResponse, type CreateWebhookRequest, type CreateWebhookResponse, type DestinationOption, type GetAll, type GetAllPaymentCode, type GetFinancialAccount, type GetOne, type GetOnePayout, type GetPayment, type GetProviderKycResponse, type GetReceiptResponse, type GetWebhookResponse, type InternalTransfer, type ListPayments, type ListWebhooksResponse, MonimeClient, type PatchPayment, type Payment, type ProviderKyc, type Receipt, type RedeemReceiptResponse, type UpdateWebhookRequest, type UpdateWebhookResponse, type UssdOtp, type Webhook, type WebhookVerificationMethod, createClient };
1045
+ export { type AllCheckout, type AllFinancialAccount, type AllInternalTransfers, type AllTransaction, type Bank, type BankFeature, type BankFeatureSet, type ClientOptions, type CreateCheckout, type CreateFinancialAccount, type CreateInternalTransfer, type CreatePaymentCode, type CreatePayout, type CreateUssdOtpRequest, type CreateUssdOtpResponse, type CreateWebhookRequest, type CreateWebhookResponse, type DestinationOption, type GetAll, type GetAllPaymentCode, type GetBankResponse, type GetFinancialAccount, type GetMomoResponse, type GetOne, type GetOnePayout, type GetPayment, type GetProviderKycResponse, type GetReceiptResponse, type GetTransaction, type GetWebhookResponse, type InternalTransfer, type ListBanksResponse, type ListMomosResponse, type ListPayments, type ListWebhooksResponse, type Momo, type MomoFeature, type MomoFeatureSet, MonimeClient, type OneCheckout, type PatchPayment, type Payment, type ProviderKyc, type Receipt, type RedeemReceiptResponse, type UpdateWebhookRequest, type UpdateWebhookResponse, type UssdOtp, type Webhook, type WebhookVerificationMethod, createClient };