95 lines
2.8 KiB
TypeScript
95 lines
2.8 KiB
TypeScript
/**
|
|
* Test wallet: play-money credits for platform discovery without real funds.
|
|
*/
|
|
export declare class TestWalletError extends Error {
|
|
readonly code?: string;
|
|
readonly waitLabel?: string;
|
|
constructor(message: string, opts?: {
|
|
code?: string;
|
|
waitLabel?: string;
|
|
});
|
|
}
|
|
export declare function getSettingsForAdmin(): Promise<{
|
|
enabled: boolean;
|
|
creditAmountRaw: string;
|
|
maxRequestsPerUser: number;
|
|
cooldownHours: number;
|
|
walletTypeId: number;
|
|
walletCode: string | null;
|
|
predictionLimitEnabled: boolean;
|
|
maxTestPredictionsPerWindow: number;
|
|
testPredictionWindowHours: number;
|
|
updatedAt: Date;
|
|
}>;
|
|
export declare function updateSettings(input: {
|
|
enabled?: boolean;
|
|
creditAmountRaw?: string;
|
|
maxRequestsPerUser?: number;
|
|
cooldownHours?: number;
|
|
walletTypeId?: number;
|
|
predictionLimitEnabled?: boolean;
|
|
maxTestPredictionsPerWindow?: number;
|
|
testPredictionWindowHours?: number;
|
|
}): Promise<{
|
|
enabled: boolean;
|
|
creditAmountRaw: string;
|
|
maxRequestsPerUser: number;
|
|
cooldownHours: number;
|
|
walletTypeId: number;
|
|
walletCode: string | null;
|
|
predictionLimitEnabled: boolean;
|
|
maxTestPredictionsPerWindow: number;
|
|
testPredictionWindowHours: number;
|
|
updatedAt: Date;
|
|
}>;
|
|
export type TestPredictionLimitStatus = {
|
|
enabled: boolean;
|
|
maxPerWindow: number;
|
|
windowHours: number;
|
|
usedInWindow: number;
|
|
remaining: number;
|
|
resetsAt: string | null;
|
|
canPredict: boolean;
|
|
reason: string | null;
|
|
};
|
|
export declare function getTestPredictionLimitStatus(userId: string): Promise<TestPredictionLimitStatus>;
|
|
/** Throws when the user may not place another Test Wallet prediction. */
|
|
export declare function assertTestPredictionAllowed(userId: string): Promise<void>;
|
|
export declare function getUserTestWalletStatus(userId: string): Promise<{
|
|
enabled: boolean;
|
|
balanceRaw: string;
|
|
walletTypeId: number;
|
|
walletCode: string | null;
|
|
decimals: number;
|
|
creditAmountRaw: string;
|
|
maxRequests: number;
|
|
requestsUsed: number;
|
|
canRequest: boolean;
|
|
reason: string | null;
|
|
cooldownEndsAt: string | null;
|
|
predictionLimit: TestPredictionLimitStatus;
|
|
}>;
|
|
export declare function requestTestCredits(userId: string): Promise<{
|
|
message: string;
|
|
amountRaw: string;
|
|
balanceRaw: string;
|
|
}>;
|
|
export declare function listCreditHistory(options: {
|
|
userId?: string;
|
|
limit: number;
|
|
offset: number;
|
|
}): Promise<{
|
|
items: {
|
|
id: string;
|
|
userId: string;
|
|
userEmail: string | null;
|
|
walletTypeId: number;
|
|
walletCode: string;
|
|
amountRaw: string;
|
|
createdAt: Date;
|
|
}[];
|
|
total: number;
|
|
limit: number;
|
|
offset: number;
|
|
}>;
|
|
//# sourceMappingURL=testWalletService.d.ts.map
|