UNPKG

tonb-merchant-api-client

Version:

Merchant API client is a library to interact with TONB Merchant API.

63 lines (62 loc) 1.5 kB
/** ID of Invoice */ export type InvoiceID = number; /** Possible Invoice statuses */ export declare enum InvoiceEnumStatus { created = "created", binded = "binded", success = "success", failed = "failed", pending = "pending", canceled = "canceled", declined = "declined" } /** Invoice type represents invoice data */ export type Invoice = { domain?: string; id: InvoiceID; code?: string; webhook?: string; amount: bigint; order_id?: bigint; status?: InvoiceEnumStatus; transaction?: unknown; createdAt?: number; updatedAt?: number; user_from_id?: bigint; user_to_id?: bigint; wallet_from_id?: number; wallet_to_id?: number; user_from?: { first_name: string; last_name?: string; photo_url?: string; }; wallet_from?: { address?: string; }; }; /** CreateInvoiceData represents data needed to create invoice. */ export type CreateInvoiceData = { order_id: number; amount: number; }; /** InvoiceStats represents statistical data about invoices. */ export type InvoiceStats = { count: number; invoice_sum: number; }; /** DataContainer includes data and validation status. */ export type DataContainer<R> = { data: R | null; isValid: boolean; error?: unknown; }; export type InvoiceUpdate = { data: { status: InvoiceEnumStatus; code: string; amount: number; order_id: number; sign: string; }; };