Skip to content

Commit

Permalink
fix: update btc balance api url and zod schema
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Nov 28, 2024
1 parent 1a71396 commit 851d250
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/query/src/bitcoin/balance/btc-blockbook-utxos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { BitcoinNetwork } from '@leather.io/models';

// E.g.
// mainnet/wpkh(xpub6CxzM41aUbKigFCifZxs9wkX37SMm5qRFqYjk1VdUZtwK3a5YoNnqZuNe29xycKLLThEEXDaKLLhke2Kwi2xKhrj14mwCCyzBGChGcaJH9L)
const balanceApi = 'https://leather-bitcoin-balances.kyran-093.workers.dev/{network}/{descriptor}';
const balanceApi = 'https://leather-bitcoin-balances.wallet-6d1.workers.dev/{network}/{descriptor}';

function makeBalanceApiUrl(network: BitcoinNetwork, descriptor: string) {
return balanceApi.replace('{network}', network).replace('{descriptor}', descriptor);
}

const utxoSchema = z.object({
address: z.string(),
confirmations: z.number(),
confirmations: z.number().optional(),
// Unconfirmed utxos appear in this response. Height omitted when unconfirmed.
height: z.number().optional(),
path: z.string(),
Expand Down

0 comments on commit 851d250

Please sign in to comment.