/* 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'; /** * * @export * @interface OnchainBalance */ export interface OnchainBalance { /** * Confirmed and immediately spendable balance * @type {number} * @memberof OnchainBalance */ confirmedSat: number; /** * All coinbase outputs not yet matured * @type {number} * @memberof OnchainBalance */ immatureSat: number; /** * All of them combined. * @type {number} * @memberof OnchainBalance */ totalSat: number; /** * Unconfirmed UTXOs generated by a wallet tx * @type {number} * @memberof OnchainBalance */ trustedPendingSat: number; /** * Get sum of trusted_pending and confirmed coins. * * This is the balance you can spend right now that shouldn't get canceled via another party * double spending it. * @type {number} * @memberof OnchainBalance */ trustedSpendableSat: number; /** * Unconfirmed UTXOs received from an external wallet * @type {number} * @memberof OnchainBalance */ untrustedPendingSat: number; } /** * Check if a given object implements the OnchainBalance interface. */ export function instanceOfOnchainBalance(value: object): value is OnchainBalance { if (!('confirmedSat' in value) || value['confirmedSat'] === undefined) return false; if (!('immatureSat' in value) || value['immatureSat'] === undefined) return false; if (!('totalSat' in value) || value['totalSat'] === undefined) return false; if (!('trustedPendingSat' in value) || value['trustedPendingSat'] === undefined) return false; if (!('trustedSpendableSat' in value) || value['trustedSpendableSat'] === undefined) return false; if (!('untrustedPendingSat' in value) || value['untrustedPendingSat'] === undefined) return false; return true; } export function OnchainBalanceFromJSON(json: any): OnchainBalance { return OnchainBalanceFromJSONTyped(json, false); } export function OnchainBalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): OnchainBalance { if (json == null) { return json; } return { 'confirmedSat': json['confirmed_sat'], 'immatureSat': json['immature_sat'], 'totalSat': json['total_sat'], 'trustedPendingSat': json['trusted_pending_sat'], 'trustedSpendableSat': json['trusted_spendable_sat'], 'untrustedPendingSat': json['untrusted_pending_sat'], }; } export function OnchainBalanceToJSON(json: any): OnchainBalance { return OnchainBalanceToJSONTyped(json, false); } export function OnchainBalanceToJSONTyped(value?: OnchainBalance | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'confirmed_sat': value['confirmedSat'], 'immature_sat': value['immatureSat'], 'total_sat': value['totalSat'], 'trusted_pending_sat': value['trustedPendingSat'], 'trusted_spendable_sat': value['trustedSpendableSat'], 'untrusted_pending_sat': value['untrustedPendingSat'], }; }