feat: complete TASK-WP2-04 credit ledger

This commit is contained in:
suyx
2026-08-02 23:27:10 +08:00
parent 9b4860cfc2
commit 4551d73e76
24 changed files with 3002 additions and 6 deletions
+16
View File
@@ -0,0 +1,16 @@
export type CreditErrorCode =
| "credit_account_not_found"
| "credit_generation_not_found"
| "credit_insufficient"
| "credit_invariant_failed"
| "credit_operation_conflict"
| "credit_request_invalid";
export class CreditError extends Error {
readonly code: CreditErrorCode;
constructor(code: CreditErrorCode) {
super(code);
this.code = code;
}
}