# @samooth/explorer

> Bitcoin Explorer API Wrapper

Latest version **0.4.0** (published 2026-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @samooth/explorer
pnpm add @samooth/explorer
yarn add @samooth/explorer
bun add @samooth/explorer
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2026-11-28 |
| First published | 2023-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 6 |
| Unpacked size | 3.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tomás Díaz @samooth |
| Maintainers | samooth |
| Keywords | Bitcoin, BSV, Blockchain, Bitcoin SV |

## Links

- npm: https://www.npmjs.com/package/@samooth/explorer
- Repository: https://github.com/samooth/explorer
- Homepage: http://github.com/samooth/explorer
- Issues: https://github.com/samooth/explorer/issues
- npm.io page: https://npm.io/package/@samooth/explorer

## Dependencies (6)

- [bsv2](https://npm.io/package/bsv2.md) ^2.5.1
- [xior](https://npm.io/package/xior.md) ^0.8.5
- [buffer](https://npm.io/package/buffer.md) ^6.0.3
- [tiny-lru](https://npm.io/package/tiny-lru.md) ^13.1.1
- [bsv-minimal](https://npm.io/package/bsv-minimal.md) ^3.0.1
- [bitcoinjs-lib](https://npm.io/package/bitcoinjs-lib.md) ^7.0.5

## Recent versions

- 0.4.0 (latest) — 2026-11-28
- 0.3.15 — 2026-11-27
- 0.3.14 — 2025-10-07
- 0.3.13 — 2025-10-07
- 0.3.11 — 2025-10-07
- 0.3.10 — 2025-10-07
- 0.3.9 — 2025-10-07
- 0.3.8 — 2025-05-09
- 0.3.7 — 2025-05-09
- 0.3.6 — 2025-05-09
- 0.3.5 — 2025-05-09
- 0.3.4 — 2025-05-09
- 0.3.3 — 2025-04-06
- 0.3.2 — 2025-04-06
- 0.3.1 — 2025-02-25
- … 11 more at https://npm.io/package/@samooth/explorer/versions

## README

# Explorer JS Wrapper library for Bitcoin SV

## Usage

```
const Explorer = require("@samooth/explorer")

const explorer = new Explorer("main")

```

or

```
import Explorer from "@samooth/explorer"

const explorer = new Explorer("main")

```

#### Endpoints

Currently there are 4 endpoints ( whatsonchain, bitails, electrumx, bsvdirect ) but extra endpoints can be added.

```javascript
let explorer = new Explorer("main")

explorer.endpoints.push( myAPI: {
        main: "https://my.api.tld/",
        test: "https://my.api.tld/",
        headerKey: 'my-api-key'
    })

explorer.api='myAPI'
```

#### Methods

  - status()

  - chainInfo()

  - blockHash()

  - blockHeight()

  - blockList ( height, limit )

  - blockLatest ( hash )

  - blockTransactions ( hash )

  - txHash ( hash )

  - downloadTx ( hash )
  
  - downloadTxOut ( hash, index )

  - broadcast( txhex )

  - broadcastBinary ( txBuf)

  - getOutputData ( hash, outputIndex )

  - getOutputsData ( hash, fromIndex, toIndex ) 

  - merkleProof ( hash )

  - mempoolInfo ()

  - mempoolTxs ()

  - addressInfo ( address )

  - balance ( address )

  - history ( address )

  - utxos ( address )

  - detailScriptHash ( scriptHash )

  - balanceScriptHash ( scriptHash )

  - historyByScriptHash ( scriptHash )

  - utxosByScriptHash ( scriptHash )

  - search ( text )

## Install

---

```javascript
npm install @samooth/explorer
```

## Sample Usage

```javascript
const Explorer = require('@samooth/explorer')

let woc = new Explorer("main", { api: "woc" });
woc.status().then((status) => console.log("woc status:", status))

woc.blockLatest(10)
.then((blk)=>console.log("woc latest:",blk))

woc.blockList("000000000000000005bf29a3bff05d1cbf120d052bdbea6d6b8643eefd44be83")
.then((blk)=>console.log("woc blk list:",blk))


let bitails = new Explorer("main", { api: "bitails" });
bitails.status().then((status) => console.log("bitails status:", status))




```


## Documentation


This library helps manage the following APIs:

[Taal](https://docs.taal.com/core-products/whatsonchain)

[Bitails](https://docs.bitails.io/)


## History

### 0.3.0
 - Upgrade to bsv2
 - Support for multiple endpoints
 - Support for binary broadcast


### 0.2.0
- Support Cache, default is true. if you don't want cache, set option `{ enableCache: false }`
- Support ApiKey and rate limit to 3 requests/sec without apiKey.
```
  // with apiKey
  const explorer = new Explorer( 'testnet', { apiKey: 'your api key'}  )
```
```
  // without apiKey
  const explorer = new Explorer( 'testnet' )
```
- Support JSDoc type check.

### 0.1.0
- Initate, Support all API in document.

# License

It is released under the terms of the Open BSV license.

---
_Source: https://npm.io/package/@samooth/explorer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
