@umituz/react-native-subscription 2.14.9 → 2.14.11
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/package.json +1 -1
- package/src/domains/paywall/components/PaywallTabBar.tsx +1 -1
- package/src/domains/wallet/domain/entities/CreditCost.ts +45 -0
- package/src/domains/wallet/domain/errors/WalletError.ts +169 -0
- package/src/domains/wallet/domain/types/credit-cost.types.ts +86 -0
- package/src/domains/wallet/domain/types/index.ts +33 -0
- package/src/domains/wallet/domain/types/transaction.types.ts +49 -0
- package/src/domains/wallet/domain/types/wallet.types.ts +50 -0
- package/src/domains/wallet/index.ts +116 -0
- package/src/domains/wallet/infrastructure/repositories/TransactionRepository.ts +166 -0
- package/src/domains/wallet/infrastructure/services/ProductMetadataService.ts +131 -0
- package/src/domains/wallet/presentation/components/BalanceCard.tsx +119 -0
- package/src/domains/wallet/presentation/components/TransactionItem.tsx +150 -0
- package/src/domains/wallet/presentation/components/TransactionList.tsx +127 -0
- package/src/domains/wallet/presentation/components/index.ts +23 -0
- package/src/domains/wallet/presentation/hooks/useProductMetadata.ts +88 -0
- package/src/domains/wallet/presentation/hooks/useTransactionHistory.ts +87 -0
- package/src/domains/wallet/presentation/hooks/useWallet.ts +93 -0
- package/src/domains/wallet/presentation/screens/WalletScreen.tsx +147 -0
- package/src/index.ts +12 -1
- package/src/presentation/components/feedback/PaywallFeedbackModal.tsx +12 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.11",
|
|
4
4
|
"description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -62,7 +62,7 @@ export const PaywallTabBar: React.FC<PaywallTabBarProps> = React.memo(
|
|
|
62
62
|
return (
|
|
63
63
|
<View style={[styles.container, { backgroundColor: tokens.colors.surfaceSecondary }]}>
|
|
64
64
|
<Animated.View
|
|
65
|
-
style={[styles.indicator, { backgroundColor: tokens.colors.surface, left: indicatorLeft }]}
|
|
65
|
+
style={[styles.indicator, { backgroundColor: tokens.colors.surface, left: indicatorLeft }] as any}
|
|
66
66
|
/>
|
|
67
67
|
{renderTab("credits", creditsLabel)}
|
|
68
68
|
{renderTab("subscription", subscriptionLabel)}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credit Cost Entity
|
|
3
|
+
*
|
|
4
|
+
* Configurable credit cost configuration for AI operations.
|
|
5
|
+
* Apps can override default costs based on their pricing model.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { AICreditCosts } from "../types/credit-cost.types";
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
DEFAULT_AI_CREDIT_COSTS,
|
|
12
|
+
createCreditCostConfig,
|
|
13
|
+
} from "../types/credit-cost.types";
|
|
14
|
+
|
|
15
|
+
export interface CreditCostEntity {
|
|
16
|
+
costs: AICreditCosts;
|
|
17
|
+
pricePerCredit: number;
|
|
18
|
+
getCost: (operation: keyof AICreditCosts) => number;
|
|
19
|
+
getDollarValue: (operation: keyof AICreditCosts) => number;
|
|
20
|
+
getCustomCost: (operation: string) => number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function createCreditCostEntity(
|
|
24
|
+
overrides?: Partial<AICreditCosts>,
|
|
25
|
+
pricePerCredit: number = 0.1
|
|
26
|
+
): CreditCostEntity {
|
|
27
|
+
const costs = createCreditCostConfig(overrides);
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
costs,
|
|
31
|
+
pricePerCredit,
|
|
32
|
+
getCost: (operation: keyof AICreditCosts): number => {
|
|
33
|
+
return costs[operation];
|
|
34
|
+
},
|
|
35
|
+
getDollarValue: (operation: keyof AICreditCosts): number => {
|
|
36
|
+
return costs[operation] * pricePerCredit;
|
|
37
|
+
},
|
|
38
|
+
getCustomCost: (operation: string): number => {
|
|
39
|
+
return (costs as unknown as Record<string, number>)[operation] ?? 0;
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { DEFAULT_AI_CREDIT_COSTS, createCreditCostConfig };
|
|
45
|
+
export type { AICreditCosts };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet Error
|
|
3
|
+
*
|
|
4
|
+
* Custom error classes for wallet and payment operations.
|
|
5
|
+
* Follows the same pattern as SubscriptionError.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type WalletErrorCategory =
|
|
9
|
+
| "PAYMENT"
|
|
10
|
+
| "VALIDATION"
|
|
11
|
+
| "INFRASTRUCTURE"
|
|
12
|
+
| "BUSINESS";
|
|
13
|
+
|
|
14
|
+
export abstract class WalletError extends Error {
|
|
15
|
+
abstract readonly code: string;
|
|
16
|
+
abstract readonly userMessage: string;
|
|
17
|
+
abstract readonly category: WalletErrorCategory;
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
message: string,
|
|
21
|
+
public readonly cause?: Error
|
|
22
|
+
) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = this.constructor.name;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
toJSON() {
|
|
28
|
+
return {
|
|
29
|
+
name: this.name,
|
|
30
|
+
code: this.code,
|
|
31
|
+
userMessage: this.userMessage,
|
|
32
|
+
category: this.category,
|
|
33
|
+
message: this.message,
|
|
34
|
+
cause: this.cause?.message,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class PaymentValidationError extends WalletError {
|
|
40
|
+
readonly code = "PAYMENT_VALIDATION_ERROR";
|
|
41
|
+
readonly category = "PAYMENT" as const;
|
|
42
|
+
readonly userMessage: string;
|
|
43
|
+
|
|
44
|
+
constructor(message: string, cause?: Error) {
|
|
45
|
+
super(message, cause);
|
|
46
|
+
this.userMessage = "Payment validation failed. Please try again.";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export class PaymentProviderError extends WalletError {
|
|
51
|
+
readonly code = "PAYMENT_PROVIDER_ERROR";
|
|
52
|
+
readonly category = "PAYMENT" as const;
|
|
53
|
+
readonly userMessage: string;
|
|
54
|
+
|
|
55
|
+
constructor(message: string, cause?: Error) {
|
|
56
|
+
super(message, cause);
|
|
57
|
+
this.userMessage = "Payment provider error. Please try again.";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export class DuplicatePaymentError extends WalletError {
|
|
62
|
+
readonly code = "DUPLICATE_PAYMENT";
|
|
63
|
+
readonly category = "PAYMENT" as const;
|
|
64
|
+
readonly userMessage: string;
|
|
65
|
+
|
|
66
|
+
constructor(message: string) {
|
|
67
|
+
super(message);
|
|
68
|
+
this.userMessage = "This payment has already been processed.";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class UserValidationError extends WalletError {
|
|
73
|
+
readonly code = "USER_VALIDATION_ERROR";
|
|
74
|
+
readonly category = "VALIDATION" as const;
|
|
75
|
+
readonly userMessage: string;
|
|
76
|
+
|
|
77
|
+
constructor(message: string) {
|
|
78
|
+
super(message);
|
|
79
|
+
this.userMessage = "Invalid user information. Please log in again.";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export class PackageValidationError extends WalletError {
|
|
84
|
+
readonly code = "PACKAGE_VALIDATION_ERROR";
|
|
85
|
+
readonly category = "VALIDATION" as const;
|
|
86
|
+
readonly userMessage: string;
|
|
87
|
+
|
|
88
|
+
constructor(message: string) {
|
|
89
|
+
super(message);
|
|
90
|
+
this.userMessage = "Invalid credit package. Please select a valid package.";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export class ReceiptValidationError extends WalletError {
|
|
95
|
+
readonly code = "RECEIPT_VALIDATION_ERROR";
|
|
96
|
+
readonly category = "VALIDATION" as const;
|
|
97
|
+
readonly userMessage: string;
|
|
98
|
+
|
|
99
|
+
constructor(message: string) {
|
|
100
|
+
super(message);
|
|
101
|
+
this.userMessage = "Invalid payment receipt. Please contact support.";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export class TransactionError extends WalletError {
|
|
106
|
+
readonly code = "TRANSACTION_ERROR";
|
|
107
|
+
readonly category = "INFRASTRUCTURE" as const;
|
|
108
|
+
readonly userMessage: string;
|
|
109
|
+
|
|
110
|
+
constructor(message: string, cause?: Error) {
|
|
111
|
+
super(message, cause);
|
|
112
|
+
this.userMessage = "Transaction failed. Please try again.";
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export class NetworkError extends WalletError {
|
|
117
|
+
readonly code = "NETWORK_ERROR";
|
|
118
|
+
readonly category = "INFRASTRUCTURE" as const;
|
|
119
|
+
readonly userMessage: string;
|
|
120
|
+
|
|
121
|
+
constructor(message: string, cause?: Error) {
|
|
122
|
+
super(message, cause);
|
|
123
|
+
this.userMessage = "Network error. Please check your connection.";
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export class CreditLimitError extends WalletError {
|
|
128
|
+
readonly code = "CREDIT_LIMIT_ERROR";
|
|
129
|
+
readonly category = "BUSINESS" as const;
|
|
130
|
+
readonly userMessage: string;
|
|
131
|
+
|
|
132
|
+
constructor(message: string) {
|
|
133
|
+
super(message);
|
|
134
|
+
this.userMessage = "Credit limit exceeded. Please contact support.";
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export class RefundError extends WalletError {
|
|
139
|
+
readonly code = "REFUND_ERROR";
|
|
140
|
+
readonly category = "BUSINESS" as const;
|
|
141
|
+
readonly userMessage: string;
|
|
142
|
+
|
|
143
|
+
constructor(message: string, cause?: Error) {
|
|
144
|
+
super(message, cause);
|
|
145
|
+
this.userMessage = "Refund failed. Please contact support.";
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function handleWalletError(error: unknown): WalletError {
|
|
150
|
+
if (error instanceof WalletError) {
|
|
151
|
+
return error;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (error instanceof Error) {
|
|
155
|
+
const message = error.message.toLowerCase();
|
|
156
|
+
|
|
157
|
+
if (message.includes("network") || message.includes("timeout")) {
|
|
158
|
+
return new NetworkError(error.message, error);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (message.includes("permission") || message.includes("unauthorized")) {
|
|
162
|
+
return new UserValidationError("Authentication failed");
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return new TransactionError(error.message, error);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return new TransactionError("Unexpected error occurred");
|
|
169
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credit Cost Types
|
|
3
|
+
*
|
|
4
|
+
* Types for configurable AI operation credit costs.
|
|
5
|
+
* Apps can override these costs based on their pricing model.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface CreditCostConfig {
|
|
9
|
+
[operationKey: string]: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AICreditCosts {
|
|
13
|
+
IMAGE: number;
|
|
14
|
+
VIDEO_5S: number;
|
|
15
|
+
VIDEO_10S: number;
|
|
16
|
+
VOICE: number;
|
|
17
|
+
UPSCALE: number;
|
|
18
|
+
PHOTO_RESTORE: number;
|
|
19
|
+
REMOVE_BACKGROUND: number;
|
|
20
|
+
ANIME_SELFIE: number;
|
|
21
|
+
FACE_SWAP: number;
|
|
22
|
+
REMOVE_OBJECT: number;
|
|
23
|
+
REPLACE_BACKGROUND: number;
|
|
24
|
+
INPAINTING: number;
|
|
25
|
+
IMAGE_TO_IMAGE: number;
|
|
26
|
+
AI_HUG: number;
|
|
27
|
+
AI_KISS: number;
|
|
28
|
+
IMAGE_TO_VIDEO_5S: number;
|
|
29
|
+
IMAGE_TO_VIDEO_10S: number;
|
|
30
|
+
TEXT_TO_VIDEO_5S: number;
|
|
31
|
+
TEXT_TO_VIDEO_10S: number;
|
|
32
|
+
TREND_VIDEO: number;
|
|
33
|
+
EFFECT_VIDEO: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const DEFAULT_AI_CREDIT_COSTS: AICreditCosts = {
|
|
37
|
+
IMAGE: 2,
|
|
38
|
+
VIDEO_5S: 20,
|
|
39
|
+
VIDEO_10S: 35,
|
|
40
|
+
VOICE: 3,
|
|
41
|
+
UPSCALE: 2,
|
|
42
|
+
PHOTO_RESTORE: 2,
|
|
43
|
+
REMOVE_BACKGROUND: 2,
|
|
44
|
+
ANIME_SELFIE: 3,
|
|
45
|
+
FACE_SWAP: 4,
|
|
46
|
+
REMOVE_OBJECT: 5,
|
|
47
|
+
REPLACE_BACKGROUND: 5,
|
|
48
|
+
INPAINTING: 5,
|
|
49
|
+
IMAGE_TO_IMAGE: 3,
|
|
50
|
+
AI_HUG: 15,
|
|
51
|
+
AI_KISS: 15,
|
|
52
|
+
IMAGE_TO_VIDEO_5S: 20,
|
|
53
|
+
IMAGE_TO_VIDEO_10S: 35,
|
|
54
|
+
TEXT_TO_VIDEO_5S: 25,
|
|
55
|
+
TEXT_TO_VIDEO_10S: 45,
|
|
56
|
+
TREND_VIDEO: 20,
|
|
57
|
+
EFFECT_VIDEO: 15,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export interface CreditCostResult {
|
|
61
|
+
cost: number;
|
|
62
|
+
dollarValue: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function getCreditCost(
|
|
66
|
+
config: CreditCostConfig,
|
|
67
|
+
operation: string
|
|
68
|
+
): number {
|
|
69
|
+
return config[operation] ?? 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function creditsToDollars(
|
|
73
|
+
credits: number,
|
|
74
|
+
pricePerCredit: number = 0.1
|
|
75
|
+
): number {
|
|
76
|
+
return credits * pricePerCredit;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function createCreditCostConfig(
|
|
80
|
+
overrides?: Partial<AICreditCosts>
|
|
81
|
+
): AICreditCosts {
|
|
82
|
+
return {
|
|
83
|
+
...DEFAULT_AI_CREDIT_COSTS,
|
|
84
|
+
...overrides,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet Domain Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type {
|
|
6
|
+
TransactionReason,
|
|
7
|
+
CreditLog,
|
|
8
|
+
TransactionRepositoryConfig,
|
|
9
|
+
TransactionQueryOptions,
|
|
10
|
+
TransactionResult,
|
|
11
|
+
} from "./transaction.types";
|
|
12
|
+
|
|
13
|
+
export type {
|
|
14
|
+
WalletConfig,
|
|
15
|
+
ProductType,
|
|
16
|
+
ProductMetadata,
|
|
17
|
+
ProductMetadataConfig,
|
|
18
|
+
CreditBalance,
|
|
19
|
+
WalletTranslations,
|
|
20
|
+
} from "./wallet.types";
|
|
21
|
+
|
|
22
|
+
export type {
|
|
23
|
+
CreditCostConfig,
|
|
24
|
+
AICreditCosts,
|
|
25
|
+
CreditCostResult,
|
|
26
|
+
} from "./credit-cost.types";
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
DEFAULT_AI_CREDIT_COSTS,
|
|
30
|
+
getCreditCost,
|
|
31
|
+
creditsToDollars,
|
|
32
|
+
createCreditCostConfig,
|
|
33
|
+
} from "./credit-cost.types";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction Types
|
|
3
|
+
*
|
|
4
|
+
* Types for credit transaction history and logs.
|
|
5
|
+
* Generic types for use across hundreds of apps.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type TransactionReason =
|
|
9
|
+
| "purchase"
|
|
10
|
+
| "usage"
|
|
11
|
+
| "refund"
|
|
12
|
+
| "bonus"
|
|
13
|
+
| "subscription"
|
|
14
|
+
| "admin"
|
|
15
|
+
| "reward"
|
|
16
|
+
| "expired";
|
|
17
|
+
|
|
18
|
+
export interface CreditLog {
|
|
19
|
+
id: string;
|
|
20
|
+
userId: string;
|
|
21
|
+
change: number;
|
|
22
|
+
reason: TransactionReason;
|
|
23
|
+
feature?: string;
|
|
24
|
+
jobId?: string;
|
|
25
|
+
packageId?: string;
|
|
26
|
+
subscriptionPlan?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
createdAt: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface TransactionRepositoryConfig {
|
|
32
|
+
collectionName: string;
|
|
33
|
+
useUserSubcollection?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface TransactionQueryOptions {
|
|
37
|
+
userId: string;
|
|
38
|
+
limit?: number;
|
|
39
|
+
startAfter?: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface TransactionResult<T = CreditLog[]> {
|
|
43
|
+
success: boolean;
|
|
44
|
+
data?: T;
|
|
45
|
+
error?: {
|
|
46
|
+
message: string;
|
|
47
|
+
code: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet Types
|
|
3
|
+
*
|
|
4
|
+
* Types for wallet configuration and product metadata.
|
|
5
|
+
* Generic types for use across hundreds of apps.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface WalletConfig {
|
|
9
|
+
transactionCollectionName: string;
|
|
10
|
+
productMetadataCollectionName: string;
|
|
11
|
+
useUserSubcollection?: boolean;
|
|
12
|
+
cacheTTL?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type ProductType = "credits" | "subscription";
|
|
16
|
+
|
|
17
|
+
export interface ProductMetadata {
|
|
18
|
+
productId: string;
|
|
19
|
+
type: ProductType;
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
credits?: number;
|
|
23
|
+
bonus?: number;
|
|
24
|
+
popular?: boolean;
|
|
25
|
+
features?: string[];
|
|
26
|
+
order?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ProductMetadataConfig {
|
|
30
|
+
collectionName: string;
|
|
31
|
+
cacheTTL?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface CreditBalance {
|
|
35
|
+
credits: number;
|
|
36
|
+
textCredits?: number;
|
|
37
|
+
imageCredits?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface WalletTranslations {
|
|
41
|
+
title: string;
|
|
42
|
+
balance: string;
|
|
43
|
+
availableCredits: string;
|
|
44
|
+
transactionHistory: string;
|
|
45
|
+
noTransactions: string;
|
|
46
|
+
loading: string;
|
|
47
|
+
purchase: string;
|
|
48
|
+
packages: string;
|
|
49
|
+
viewHistory: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet Domain
|
|
3
|
+
*
|
|
4
|
+
* Public API for wallet functionality.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Types
|
|
8
|
+
export type {
|
|
9
|
+
TransactionReason,
|
|
10
|
+
CreditLog,
|
|
11
|
+
TransactionRepositoryConfig,
|
|
12
|
+
TransactionQueryOptions,
|
|
13
|
+
TransactionResult,
|
|
14
|
+
WalletConfig,
|
|
15
|
+
ProductType,
|
|
16
|
+
ProductMetadata,
|
|
17
|
+
ProductMetadataConfig,
|
|
18
|
+
CreditBalance,
|
|
19
|
+
WalletTranslations,
|
|
20
|
+
CreditCostConfig,
|
|
21
|
+
AICreditCosts,
|
|
22
|
+
CreditCostResult,
|
|
23
|
+
} from "./domain/types";
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
DEFAULT_AI_CREDIT_COSTS,
|
|
27
|
+
getCreditCost,
|
|
28
|
+
creditsToDollars,
|
|
29
|
+
createCreditCostConfig,
|
|
30
|
+
} from "./domain/types";
|
|
31
|
+
|
|
32
|
+
// Errors
|
|
33
|
+
export {
|
|
34
|
+
WalletError,
|
|
35
|
+
PaymentValidationError,
|
|
36
|
+
PaymentProviderError,
|
|
37
|
+
DuplicatePaymentError,
|
|
38
|
+
UserValidationError,
|
|
39
|
+
PackageValidationError,
|
|
40
|
+
ReceiptValidationError,
|
|
41
|
+
TransactionError,
|
|
42
|
+
NetworkError,
|
|
43
|
+
CreditLimitError,
|
|
44
|
+
RefundError,
|
|
45
|
+
handleWalletError,
|
|
46
|
+
type WalletErrorCategory,
|
|
47
|
+
} from "./domain/errors/WalletError";
|
|
48
|
+
|
|
49
|
+
// Entities
|
|
50
|
+
export {
|
|
51
|
+
createCreditCostEntity,
|
|
52
|
+
type CreditCostEntity,
|
|
53
|
+
} from "./domain/entities/CreditCost";
|
|
54
|
+
|
|
55
|
+
// Repositories
|
|
56
|
+
export {
|
|
57
|
+
TransactionRepository,
|
|
58
|
+
createTransactionRepository,
|
|
59
|
+
} from "./infrastructure/repositories/TransactionRepository";
|
|
60
|
+
|
|
61
|
+
// Services
|
|
62
|
+
export {
|
|
63
|
+
ProductMetadataService,
|
|
64
|
+
createProductMetadataService,
|
|
65
|
+
configureProductMetadataService,
|
|
66
|
+
getProductMetadataService,
|
|
67
|
+
resetProductMetadataService,
|
|
68
|
+
} from "./infrastructure/services/ProductMetadataService";
|
|
69
|
+
|
|
70
|
+
// Hooks
|
|
71
|
+
export {
|
|
72
|
+
useWallet,
|
|
73
|
+
type UseWalletParams,
|
|
74
|
+
type UseWalletResult,
|
|
75
|
+
} from "./presentation/hooks/useWallet";
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
useTransactionHistory,
|
|
79
|
+
transactionQueryKeys,
|
|
80
|
+
type UseTransactionHistoryParams,
|
|
81
|
+
type UseTransactionHistoryResult,
|
|
82
|
+
} from "./presentation/hooks/useTransactionHistory";
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
useProductMetadata,
|
|
86
|
+
productMetadataQueryKeys,
|
|
87
|
+
type UseProductMetadataParams,
|
|
88
|
+
type UseProductMetadataResult,
|
|
89
|
+
} from "./presentation/hooks/useProductMetadata";
|
|
90
|
+
|
|
91
|
+
// Components
|
|
92
|
+
export {
|
|
93
|
+
BalanceCard,
|
|
94
|
+
type BalanceCardProps,
|
|
95
|
+
type BalanceCardTranslations,
|
|
96
|
+
} from "./presentation/components/BalanceCard";
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
TransactionItem,
|
|
100
|
+
type TransactionItemProps,
|
|
101
|
+
type TransactionItemTranslations,
|
|
102
|
+
} from "./presentation/components/TransactionItem";
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
TransactionList,
|
|
106
|
+
type TransactionListProps,
|
|
107
|
+
type TransactionListTranslations,
|
|
108
|
+
} from "./presentation/components/TransactionList";
|
|
109
|
+
|
|
110
|
+
// Screens
|
|
111
|
+
export {
|
|
112
|
+
WalletScreen,
|
|
113
|
+
type WalletScreenProps,
|
|
114
|
+
type WalletScreenConfig,
|
|
115
|
+
type WalletScreenTranslations,
|
|
116
|
+
} from "./presentation/screens/WalletScreen";
|