[{"data":1,"prerenderedAt":448},["ShallowReactive",2],{"navigation_docs":3,"-providers-dcrdata":124,"-providers-dcrdata-surround":443},[4,56,120],{"title":5,"path":6,"stem":7,"children":8,"icon":55},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39,43,47,51],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"CLI","\u002Fguide\u002Fcli","1.guide\u002F02.cli",{"title":16,"path":17,"stem":18},"Provider selection","\u002Fguide\u002Fselection","1.guide\u002F03.selection",{"title":20,"path":21,"stem":22},"Balances","\u002Fguide\u002Fbalances","1.guide\u002F04.balances",{"title":24,"path":25,"stem":26},"Transactions","\u002Fguide\u002Ftransactions","1.guide\u002F05.transactions",{"title":28,"path":29,"stem":30},"Tokens","\u002Fguide\u002Ftokens","1.guide\u002F06.tokens",{"title":32,"path":33,"stem":34},"Contracts","\u002Fguide\u002Fcontracts","1.guide\u002F07.contracts",{"title":36,"path":37,"stem":38},"Gas and blocks","\u002Fguide\u002Fgas-and-blocks","1.guide\u002F08.gas-and-blocks",{"title":40,"path":41,"stem":42},"Errors","\u002Fguide\u002Ferrors","1.guide\u002F09.errors",{"title":44,"path":45,"stem":46},"Agents","\u002Fguide\u002Fagents","1.guide\u002F10.agents",{"title":48,"path":49,"stem":50},"Custom providers","\u002Fguide\u002Fcustom","1.guide\u002F11.custom",{"title":52,"path":53,"stem":54},"Explorer","\u002Fguide\u002Fexplorer","1.guide\u002F12.explorer","i-lucide-book-open",{"title":57,"path":58,"stem":59,"children":60,"icon":119},"Providers","\u002Fproviders","2.providers\u002F0.index",[61,63,67,71,75,79,83,87,91,95,99,103,107,111,115],{"title":62,"path":58,"stem":59},"Overview",{"title":64,"path":65,"stem":66},"Etherscan","\u002Fproviders\u002Fetherscan","2.providers\u002F01.etherscan",{"title":68,"path":69,"stem":70},"Blockscout","\u002Fproviders\u002Fblockscout","2.providers\u002F02.blockscout",{"title":72,"path":73,"stem":74},"Blockchair","\u002Fproviders\u002Fblockchair","2.providers\u002F03.blockchair",{"title":76,"path":77,"stem":78},"Mempool","\u002Fproviders\u002Fmempool","2.providers\u002F04.mempool",{"title":80,"path":81,"stem":82},"Blockstream","\u002Fproviders\u002Fblockstream","2.providers\u002F05.blockstream",{"title":84,"path":85,"stem":86},"Solscan","\u002Fproviders\u002Fsolscan","2.providers\u002F06.solscan",{"title":88,"path":89,"stem":90},"Helius","\u002Fproviders\u002Fhelius","2.providers\u002F07.helius",{"title":92,"path":93,"stem":94},"TONAPI","\u002Fproviders\u002Fton","2.providers\u002F08.ton",{"title":96,"path":97,"stem":98},"TRONSCAN","\u002Fproviders\u002Ftronscan","2.providers\u002F09.tronscan",{"title":100,"path":101,"stem":102},"Aptos Explorer","\u002Fproviders\u002Faptos","2.providers\u002F10.aptos",{"title":104,"path":105,"stem":106},"Blockberry","\u002Fproviders\u002Fblockberry","2.providers\u002F11.blockberry",{"title":108,"path":109,"stem":110},"Koios","\u002Fproviders\u002Fkoios","2.providers\u002F12.koios",{"title":112,"path":113,"stem":114},"Arweave gateway","\u002Fproviders\u002Farweave","2.providers\u002F13.arweave",{"title":116,"path":117,"stem":118},"dcrdata","\u002Fproviders\u002Fdcrdata","2.providers\u002F14.dcrdata","i-lucide-library",{"title":121,"path":122,"stem":123},"Chains","\u002Fchains","3.chains",{"id":125,"title":116,"body":126,"description":436,"extension":437,"links":438,"meta":439,"navigation":190,"path":117,"seo":441,"stem":118,"__hash__":442},"docs\u002F2.providers\u002F14.dcrdata.md",{"type":127,"value":128,"toc":430},"minimark",[129,132,137,286,302,306,324,328,417,421,426],[130,131],"provider-facts",{"provider":116},[133,134,136],"h2",{"id":135},"address-it","Address it",[138,139,144],"pre",{"className":140,"code":141,"language":142,"meta":143,"style":143},"language-ts shiki shiki-themes github-light github-light poimandres","import { Dcrdata } from \"@agntn\u002Fexplorers\u002Fproviders\u002Fdcrdata\";\n\nconst dcrdata = new Dcrdata(); \u002F\u002F or create(\"dcrdata\"), or { baseUrl: \"https:\u002F\u002Fmy.dcrdata\u002Finsight\u002Fapi\" }\nawait dcrdata.getBalance(\"Ds…\", \"decred\");\nawait dcrdata.getBlockInfo(1000, \"decred\");\n","ts","",[145,146,147,185,192,219,258],"code",{"__ignoreMap":143},[148,149,152,156,160,164,167,171,175,179,182],"span",{"class":150,"line":151},"line",1,[148,153,155],{"class":154},"sP0CR","import",[148,157,159],{"class":158},"sKlNE"," {",[148,161,163],{"class":162},"snHMy"," Dcrdata",[148,165,166],{"class":158}," }",[148,168,170],{"class":169},"stCPd"," from",[148,172,174],{"class":173},"scVjq"," \"",[148,176,178],{"class":177},"sQ7BG","@agntn\u002Fexplorers\u002Fproviders\u002Fdcrdata",[148,180,181],{"class":173},"\"",[148,183,184],{"class":158},";\n",[148,186,188],{"class":150,"line":187},2,[148,189,191],{"emptyLinePlaceholder":190},true,"\n",[148,193,195,199,203,206,209,212,215],{"class":150,"line":194},3,[148,196,198],{"class":197},"s1TYA","const",[148,200,202],{"class":201},"saoiD"," dcrdata",[148,204,205],{"class":197}," =",[148,207,208],{"class":154}," new",[148,210,163],{"class":211},"sULi6",[148,213,214],{"class":158},"(); ",[148,216,218],{"class":217},"sjhu3","\u002F\u002F or create(\"dcrdata\"), or { baseUrl: \"https:\u002F\u002Fmy.dcrdata\u002Finsight\u002Fapi\" }\n",[148,220,222,226,229,232,235,238,240,243,245,248,250,253,255],{"class":150,"line":221},4,[148,223,225],{"class":224},"sZW6a","await",[148,227,202],{"class":228},"spVlQ",[148,230,231],{"class":158},".",[148,233,234],{"class":211},"getBalance",[148,236,237],{"class":158},"(",[148,239,181],{"class":173},[148,241,242],{"class":177},"Ds…",[148,244,181],{"class":173},[148,246,247],{"class":158},", ",[148,249,181],{"class":173},[148,251,252],{"class":177},"decred",[148,254,181],{"class":173},[148,256,257],{"class":158},");\n",[148,259,261,263,265,267,270,272,276,278,280,282,284],{"class":150,"line":260},5,[148,262,225],{"class":224},[148,264,202],{"class":228},[148,266,231],{"class":158},[148,268,269],{"class":211},"getBlockInfo",[148,271,237],{"class":158},[148,273,275],{"class":274},"siHFe","1000",[148,277,247],{"class":158},[148,279,181],{"class":173},[148,281,252],{"class":177},[148,283,181],{"class":173},[148,285,257],{"class":158},[287,288,289,290,293,294,297,298,301],"p",{},"One chain, no key. ",[145,291,292],{},"baseUrl"," is the Insight root and defaults to ",[145,295,296],{},"https:\u002F\u002Fexplorer.dcrdata.org\u002Finsight\u002Fapi",", so a dcrdata you run yourself works too. Any other chain is an ",[145,299,300],{},"UnsupportedChainError",", and an address that isn't a Decred mainnet address fails before a request goes out.",[133,303,305],{"id":304},"what-it-reads","What it reads",[287,307,308,311,312,315,316,319,320,323],{},[145,309,310],{},"\u002Faddr\u002F:address?noTxList=1"," for the balance, ",[145,313,314],{},"\u002Faddrs\u002F:address\u002Ftxs?from=&to="," for history, ",[145,317,318],{},"\u002Ftx\u002F:hash"," for one transaction, ",[145,321,322],{},"\u002Fblock\u002F:height"," for a block. Balances, history, details and blocks; no tokens, contracts, gas or unspent outputs.",[133,325,327],{"id":326},"gotchas","Gotchas",[329,330,331,339,356,377,395,409],"ul",{},[332,333,334,335,338],"li",{},"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. ",[145,336,337],{},"balanceSat"," and friends come as integers and stay integers.",[332,340,341,247,344,347,348,351,352,355],{},[145,342,343],{},"balance",[145,345,346],{},"funded"," and ",[145,349,350],{},"spent"," are confirmed. The signed mempool delta goes to ",[145,353,354],{},"unconfirmed",", so a pending payment never shows up as money you can spend.",[332,357,358,359,347,362,365,366,347,369,372,373,376],{},"History pages with ",[145,360,361],{},"from",[145,363,364],{},"to",", up to 250 rows a page, and ",[145,367,368],{},"startBlock",[145,370,371],{},"endBlock"," throw because Insight has no block filter. ",[145,374,375],{},"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.",[332,378,379,382,383,386,387,390,391,394],{},[145,380,381],{},"confirmations"," decides the status: 0 is ",[145,384,385],{},"pending"," with block number 0, below zero is ",[145,388,389],{},"failed",". Coinbase and treasurybase transactions get fee ",[145,392,393],{},"\"0\"",", everything else the fee Insight quotes or none.",[332,396,397,398,401,402,404,405,408],{},"Blocks come back with an empty ",[145,399,400],{},"miner"," and gas fields of ",[145,403,393],{},", like every other chain without gas. The block's transaction count is the length of its ",[145,406,407],{},"tx"," list.",[332,410,411,412,416],{},"The ",[413,414,52],"a",{"href":415},"\u002Fexplorer"," 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.",[133,418,420],{"id":419},"where-it-lives","Where it lives",[287,422,423,231],{},[145,424,425],{},"src\u002Fproviders\u002Fdcrdata.ts",[427,428,429],"style",{},"html pre.shiki code .sP0CR, html code.shiki .sP0CR{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7}html pre.shiki code .sKlNE, html code.shiki .sKlNE{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#A6ACCD}html pre.shiki code .snHMy, html code.shiki .snHMy{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#ADD7FF}html pre.shiki code .stCPd, html code.shiki .stCPd{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#A6ACCD}html pre.shiki code .scVjq, html code.shiki .scVjq{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#A6ACCD}html pre.shiki code .sQ7BG, html code.shiki .sQ7BG{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#5DE4C7}html pre.shiki code .s1TYA, html code.shiki .s1TYA{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#91B4D5}html pre.shiki code .saoiD, html code.shiki .saoiD{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#E4F0FB}html pre.shiki code .sULi6, html code.shiki .sULi6{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#E4F0FBD0}html pre.shiki code .sjhu3, html code.shiki .sjhu3{--shiki-light:#6A737D;--shiki-light-font-style:inherit;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#767C9DB0;--shiki-dark-font-style:italic}html pre.shiki code .sZW6a, html code.shiki .sZW6a{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7C0}html pre.shiki code .spVlQ, html code.shiki .spVlQ{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E4F0FB}html pre.shiki code .siHFe, html code.shiki .siHFe{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#5DE4C7}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":143,"searchDepth":187,"depth":187,"links":431},[432,433,434,435],{"id":135,"depth":187,"text":136},{"id":304,"depth":187,"text":305},{"id":326,"depth":187,"text":327},{"id":419,"depth":187,"text":420},"Decred through the Insight API of explorer.dcrdata.org. Balances with totals and the mempool delta. History and details and blocks. Atoms. No key.","md",null,{"icon":440},"i-lucide-chart-column",{"title":116,"description":436},"4-cJwZC4i9lPUpZr99I_wQaGiAL3F9clxiO6uOVrHg0",[444,446],{"title":112,"path":113,"stem":114,"description":445,"children":-1},"Wallet and block REST plus the GraphQL index of a gateway. arweave.net by default. Winstons. No gas. History that stays on one gateway.",{"title":121,"path":122,"stem":123,"description":447,"children":-1},"The 24 chains the built-in providers serve. Which provider answers for each and which operations any of them cover. Read from the registry and not typed in.",1789490625407]