/* tslint:disable */ /* eslint-disable */ /** * barkd REST API * A simple REST API for barkd, a wallet daemon for integrating bitcoin payments into your app over HTTP. Supports self-custodial Lightning, Ark, and on-chain out of the box. barkd is a long-running daemon best suited for always-on or high-connectivity environments like nodes, servers, desktops, and point-of-sale terminals. All endpoints return JSON. Amounts are denominated in satoshis. * * The version of the OpenAPI document: 0.6.1 * Contact: hello@second.tech * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; import type { WalletNotification } from './WalletNotification'; import { WalletNotificationFromJSON, WalletNotificationFromJSONTyped, WalletNotificationToJSON, WalletNotificationToJSONTyped, } from './WalletNotification'; /** * Response payload for the long-poll `wait` endpoint. * @export * @interface WaitNotificationResponse */ export interface WaitNotificationResponse { /** * The timestamp of the last notification pushed to the client. * @type {Date} * @memberof WaitNotificationResponse */ lastPushedAt?: Date | null; /** * Notifications received during the long-poll window. Empty if the * timeout elapsed without any notifications. Sorted by timestamp * in ascending order. * @type {Array} * @memberof WaitNotificationResponse */ notifications: Array; } /** * Check if a given object implements the WaitNotificationResponse interface. */ export function instanceOfWaitNotificationResponse(value: object): value is WaitNotificationResponse { if (!('notifications' in value) || value['notifications'] === undefined) return false; return true; } export function WaitNotificationResponseFromJSON(json: any): WaitNotificationResponse { return WaitNotificationResponseFromJSONTyped(json, false); } export function WaitNotificationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): WaitNotificationResponse { if (json == null) { return json; } return { 'lastPushedAt': json['last_pushed_at'] == null ? undefined : (new Date(json['last_pushed_at'])), 'notifications': ((json['notifications'] as Array).map(WalletNotificationFromJSON)), }; } export function WaitNotificationResponseToJSON(json: any): WaitNotificationResponse { return WaitNotificationResponseToJSONTyped(json, false); } export function WaitNotificationResponseToJSONTyped(value?: WaitNotificationResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'last_pushed_at': value['lastPushedAt'] == null ? value['lastPushedAt'] : value['lastPushedAt'].toISOString(), 'notifications': ((value['notifications'] as Array).map(WalletNotificationToJSON)), }; }