Initial Commit
This commit is contained in:
commit
2d858727b0
10 changed files with 1128 additions and 0 deletions
30
paymentStatus.ts
Normal file
30
paymentStatus.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import type { Proof } from "@cashu/cashu-ts";
|
||||
|
||||
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;
|
||||
paymentType: "receive" | "send";
|
||||
amountSat: number;
|
||||
timestamp: number;
|
||||
status: "complete";
|
||||
}
|
||||
|
||||
export interface CashuStore {
|
||||
getProofs(): Promise<Proof[]>;
|
||||
getTxns(): Promise<CashuTxn[]>;
|
||||
getLastRedeemedCashuQuoteTimestamp(): Promise<number>;
|
||||
persistProofs(proofs: Proof[]): Promise<void>;
|
||||
persistTxns(txns: CashuTxn[]): Promise<void>;
|
||||
persistLastRedeemedCashuQuoteTimestamp(timestamp: number): Promise<void>;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue