enums in typescript are terrible
This commit is contained in:
parent
4b9a870063
commit
754cd2d198
2 changed files with 12 additions and 12 deletions
2
index.ts
2
index.ts
|
|
@ -14,7 +14,7 @@ import initBreez, {
|
|||
import { privateKeyFromSeedWords as nostrPrivateKeyFromSeedWords } from "nostr-tools/nip06";
|
||||
import { getPublicKey, nip19 } from "nostr-tools";
|
||||
import { type CashuStore, type CashuTxn, PaymentStatus } from "./paymentStatus";
|
||||
export type { CashuStore, PaymentStatus } from "./paymentStatus";
|
||||
export { type CashuStore, PaymentStatus } from "./paymentStatus";
|
||||
import PortalBtcWalletCashu from "./cashu";
|
||||
|
||||
type CombinedPayment = Payment | CashuTxn;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import type { Proof } from "@cashu/cashu-ts";
|
||||
|
||||
export enum PaymentStatus {
|
||||
ParsingDestination = 0,
|
||||
AttemptingCashuPayment = 1,
|
||||
AttemptingLightningPayment = 2,
|
||||
CashuPaymentFailed = 3,
|
||||
AmountRequired = 4,
|
||||
PreparingOnchainPayment = 5,
|
||||
BroadcastingOnchainPayment = 6,
|
||||
PaymentFailed = 0xfe,
|
||||
PaymentSent = 0xff,
|
||||
}
|
||||
export const PaymentStatus = {
|
||||
ParsingDestination: 0,
|
||||
AttemptingCashuPayment: 1,
|
||||
AttemptingLightningPayment: 2,
|
||||
CashuPaymentFailed: 3,
|
||||
AmountRequired: 4,
|
||||
PreparingOnchainPayment: 5,
|
||||
BroadcastingOnchainPayment: 6,
|
||||
PaymentFailed: 0xfe,
|
||||
PaymentSent: 0xff,
|
||||
} as const;
|
||||
|
||||
export interface CashuTxn {
|
||||
txId: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue