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 { 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;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue