Providers

dcrdata

Decred through the Insight API of explorer.dcrdata.org. Balances with totals and the mempool delta. History and details and blocks. Atoms. No key.
IDdcrdata16 / 22keyless
Provider

dcrdata

  • decred
Chains
1
Auth
none
Operations
4 of 10
served 4 / 10

Operations

  • balancegetBalanceserved
  • historygetTxHistoryserved
  • tx detailgetTxDetailserved
  • utxosgetUtxosabsent
  • pubkeygetPubkeyabsent
  • contractgetContractInfoabsent
  • tokensgetTokenBalancesabsent
  • transfersgetTokenTransfersabsent
  • gasgetGasDataabsent
  • blockgetBlockInfoserved

Access

Createcreate("dcrdata")
Import@agntn/explorers/providers/dcrdata
Hostexplorer.dcrdata.org/insight/api
Statusproviders on the docs worker

Address it

ts
import { Dcrdata } from "@agntn/explorers/providers/dcrdata";

const dcrdata = new Dcrdata(); // or create("dcrdata"), or { baseUrl: "https://my.dcrdata/insight/api" }
await dcrdata.getBalance("Ds…", "decred");
await dcrdata.getBlockInfo(1000, "decred");

One chain, no key. baseUrl is the Insight root and defaults to https://explorer.dcrdata.org/insight/api, so a dcrdata you run yourself works too. Any other chain is an UnsupportedChainError, and an address that isn't a Decred mainnet address fails before a request goes out.

What it reads

/addr/:address?noTxList=1 for the balance, /addrs/:address/txs?from=&to= for history, /tx/:hash for one transaction, /block/:height for a block. Balances, history, details and blocks; no tokens, contracts, gas or unspent outputs.

Gotchas

  • Atoms, eight decimals. Insight quotes DCR as floating point numbers, sometimes in scientific notation, and the provider converts the decimal spelling to atoms without ever multiplying a float. balanceSat and friends come as integers and stay integers.
  • balance, funded and spent are confirmed. The signed mempool delta goes to unconfirmed, so a pending payment never shows up as money you can spend.
  • History pages with from and to, up to 250 rows a page, and startBlock and endBlock throw because Insight has no block filter. sort: "asc" costs a second request: the provider reads the total first, then the window from the other end, and refuses the page if the total moved in between.
  • confirmations decides the status: 0 is pending with block number 0, below zero is failed. Coinbase and treasurybase transactions get fee "0", everything else the fee Insight quotes or none.
  • Blocks come back with an empty miner and gas fields of "0", like every other chain without gas. The block's transaction count is the length of its tx list.
  • The Explorer has no live feed for Decred and no block transaction list. The feed only wraps Blockscout, Mempool and the Arweave gateway, so search works and the hub says there's no tip.

Where it lives

src/providers/dcrdata.ts.