![barkd](https://gitlab.com/ark-bitcoin/barkd-clients/-/raw/master/assets/barkd-header-white.jpg)

# @secondts/barkd

Auto-generated TypeScript/JavaScript client for the **barkd REST API**, built from its OpenAPI specification.

## Installation

```bash
npm install @secondts/barkd
```

## Usage

```typescript
import { Configuration, WalletApi } from "@secondts/barkd";

const config = new Configuration({
  basePath: "http://localhost:3535",
});

const wallet = new WalletApi(config);
const balance = await wallet.balance();
```

## API Endpoints

All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BitcoinApi* | **tip** | **GET** /api/v1/bitcoin/tip | Get bitcoin tip height
*BoardsApi* | **boardAll** | **POST** /api/v1/boards/board-all | Board all on-chain bitcoin
*BoardsApi* | **boardAmount** | **POST** /api/v1/boards/board-amount | Board a specific amount
*BoardsApi* | **getPendingBoards** | **GET** /api/v1/boards/pending | List pending boards
*DefaultApi* | **ping** | **GET** /ping | Ping
*ExitsApi* | **exitCancel** | **POST** /api/v1/exits/cancel/{vtxo_id} | Cancel an exit
*ExitsApi* | **exitClaimAll** | **POST** /api/v1/exits/claim/all | Claim all exited VTXOs
*ExitsApi* | **exitClaimVtxos** | **POST** /api/v1/exits/claim/vtxos | Claim specific exited VTXOs
*ExitsApi* | **exitProgress** | **POST** /api/v1/exits/progress | Progress exits
*ExitsApi* | **exitStartAll** | **POST** /api/v1/exits/start/all | Start exit for all VTXOs
*ExitsApi* | **exitStartVtxos** | **POST** /api/v1/exits/start/vtxos | Start exit for specific VTXOs
*ExitsApi* | **getAllExitStatus** | **GET** /api/v1/exits/status/all | List all exit statuses
*ExitsApi* | **getAllExitStatusDeprecated** | **GET** /api/v1/exits/status | List all exit statuses (deprecated)
*ExitsApi* | **getExitStatusByVtxoId** | **GET** /api/v1/exits/status/vtxo/{vtxo_id} | Get VTXO exit status
*ExitsApi* | **getExitStatusByVtxoIdDeprecated** | **GET** /api/v1/exits/status/{vtxo_id} | Get exit status (deprecated)
*ExitsApi* | **getFinishedExits** | **GET** /api/v1/exits/status/finished | List finished exits
*ExitsApi* | **getLiveExitStatus** | **GET** /api/v1/exits/status/live | List live exit statuses
*FeesApi* | **boardFee** | **GET** /api/v1/fees/board | Estimate board fee
*FeesApi* | **lightningReceiveFee** | **GET** /api/v1/fees/lightning/receive | Estimate Lightning receive fee
*FeesApi* | **lightningSendFee** | **GET** /api/v1/fees/lightning/pay | Estimate Lightning send fee
*FeesApi* | **offboardAllFee** | **GET** /api/v1/fees/offboard-all | Estimate offboard-all fee
*FeesApi* | **offboardFee** | **POST** /api/v1/fees/offboard | Estimate offboard fee
*FeesApi* | **onchainFeeRates** | **GET** /api/v1/fees/onchain | Get on-chain fee rates
*FeesApi* | **sendOnchainFee** | **GET** /api/v1/fees/send-onchain | Estimate send-onchain fee
*HistoryApi* | **list** | **GET** /api/v1/history | Get wallet history
*HistoryApi* | **updateMetadata** | **POST** /api/v1/history/{id}/metadata | Patch movement metadata
*LightningApi* | **cancelReceive** | **DELETE** /api/v1/lightning/receives/{identifier} | Cancel a pending receive
*LightningApi* | **generateInvoice** | **POST** /api/v1/lightning/receives/invoice | Create a BOLT11 invoice
*LightningApi* | **generateInvoiceForAddress** | **POST** /api/v1/lightning/receives/invoice/for-address | Create a BOLT11 invoice for an Ark address
*LightningApi* | **getReceiveStatus** | **GET** /api/v1/lightning/receives/{identifier} | Get receive status
*LightningApi* | **listReceiveStatuses** | **GET** /api/v1/lightning/receives | List all pending receive statuses
*LightningApi* | **pay** | **POST** /api/v1/lightning/pay | Send a Lightning payment
*NotificationsApi* | **waitNotification** | **GET** /api/v1/notifications/wait | Long-poll for wallet notifications
*NotificationsApi* | **websocketTicket** | **GET** /api/v1/notifications/ws/ticket | Create a websocket ticket
*OnchainApi* | **onchainAddress** | **POST** /api/v1/onchain/addresses/next | Generate on-chain address
*OnchainApi* | **onchainBalance** | **GET** /api/v1/onchain/balance | Get on-chain balance
*OnchainApi* | **onchainDrain** | **POST** /api/v1/onchain/drain | Drain on-chain wallet
*OnchainApi* | **onchainSend** | **POST** /api/v1/onchain/send | Send on-chain payment
*OnchainApi* | **onchainSendMany** | **POST** /api/v1/onchain/send-many | Send to multiple addresses
*OnchainApi* | **onchainSync** | **POST** /api/v1/onchain/sync | Sync on-chain wallet
*OnchainApi* | **onchainTransactions** | **GET** /api/v1/onchain/transactions | List on-chain transactions
*OnchainApi* | **onchainUtxos** | **GET** /api/v1/onchain/utxos | List on-chain UTXOs
*WalletApi* | **address** | **POST** /api/v1/wallet/addresses/next | Generate Ark address
*WalletApi* | **arkInfo** | **GET** /api/v1/wallet/ark-info | Get Ark server info
*WalletApi* | **balance** | **GET** /api/v1/wallet/balance | Get wallet balance
*WalletApi* | **bip321Uri** | **POST** /api/v1/wallet/bip321 | Build a BIP 321 payment URI
*WalletApi* | **connected** | **GET** /api/v1/wallet/connected | Check server connection
*WalletApi* | **createWallet** | **POST** /api/v1/wallet/create | Create a wallet
*WalletApi* | **getVtxo** | **GET** /api/v1/wallet/vtxos/{id} | Get VTXO detail
*WalletApi* | **getVtxoEncoded** | **GET** /api/v1/wallet/vtxos/{id}/encoded | Get encoded VTXO
*WalletApi* | **history** | **GET** /api/v1/wallet/history | Get wallet history (deprecated)
*WalletApi* | **importVtxo** | **POST** /api/v1/wallet/import-vtxo | Import a VTXO
*WalletApi* | **mnemonic** | **GET** /api/v1/wallet/mnemonic | Get wallet mnemonic
*WalletApi* | **movements** | **GET** /api/v1/wallet/movements | List movements (deprecated)
*WalletApi* | **nextRound** | **GET** /api/v1/wallet/next-round | Get next round time
*WalletApi* | **offboardAll** | **POST** /api/v1/wallet/offboard/all | Offboard all VTXOs
*WalletApi* | **offboardVtxos** | **POST** /api/v1/wallet/offboard/vtxos | Offboard specific VTXOs
*WalletApi* | **peekAddress** | **GET** /api/v1/wallet/addresses/index/{index} | Get Ark address by index
*WalletApi* | **pendingRounds** | **GET** /api/v1/wallet/rounds | List round participations
*WalletApi* | **refreshAll** | **POST** /api/v1/wallet/refresh/all | Refresh all VTXOs
*WalletApi* | **refreshCounterparty** | **POST** /api/v1/wallet/refresh/counterparty | Refresh received VTXOs
*WalletApi* | **refreshDelegated** | **POST** /api/v1/wallet/refresh/delegated/vtxos | Refresh VTXOs in delegated mode
*WalletApi* | **refreshVtxos** | **POST** /api/v1/wallet/refresh/vtxos | Refresh specific VTXOs
*WalletApi* | **send** | **POST** /api/v1/wallet/send | Send a payment
*WalletApi* | **sendOnchain** | **POST** /api/v1/wallet/send-onchain | Send on-chain from Ark balance
*WalletApi* | **sync** | **POST** /api/v1/wallet/sync | Sync wallet
*WalletApi* | **syncMailbox** | **POST** /api/v1/wallet/sync/mailbox | Sync mailbox only
*WalletApi* | **vtxos** | **GET** /api/v1/wallet/vtxos | List VTXOs
*WalletApi* | **walletDelete** | **DELETE** /api/v1/wallet | 
*WalletApi* | **walletExists** | **GET** /api/v1/wallet | 


## License

Released under the **MIT** license.
