aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/bitcoinSync.ts
blob: 92d3382bbe5572e86f31f8c23a9e7f0f38e43a2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { post } from "$lib/utils";

let syncing = false;

export const syncBitcoinVault = async (aid: string) => {
  if (syncing) return;
  syncing = true;
  try {
    return await post("/api/bitcoin/sync", { aid });
  } finally {
    syncing = false;
  }
};