Files
ncd-fe/packages/pl-api/lib/entities/subscription-invoice.ts
nicole mikołajczyk ad00129411 pl-api: migrate to oxfmt+oxlint
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-02-15 03:00:05 +01:00

44 lines
996 B
TypeScript

import * as v from 'valibot';
import { datetimeSchema } from './utils';
/**
* @category Schemas
*/
const subscriptionInvoiceSchema = v.object({
/** Invoice ID. */
id: v.string(),
/** The ID of the sender. */
sender_id: v.string(),
/** The ID of the recipient. */
recipient_id: v.string(),
/** CAIP-2 chain ID. */
chain_id: v.string(),
/** Payment address. */
payment_address: v.string(),
/** Requested payment amount (in atomic units). */
amount: v.number(),
/** Invoice status. */
status: v.picklist([
'open',
'paid',
'forwarded',
'timeout',
'cancelled',
'underpaid',
'completed',
'failed',
]),
/** The date when invoice was created. */
created_at: datetimeSchema,
/** The date when invoice times out. */
invoice_expires_at: datetimeSchema,
});
/**
* @category Entity types
*/
type SubscriptionInvoice = v.InferOutput<typeof subscriptionInvoiceSchema>;
export { subscriptionInvoiceSchema, type SubscriptionInvoice };