/* 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 { BlockRef } from './BlockRef'; import { BlockRefFromJSON, BlockRefFromJSONTyped, BlockRefToJSON, BlockRefToJSONTyped, } from './BlockRef'; /** * A richer wallet-transaction summary returned by the onchain transactions endpoint. * * Includes the raw transaction plus its fee, the wallet's net balance change, and * confirmation status. * @export * @interface WalletTxInfo */ export interface WalletTxInfo { /** * Net change to the wallet's balance: `received - sent` over wallet-owned outputs. * Positive for inbound, negative for outbound, zero for self-spends with no net change. * @type {number} * @memberof WalletTxInfo */ balanceChangeSat: number; /** * `Some` when the transaction is mined; `None` while still in the mempool. * @type {BlockRef} * @memberof WalletTxInfo */ confirmation?: BlockRef | null; /** * `true` when this tx spends a P2A fee anchor output — i.e. it is a CPFP * child bumping its parent. In bark this typically means the wallet is * fee-bumping an exit transaction. * @type {boolean} * @memberof WalletTxInfo */ isCpfp: boolean; /** * Total fee paid by the transaction, when known. `None` for txs whose foreign * prevouts BDK has not indexed (e.g. inbound payments observed via the * bitcoind-rpc sync path; esplora sync always populates prevouts). * @type {number} * @memberof WalletTxInfo */ onchainFeeSat?: number | null; /** * * @type {string} * @memberof WalletTxInfo */ tx: string; /** * * @type {string} * @memberof WalletTxInfo */ txid: string; } /** * Check if a given object implements the WalletTxInfo interface. */ export function instanceOfWalletTxInfo(value: object): value is WalletTxInfo { if (!('balanceChangeSat' in value) || value['balanceChangeSat'] === undefined) return false; if (!('isCpfp' in value) || value['isCpfp'] === undefined) return false; if (!('tx' in value) || value['tx'] === undefined) return false; if (!('txid' in value) || value['txid'] === undefined) return false; return true; } export function WalletTxInfoFromJSON(json: any): WalletTxInfo { return WalletTxInfoFromJSONTyped(json, false); } export function WalletTxInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): WalletTxInfo { if (json == null) { return json; } return { 'balanceChangeSat': json['balance_change_sat'], 'confirmation': json['confirmation'] == null ? undefined : BlockRefFromJSON(json['confirmation']), 'isCpfp': json['is_cpfp'], 'onchainFeeSat': json['onchain_fee_sat'] == null ? undefined : json['onchain_fee_sat'], 'tx': json['tx'], 'txid': json['txid'], }; } export function WalletTxInfoToJSON(json: any): WalletTxInfo { return WalletTxInfoToJSONTyped(json, false); } export function WalletTxInfoToJSONTyped(value?: WalletTxInfo | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'balance_change_sat': value['balanceChangeSat'], 'confirmation': BlockRefToJSON(value['confirmation']), 'is_cpfp': value['isCpfp'], 'onchain_fee_sat': value['onchainFeeSat'], 'tx': value['tx'], 'txid': value['txid'], }; }