/* 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 { ArkAddressResponse, ArkInfo, BadRequestError, Balance, Bip321UriRequest, Bip321UriResponse, ConnectedResponse, CreateWalletRequest, CreateWalletResponse, DelegatedRefreshRequest, EncodedVtxoResponse, ImportVtxoRequest, InternalServerError, MailboxSyncResponse, MnemonicResponse, Movement, NextRoundStart, NotFoundError, OffboardAllRequest, OffboardResult, OffboardVtxosRequest, PendingRoundInfo, RefreshRequest, SendOnchainRequest, SendRequest, SendResponse, WalletDeleteRequest, WalletDeleteResponse, WalletExistsResponse, WalletVtxoInfo, } from '../models/index'; import { ArkAddressResponseFromJSON, ArkAddressResponseToJSON, ArkInfoFromJSON, ArkInfoToJSON, BadRequestErrorFromJSON, BadRequestErrorToJSON, BalanceFromJSON, BalanceToJSON, Bip321UriRequestFromJSON, Bip321UriRequestToJSON, Bip321UriResponseFromJSON, Bip321UriResponseToJSON, ConnectedResponseFromJSON, ConnectedResponseToJSON, CreateWalletRequestFromJSON, CreateWalletRequestToJSON, CreateWalletResponseFromJSON, CreateWalletResponseToJSON, DelegatedRefreshRequestFromJSON, DelegatedRefreshRequestToJSON, EncodedVtxoResponseFromJSON, EncodedVtxoResponseToJSON, ImportVtxoRequestFromJSON, ImportVtxoRequestToJSON, InternalServerErrorFromJSON, InternalServerErrorToJSON, MailboxSyncResponseFromJSON, MailboxSyncResponseToJSON, MnemonicResponseFromJSON, MnemonicResponseToJSON, MovementFromJSON, MovementToJSON, NextRoundStartFromJSON, NextRoundStartToJSON, NotFoundErrorFromJSON, NotFoundErrorToJSON, OffboardAllRequestFromJSON, OffboardAllRequestToJSON, OffboardResultFromJSON, OffboardResultToJSON, OffboardVtxosRequestFromJSON, OffboardVtxosRequestToJSON, PendingRoundInfoFromJSON, PendingRoundInfoToJSON, RefreshRequestFromJSON, RefreshRequestToJSON, SendOnchainRequestFromJSON, SendOnchainRequestToJSON, SendRequestFromJSON, SendRequestToJSON, SendResponseFromJSON, SendResponseToJSON, WalletDeleteRequestFromJSON, WalletDeleteRequestToJSON, WalletDeleteResponseFromJSON, WalletDeleteResponseToJSON, WalletExistsResponseFromJSON, WalletExistsResponseToJSON, WalletVtxoInfoFromJSON, WalletVtxoInfoToJSON, } from '../models/index'; export interface Bip321UriOperationRequest { bip321UriRequest: Bip321UriRequest; uppercase?: boolean; } export interface CreateWalletOperationRequest { createWalletRequest: CreateWalletRequest; } export interface GetVtxoRequest { id: string; } export interface GetVtxoEncodedRequest { id: string; } export interface ImportVtxoOperationRequest { importVtxoRequest: ImportVtxoRequest; } export interface OffboardAllOperationRequest { offboardAllRequest: OffboardAllRequest; } export interface OffboardVtxosOperationRequest { offboardVtxosRequest: OffboardVtxosRequest; } export interface PeekAddressRequest { index: number; } export interface RefreshDelegatedRequest { delegatedRefreshRequest: DelegatedRefreshRequest; } export interface RefreshVtxosRequest { refreshRequest: RefreshRequest; } export interface SendOperationRequest { sendRequest: SendRequest; } export interface SendOnchainOperationRequest { sendOnchainRequest: SendOnchainRequest; } export interface VtxosRequest { all?: boolean; } export interface WalletDeleteOperationRequest { walletDeleteRequest: WalletDeleteRequest; } /** * */ export class WalletApi extends runtime.BaseAPI { /** * Creates request options for address without sending the request */ async addressRequestOpts(): 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/wallet/addresses/next`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }; } /** * Generates a new Ark receiving address. Each call returns the next unused address from the wallet\'s HD keychain. * Generate Ark address */ async addressRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.addressRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ArkAddressResponseFromJSON(jsonValue)); } /** * Generates a new Ark receiving address. Each call returns the next unused address from the wallet\'s HD keychain. * Generate Ark address */ async address(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.addressRaw(initOverrides); return await response.value(); } /** * Creates request options for arkInfo without sending the request */ async arkInfoRequestOpts(): 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/wallet/ark-info`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns the Ark server\'s configuration parameters, including network, public key, round interval, VTXO expiry and exit deltas, fee settings, and Lightning support details. * Get Ark server info */ async arkInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.arkInfoRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ArkInfoFromJSON(jsonValue)); } /** * Returns the Ark server\'s configuration parameters, including network, public key, round interval, VTXO expiry and exit deltas, fee settings, and Lightning support details. * Get Ark server info */ async arkInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.arkInfoRaw(initOverrides); return await response.value(); } /** * Creates request options for balance without sending the request */ async balanceRequestOpts(): 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/wallet/balance`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns the wallet balance broken down by category: spendable sats available for immediate use, sats pending in an Ark round, sats locked in outgoing or incoming Lightning payments, sats awaiting board confirmation, and sats in a pending exit. The balance is computed from local state, which the background daemon keeps reasonably fresh (Lightning syncs every second, mailbox and boards every 30 seconds). For the most up-to-date figures, call `sync` before this endpoint. * Get wallet balance */ async balanceRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.balanceRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => BalanceFromJSON(jsonValue)); } /** * Returns the wallet balance broken down by category: spendable sats available for immediate use, sats pending in an Ark round, sats locked in outgoing or incoming Lightning payments, sats awaiting board confirmation, and sats in a pending exit. The balance is computed from local state, which the background daemon keeps reasonably fresh (Lightning syncs every second, mailbox and boards every 30 seconds). For the most up-to-date figures, call `sync` before this endpoint. * Get wallet balance */ async balance(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.balanceRaw(initOverrides); return await response.value(); } /** * Creates request options for bip321Uri without sending the request */ async bip321UriRequestOpts(requestParameters: Bip321UriOperationRequest): Promise { if (requestParameters['bip321UriRequest'] == null) { throw new runtime.RequiredError( 'bip321UriRequest', 'Required parameter "bip321UriRequest" was null or undefined when calling bip321Uri().' ); } const queryParameters: any = {}; if (requestParameters['uppercase'] != null) { queryParameters['uppercase'] = requestParameters['uppercase']; } 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/wallet/bip321`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: Bip321UriRequestToJSON(requestParameters['bip321UriRequest']), }; } /** * Builds a single BIP 321 `bitcoin:` URI bundling multiple ways to receive the same payment, so one call prepares everything needed for an incoming payment. A fresh Ark address is always included. When `amount_sat` is given, a BOLT11 invoice for that amount is generated and the amount is embedded in the URI. When `onchain` is `true`, a fresh on-chain address is added (placed in the URI body on mainnet, as a `tb=` parameter on test networks). Set the `uppercase` query parameter to upper-case the `bip321` URI so QR encoders can use the compact alphanumeric mode; this fails if the URI carries case-sensitive data. The individual `ark`, `bolt11`, and `onchain` destinations are always returned in their natural case for direct use. * Build a BIP 321 payment URI */ async bip321UriRaw(requestParameters: Bip321UriOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.bip321UriRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => Bip321UriResponseFromJSON(jsonValue)); } /** * Builds a single BIP 321 `bitcoin:` URI bundling multiple ways to receive the same payment, so one call prepares everything needed for an incoming payment. A fresh Ark address is always included. When `amount_sat` is given, a BOLT11 invoice for that amount is generated and the amount is embedded in the URI. When `onchain` is `true`, a fresh on-chain address is added (placed in the URI body on mainnet, as a `tb=` parameter on test networks). Set the `uppercase` query parameter to upper-case the `bip321` URI so QR encoders can use the compact alphanumeric mode; this fails if the URI carries case-sensitive data. The individual `ark`, `bolt11`, and `onchain` destinations are always returned in their natural case for direct use. * Build a BIP 321 payment URI */ async bip321Uri(requestParameters: Bip321UriOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.bip321UriRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for connected without sending the request */ async connectedRequestOpts(): 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/wallet/connected`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Checks whether the wallet has an active connection to the Ark server. Returns `true` if the wallet can reach the server and retrieve its configuration, `false` otherwise. The background daemon checks the server connection every second, so this reflects the most recent known state. * Check server connection */ async connectedRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.connectedRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ConnectedResponseFromJSON(jsonValue)); } /** * Checks whether the wallet has an active connection to the Ark server. Returns `true` if the wallet can reach the server and retrieve its configuration, `false` otherwise. The background daemon checks the server connection every second, so this reflects the most recent known state. * Check server connection */ async connected(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.connectedRaw(initOverrides); return await response.value(); } /** * Creates request options for createWallet without sending the request */ async createWalletRequestOpts(requestParameters: CreateWalletOperationRequest): Promise { if (requestParameters['createWalletRequest'] == null) { throw new runtime.RequiredError( 'createWalletRequest', 'Required parameter "createWalletRequest" was null or undefined when calling createWallet().' ); } 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/wallet/create`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateWalletRequestToJSON(requestParameters['createWalletRequest']), }; } /** * Creates a new wallet with the specified Ark server and chain source configuration. Fails if a wallet already exists. Returns the wallet fingerprint on success. * Create a wallet */ async createWalletRaw(requestParameters: CreateWalletOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.createWalletRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CreateWalletResponseFromJSON(jsonValue)); } /** * Creates a new wallet with the specified Ark server and chain source configuration. Fails if a wallet already exists. Returns the wallet fingerprint on success. * Create a wallet */ async createWallet(requestParameters: CreateWalletOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.createWalletRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for getVtxo without sending the request */ async getVtxoRequestOpts(requestParameters: GetVtxoRequest): Promise { if (requestParameters['id'] == null) { throw new runtime.RequiredError( 'id', 'Required parameter "id" was null or undefined when calling getVtxo().' ); } 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/wallet/vtxos/{id}`; urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns detail for a single VTXO. To get the hex-encoded serialization use `GET /vtxos/{id}/encoded`. * Get VTXO detail */ async getVtxoRaw(requestParameters: GetVtxoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.getVtxoRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => WalletVtxoInfoFromJSON(jsonValue)); } /** * Returns detail for a single VTXO. To get the hex-encoded serialization use `GET /vtxos/{id}/encoded`. * Get VTXO detail */ async getVtxo(requestParameters: GetVtxoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getVtxoRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for getVtxoEncoded without sending the request */ async getVtxoEncodedRequestOpts(requestParameters: GetVtxoEncodedRequest): Promise { if (requestParameters['id'] == null) { throw new runtime.RequiredError( 'id', 'Required parameter "id" was null or undefined when calling getVtxoEncoded().' ); } 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/wallet/vtxos/{id}/encoded`; urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns the hex-encoded serialization of a VTXO. The `encoded` field can be passed to `POST /wallet/import-vtxo` to re-import this VTXO. * Get encoded VTXO */ async getVtxoEncodedRaw(requestParameters: GetVtxoEncodedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.getVtxoEncodedRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EncodedVtxoResponseFromJSON(jsonValue)); } /** * Returns the hex-encoded serialization of a VTXO. The `encoded` field can be passed to `POST /wallet/import-vtxo` to re-import this VTXO. * Get encoded VTXO */ async getVtxoEncoded(requestParameters: GetVtxoEncodedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getVtxoEncodedRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for history without sending the request * @deprecated */ async historyRequestOpts(): 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/wallet/history`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Deprecated: use `GET /api/v1/history` instead. * Get wallet history (deprecated) * @deprecated */ async historyRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const requestOptions = await this.historyRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MovementFromJSON)); } /** * Deprecated: use `GET /api/v1/history` instead. * Get wallet history (deprecated) * @deprecated */ async history(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.historyRaw(initOverrides); return await response.value(); } /** * Creates request options for importVtxo without sending the request */ async importVtxoRequestOpts(requestParameters: ImportVtxoOperationRequest): Promise { if (requestParameters['importVtxoRequest'] == null) { throw new runtime.RequiredError( 'importVtxoRequest', 'Required parameter "importVtxoRequest" was null or undefined when calling importVtxo().' ); } 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/wallet/import-vtxo`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ImportVtxoRequestToJSON(requestParameters['importVtxoRequest']), }; } /** * Imports hex-encoded serialized VTXOs into the wallet. Validates that each VTXO is anchored on-chain, owned by this wallet, and has not expired. Useful for restoring VTXOs after database loss or re-importing from the server mailbox. The operation is idempotent. * Import a VTXO */ async importVtxoRaw(requestParameters: ImportVtxoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const requestOptions = await this.importVtxoRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletVtxoInfoFromJSON)); } /** * Imports hex-encoded serialized VTXOs into the wallet. Validates that each VTXO is anchored on-chain, owned by this wallet, and has not expired. Useful for restoring VTXOs after database loss or re-importing from the server mailbox. The operation is idempotent. * Import a VTXO */ async importVtxo(requestParameters: ImportVtxoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.importVtxoRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for mnemonic without sending the request */ async mnemonicRequestOpts(): 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/wallet/mnemonic`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns the BIP-39 mnemonic phrase backing the wallet. Returns 404 when mnemonic exposure is disabled. Exposure is off by default; the endpoint returns 404 unless barkd is started with the `--expose-mnemonic` flag. * Get wallet mnemonic */ async mnemonicRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.mnemonicRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => MnemonicResponseFromJSON(jsonValue)); } /** * Returns the BIP-39 mnemonic phrase backing the wallet. Returns 404 when mnemonic exposure is disabled. Exposure is off by default; the endpoint returns 404 unless barkd is started with the `--expose-mnemonic` flag. * Get wallet mnemonic */ async mnemonic(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.mnemonicRaw(initOverrides); return await response.value(); } /** * Creates request options for movements without sending the request * @deprecated */ async movementsRequestOpts(): 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/wallet/movements`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Deprecated: Use history instead * List movements (deprecated) * @deprecated */ async movementsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const requestOptions = await this.movementsRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MovementFromJSON)); } /** * Deprecated: Use history instead * List movements (deprecated) * @deprecated */ async movements(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.movementsRaw(initOverrides); return await response.value(); } /** * Creates request options for nextRound without sending the request */ async nextRoundRequestOpts(): 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/wallet/next-round`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Queries the Ark server for the next scheduled round start time and returns it in RFC 3339 format. * Get next round time */ async nextRoundRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.nextRoundRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => NextRoundStartFromJSON(jsonValue)); } /** * Queries the Ark server for the next scheduled round start time and returns it in RFC 3339 format. * Get next round time */ async nextRound(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.nextRoundRaw(initOverrides); return await response.value(); } /** * Creates request options for offboardAll without sending the request */ async offboardAllRequestOpts(requestParameters: OffboardAllOperationRequest): Promise { if (requestParameters['offboardAllRequest'] == null) { throw new runtime.RequiredError( 'offboardAllRequest', 'Required parameter "offboardAllRequest" was null or undefined when calling offboardAll().' ); } 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/wallet/offboard/all`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: OffboardAllRequestToJSON(requestParameters['offboardAllRequest']), }; } /** * Cooperatively moves all spendable VTXOs off the Ark protocol to an on-chain address. Each VTXO is offboarded in full—partial amounts are not supported. The on-chain transaction fee is deducted from the total, and the remaining amount is sent to the destination. If no address is specified, the wallet generates a new on-chain address. To send a specific amount on-chain, use `send-onchain` instead. * Offboard all VTXOs */ async offboardAllRaw(requestParameters: OffboardAllOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.offboardAllRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => OffboardResultFromJSON(jsonValue)); } /** * Cooperatively moves all spendable VTXOs off the Ark protocol to an on-chain address. Each VTXO is offboarded in full—partial amounts are not supported. The on-chain transaction fee is deducted from the total, and the remaining amount is sent to the destination. If no address is specified, the wallet generates a new on-chain address. To send a specific amount on-chain, use `send-onchain` instead. * Offboard all VTXOs */ async offboardAll(requestParameters: OffboardAllOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.offboardAllRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for offboardVtxos without sending the request */ async offboardVtxosRequestOpts(requestParameters: OffboardVtxosOperationRequest): Promise { if (requestParameters['offboardVtxosRequest'] == null) { throw new runtime.RequiredError( 'offboardVtxosRequest', 'Required parameter "offboardVtxosRequest" was null or undefined when calling offboardVtxos().' ); } 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/wallet/offboard/vtxos`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: OffboardVtxosRequestToJSON(requestParameters['offboardVtxosRequest']), }; } /** * Cooperatively moves the specified VTXOs off the Ark protocol to an on-chain address. Each VTXO is offboarded in full—partial amounts are not supported. The on-chain transaction fee is deducted from the total, and the remaining amount is sent to the destination. If no address is specified, the wallet generates a new on-chain address. To send a specific amount on-chain, use `send-onchain` instead. * Offboard specific VTXOs */ async offboardVtxosRaw(requestParameters: OffboardVtxosOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.offboardVtxosRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => OffboardResultFromJSON(jsonValue)); } /** * Cooperatively moves the specified VTXOs off the Ark protocol to an on-chain address. Each VTXO is offboarded in full—partial amounts are not supported. The on-chain transaction fee is deducted from the total, and the remaining amount is sent to the destination. If no address is specified, the wallet generates a new on-chain address. To send a specific amount on-chain, use `send-onchain` instead. * Offboard specific VTXOs */ async offboardVtxos(requestParameters: OffboardVtxosOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.offboardVtxosRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for peekAddress without sending the request */ async peekAddressRequestOpts(requestParameters: PeekAddressRequest): Promise { if (requestParameters['index'] == null) { throw new runtime.RequiredError( 'index', 'Required parameter "index" was null or undefined when calling peekAddress().' ); } 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/wallet/addresses/index/{index}`; urlPath = urlPath.replace(`{${"index"}}`, encodeURIComponent(String(requestParameters['index']))); return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns a previously generated Ark address by its derivation index. Only addresses that have already been generated are available. * Get Ark address by index */ async peekAddressRaw(requestParameters: PeekAddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.peekAddressRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ArkAddressResponseFromJSON(jsonValue)); } /** * Returns a previously generated Ark address by its derivation index. Only addresses that have already been generated are available. * Get Ark address by index */ async peekAddress(requestParameters: PeekAddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.peekAddressRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for pendingRounds without sending the request */ async pendingRoundsRequestOpts(): 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/wallet/rounds`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns all active round participations and their current status. A round participation is created when you call one of the `refresh` endpoints and persists until the round\'s funding transaction is confirmed on-chain (2 confirmations on mainnet, 1 on testnet). The list can contain multiple entries—for example, a previous round awaiting on-chain confirmation alongside a newly submitted round waiting for the next server round to start. Confirmed and failed rounds are removed automatically by the background daemon. * List round participations */ async pendingRoundsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const requestOptions = await this.pendingRoundsRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PendingRoundInfoFromJSON)); } /** * Returns all active round participations and their current status. A round participation is created when you call one of the `refresh` endpoints and persists until the round\'s funding transaction is confirmed on-chain (2 confirmations on mainnet, 1 on testnet). The list can contain multiple entries—for example, a previous round awaiting on-chain confirmation alongside a newly submitted round waiting for the next server round to start. Confirmed and failed rounds are removed automatically by the background daemon. * List round participations */ async pendingRounds(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.pendingRoundsRaw(initOverrides); return await response.value(); } /** * Creates request options for refreshAll without sending the request */ async refreshAllRequestOpts(): 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/wallet/refresh/all`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }; } /** * Registers all spendable VTXOs for refresh in the next Ark round. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry. The background daemon automatically participates in the round and progresses it to completion. Use the `rounds` endpoint to track progress. * Refresh all VTXOs */ async refreshAllRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.refreshAllRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PendingRoundInfoFromJSON(jsonValue)); } /** * Registers all spendable VTXOs for refresh in the next Ark round. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry. The background daemon automatically participates in the round and progresses it to completion. Use the `rounds` endpoint to track progress. * Refresh all VTXOs */ async refreshAll(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.refreshAllRaw(initOverrides); return await response.value(); } /** * Creates request options for refreshCounterparty without sending the request */ async refreshCounterpartyRequestOpts(): 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/wallet/refresh/counterparty`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }; } /** * Registers all out-of-round VTXOs held by the wallet for refresh in the next Ark round. Refreshing replaces out-of-round VTXOs under arkoor trust assumptions with trustless, in-round VTXOs. Out-of-round VTXOs whose entire transaction chain originates from your own in-round VTXOs are excluded. The background daemon automatically participates in the round and progresses it to completion. Use the `rounds` endpoint to track progress. * Refresh received VTXOs */ async refreshCounterpartyRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.refreshCounterpartyRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PendingRoundInfoFromJSON(jsonValue)); } /** * Registers all out-of-round VTXOs held by the wallet for refresh in the next Ark round. Refreshing replaces out-of-round VTXOs under arkoor trust assumptions with trustless, in-round VTXOs. Out-of-round VTXOs whose entire transaction chain originates from your own in-round VTXOs are excluded. The background daemon automatically participates in the round and progresses it to completion. Use the `rounds` endpoint to track progress. * Refresh received VTXOs */ async refreshCounterparty(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.refreshCounterpartyRaw(initOverrides); return await response.value(); } /** * Creates request options for refreshDelegated without sending the request */ async refreshDelegatedRequestOpts(requestParameters: RefreshDelegatedRequest): Promise { if (requestParameters['delegatedRefreshRequest'] == null) { throw new runtime.RequiredError( 'delegatedRefreshRequest', 'Required parameter "delegatedRefreshRequest" was null or undefined when calling refreshDelegated().' ); } 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/wallet/refresh/delegated/vtxos`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: DelegatedRefreshRequestToJSON(requestParameters['delegatedRefreshRequest']), }; } /** * Registers the specified VTXOs for refresh as a delegated participation: the wallet hands the server a signed participation and the server carries it through the round, so the wallet doesn\'t need to follow the round interactively. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry. Set `height` to schedule the refresh for a future block height: the refresh fee is priced at that height and the server includes the participation in the first round once the chain tip reaches it. When `height` is omitted, the participation is eligible for the next round. Use the `rounds` endpoint to track progress. * Refresh VTXOs in delegated mode */ async refreshDelegatedRaw(requestParameters: RefreshDelegatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.refreshDelegatedRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PendingRoundInfoFromJSON(jsonValue)); } /** * Registers the specified VTXOs for refresh as a delegated participation: the wallet hands the server a signed participation and the server carries it through the round, so the wallet doesn\'t need to follow the round interactively. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry. Set `height` to schedule the refresh for a future block height: the refresh fee is priced at that height and the server includes the participation in the first round once the chain tip reaches it. When `height` is omitted, the participation is eligible for the next round. Use the `rounds` endpoint to track progress. * Refresh VTXOs in delegated mode */ async refreshDelegated(requestParameters: RefreshDelegatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.refreshDelegatedRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for refreshVtxos without sending the request */ async refreshVtxosRequestOpts(requestParameters: RefreshVtxosRequest): Promise { if (requestParameters['refreshRequest'] == null) { throw new runtime.RequiredError( 'refreshRequest', 'Required parameter "refreshRequest" was null or undefined when calling refreshVtxos().' ); } 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/wallet/refresh/vtxos`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: RefreshRequestToJSON(requestParameters['refreshRequest']), }; } /** * Registers the specified VTXOs for refresh in the next Ark round. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry. The background daemon automatically participates in the round and progresses it to completion. Use the `rounds` endpoint to track progress. * Refresh specific VTXOs */ async refreshVtxosRaw(requestParameters: RefreshVtxosRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.refreshVtxosRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PendingRoundInfoFromJSON(jsonValue)); } /** * Registers the specified VTXOs for refresh in the next Ark round. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry. The background daemon automatically participates in the round and progresses it to completion. Use the `rounds` endpoint to track progress. * Refresh specific VTXOs */ async refreshVtxos(requestParameters: RefreshVtxosRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.refreshVtxosRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for send without sending the request */ async sendRequestOpts(requestParameters: SendOperationRequest): Promise { if (requestParameters['sendRequest'] == null) { throw new runtime.RequiredError( 'sendRequest', 'Required parameter "sendRequest" was null or undefined when calling send().' ); } 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/wallet/send`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: SendRequestToJSON(requestParameters['sendRequest']), }; } /** * Sends an Ark or Lightning payment to the specified destination. Accepts an Ark address, BOLT11 invoice, BOLT12 offer, or Lightning address. Ark address payments are settled instantly via an out-of-round (arkoor) transaction. The `amount_sat` field is required for Ark addresses and Lightning addresses but optional for invoices and offers that already encode an amount. Comments are only supported for Lightning addresses. To send to an on-chain bitcoin address, use `send-onchain` instead. * Send a payment */ async sendRaw(requestParameters: SendOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.sendRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => SendResponseFromJSON(jsonValue)); } /** * Sends an Ark or Lightning payment to the specified destination. Accepts an Ark address, BOLT11 invoice, BOLT12 offer, or Lightning address. Ark address payments are settled instantly via an out-of-round (arkoor) transaction. The `amount_sat` field is required for Ark addresses and Lightning addresses but optional for invoices and offers that already encode an amount. Comments are only supported for Lightning addresses. To send to an on-chain bitcoin address, use `send-onchain` instead. * Send a payment */ async send(requestParameters: SendOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.sendRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for sendOnchain without sending the request */ async sendOnchainRequestOpts(requestParameters: SendOnchainOperationRequest): Promise { if (requestParameters['sendOnchainRequest'] == null) { throw new runtime.RequiredError( 'sendOnchainRequest', 'Required parameter "sendOnchainRequest" was null or undefined when calling sendOnchain().' ); } 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/wallet/send-onchain`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: SendOnchainRequestToJSON(requestParameters['sendOnchainRequest']), }; } /** * Sends the specified amount to an on-chain address using the wallet\'s off-chain Ark balance. The on-chain transaction fee is paid on top of the specified amount. Internally creates an out-of-round transaction to consolidate VTXOs into the exact amount needed, then cooperatively sends the on-chain payment via the Ark server. To offboard entire VTXOs without specifying an amount, use `offboard/vtxos` or `offboard/all` instead. * Send on-chain from Ark balance */ async sendOnchainRaw(requestParameters: SendOnchainOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.sendOnchainRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => OffboardResultFromJSON(jsonValue)); } /** * Sends the specified amount to an on-chain address using the wallet\'s off-chain Ark balance. The on-chain transaction fee is paid on top of the specified amount. Internally creates an out-of-round transaction to consolidate VTXOs into the exact amount needed, then cooperatively sends the on-chain payment via the Ark server. To offboard entire VTXOs without specifying an amount, use `offboard/vtxos` or `offboard/all` instead. * Send on-chain from Ark balance */ async sendOnchain(requestParameters: SendOnchainOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.sendOnchainRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for sync without sending the request */ async syncRequestOpts(): 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/wallet/sync`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }; } /** * Triggers an immediate sync of the wallet\'s off-chain state. Updates on-chain fee rates, processes incoming arkoor payments, resolves outgoing and incoming Lightning payments, and progresses pending rounds and boards toward confirmation. The background daemon already runs these operations automatically (e.g., Lightning every second, mailbox and boards every 30 seconds), but calling `sync` forces all of them to run immediately. * Sync wallet */ async syncRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.syncRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.VoidApiResponse(response); } /** * Triggers an immediate sync of the wallet\'s off-chain state. Updates on-chain fee rates, processes incoming arkoor payments, resolves outgoing and incoming Lightning payments, and progresses pending rounds and boards toward confirmation. The background daemon already runs these operations automatically (e.g., Lightning every second, mailbox and boards every 30 seconds), but calling `sync` forces all of them to run immediately. * Sync wallet */ async sync(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.syncRaw(initOverrides); } /** * Creates request options for syncMailbox without sending the request */ async syncMailboxRequestOpts(): 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/wallet/sync/mailbox`; return { path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }; } /** * Triggers an immediate mailbox sync without running any of the other off-chain sync steps. Fetches any pending mailbox messages from the Ark server, processes them (incoming arkoor payments, lightning receive notifications), and returns the new mailbox checkpoint (tip). Useful in `daemon_manual_sync` mode where background mailbox subscription is disabled and the operator needs a granular way to pull incoming events. * Sync mailbox only */ async syncMailboxRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.syncMailboxRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => MailboxSyncResponseFromJSON(jsonValue)); } /** * Triggers an immediate mailbox sync without running any of the other off-chain sync steps. Fetches any pending mailbox messages from the Ark server, processes them (incoming arkoor payments, lightning receive notifications), and returns the new mailbox checkpoint (tip). Useful in `daemon_manual_sync` mode where background mailbox subscription is disabled and the operator needs a granular way to pull incoming events. * Sync mailbox only */ async syncMailbox(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.syncMailboxRaw(initOverrides); return await response.value(); } /** * Creates request options for vtxos without sending the request */ async vtxosRequestOpts(requestParameters: VtxosRequest): Promise { const queryParameters: any = {}; if (requestParameters['all'] != null) { queryParameters['all'] = requestParameters['all']; } 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/wallet/vtxos`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** * Returns VTXOs held by the wallet, including their state and expiry information. By default returns only non-spent VTXOs. Set `all=true` to include all VTXOs regardless of state. * List VTXOs */ async vtxosRaw(requestParameters: VtxosRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const requestOptions = await this.vtxosRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletVtxoInfoFromJSON)); } /** * Returns VTXOs held by the wallet, including their state and expiry information. By default returns only non-spent VTXOs. Set `all=true` to include all VTXOs regardless of state. * List VTXOs */ async vtxos(requestParameters: VtxosRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.vtxosRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for walletDelete without sending the request */ async walletDeleteRequestOpts(requestParameters: WalletDeleteOperationRequest): Promise { if (requestParameters['walletDeleteRequest'] == null) { throw new runtime.RequiredError( 'walletDeleteRequest', 'Required parameter "walletDeleteRequest" was null or undefined when calling walletDelete().' ); } 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/wallet`; return { path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, body: WalletDeleteRequestToJSON(requestParameters['walletDeleteRequest']), }; } /** */ async walletDeleteRaw(requestParameters: WalletDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.walletDeleteRequestOpts(requestParameters); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => WalletDeleteResponseFromJSON(jsonValue)); } /** */ async walletDelete(requestParameters: WalletDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.walletDeleteRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates request options for walletExists without sending the request */ async walletExistsRequestOpts(): 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/wallet`; return { path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }; } /** */ async walletExistsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const requestOptions = await this.walletExistsRequestOpts(); const response = await this.request(requestOptions, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => WalletExistsResponseFromJSON(jsonValue)); } /** */ async walletExists(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.walletExistsRaw(initOverrides); return await response.value(); } }