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.
Provider
dcrdata
- decred
- Chains
- 1
- Auth
- none
- Operations
- 4 of 10
served 4 / 10
Operations
- balance
getBalanceserved - history
getTxHistoryserved - tx detail
getTxDetailserved - utxos
getUtxosabsent - pubkey
getPubkeyabsent - contract
getContractInfoabsent - tokens
getTokenBalancesabsent - transfers
getTokenTransfersabsent - gas
getGasDataabsent - block
getBlockInfoserved
Access
- Create
create("dcrdata") - Import
@agntn/explorers/providers/dcrdata - Host
explorer.dcrdata.org/insight/api - Statusproviders on the docs worker
Address it
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.
balanceSatand friends come as integers and stay integers. balance,fundedandspentare confirmed. The signed mempool delta goes tounconfirmed, so a pending payment never shows up as money you can spend.- History pages with
fromandto, up to 250 rows a page, andstartBlockandendBlockthrow 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. confirmationsdecides the status: 0 ispendingwith block number 0, below zero isfailed. Coinbase and treasurybase transactions get fee"0", everything else the fee Insight quotes or none.- Blocks come back with an empty
minerand gas fields of"0", like every other chain without gas. The block's transaction count is the length of itstxlist. - 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.