/* 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 * as runtime from '../runtime'; import type { BadRequestError, ExitCancelResponse, ExitClaimAllRequest, ExitClaimResponse, ExitClaimVtxosRequest, ExitProgressRequest, ExitProgressResponse, ExitStartRequest, ExitStartResponse, ExitTransactionStatus, InternalServerError, NotFoundError, } from '../models/index'; import { BadRequestErrorFromJSON, BadRequestErrorToJSON, ExitCancelResponseFromJSON, ExitCancelResponseToJSON, ExitClaimAllRequestFromJSON, ExitClaimAllRequestToJSON, ExitClaimResponseFromJSON, ExitClaimResponseToJSON, ExitClaimVtxosRequestFromJSON, ExitClaimVtxosRequestToJSON, ExitProgressRequestFromJSON, ExitProgressRequestToJSON, ExitProgressResponseFromJSON, ExitProgressResponseToJSON, ExitStartRequestFromJSON, ExitStartRequestToJSON, ExitStartResponseFromJSON, ExitStartResponseToJSON, ExitTransactionStatusFromJSON, ExitTransactionStatusToJSON, InternalServerErrorFromJSON, InternalServerErrorToJSON, NotFoundErrorFromJSON, NotFoundErrorToJSON, } from '../models/index'; export interface ExitCancelRequest { vtxoId: string; } export interface ExitClaimAllOperationRequest { exitClaimAllRequest: ExitClaimAllRequest; } export interface ExitClaimVtxosOperationRequest { exitClaimVtxosRequest: ExitClaimVtxosRequest; } export interface ExitProgressOperationRequest { exitProgressRequest: ExitProgressRequest; } export interface ExitStartVtxosRequest { exitStartRequest: ExitStartRequest; } export interface GetAllExitStatusRequest { history?: boolean; transactions?: boolean; } export interface GetExitStatusByVtxoIdRequest { vtxoId: string; history?: boolean; transactions?: boolean; } export interface GetExitStatusByVtxoIdDeprecatedRequest { vtxoId: string; history?: boolean; transactions?: boolean; } export interface GetFinishedExitsRequest { history?: boolean; transactions?: boolean; } export interface GetLiveExitStatusRequest { history?: boolean; transactions?: boolean; } /** * */ export class ExitsApi extends runtime.BaseAPI { /** * Creates request options for exitCancel without sending the request */ async exitCancelRequestOpts(requestParameters: ExitCancelRequest): Promise { if (requestParameters['vtxoId'] == null) { throw new runtime.RequiredError( 'vtxoId', 'Required parameter "vtxoId" was null or undefined when calling exitCancel().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/cancel/{vtxo_id}`; urlPath = urlPath.replace(`{${"vtxo_id"}}`, encodeURIComponent(String(requestParameters['vtxoId']))); return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }; } /** * Aborts an in-progress emergency exit while it is still safe to do so—before its final transaction has been broadcast. Exit transactions are ordered topologically and only the final one moves the VTXO on-chain, so an exit can still be canceled even after its shared ancestor transactions are in the mempool or a block. Canceling leaves the VTXO spendable, so a fresh exit can be started for it later. Before canceling, the endpoint verifies directly against the chain that the final transaction hasn\'t been broadcast; nothing is rebroadcast in the process. Canceling an already-canceled exit succeeds as a no-op, so retries are safe. Note the daemon auto-progresses exits at the cadence defined by `SLOW_INTERVAL`, so cancel promptly once an exit reaches a state you no longer wish to pursue. * Cancel an exit */ async exitCancelRaw(requestParameters: ExitCancelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.exitCancelRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ExitCancelResponseFromJSON(jsonValue)); } /** * Aborts an in-progress emergency exit while it is still safe to do so—before its final transaction has been broadcast. Exit transactions are ordered topologically and only the final one moves the VTXO on-chain, so an exit can still be canceled even after its shared ancestor transactions are in the mempool or a block. Canceling leaves the VTXO spendable, so a fresh exit can be started for it later. Before canceling, the endpoint verifies directly against the chain that the final transaction hasn\'t been broadcast; nothing is rebroadcast in the process. Canceling an already-canceled exit succeeds as a no-op, so retries are safe. Note the daemon auto-progresses exits at the cadence defined by `SLOW_INTERVAL`, so cancel promptly once an exit reaches a state you no longer wish to pursue. * Cancel an exit */ async exitCancel(requestParameters: ExitCancelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.exitCancelRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for exitClaimAll without sending the request */ async exitClaimAllRequestOpts(requestParameters: ExitClaimAllOperationRequest): Promise { if (requestParameters['exitClaimAllRequest'] == null) { throw new runtime.RequiredError( 'exitClaimAllRequest', 'Required parameter "exitClaimAllRequest" was null or undefined when calling exitClaimAll().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/claim/all`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ExitClaimAllRequestToJSON(requestParameters['exitClaimAllRequest']), }; } /** * Sweeps all claimable exit outputs into a single on-chain transaction sent to the specified address. Unlike `progress`, the daemon does not claim automatically—this endpoint must be called manually. Poll the `status` endpoint or call `progress` and check for `done: true` to know when VTXOs are ready to claim. This is the final step of the emergency exit process—the bitcoin is not considered back on-chain until this transaction confirms. * Claim all exited VTXOs */ async exitClaimAllRaw(requestParameters: ExitClaimAllOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.exitClaimAllRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ExitClaimResponseFromJSON(jsonValue)); } /** * Sweeps all claimable exit outputs into a single on-chain transaction sent to the specified address. Unlike `progress`, the daemon does not claim automatically—this endpoint must be called manually. Poll the `status` endpoint or call `progress` and check for `done: true` to know when VTXOs are ready to claim. This is the final step of the emergency exit process—the bitcoin is not considered back on-chain until this transaction confirms. * Claim all exited VTXOs */ async exitClaimAll(requestParameters: ExitClaimAllOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.exitClaimAllRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for exitClaimVtxos without sending the request */ async exitClaimVtxosRequestOpts(requestParameters: ExitClaimVtxosOperationRequest): Promise { if (requestParameters['exitClaimVtxosRequest'] == null) { throw new runtime.RequiredError( 'exitClaimVtxosRequest', 'Required parameter "exitClaimVtxosRequest" was null or undefined when calling exitClaimVtxos().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/claim/vtxos`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ExitClaimVtxosRequestToJSON(requestParameters['exitClaimVtxosRequest']), }; } /** * Sweeps the specified claimable exit outputs into a single on-chain transaction sent to the specified address. Unlike `progress`, the daemon does not claim automatically—this endpoint must be called manually. Poll the `status` endpoint or call `progress` and check for `done: true` to know when VTXOs are ready to claim. This is the final step of the emergency exit process—the bitcoin is not considered back on-chain until this transaction confirms. * Claim specific exited VTXOs */ async exitClaimVtxosRaw(requestParameters: ExitClaimVtxosOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.exitClaimVtxosRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ExitClaimResponseFromJSON(jsonValue)); } /** * Sweeps the specified claimable exit outputs into a single on-chain transaction sent to the specified address. Unlike `progress`, the daemon does not claim automatically—this endpoint must be called manually. Poll the `status` endpoint or call `progress` and check for `done: true` to know when VTXOs are ready to claim. This is the final step of the emergency exit process—the bitcoin is not considered back on-chain until this transaction confirms. * Claim specific exited VTXOs */ async exitClaimVtxos(requestParameters: ExitClaimVtxosOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.exitClaimVtxosRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for exitProgress without sending the request */ async exitProgressRequestOpts(requestParameters: ExitProgressOperationRequest): Promise { if (requestParameters['exitProgressRequest'] == null) { throw new runtime.RequiredError( 'exitProgressRequest', 'Required parameter "exitProgressRequest" was null or undefined when calling exitProgress().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/progress`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ExitProgressRequestToJSON(requestParameters['exitProgressRequest']), }; } /** * Triggers all in-progress exits to advance. The daemon already progresses exits automatically in the background—use this endpoint when you want immediate progress rather than waiting for the next automatic cycle. On each call, the endpoint syncs transaction statuses, advances the exit state machine, and creates or fee-bumps CPFP children for any exit transactions that need them. The on-chain wallet must have sufficient bitcoin to cover transaction fees. * Progress exits */ async exitProgressRaw(requestParameters: ExitProgressOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.exitProgressRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ExitProgressResponseFromJSON(jsonValue)); } /** * Triggers all in-progress exits to advance. The daemon already progresses exits automatically in the background—use this endpoint when you want immediate progress rather than waiting for the next automatic cycle. On each call, the endpoint syncs transaction statuses, advances the exit state machine, and creates or fee-bumps CPFP children for any exit transactions that need them. The on-chain wallet must have sufficient bitcoin to cover transaction fees. * Progress exits */ async exitProgress(requestParameters: ExitProgressOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.exitProgressRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for exitStartAll without sending the request */ async exitStartAllRequestOpts(): Promise { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/start/all`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }; } /** * Registers all wallet VTXOs for emergency exit. The daemon automatically progresses registered exits in the background at the cadence defined by `SLOW_INTERVAL`, creating and broadcasting the required transactions in sequence. Once all exit transactions are confirmed and the timelock has elapsed, call `claim` to sweep the resulting outputs to an on-chain address. * Start exit for all VTXOs */ async exitStartAllRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.exitStartAllRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ExitStartResponseFromJSON(jsonValue)); } /** * Registers all wallet VTXOs for emergency exit. The daemon automatically progresses registered exits in the background at the cadence defined by `SLOW_INTERVAL`, creating and broadcasting the required transactions in sequence. Once all exit transactions are confirmed and the timelock has elapsed, call `claim` to sweep the resulting outputs to an on-chain address. * Start exit for all VTXOs */ async exitStartAll(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.exitStartAllRaw(initOverrides); return await response.value(); } /** * Creates request options for exitStartVtxos without sending the request */ async exitStartVtxosRequestOpts(requestParameters: ExitStartVtxosRequest): Promise { if (requestParameters['exitStartRequest'] == null) { throw new runtime.RequiredError( 'exitStartRequest', 'Required parameter "exitStartRequest" was null or undefined when calling exitStartVtxos().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/start/vtxos`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ExitStartRequestToJSON(requestParameters['exitStartRequest']), }; } /** * Registers the specified VTXOs for emergency exit. The daemon automatically progresses registered exits in the background at the cadence defined by `SLOW_INTERVAL`, creating and broadcasting the required transactions in sequence. Once all exit transactions are confirmed and the timelock has elapsed, call `claim` to sweep the resulting outputs to an on-chain address. * Start exit for specific VTXOs */ async exitStartVtxosRaw(requestParameters: ExitStartVtxosRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.exitStartVtxosRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ExitStartResponseFromJSON(jsonValue)); } /** * Registers the specified VTXOs for emergency exit. The daemon automatically progresses registered exits in the background at the cadence defined by `SLOW_INTERVAL`, creating and broadcasting the required transactions in sequence. Once all exit transactions are confirmed and the timelock has elapsed, call `claim` to sweep the resulting outputs to an on-chain address. * Start exit for specific VTXOs */ async exitStartVtxos(requestParameters: ExitStartVtxosRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.exitStartVtxosRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for getAllExitStatus without sending the request */ async getAllExitStatusRequestOpts(requestParameters: GetAllExitStatusRequest): Promise { const queryParameters: any = {}; if (requestParameters['history'] != null) { queryParameters['history'] = requestParameters['history']; } if (requestParameters['transactions'] != null) { queryParameters['transactions'] = requestParameters['transactions']; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/status/all`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns every exit, live and finished. Optionally includes each exit\'s state history and its transactions with their CPFP children. * List all exit statuses */ async getAllExitStatusRaw(requestParameters: GetAllExitStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const requestOptions = await this.getAllExitStatusRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ExitTransactionStatusFromJSON)); } /** * Returns every exit, live and finished. Optionally includes each exit\'s state history and its transactions with their CPFP children. * List all exit statuses */ async getAllExitStatus(requestParameters: GetAllExitStatusRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getAllExitStatusRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for getAllExitStatusDeprecated without sending the request * @deprecated */ async getAllExitStatusDeprecatedRequestOpts(): Promise { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/status`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Deprecated: redirects to `GET /exits/status/all`. * List all exit statuses (deprecated) * @deprecated */ async getAllExitStatusDeprecatedRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.getAllExitStatusDeprecatedRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.VoidApiResponse(response); } /** * Deprecated: redirects to `GET /exits/status/all`. * List all exit statuses (deprecated) * @deprecated */ async getAllExitStatusDeprecated(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.getAllExitStatusDeprecatedRaw(initOverrides); } /** * Creates request options for getExitStatusByVtxoId without sending the request */ async getExitStatusByVtxoIdRequestOpts(requestParameters: GetExitStatusByVtxoIdRequest): Promise { if (requestParameters['vtxoId'] == null) { throw new runtime.RequiredError( 'vtxoId', 'Required parameter "vtxoId" was null or undefined when calling getExitStatusByVtxoId().' ); } const queryParameters: any = {}; if (requestParameters['history'] != null) { queryParameters['history'] = requestParameters['history']; } if (requestParameters['transactions'] != null) { queryParameters['transactions'] = requestParameters['transactions']; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/status/vtxo/{vtxo_id}`; urlPath = urlPath.replace(`{${"vtxo_id"}}`, encodeURIComponent(String(requestParameters['vtxoId']))); return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns the exit status for the given VTXO, live or finished. Optionally includes the state history and the exit transactions with their CPFP children. * Get VTXO exit status */ async getExitStatusByVtxoIdRaw(requestParameters: GetExitStatusByVtxoIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.getExitStatusByVtxoIdRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ExitTransactionStatusFromJSON(jsonValue)); } /** * Returns the exit status for the given VTXO, live or finished. Optionally includes the state history and the exit transactions with their CPFP children. * Get VTXO exit status */ async getExitStatusByVtxoId(requestParameters: GetExitStatusByVtxoIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getExitStatusByVtxoIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for getExitStatusByVtxoIdDeprecated without sending the request * @deprecated */ async getExitStatusByVtxoIdDeprecatedRequestOpts(requestParameters: GetExitStatusByVtxoIdDeprecatedRequest): Promise { if (requestParameters['vtxoId'] == null) { throw new runtime.RequiredError( 'vtxoId', 'Required parameter "vtxoId" was null or undefined when calling getExitStatusByVtxoIdDeprecated().' ); } const queryParameters: any = {}; if (requestParameters['history'] != null) { queryParameters['history'] = requestParameters['history']; } if (requestParameters['transactions'] != null) { queryParameters['transactions'] = requestParameters['transactions']; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/status/{vtxo_id}`; urlPath = urlPath.replace(`{${"vtxo_id"}}`, encodeURIComponent(String(requestParameters['vtxoId']))); return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Deprecated: use `GET /exits/status/vtxo/{vtxo_id}` instead. * Get exit status (deprecated) * @deprecated */ async getExitStatusByVtxoIdDeprecatedRaw(requestParameters: GetExitStatusByVtxoIdDeprecatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.getExitStatusByVtxoIdDeprecatedRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ExitTransactionStatusFromJSON(jsonValue)); } /** * Deprecated: use `GET /exits/status/vtxo/{vtxo_id}` instead. * Get exit status (deprecated) * @deprecated */ async getExitStatusByVtxoIdDeprecated(requestParameters: GetExitStatusByVtxoIdDeprecatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getExitStatusByVtxoIdDeprecatedRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for getFinishedExits without sending the request */ async getFinishedExitsRequestOpts(requestParameters: GetFinishedExitsRequest): Promise { const queryParameters: any = {}; if (requestParameters['history'] != null) { queryParameters['history'] = requestParameters['history']; } if (requestParameters['transactions'] != null) { queryParameters['transactions'] = requestParameters['transactions']; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/status/finished`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns exits that reached a terminal state: claimed, aborted because the VTXO was already spent, or canceled. Finished exits are dropped from active tracking—they are never progressed—but they\'re retained for auditing and surfaced here. * List finished exits */ async getFinishedExitsRaw(requestParameters: GetFinishedExitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const requestOptions = await this.getFinishedExitsRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ExitTransactionStatusFromJSON)); } /** * Returns exits that reached a terminal state: claimed, aborted because the VTXO was already spent, or canceled. Finished exits are dropped from active tracking—they are never progressed—but they\'re retained for auditing and surfaced here. * List finished exits */ async getFinishedExits(requestParameters: GetFinishedExitsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getFinishedExitsRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for getLiveExitStatus without sending the request */ async getLiveExitStatusRequestOpts(requestParameters: GetLiveExitStatusRequest): Promise { const queryParameters: any = {}; if (requestParameters['history'] != null) { queryParameters['history'] = requestParameters['history']; } if (requestParameters['transactions'] != null) { queryParameters['transactions'] = requestParameters['transactions']; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v1/exits/status/live`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns exits that are still progressing. Optionally includes each exit\'s state history and its transactions with their CPFP children. * List live exit statuses */ async getLiveExitStatusRaw(requestParameters: GetLiveExitStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const requestOptions = await this.getLiveExitStatusRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ExitTransactionStatusFromJSON)); } /** * Returns exits that are still progressing. Optionally includes each exit\'s state history and its transactions with their CPFP children. * List live exit statuses */ async getLiveExitStatus(requestParameters: GetLiveExitStatusRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getLiveExitStatusRaw(requestParameters, initOverrides); return await response.value(); } }