enums in typescript are terrible

This commit is contained in:
Danny Morabito 2025-07-09 16:34:52 +02:00
parent 4b9a870063
commit 754cd2d198
Signed by: dannym
GPG key ID: 7CC8056A5A04557E
2 changed files with 12 additions and 12 deletions

View file

@ -14,7 +14,7 @@ import initBreez, {
import { privateKeyFromSeedWords as nostrPrivateKeyFromSeedWords } from "nostr-tools/nip06"; import { privateKeyFromSeedWords as nostrPrivateKeyFromSeedWords } from "nostr-tools/nip06";
import { getPublicKey, nip19 } from "nostr-tools"; import { getPublicKey, nip19 } from "nostr-tools";
import { type CashuStore, type CashuTxn, PaymentStatus } from "./paymentStatus"; import { type CashuStore, type CashuTxn, PaymentStatus } from "./paymentStatus";
export type { CashuStore, PaymentStatus } from "./paymentStatus"; export { type CashuStore, PaymentStatus } from "./paymentStatus";
import PortalBtcWalletCashu from "./cashu"; import PortalBtcWalletCashu from "./cashu";
type CombinedPayment = Payment | CashuTxn; type CombinedPayment = Payment | CashuTxn;

View file

@ -1,16 +1,16 @@
import type { Proof } from "@cashu/cashu-ts"; import type { Proof } from "@cashu/cashu-ts";
export enum PaymentStatus { export const PaymentStatus = {
ParsingDestination = 0, ParsingDestination: 0,
AttemptingCashuPayment = 1, AttemptingCashuPayment: 1,
AttemptingLightningPayment = 2, AttemptingLightningPayment: 2,
CashuPaymentFailed = 3, CashuPaymentFailed: 3,
AmountRequired = 4, AmountRequired: 4,
PreparingOnchainPayment = 5, PreparingOnchainPayment: 5,
BroadcastingOnchainPayment = 6, BroadcastingOnchainPayment: 6,
PaymentFailed = 0xfe, PaymentFailed: 0xfe,
PaymentSent = 0xff, PaymentSent: 0xff,
} } as const;
export interface CashuTxn { export interface CashuTxn {
txId: string; txId: string;