[{"data":1,"prerenderedAt":623},["ShallowReactive",2],{"navigation_docs":3,"-providers-haskoin":140,"-providers-haskoin-surround":618},[4,56,136],{"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":135},"Providers","\u002Fproviders","2.providers\u002F0.index",[61,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131],{"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",{"title":120,"path":121,"stem":122},"Horizon","\u002Fproviders\u002Fhorizon","2.providers\u002F15.horizon",{"title":124,"path":125,"stem":126},"WhatsOnChain","\u002Fproviders\u002Fwhatsonchain","2.providers\u002F16.whatsonchain",{"title":128,"path":129,"stem":130},"Blockbook","\u002Fproviders\u002Fblockbook","2.providers\u002F17.blockbook",{"title":132,"path":133,"stem":134},"Haskoin","\u002Fproviders\u002Fhaskoin","2.providers\u002F18.haskoin","i-lucide-library",{"title":137,"path":138,"stem":139},"Chains","\u002Fchains","3.chains",{"id":141,"title":132,"body":142,"description":611,"extension":612,"links":613,"meta":614,"navigation":207,"path":133,"seo":616,"stem":134,"__hash__":617},"docs\u002F2.providers\u002F18.haskoin.md",{"type":143,"value":144,"toc":605},"minimark",[145,149,154,328,347,351,421,424,428,592,596,601],[146,147],"provider-facts",{"provider":148},"haskoin",[150,151,153],"h2",{"id":152},"address-it","Address it",[155,156,161],"pre",{"className":157,"code":158,"language":159,"meta":160,"style":160},"language-ts shiki shiki-themes github-light github-light poimandres","import { Haskoin } from \"@agntn\u002Fexplorers\u002Fproviders\u002Fhaskoin\";\n\nconst bch = new Haskoin(); \u002F\u002F or create(\"haskoin\")\nawait bch.getBalance(\"bitcoincash:qz3yjg59ypg6jqpwhaxgvjj44jm4hdx0w5wsxw2qez\", \"bitcoincash\");\nawait bch.getTxHistory(\"bitcoincash:qz3yjg59ypg6jqpwhaxgvjj44jm4hdx0w5wsxw2qez\", \"bitcoincash\", {\n  limit: 10,\n});\n","ts","",[162,163,164,202,209,236,275,306,322],"code",{"__ignoreMap":160},[165,166,169,173,177,181,184,188,192,196,199],"span",{"class":167,"line":168},"line",1,[165,170,172],{"class":171},"sP0CR","import",[165,174,176],{"class":175},"sKlNE"," {",[165,178,180],{"class":179},"snHMy"," Haskoin",[165,182,183],{"class":175}," }",[165,185,187],{"class":186},"stCPd"," from",[165,189,191],{"class":190},"scVjq"," \"",[165,193,195],{"class":194},"sQ7BG","@agntn\u002Fexplorers\u002Fproviders\u002Fhaskoin",[165,197,198],{"class":190},"\"",[165,200,201],{"class":175},";\n",[165,203,205],{"class":167,"line":204},2,[165,206,208],{"emptyLinePlaceholder":207},true,"\n",[165,210,212,216,220,223,226,229,232],{"class":167,"line":211},3,[165,213,215],{"class":214},"s1TYA","const",[165,217,219],{"class":218},"saoiD"," bch",[165,221,222],{"class":214}," =",[165,224,225],{"class":171}," new",[165,227,180],{"class":228},"sULi6",[165,230,231],{"class":175},"(); ",[165,233,235],{"class":234},"sjhu3","\u002F\u002F or create(\"haskoin\")\n",[165,237,239,243,246,249,252,255,257,260,262,265,267,270,272],{"class":167,"line":238},4,[165,240,242],{"class":241},"sZW6a","await",[165,244,219],{"class":245},"spVlQ",[165,247,248],{"class":175},".",[165,250,251],{"class":228},"getBalance",[165,253,254],{"class":175},"(",[165,256,198],{"class":190},[165,258,259],{"class":194},"bitcoincash:qz3yjg59ypg6jqpwhaxgvjj44jm4hdx0w5wsxw2qez",[165,261,198],{"class":190},[165,263,264],{"class":175},", ",[165,266,198],{"class":190},[165,268,269],{"class":194},"bitcoincash",[165,271,198],{"class":190},[165,273,274],{"class":175},");\n",[165,276,278,280,282,284,287,289,291,293,295,297,299,301,303],{"class":167,"line":277},5,[165,279,242],{"class":241},[165,281,219],{"class":245},[165,283,248],{"class":175},[165,285,286],{"class":228},"getTxHistory",[165,288,254],{"class":175},[165,290,198],{"class":190},[165,292,259],{"class":194},[165,294,198],{"class":190},[165,296,264],{"class":175},[165,298,198],{"class":190},[165,300,269],{"class":194},[165,302,198],{"class":190},[165,304,305],{"class":175},", {\n",[165,307,309,312,315,319],{"class":167,"line":308},6,[165,310,311],{"class":179},"  limit",[165,313,314],{"class":175},":",[165,316,318],{"class":317},"siHFe"," 10",[165,320,321],{"class":175},",\n",[165,323,325],{"class":167,"line":324},7,[165,326,327],{"class":175},"});\n",[329,330,331,332,335,336,339,340,343,344,248],"p",{},"One chain, no key. Haskoin Store is an indexer written in Haskell, and api.haskoin.com runs a public instance of it for Bitcoin Cash. ",[162,333,334],{},"baseUrl"," is the network root, ",[162,337,338],{},"https:\u002F\u002Fapi.haskoin.com\u002Fbch"," by default. Before it, Bitcoin Cash had Blockchair and nothing else, and keyless Blockchair blocks an IP after a handful of reads. Now automatic selection starts on Haskoin, and with ",[162,341,342],{},"BLOCKCHAIR_API_KEY"," set it starts on Blockchair and falls back here. Any other chain is an ",[162,345,346],{},"UnsupportedChainError",[150,348,350],{"id":349},"what-it-reads","What it reads",[352,353,354,367],"table",{},[355,356,357],"thead",{},[358,359,360,364],"tr",{},[361,362,363],"th",{},"Operation",[361,365,366],{},"Route",[368,369,370,381,391,401,411],"tbody",{},[358,371,372,376],{},[373,374,375],"td",{},"balance",[373,377,378],{},[162,379,380],{},"\u002Faddress\u002F{address}\u002Fbalance",[358,382,383,386],{},[373,384,385],{},"history",[373,387,388],{},[162,389,390],{},"\u002Faddress\u002F{address}\u002Ftransactions\u002Ffull",[358,392,393,396],{},[373,394,395],{},"one transaction",[373,397,398],{},[162,399,400],{},"\u002Ftransaction\u002F{txid}",[358,402,403,406],{},[373,404,405],{},"unspent outputs",[373,407,408],{},[162,409,410],{},"\u002Faddress\u002F{address}\u002Funspent",[358,412,413,416],{},[373,414,415],{},"block",[373,417,418],{},[162,419,420],{},"\u002Fblock\u002Fheight\u002F{height}",[329,422,423],{},"No gas and no tokens. Haskoin keeps no fee estimates at all.",[150,425,427],{"id":426},"gotchas","Gotchas",[429,430,431,450,453,467,486,500,522,529,539,545,558,571,581],"ul",{},[432,433,434,435,438,439,442,443,446,447,248],"li",{},"CashAddr only, with or without the ",[162,436,437],{},"bitcoincash:"," prefix. A legacy ",[162,440,441],{},"1..."," address fails before a request goes out. Haskoin itself would take it, but ",[162,444,445],{},"@agntn\u002Fchains"," doesn't, and that's the check every provider here goes through. Blockchair takes the legacy form, so ask it with ",[162,448,449],{},"-p blockchair",[432,451,452],{},"Every input comes with the address and the amount it spends. So the sender and the fee arrive with the transaction itself, no parent lookups like on WhatsOnChain.",[432,454,455,456,459,460,463,464,466],{},"Seen from an address, a transaction is a send when one of its inputs spent from that address. Then ",[162,457,458],{},"value"," is what went to everyone else and ",[162,461,462],{},"to"," is the first of them. Otherwise it's a receive and ",[162,465,458],{}," is what landed on the address.",[432,468,469,470,473,474,477,478,481,482,485],{},"History comes newest first and only that way, so ",[162,471,472],{},"sort: \"asc\""," throws. Haskoin bounds a listing from above only: ",[162,475,476],{},"endBlock"," goes out as ",[162,479,480],{},"height",", and ",[162,483,484],{},"startBlock"," throws instead of being ignored.",[432,487,488,491,492,495,496,499],{},[162,489,490],{},"limit"," up to 100, and ",[162,493,494],{},"page"," turns into an ",[162,497,498],{},"offset",". The public instance refuses an offset above 50000, so a page that deep throws before the request.",[432,501,502,503,505,506,509,510,513,514,517,518,521],{},"Balance splits differently from Mempool. ",[162,504,375],{}," is Haskoin's ",[162,507,508],{},"confirmed",": confirmed outputs that nothing spends yet, and a spend still in the mempool already counts. ",[162,511,512],{},"unconfirmed"," is the unspent outputs still waiting in the mempool, never negative. The two add up to what the address holds once the mempool confirms. ",[162,515,516],{},"funded"," is everything ever received, ",[162,519,520],{},"spent"," is the rest.",[432,523,524,525,528],{},"No block height on a balance, the endpoint doesn't send one, so ",[162,526,527],{},"blockNumber"," stays null.",[432,530,531,532,535,536,248],{},"A transaction still in the mempool reads as ",[162,533,534],{},"pending"," at block 0. One Haskoin marks as deleted, pushed out by a double spend or a reorg, reads as ",[162,537,538],{},"failed",[432,540,541,542,528],{},"Unspent outputs come in pages of 1000, ten pages at most. The height comes along, the block hash doesn't, so ",[162,543,544],{},"blockHash",[432,546,547,549,550,553,554,557],{},[162,548,420],{}," lists every block seen at that height, orphans too. The provider takes the main chain one. Past the tip the list is empty and that's a ",[162,551,552],{},"NotFoundError",". The request skips ",[162,555,556],{},"notx",", because without the list of transactions there's nothing to count.",[432,559,560,561,563,564,567,568,248],{},"A missing transaction or address is a 404, so ",[162,562,552],{},". A 400 carries its reason in ",[162,565,566],{},"message",", and that reason travels in a plain ",[162,569,570],{},"ExplorerError",[432,572,573,574,577,578,248],{},"OP_RETURN outputs have no address and never become the recipient. Their payloads stay in ",[162,575,576],{},"raw",", not decoded into ",[162,579,580],{},"opReturn",[432,582,583,584,587,588,591],{},"A block has an empty ",[162,585,586],{},"miner"," and gas fields of ",[162,589,590],{},"\"0\"",", like every other chain without gas.",[150,593,595],{"id":594},"where-it-lives","Where it lives",[329,597,598,248],{},[162,599,600],{},"src\u002Fproviders\u002Fhaskoin.ts",[602,603,604],"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":160,"searchDepth":204,"depth":204,"links":606},[607,608,609,610],{"id":152,"depth":204,"text":153},{"id":349,"depth":204,"text":350},{"id":426,"depth":204,"text":427},{"id":594,"depth":204,"text":595},"Bitcoin Cash through Haskoin Store at api.haskoin.com. Balances, history, unspent outputs, transactions and blocks. Satoshis, no key.","md",null,{"icon":615},"i-lucide-square-function",{"title":132,"description":611},"UQI8t_Kd403CVlH9_lcDBvfLydhMzEX1MgdWmvFm_P4",[619,621],{"title":128,"path":129,"stem":130,"description":620,"children":-1},"Bitcoin Gold through the Blockbook API of btgexplorer.com. Balances, history, unspent outputs, transactions and blocks. Satoshis, no key.",{"title":137,"path":138,"stem":139,"description":622,"children":-1},"The 29 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.",1790442816992]