Files
ncd-fe/packages/pl-api/lib/entities/subscription-invoice.ts
nicole mikołajczyk 9e25fed130 pl-api: mitra fixes and updates
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-01-19 04:47:37 +01:00

38 lines
964 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,
};