Wallet check and wallet delete

In bark-0.1.0-beta.6 version we release a new endpoint for barkd: wallet/create.

This is great because I don't need to create a workaround that calls bark create CLI command via a proxy endpoint.

At the moment I still have 2 workarounds:

  1. Proxy endpoint to check if wallet exists GET /api/v1/wallet
const { stdout } = await execAsync('docker exec bark find /root/.bark -type f 2>/dev/null | head -n 1')

const exists = stdout.trim().length > 0
  1. Proxy endpoint to delete a wallet DELETE /api/v1/wallet
await execAsync('docker exec bark find /root/.bark -mindepth 1 -delete')

Reference: https://gitlab.com/ark-bitcoin/labs/bark-web/-/blob/feat/dashboard/proxy/index.ts?ref_type=heads

Having barkd APIs for these would be great! I could then remove the proxy entirely. I propose:

  1. Check wallet: GET /api/v1/wallet
  2. Delete wallet: DELETE /api/v1/wallet

CC: @ErikDeSmedt @acidbunny21

Edited by psycarlo