From 7b4607223540ca415c8c3bda40fac96598504a03 Mon Sep 17 00:00:00 2001 From: NostrDev Date: Thu, 19 Dec 2024 12:03:19 +0100 Subject: [PATCH] Implements Address/Utxo Endpoint (#10) * fix: adds a utxo route * fix: implemenets esplora txs endpoint * fix: upgrades mempool_api docker version --- backend/src/api/bitcoin/bitcoin.routes.ts | 1 + backend/src/api/bitcoin/esplora-api.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/api/bitcoin/bitcoin.routes.ts b/backend/src/api/bitcoin/bitcoin.routes.ts index 8cdec883d9..4fb8918b7a 100644 --- a/backend/src/api/bitcoin/bitcoin.routes.ts +++ b/backend/src/api/bitcoin/bitcoin.routes.ts @@ -34,6 +34,7 @@ class BitcoinRoutes { .get(config.MEMPOOL.API_URL_PREFIX + 'init-data', this.getInitData) .get(config.MEMPOOL.API_URL_PREFIX + 'validate-address/:address', this.validateAddress) .get(config.MEMPOOL.API_URL_PREFIX + 'address/:address', this.getAddress) + .get(config.MEMPOOL.API_URL_PREFIX + 'address/:address/txs', this.getAddressTransactions) .get(config.MEMPOOL.API_URL_PREFIX + 'block-height/:height', this.getBlockHeight) .get(config.MEMPOOL.API_URL_PREFIX + 'tx/:txId/rbf', this.getRbfHistory) .get(config.MEMPOOL.API_URL_PREFIX + 'tx/:txId/cached', this.getCachedTx) diff --git a/backend/src/api/bitcoin/esplora-api.ts b/backend/src/api/bitcoin/esplora-api.ts index 9a4b7706a6..91752e99d4 100644 --- a/backend/src/api/bitcoin/esplora-api.ts +++ b/backend/src/api/bitcoin/esplora-api.ts @@ -309,7 +309,7 @@ class ElectrsApi implements AbstractBitcoinApi { } $getAddressTransactions(address: string, txId?: string): Promise { - throw new Error('Method getAddressTransactions not implemented.'); + return this.failoverRouter.$get('/address/' + address + '/txs'); } $getScriptHash(scripthash: string): Promise {