@rift-finance/wallet 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/Readme.md +1345 -0
  2. package/dist/base-service.d.ts +28 -0
  3. package/dist/base-service.d.ts.map +1 -0
  4. package/dist/base-service.js +49 -0
  5. package/dist/base-service.js.map +1 -0
  6. package/dist/http-client.d.ts +15 -0
  7. package/dist/http-client.d.ts.map +1 -0
  8. package/dist/http-client.js +166 -0
  9. package/dist/http-client.js.map +1 -0
  10. package/dist/index.d.ts +61 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +130 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/mpesa-http-client.d.ts +14 -0
  15. package/dist/mpesa-http-client.d.ts.map +1 -0
  16. package/dist/mpesa-http-client.js +156 -0
  17. package/dist/mpesa-http-client.js.map +1 -0
  18. package/dist/services/assets.d.ts +31 -0
  19. package/dist/services/assets.d.ts.map +1 -0
  20. package/dist/services/assets.js +75 -0
  21. package/dist/services/assets.js.map +1 -0
  22. package/dist/services/auth.d.ts +23 -0
  23. package/dist/services/auth.d.ts.map +1 -0
  24. package/dist/services/auth.js +131 -0
  25. package/dist/services/auth.js.map +1 -0
  26. package/dist/services/defi.d.ts +6 -0
  27. package/dist/services/defi.d.ts.map +1 -0
  28. package/dist/services/defi.js +15 -0
  29. package/dist/services/defi.js.map +1 -0
  30. package/dist/services/notifications.d.ts +39 -0
  31. package/dist/services/notifications.d.ts.map +1 -0
  32. package/dist/services/notifications.js +79 -0
  33. package/dist/services/notifications.js.map +1 -0
  34. package/dist/services/onramp.d.ts +43 -0
  35. package/dist/services/onramp.d.ts.map +1 -0
  36. package/dist/services/onramp.js +109 -0
  37. package/dist/services/onramp.js.map +1 -0
  38. package/dist/services/payment-links.d.ts +24 -0
  39. package/dist/services/payment-links.d.ts.map +1 -0
  40. package/dist/services/payment-links.js +121 -0
  41. package/dist/services/payment-links.js.map +1 -0
  42. package/dist/services/signer.d.ts +25 -0
  43. package/dist/services/signer.d.ts.map +1 -0
  44. package/dist/services/signer.js +52 -0
  45. package/dist/services/signer.js.map +1 -0
  46. package/dist/services/transactions.d.ts +8 -0
  47. package/dist/services/transactions.d.ts.map +1 -0
  48. package/dist/services/transactions.js +29 -0
  49. package/dist/services/transactions.js.map +1 -0
  50. package/dist/services/wallet.d.ts +7 -0
  51. package/dist/services/wallet.d.ts.map +1 -0
  52. package/dist/services/wallet.js +28 -0
  53. package/dist/services/wallet.js.map +1 -0
  54. package/dist/types.d.ts +1069 -0
  55. package/dist/types.d.ts.map +1 -0
  56. package/dist/types.js +17 -0
  57. package/dist/types.js.map +1 -0
  58. package/package.json +41 -0
@@ -0,0 +1,1069 @@
1
+ export interface RecoveryData {
2
+ id: string;
3
+ email?: string;
4
+ phoneNumber?: string;
5
+ createdAt: string;
6
+ updatedAt?: string;
7
+ }
8
+ export interface CreateRecoveryRequest {
9
+ externalId: string;
10
+ password: string;
11
+ emailRecovery?: string;
12
+ phoneRecovery?: string;
13
+ }
14
+ export interface CreateRecoveryResponse {
15
+ message: string;
16
+ recovery: RecoveryData;
17
+ }
18
+ export interface RecoveryOptionsResponse {
19
+ recoveryOptions: {
20
+ email?: string;
21
+ phone?: string;
22
+ };
23
+ }
24
+ export interface RequestPasswordResetRequest {
25
+ externalId: string;
26
+ method: "emailRecovery" | "phoneRecovery";
27
+ }
28
+ export interface RequestPasswordResetResponse {
29
+ message: string;
30
+ target: string;
31
+ }
32
+ export type ResetPasswordRequest = {
33
+ username: string;
34
+ newPassword: string;
35
+ email: string;
36
+ otpCode: string;
37
+ phoneNumber?: never;
38
+ } | {
39
+ username: string;
40
+ newPassword: string;
41
+ phoneNumber: string;
42
+ otpCode: string;
43
+ email?: never;
44
+ };
45
+ export interface ResetPasswordResponse {
46
+ message: string;
47
+ }
48
+ export interface UpdateRecoveryRequest {
49
+ externalId: string;
50
+ password: string;
51
+ emailRecovery?: string;
52
+ phoneRecovery?: string;
53
+ }
54
+ export interface UpdateRecoveryResponse {
55
+ message: string;
56
+ recovery: RecoveryData;
57
+ }
58
+ export interface AddRecoveryMethodRequest {
59
+ externalId: string;
60
+ password: string;
61
+ method: "emailRecovery" | "phoneRecovery";
62
+ value: string;
63
+ }
64
+ export interface AddRecoveryMethodResponse {
65
+ message: string;
66
+ recovery: RecoveryData;
67
+ }
68
+ export interface RemoveRecoveryMethodRequest {
69
+ externalId: string;
70
+ password: string;
71
+ method: "emailRecovery" | "phoneRecovery";
72
+ }
73
+ export interface RemoveRecoveryMethodResponse {
74
+ message: string;
75
+ recovery: RecoveryData;
76
+ }
77
+ export interface UpdateRecoveryMethodRequest {
78
+ externalId: string;
79
+ password: string;
80
+ method: "emailRecovery" | "phoneRecovery";
81
+ value: string;
82
+ }
83
+ export interface UpdateRecoveryMethodResponse {
84
+ message: string;
85
+ recovery: RecoveryData;
86
+ }
87
+ export interface GetMyRecoveryMethodsRequest {
88
+ externalId: string;
89
+ password: string;
90
+ }
91
+ export interface GetMyRecoveryMethodsResponse {
92
+ recovery: RecoveryData;
93
+ }
94
+ export interface DeleteAllRecoveryMethodsRequest {
95
+ externalId: string;
96
+ password: string;
97
+ }
98
+ export interface DeleteAllRecoveryMethodsResponse {
99
+ message: string;
100
+ }
101
+ export declare enum Environment {
102
+ DEVELOPMENT = "development",
103
+ PRODUCTION = "production"
104
+ }
105
+ export interface RiftConfig {
106
+ apiKey?: string;
107
+ environment: Environment;
108
+ baseUrl?: string;
109
+ timeout?: number;
110
+ retries?: number;
111
+ }
112
+ export interface ApiResponse<T = any> {
113
+ success?: boolean;
114
+ message?: string;
115
+ data?: T;
116
+ error?: string;
117
+ }
118
+ export interface LoginResponse {
119
+ user: string;
120
+ address: string;
121
+ btcAddress: string;
122
+ accessToken: string;
123
+ }
124
+ export type LoginRequest = {
125
+ phoneNumber: string;
126
+ otpCode: string;
127
+ externalId?: never;
128
+ email?: never;
129
+ } | {
130
+ externalId: string;
131
+ password: string;
132
+ phoneNumber?: never;
133
+ otpCode?: never;
134
+ email?: never;
135
+ } | {
136
+ email: string;
137
+ otpCode: string;
138
+ phoneNumber?: never;
139
+ externalId?: never;
140
+ password?: never;
141
+ };
142
+ export type SignupRequest = {
143
+ externalId: string;
144
+ password: string;
145
+ phoneNumber?: string;
146
+ email?: string;
147
+ } | {
148
+ externalId?: never;
149
+ password?: never;
150
+ phoneNumber?: string;
151
+ email?: string;
152
+ };
153
+ export interface SignupResponse {
154
+ message: string;
155
+ userId: string;
156
+ }
157
+ export interface AuthResponse {
158
+ message: string;
159
+ token: string;
160
+ }
161
+ export type OtpRequest = {
162
+ phone: string;
163
+ email?: never;
164
+ } | {
165
+ email: string;
166
+ phone?: never;
167
+ };
168
+ export interface OtpResponse {
169
+ status: string;
170
+ message?: string;
171
+ }
172
+ export type OtpVerifyRequest = {
173
+ phone: string;
174
+ code: string;
175
+ email?: never;
176
+ } | {
177
+ email: string;
178
+ code: string;
179
+ phone?: never;
180
+ };
181
+ export interface OtpResponse {
182
+ status: string;
183
+ message?: string;
184
+ }
185
+ export interface User {
186
+ id: string;
187
+ externalId: string;
188
+ referrer?: string;
189
+ createdAt?: string;
190
+ updatedAt?: string;
191
+ email?: string;
192
+ telegramId?: string;
193
+ phoneNumber?: string;
194
+ address?: string;
195
+ }
196
+ export interface UserResponse {
197
+ user: User;
198
+ }
199
+ export type DeleteUserRequest = {
200
+ externalId: string;
201
+ password: string;
202
+ phoneNumber?: never;
203
+ email?: never;
204
+ otpCode?: never;
205
+ } | {
206
+ phoneNumber: string;
207
+ otpCode: string;
208
+ externalId?: never;
209
+ password?: never;
210
+ email?: never;
211
+ } | {
212
+ email: string;
213
+ otpCode: string;
214
+ externalId?: never;
215
+ password?: never;
216
+ phoneNumber?: never;
217
+ };
218
+ export interface DeleteUserResponse {
219
+ message: string;
220
+ }
221
+ export interface GetAllUsersResponse {
222
+ externalId: string[];
223
+ phoneNumber: string[];
224
+ email: string[];
225
+ }
226
+ export interface Project {
227
+ id: string;
228
+ name: string;
229
+ api_key: string;
230
+ created_at: string;
231
+ }
232
+ export interface CreateProjectRequest {
233
+ name: string;
234
+ }
235
+ export interface ProjectsResponse {
236
+ projects: Project[];
237
+ pagination: {
238
+ page: number;
239
+ limit: number;
240
+ total: number;
241
+ pages: number;
242
+ };
243
+ }
244
+ export type ChainName = "ARBITRUM" | "BASE" | "OPTIMISM" | "ETHEREUM" | "LISK" | "BNB" | "BERACHAIN" | "POLYGON" | "BERACHAIN_TESTNET" | "POLYGON_TESTNET";
245
+ export type TokenSymbol = "USDC" | "USDT" | "DYU" | "ETH" | "BTC" | "WBERA" | "USDC.e" | "LSK" | "BNB" | "MATIC" | "SAIL";
246
+ export interface Balance {
247
+ amount: number;
248
+ chain: string;
249
+ token: string;
250
+ chainName: string;
251
+ }
252
+ export interface TokenBalanceRequest {
253
+ token: TokenSymbol;
254
+ chain?: ChainName;
255
+ }
256
+ export interface ChainBalanceRequest {
257
+ chain?: ChainName;
258
+ }
259
+ export type TransactionType = "gasless" | "normal";
260
+ export type TransactionRequest = {
261
+ to: string;
262
+ value: string;
263
+ token: TokenSymbol;
264
+ chain: ChainName;
265
+ intent?: "unlock";
266
+ type?: TransactionType;
267
+ } & ({
268
+ externalId: string;
269
+ password: string;
270
+ phoneNumber?: never;
271
+ otpCode?: never;
272
+ email?: never;
273
+ } | {
274
+ phoneNumber: string;
275
+ otpCode: string;
276
+ externalId?: never;
277
+ password?: never;
278
+ email?: never;
279
+ } | {
280
+ email: string;
281
+ otpCode: string;
282
+ externalId?: never;
283
+ password?: never;
284
+ phoneNumber?: never;
285
+ });
286
+ export interface TransactionResponse {
287
+ message: string;
288
+ transactionHash: string;
289
+ }
290
+ export interface TransactionHistoryRequest {
291
+ limit?: number;
292
+ page?: number;
293
+ token?: string;
294
+ chain?: string;
295
+ }
296
+ export interface Transaction {
297
+ transaction_hash: string;
298
+ user_email: string;
299
+ amount: string;
300
+ chain: string;
301
+ token: string;
302
+ recipient_address: string;
303
+ created_at: string;
304
+ }
305
+ export interface TransactionHistory {
306
+ id: string;
307
+ userId: string;
308
+ transactionHash: string;
309
+ chain: string;
310
+ token: string;
311
+ currency?: string;
312
+ amount: number;
313
+ recipientAddress: string;
314
+ createdAt: string;
315
+ }
316
+ export interface TransactionHistoryResponse {
317
+ transactions: TransactionHistory[];
318
+ pagination: {
319
+ total: number;
320
+ pages: number;
321
+ currentPage: number;
322
+ perPage: number;
323
+ };
324
+ }
325
+ export interface TransactionFeeRequest {
326
+ recipient: string;
327
+ amount: string;
328
+ chain: string;
329
+ token: string;
330
+ }
331
+ export interface TransactionFeeResponse {
332
+ amount: number;
333
+ token: string;
334
+ }
335
+ export type SwapFlow = "normal" | "gasless";
336
+ export interface SwapRequest {
337
+ chain: ChainName;
338
+ flow: SwapFlow;
339
+ token_to_sell_address?: string;
340
+ token_to_buy_address?: string;
341
+ amountOut?: string;
342
+ token_to_sell: string;
343
+ token_to_buy: string;
344
+ value: string;
345
+ isEth?: boolean;
346
+ isBuyingEth?: boolean;
347
+ }
348
+ export interface SwapResponse {
349
+ "swap successful": string;
350
+ }
351
+ export interface ConversationRequest {
352
+ accessToken: string;
353
+ user_prompt: string;
354
+ conversation_id: string;
355
+ nonce: string;
356
+ }
357
+ export interface ConversationResponse {
358
+ message: string;
359
+ }
360
+ export interface ChatRequest {
361
+ secret: string;
362
+ prompt: string;
363
+ }
364
+ export interface ChatResponse {
365
+ response: string;
366
+ }
367
+ export interface ConversationHistoryRequest {
368
+ conversation_id: string;
369
+ }
370
+ export interface ConversationMessage {
371
+ prompt: string;
372
+ response: string;
373
+ }
374
+ export interface Asset {
375
+ chain: string;
376
+ chainId: number;
377
+ symbol: string;
378
+ address?: string;
379
+ decimals: number;
380
+ type: string;
381
+ category: string;
382
+ isNative: boolean;
383
+ }
384
+ export interface AssetsResponse {
385
+ message: string;
386
+ assets: Asset[];
387
+ }
388
+ export interface Chain {
389
+ id: string;
390
+ name: string;
391
+ enabled: boolean;
392
+ }
393
+ export interface ChainsResponse {
394
+ message: string;
395
+ data: Chain[];
396
+ }
397
+ export interface Token {
398
+ id: string;
399
+ name: string;
400
+ description: string;
401
+ enabled: boolean;
402
+ contract_address?: string;
403
+ chain_id: string;
404
+ }
405
+ export interface TokensResponse {
406
+ message: string;
407
+ data: Token[];
408
+ }
409
+ export interface WalletChain {
410
+ id: string;
411
+ name: string;
412
+ description?: string;
413
+ icon?: string;
414
+ enabled: boolean;
415
+ }
416
+ export interface WalletToken {
417
+ id: string;
418
+ name: string;
419
+ description?: string;
420
+ enabled: boolean;
421
+ contract_address?: string | null;
422
+ chain_id: string;
423
+ icon?: string;
424
+ }
425
+ export interface BurnRequest {
426
+ amountToBurn: string;
427
+ }
428
+ export interface BurnResponse {
429
+ message: string;
430
+ burnTransactionHash: string;
431
+ rewardApiResponse: any;
432
+ }
433
+ export interface BurnStats {
434
+ totalSphereBurnt: number;
435
+ totalUsdcRewarded: number;
436
+ recordCount: number;
437
+ }
438
+ export interface SphereAccount {
439
+ id: string;
440
+ userId: string;
441
+ isDefault: boolean;
442
+ accessToken?: string;
443
+ }
444
+ export interface CreateSphereAccountRequest {
445
+ makeDefault?: boolean;
446
+ }
447
+ export interface SphereAccountResponse {
448
+ message: string;
449
+ sphereAccount: SphereAccount;
450
+ }
451
+ export interface SphereAccountsResponse {
452
+ sphereAccount: SphereAccount[];
453
+ }
454
+ export interface SetDefaultAccountRequest {
455
+ sphereAccountId: string;
456
+ }
457
+ export interface ClaimRewardsRequest {
458
+ campaignId?: string;
459
+ amount?: string;
460
+ }
461
+ export type SecretPurpose = "AIRWALLEX" | "OPENAI";
462
+ export interface ImportSecretRequest {
463
+ key: string;
464
+ purpose: SecretPurpose;
465
+ }
466
+ export interface Secret {
467
+ id: string;
468
+ purpose: string;
469
+ email: string;
470
+ url: string;
471
+ locked: boolean;
472
+ }
473
+ export interface ShareSecretRequest {
474
+ email: string;
475
+ key: string;
476
+ time: string;
477
+ purpose: SecretPurpose;
478
+ charge?: string;
479
+ token?: string;
480
+ chain?: string;
481
+ amountInUSD?: string;
482
+ }
483
+ export interface ShareSecretResponse {
484
+ message: string;
485
+ data: string;
486
+ }
487
+ export declare enum Platform {
488
+ SERVER = "SERVER",
489
+ MOBILE = "MOBILE",
490
+ WEB = "WEB",
491
+ TELEGRAM = "TELEGRAM"
492
+ }
493
+ export interface RegisterRedirectUrlRequest {
494
+ url?: string;
495
+ phoneNumber?: string;
496
+ telegram_url?: string;
497
+ mobile_url?: string;
498
+ email?: string;
499
+ otpCode: string;
500
+ project_api_key: string;
501
+ }
502
+ export interface RegisterRedirectUrlResponse {
503
+ message: string;
504
+ data: {
505
+ url: string;
506
+ telegram_url?: string;
507
+ mobile_url?: string;
508
+ project_api_key: string;
509
+ createdAt: Date;
510
+ updatedAt: Date;
511
+ };
512
+ }
513
+ export interface RequestLinkRedirect {
514
+ url: string;
515
+ telegram_url?: string;
516
+ mobile_url?: string;
517
+ project_api_key: string;
518
+ createdAt: string;
519
+ updatedAt: string;
520
+ }
521
+ export interface SendLinkRedirect {
522
+ url: string;
523
+ telegram_url?: string;
524
+ mobile_url?: string;
525
+ project_api_key: string;
526
+ createdAt: string;
527
+ updatedAt: string;
528
+ }
529
+ export interface GetRedirectLinksResponse {
530
+ sendLinkRedirect: SendLinkRedirect | null;
531
+ requestRedirectLink: RequestLinkRedirect | null;
532
+ }
533
+ export interface GetRedirectLinksRequest {
534
+ project_api_key: string;
535
+ }
536
+ export interface CreatePaymentRequestInput {
537
+ amount: number;
538
+ chain: ChainName;
539
+ token: TokenSymbol;
540
+ }
541
+ export interface PaymentRequestResult {
542
+ data: string;
543
+ message?: string;
544
+ error?: string;
545
+ }
546
+ export interface PayPaymentRequestInput {
547
+ nonce: string;
548
+ }
549
+ export interface PayPaymentRequestResponse {
550
+ message: string;
551
+ data?: any;
552
+ error?: any;
553
+ }
554
+ export type SendSpecificPaymentRequest = {
555
+ time: string;
556
+ value: string;
557
+ token: TokenSymbol;
558
+ chain: ChainName;
559
+ } & ({
560
+ recipientUsername: string;
561
+ recipientPhoneNumber?: never;
562
+ recipientEmail?: never;
563
+ } | {
564
+ recipientPhoneNumber: string;
565
+ recipientUsername?: never;
566
+ recipientEmail?: never;
567
+ } | {
568
+ recipientEmail: string;
569
+ recipientUsername?: never;
570
+ recipientPhoneNumber?: never;
571
+ }) & ({
572
+ externalId: string;
573
+ password: string;
574
+ phoneNumber?: never;
575
+ otpCode?: never;
576
+ email?: never;
577
+ } | {
578
+ phoneNumber: string;
579
+ otpCode: string;
580
+ externalId?: never;
581
+ password?: never;
582
+ email?: never;
583
+ } | {
584
+ email: string;
585
+ otpCode: string;
586
+ externalId?: never;
587
+ password?: never;
588
+ phoneNumber?: never;
589
+ });
590
+ export type SendOpenPaymentRequest = {
591
+ time: string;
592
+ value: string;
593
+ token: TokenSymbol;
594
+ chain: ChainName;
595
+ } & ({
596
+ externalId: string;
597
+ password: string;
598
+ phoneNumber?: never;
599
+ otpCode?: never;
600
+ email?: never;
601
+ } | {
602
+ phoneNumber: string;
603
+ otpCode: string;
604
+ externalId?: never;
605
+ password?: never;
606
+ email?: never;
607
+ } | {
608
+ email: string;
609
+ otpCode: string;
610
+ externalId?: never;
611
+ password?: never;
612
+ phoneNumber?: never;
613
+ });
614
+ export interface SendPaymentResponse {
615
+ data: string;
616
+ error?: string;
617
+ }
618
+ export interface ClaimPaymentRequest {
619
+ id: string;
620
+ }
621
+ export interface ClaimPaymentResponse {
622
+ message: string;
623
+ error?: any;
624
+ }
625
+ export interface PaymentLinkValidationError {
626
+ error?: string;
627
+ message?: string;
628
+ supportedCombinations?: {
629
+ [key in ChainName]?: TokenSymbol[];
630
+ };
631
+ }
632
+ export interface PaymentLinkNotFoundError {
633
+ message: "Payment link not found" | "Token not found or expired";
634
+ }
635
+ export interface PaymentLinkAlreadyPaidError {
636
+ message: "Payment link already paid";
637
+ }
638
+ export interface UnauthorizedPaymentError {
639
+ message: "Unauthorized" | "Unauthorized: You are not authorized to spend this!" | "Forbidden: Invalid spend token.";
640
+ }
641
+ export interface CreateSendLinkInput {
642
+ /**
643
+ * Expiration time for the send link
644
+ * Format: number followed by time unit (s, m, h, d)
645
+ * Examples: "1s", "5m", "2h", "30d"
646
+ * - s: seconds
647
+ * - m: minutes
648
+ * - h: hours
649
+ * - d: days
650
+ */
651
+ time: string;
652
+ receiver?: string;
653
+ value: string;
654
+ token: TokenSymbol;
655
+ chain: ChainName;
656
+ }
657
+ export interface ClaimSendLinkInput {
658
+ id: string;
659
+ }
660
+ export interface ClaimSendLinkResult {
661
+ message: string;
662
+ error?: any;
663
+ }
664
+ export interface GetPaymentRequestsInput {
665
+ expired?: "true" | "false";
666
+ limit?: string;
667
+ page?: string;
668
+ }
669
+ export interface PaymentRequestItem {
670
+ id: string;
671
+ nonce: string;
672
+ amount: number;
673
+ token: string;
674
+ chain: string;
675
+ creatorAddress: string;
676
+ status: string;
677
+ createdAt: string;
678
+ updatedAt: string;
679
+ paidByAddress?: string | null;
680
+ paidByUserId?: string | null;
681
+ paidAt?: string | null;
682
+ }
683
+ export interface GetPaymentRequestsResult {
684
+ data: PaymentRequestItem[];
685
+ pagination: {
686
+ currentPage: number;
687
+ totalPages: number;
688
+ totalCount: number;
689
+ limit: number;
690
+ hasNextPage: boolean;
691
+ hasPreviousPage: boolean;
692
+ };
693
+ }
694
+ export interface GetSendLinksInput {
695
+ fulfilled?: "true" | "false";
696
+ limit?: string;
697
+ page?: string;
698
+ }
699
+ export interface SendLinkItem {
700
+ id: string;
701
+ urlId: string;
702
+ value: string;
703
+ receiver?: string | null;
704
+ expiresAt: string;
705
+ createdAt: string;
706
+ updatedAt: string;
707
+ }
708
+ export interface GetSendLinksResult {
709
+ data: SendLinkItem[];
710
+ fulfilled: boolean;
711
+ pagination: {
712
+ currentPage: number;
713
+ totalPages: number;
714
+ totalCount: number;
715
+ limit: number;
716
+ hasNextPage: boolean;
717
+ hasPreviousPage: boolean;
718
+ };
719
+ }
720
+ export interface CancelPaymentRequestInput {
721
+ nonce: string;
722
+ }
723
+ export interface CancelPaymentRequestResult {
724
+ message: string;
725
+ data: {
726
+ nonce: string;
727
+ amount: string;
728
+ token: string;
729
+ chain: string;
730
+ };
731
+ }
732
+ export interface CancelSendLinkInput {
733
+ urlId: string;
734
+ }
735
+ export interface CancelSendLinkResult {
736
+ message: string;
737
+ data: {
738
+ urlId: string;
739
+ value: string;
740
+ receiver?: string;
741
+ expiresAt: string;
742
+ };
743
+ }
744
+ export interface ApiError {
745
+ message: string;
746
+ error?: string;
747
+ status?: number;
748
+ }
749
+ export interface RequestConfig {
750
+ method: "GET" | "POST" | "PUT" | "DELETE";
751
+ url: string;
752
+ data?: any;
753
+ params?: Record<string, any>;
754
+ headers?: Record<string, string>;
755
+ }
756
+ export interface HttpClient {
757
+ request<T>(config: RequestConfig): Promise<T>;
758
+ }
759
+ export interface SocketConfig {
760
+ autoConnect?: boolean;
761
+ reconnection?: boolean;
762
+ reconnectionAttempts?: number;
763
+ reconnectionDelay?: number;
764
+ reconnectionDelayMax?: number;
765
+ timeout?: number;
766
+ transports?: string[];
767
+ }
768
+ export interface EventSubscription {
769
+ eventName: string;
770
+ handler: EventHandler;
771
+ id: string;
772
+ }
773
+ export type EventHandler<T = any> = (data: T) => void | Promise<void>;
774
+ export interface ConnectionStatus {
775
+ connected: boolean;
776
+ connecting: boolean;
777
+ disconnected: boolean;
778
+ error?: string;
779
+ }
780
+ export interface TXFailedEvent {
781
+ email: string;
782
+ message: string;
783
+ error: string;
784
+ }
785
+ export interface TXConfirmedEvent {
786
+ email: string;
787
+ message: string;
788
+ transactionHash: string;
789
+ }
790
+ export interface AccountCreationSuccessEvent {
791
+ user: string;
792
+ address: string;
793
+ btcAdress: string;
794
+ accessToken: string;
795
+ }
796
+ export interface AccountCreationFailedEvent {
797
+ email: string;
798
+ message: string;
799
+ error: string;
800
+ }
801
+ export interface MpesaSTKInitiateRequest {
802
+ email?: string;
803
+ amount: number;
804
+ phone: string;
805
+ cryptoAsset: "POL-USDC" | "BERA-USDC" | "ETH" | "WBERA";
806
+ cryptoWalletAddress: string;
807
+ externalReference: string;
808
+ }
809
+ export interface MpesaSafaricomResponse {
810
+ MerchantRequestID: string;
811
+ CheckoutRequestID: string;
812
+ ResponseCode: string;
813
+ ResponseDescription: string;
814
+ CustomerMessage: string;
815
+ }
816
+ export interface MpesaCryptoIntent {
817
+ asset: string;
818
+ walletAddress: string;
819
+ }
820
+ export interface MpesaSTKInitiateResponse {
821
+ success: boolean;
822
+ message: string;
823
+ data: {
824
+ message: string;
825
+ merchantRequestID: string;
826
+ checkoutRequestID: string;
827
+ safaricomResponse: MpesaSafaricomResponse;
828
+ cryptoIntent: MpesaCryptoIntent;
829
+ note: string;
830
+ };
831
+ }
832
+ export interface MpesaTransactionStatusRequest {
833
+ checkoutRequestId?: string;
834
+ merchantRequestId?: string;
835
+ }
836
+ export interface MpesaTransactionData {
837
+ id: string;
838
+ checkoutRequestId: string;
839
+ merchantRequestId: string;
840
+ status: "pending" | "success" | "failed";
841
+ failureReason: string | null;
842
+ amount: number;
843
+ currency: string;
844
+ phoneNumber: string;
845
+ userEmail: string;
846
+ mpesaReceiptNumber: string | null;
847
+ transactionDate: string | null;
848
+ cryptoIntent: MpesaCryptoIntent;
849
+ cryptoStatus: "pending" | "success" | "failed" | null;
850
+ cryptoTxHash: string | null;
851
+ cryptoFailureReason: string | null;
852
+ cryptoAmount: number | null;
853
+ amountInUSD: number | null;
854
+ cryptoProcessedAt: string | null;
855
+ createdAt: string;
856
+ updatedAt: string;
857
+ }
858
+ export interface MpesaTransactionStatusResponse {
859
+ success: boolean;
860
+ status: "pending" | "success" | "failed";
861
+ data: MpesaTransactionData;
862
+ }
863
+ export interface MpesaTransactionHistoryRequest {
864
+ email?: string;
865
+ externalReference?: string;
866
+ status?: "pending" | "success" | "failed";
867
+ cryptoStatus?: "pending" | "success" | "failed";
868
+ cryptoTxHash?: string;
869
+ mpesaReceiptNumber?: string;
870
+ minAmount?: number;
871
+ maxAmount?: number;
872
+ startDate?: string;
873
+ endDate?: string;
874
+ page?: number;
875
+ limit?: number;
876
+ sortBy?: string;
877
+ sortOrder?: "asc" | "desc";
878
+ }
879
+ export interface MpesaTransactionHistoryItem {
880
+ id: string;
881
+ checkoutRequestId: string;
882
+ merchantRequestId: string;
883
+ phoneNumber: string;
884
+ amount: number;
885
+ currency: string;
886
+ status: "pending" | "success" | "failed";
887
+ failureReason: string | null;
888
+ mpesaReceiptNumber: string | null;
889
+ accountReference: string;
890
+ transactionDate: string | null;
891
+ cryptoIntent: MpesaCryptoIntent;
892
+ cryptoStatus: "pending" | "success" | "failed" | null;
893
+ cryptoTxHash: string | null;
894
+ cryptoFailureReason: string | null;
895
+ cryptoAmount: number | null;
896
+ amountInUSD: number | null;
897
+ cryptoProcessedAt: string | null;
898
+ createdAt: string;
899
+ updatedAt: string;
900
+ }
901
+ export interface MpesaTransactionHistoryPagination {
902
+ currentPage: number;
903
+ totalPages: number;
904
+ totalCount: number;
905
+ limit: number;
906
+ hasNextPage: boolean;
907
+ hasPrevPage: boolean;
908
+ }
909
+ export interface MpesaTransactionHistoryResponse {
910
+ success: boolean;
911
+ data: MpesaTransactionHistoryItem[];
912
+ pagination: MpesaTransactionHistoryPagination;
913
+ }
914
+ export interface GetWalletInstanceRequest {
915
+ chain: ChainName;
916
+ [key: string]: any;
917
+ }
918
+ export interface ChainInfo {
919
+ id: number;
920
+ name: string;
921
+ nativeToken: string;
922
+ tokens: string[];
923
+ }
924
+ export interface ProviderInfo {
925
+ url: string;
926
+ chainId: number;
927
+ name: string;
928
+ }
929
+ export interface WalletInstanceResponse {
930
+ address: string;
931
+ publicKey: string;
932
+ provider: ProviderInfo;
933
+ chain: ChainInfo;
934
+ _isWallet: boolean;
935
+ _isSigner: boolean;
936
+ availableMethods: {
937
+ getAddress: string;
938
+ getBalance: string;
939
+ sendTransaction: string;
940
+ signTransaction: string;
941
+ signMessage: string;
942
+ };
943
+ }
944
+ export interface SignTransactionRequest {
945
+ chain: ChainName;
946
+ transactionData: {
947
+ to?: string;
948
+ value?: string;
949
+ data?: string;
950
+ gasLimit?: string;
951
+ gasPrice?: string;
952
+ maxFeePerGas?: string;
953
+ maxPriorityFeePerGas?: string;
954
+ nonce?: number;
955
+ type?: number;
956
+ chainId?: number;
957
+ [key: string]: any;
958
+ };
959
+ [key: string]: any;
960
+ }
961
+ export interface SignTransactionResponse {
962
+ signedTransaction: string;
963
+ txHash: string;
964
+ from: string;
965
+ originalTx: SignTransactionRequest["transactionData"];
966
+ }
967
+ export interface SendTransactionRequest {
968
+ chain: ChainName;
969
+ transactionData: {
970
+ to?: string;
971
+ value?: string;
972
+ data?: string;
973
+ gasLimit?: string;
974
+ gasPrice?: string;
975
+ maxFeePerGas?: string;
976
+ maxPriorityFeePerGas?: string;
977
+ nonce?: number;
978
+ type?: number;
979
+ chainId?: number;
980
+ [key: string]: any;
981
+ };
982
+ [key: string]: any;
983
+ }
984
+ export interface SendTransactionResponse {
985
+ hash: string;
986
+ to?: string;
987
+ from: string;
988
+ value?: string;
989
+ gasLimit?: string;
990
+ gasPrice?: string;
991
+ nonce: number;
992
+ chainId?: number;
993
+ blockNumber?: number;
994
+ blockHash?: string;
995
+ timestamp?: number;
996
+ confirmations: number;
997
+ raw: any;
998
+ }
999
+ export interface SignMessageRequest {
1000
+ chain: ChainName;
1001
+ message: string;
1002
+ [key: string]: any;
1003
+ }
1004
+ export interface SignMessageResponse {
1005
+ signature: string;
1006
+ message: string;
1007
+ signer: string;
1008
+ messageHash: string;
1009
+ recoveredAddress: string;
1010
+ }
1011
+ export interface GenerateSignatureResponse {
1012
+ address: string;
1013
+ publicKey: string;
1014
+ signature: string;
1015
+ availableEndpoints: {
1016
+ signMessage: string;
1017
+ signTransaction: string;
1018
+ sendTransaction: string;
1019
+ getWallet: string;
1020
+ };
1021
+ }
1022
+ export interface ProxyWalletError {
1023
+ error: string;
1024
+ supportedChains?: string[];
1025
+ }
1026
+ export interface NotificationSubscriptionRequest {
1027
+ subscriberId: string;
1028
+ deviceInfo?: string;
1029
+ platform?: string;
1030
+ }
1031
+ export interface NotificationSubscription {
1032
+ id: string;
1033
+ subscriberId: string;
1034
+ isActive: boolean;
1035
+ }
1036
+ export interface UserNotificationSubscription {
1037
+ id: string;
1038
+ subscriberId: string;
1039
+ deviceInfo?: string;
1040
+ platform?: string;
1041
+ isActive: boolean;
1042
+ createdAt: string;
1043
+ updatedAt: string;
1044
+ }
1045
+ export interface NotificationTestRequest {
1046
+ subscriberId: string;
1047
+ message: string;
1048
+ targetUrl?: string;
1049
+ title?: string;
1050
+ }
1051
+ export interface NotificationSendRequest {
1052
+ message: string;
1053
+ targetUrl?: string;
1054
+ title?: string;
1055
+ }
1056
+ export interface NotificationSendResponse {
1057
+ summary: {
1058
+ sent: number;
1059
+ failed: number;
1060
+ total: number;
1061
+ };
1062
+ details: Array<{
1063
+ subscriberId: string;
1064
+ success: boolean;
1065
+ error?: string;
1066
+ requestId?: string;
1067
+ }>;
1068
+ }
1069
+ //# sourceMappingURL=types.d.ts.map