[{"data":1,"prerenderedAt":590},["ShallowReactive",2],{"navigation_docs":3,"-providers-whatsonchain":136,"-providers-whatsonchain-surround":585},[4,56,132],{"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":131},"Providers","\u002Fproviders","2.providers\u002F0.index",[61,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127],{"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","i-lucide-library",{"title":133,"path":134,"stem":135},"Chains","\u002Fchains","3.chains",{"id":137,"title":124,"body":138,"description":578,"extension":579,"links":580,"meta":581,"navigation":203,"path":125,"seo":583,"stem":126,"__hash__":584},"docs\u002F2.providers\u002F16.whatsonchain.md",{"type":139,"value":140,"toc":572},"minimark",[141,145,150,315,343,347,426,436,440,559,563,568],[142,143],"provider-facts",{"provider":144},"whatsonchain",[146,147,149],"h2",{"id":148},"address-it","Address it",[151,152,157],"pre",{"className":153,"code":154,"language":155,"meta":156,"style":156},"language-ts shiki shiki-themes github-light github-light poimandres","import { WhatsOnChain } from \"@agntn\u002Fexplorers\u002Fproviders\u002Fwhatsonchain\";\n\nconst woc = new WhatsOnChain(); \u002F\u002F or create(\"whatsonchain\")\nawait woc.getBalance(\"1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF\", \"bitcoinsv\");\nawait woc.getTxHistory(\"1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF\", \"bitcoinsv\", { limit: 10 });\n","ts","",[158,159,160,198,205,232,271],"code",{"__ignoreMap":156},[161,162,165,169,173,177,180,184,188,192,195],"span",{"class":163,"line":164},"line",1,[161,166,168],{"class":167},"sP0CR","import",[161,170,172],{"class":171},"sKlNE"," {",[161,174,176],{"class":175},"snHMy"," WhatsOnChain",[161,178,179],{"class":171}," }",[161,181,183],{"class":182},"stCPd"," from",[161,185,187],{"class":186},"scVjq"," \"",[161,189,191],{"class":190},"sQ7BG","@agntn\u002Fexplorers\u002Fproviders\u002Fwhatsonchain",[161,193,194],{"class":186},"\"",[161,196,197],{"class":171},";\n",[161,199,201],{"class":163,"line":200},2,[161,202,204],{"emptyLinePlaceholder":203},true,"\n",[161,206,208,212,216,219,222,225,228],{"class":163,"line":207},3,[161,209,211],{"class":210},"s1TYA","const",[161,213,215],{"class":214},"saoiD"," woc",[161,217,218],{"class":210}," =",[161,220,221],{"class":167}," new",[161,223,176],{"class":224},"sULi6",[161,226,227],{"class":171},"(); ",[161,229,231],{"class":230},"sjhu3","\u002F\u002F or create(\"whatsonchain\")\n",[161,233,235,239,242,245,248,251,253,256,258,261,263,266,268],{"class":163,"line":234},4,[161,236,238],{"class":237},"sZW6a","await",[161,240,215],{"class":241},"spVlQ",[161,243,244],{"class":171},".",[161,246,247],{"class":224},"getBalance",[161,249,250],{"class":171},"(",[161,252,194],{"class":186},[161,254,255],{"class":190},"1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF",[161,257,194],{"class":186},[161,259,260],{"class":171},", ",[161,262,194],{"class":186},[161,264,265],{"class":190},"bitcoinsv",[161,267,194],{"class":186},[161,269,270],{"class":171},");\n",[161,272,274,276,278,280,283,285,287,289,291,293,295,297,299,302,305,308,312],{"class":163,"line":273},5,[161,275,238],{"class":237},[161,277,215],{"class":241},[161,279,244],{"class":171},[161,281,282],{"class":224},"getTxHistory",[161,284,250],{"class":171},[161,286,194],{"class":186},[161,288,255],{"class":190},[161,290,194],{"class":186},[161,292,260],{"class":171},[161,294,194],{"class":186},[161,296,265],{"class":190},[161,298,194],{"class":186},[161,300,301],{"class":171},", {",[161,303,304],{"class":175}," limit",[161,306,307],{"class":171},":",[161,309,311],{"class":310},"siHFe"," 10",[161,313,314],{"class":171}," });\n",[316,317,318,319,322,323,326,327,330,331,334,335,338,339,342],"p",{},"One chain. The key is optional: WhatsOnChain answers three requests a second without one, and ",[158,320,321],{},"WHATSONCHAIN_API_KEY"," goes out in the ",[158,324,325],{},"Authorization"," header for a paid plan. ",[158,328,329],{},"baseUrl"," is the network root, ",[158,332,333],{},"https:\u002F\u002Fapi.whatsonchain.com\u002Fv1\u002Fbsv\u002Fmain"," by default. Any other chain is an ",[158,336,337],{},"UnsupportedChainError",". An address Bitcoin SV doesn't take, a ",[158,340,341],{},"3..."," P2SH one for example, fails before a request goes out.",[146,344,346],{"id":345},"what-it-reads","What it reads",[348,349,350,363],"table",{},[351,352,353],"thead",{},[354,355,356,360],"tr",{},[357,358,359],"th",{},"Operation",[357,361,362],{},"Route",[364,365,366,381,396,406,416],"tbody",{},[354,367,368,372],{},[369,370,371],"td",{},"balance",[369,373,374,377,378],{},[158,375,376],{},"\u002Faddress\u002F{address}\u002Fconfirmed\u002Fbalance"," and ",[158,379,380],{},"\u002Funconfirmed\u002Fbalance",[354,382,383,386],{},[369,384,385],{},"history",[369,387,388,391,392,395],{},[158,389,390],{},"\u002Faddress\u002F{address}\u002Fconfirmed\u002Fhistory",", then ",[158,393,394],{},"POST \u002Ftxs",", 20 hashes a go",[354,397,398,401],{},[369,399,400],{},"one transaction",[369,402,403],{},[158,404,405],{},"\u002Ftx\u002Fhash\u002F{txid}",[354,407,408,411],{},[369,409,410],{},"unspent outputs",[369,412,413],{},[158,414,415],{},"\u002Faddress\u002F{address}\u002Funspent\u002Fall",[354,417,418,421],{},[369,419,420],{},"block",[369,422,423],{},[158,424,425],{},"\u002Fblock\u002Fheight\u002F{height}",[316,427,428,429,432,433,244],{},"No gas and no tokens. ",[158,430,431],{},"\u002Ffeerecommendation"," quotes satoshis per kilobyte, and nothing else in this library speaks that unit, so gas stays unsupported rather than converted into something that looks like ",[158,434,435],{},"sat\u002FvB",[146,437,439],{"id":438},"gotchas","Gotchas",[441,442,443,459,469,483,490,511,518,533,540,551],"ul",{},[444,445,446,447,450,451,454,455,458],"li",{},"A legacy ",[158,448,449],{},"1..."," address is valid on Bitcoin and on Bitcoin SV. Without a chain it reads as Bitcoin, where far more of them live, so ask for ",[158,452,453],{},"-c bsv"," or ",[158,456,457],{},"-p whatsonchain"," when you mean the fork. Naming the provider is enough, the address then reads as the one chain WhatsOnChain serves.",[444,460,461,462,464,465,468],{},"An input on WhatsOnChain names only the output it spends, not the address or the amount. So the sender, the fee and the question \"did this address pay into it\" all come from the parent transactions, fetched through ",[158,463,394],{}," twenty at a time. A page of 25 transactions is about five requests. A read stops after 200 parents, which is ten requests, so a consolidation of thousands of inputs doesn't eat your rate limit. Past that the ",[158,466,467],{},"fee"," stays out of the row, since half a sum would be a wrong number.",[444,470,471,472,475,476,479,480,482],{},"Seen from an address, a transaction is a send when one of its inputs spent that address's output. Then ",[158,473,474],{},"value"," is what went to everyone else and ",[158,477,478],{},"to"," is the first of them. Otherwise it's a receive and ",[158,481,474],{}," is what landed on the address.",[444,484,485,486,489],{},"History lists confirmed transactions only. Pending ones show up as the signed ",[158,487,488],{},"unconfirmed"," delta on the balance and as unconfirmed unspent outputs, not as rows.",[444,491,492,495,496,499,500,503,504,377,507,510],{},[158,493,494],{},"limit"," up to 100, ",[158,497,498],{},"page"," up to 10. WhatsOnChain pages with ",[158,501,502],{},"next-page"," tokens, so page 3 costs three requests. ",[158,505,506],{},"startBlock",[158,508,509],{},"endBlock"," throw. The API also lists a page the other way round from the order you asked for, transactions of one block included, and the provider reverses it back.",[444,512,513,514,517],{},"Amounts arrive as BSV in JSON numbers, and the small ones in exponent form, one satoshi as ",[158,515,516],{},"1e-8",". The provider turns them into satoshis from the decimal spelling, no float multiplication.",[444,519,520,521,524,525,528,529,532],{},"OP_RETURN outputs, bare or the ",[158,522,523],{},"OP_FALSE OP_RETURN"," Bitcoin SV uses, never become the recipient. Their payloads stay in ",[158,526,527],{},"raw"," and don't get decoded into ",[158,530,531],{},"opReturn"," the way Mempool does it.",[444,534,535,536,539],{},"Unspent outputs come back with the height and without the block hash, because WhatsOnChain doesn't send one, so ",[158,537,538],{},"blockHash"," stays null. An output some mempool transaction already spends is left out. The list stops after ten pages, about ten thousand confirmed outputs.",[444,541,542,543,546,547,550],{},"A block has an empty ",[158,544,545],{},"miner",", since WhatsOnChain names the pool by its tag and not by an address, and gas fields of ",[158,548,549],{},"\"0\"",", like every other chain without gas.",[444,552,553,554,558],{},"The ",[555,556,52],"a",{"href":557},"\u002Fexplorer"," has no live feed for Bitcoin SV. Search works, the hub says there's no tip.",[146,560,562],{"id":561},"where-it-lives","Where it lives",[316,564,565,244],{},[158,566,567],{},"src\u002Fproviders\u002Fwhatsonchain.ts",[569,570,571],"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":156,"searchDepth":200,"depth":200,"links":573},[574,575,576,577],{"id":148,"depth":200,"text":149},{"id":345,"depth":200,"text":346},{"id":438,"depth":200,"text":439},{"id":561,"depth":200,"text":562},"Bitcoin SV through WhatsOnChain. Balances, history, unspent outputs, transactions and blocks. Satoshis. Three requests a second without a key.","md",null,{"icon":582},"i-lucide-eye",{"title":124,"description":578},"Zaj8DyUalyMtwMx4a-Lv5bxtsXz513ipuTp_jb1I7Bc",[586,588],{"title":120,"path":121,"stem":122,"description":587,"children":-1},"Stellar through the SDF's public Horizon. Balances and trustlines. Payments as history. Ledgers as blocks and fee stats as gas. Stroops. No key.",{"title":128,"path":129,"stem":130,"description":589,"children":-1},"Bitcoin Gold through the Blockbook API of btgexplorer.com. Balances, history, unspent outputs, transactions and blocks. Satoshis, no key.",1790332430460]