/* 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 type { VtxoStateInfoOneOf } from './VtxoStateInfoOneOf'; import { instanceOfVtxoStateInfoOneOf, VtxoStateInfoOneOfFromJSON, VtxoStateInfoOneOfFromJSONTyped, VtxoStateInfoOneOfToJSON, } from './VtxoStateInfoOneOf'; import type { VtxoStateInfoOneOf1 } from './VtxoStateInfoOneOf1'; import { instanceOfVtxoStateInfoOneOf1, VtxoStateInfoOneOf1FromJSON, VtxoStateInfoOneOf1FromJSONTyped, VtxoStateInfoOneOf1ToJSON, } from './VtxoStateInfoOneOf1'; import type { VtxoStateInfoOneOf2 } from './VtxoStateInfoOneOf2'; import { instanceOfVtxoStateInfoOneOf2, VtxoStateInfoOneOf2FromJSON, VtxoStateInfoOneOf2FromJSONTyped, VtxoStateInfoOneOf2ToJSON, } from './VtxoStateInfoOneOf2'; import type { VtxoStateInfoOneOf3 } from './VtxoStateInfoOneOf3'; import { instanceOfVtxoStateInfoOneOf3, VtxoStateInfoOneOf3FromJSON, VtxoStateInfoOneOf3FromJSONTyped, VtxoStateInfoOneOf3ToJSON, } from './VtxoStateInfoOneOf3'; /** * @type VtxoStateInfo * The current state of a VTXO in the wallet. * @export */ export type VtxoStateInfo = VtxoStateInfoOneOf | VtxoStateInfoOneOf1 | VtxoStateInfoOneOf2 | VtxoStateInfoOneOf3; export function VtxoStateInfoFromJSON(json: any): VtxoStateInfo { return VtxoStateInfoFromJSONTyped(json, false); } export function VtxoStateInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): VtxoStateInfo { if (json == null) { return json; } if (typeof json !== 'object') { return json; } switch (json["type"]) { case "spendable": return VtxoStateInfoOneOfFromJSONTyped(json, true); case "spent": return VtxoStateInfoOneOf1FromJSONTyped(json, true); case "exited": return VtxoStateInfoOneOf2FromJSONTyped(json, true); case "locked": return VtxoStateInfoOneOf3FromJSONTyped(json, true); default: return {} as any; } } export function VtxoStateInfoToJSON(json: any): any { return VtxoStateInfoToJSONTyped(json, false); } export function VtxoStateInfoToJSONTyped(value?: VtxoStateInfo | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } if (typeof value !== 'object') { return value; } if (instanceOfVtxoStateInfoOneOf(value)) { return VtxoStateInfoOneOfToJSON(value as VtxoStateInfoOneOf); } if (instanceOfVtxoStateInfoOneOf1(value)) { return VtxoStateInfoOneOf1ToJSON(value as VtxoStateInfoOneOf1); } if (instanceOfVtxoStateInfoOneOf2(value)) { return VtxoStateInfoOneOf2ToJSON(value as VtxoStateInfoOneOf2); } if (instanceOfVtxoStateInfoOneOf3(value)) { return VtxoStateInfoOneOf3ToJSON(value as VtxoStateInfoOneOf3); } return {}; }