[{"data":1,"prerenderedAt":461},["ShallowReactive",2],{"navigation_docs":3,"-providers-etherscan":120,"-providers-etherscan-surround":456},[4,56,116],{"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-solar-book-2-linear",{"title":57,"path":58,"stem":59,"children":60,"icon":115},"Providers","\u002Fproviders","2.providers\u002F0.index",[61,63,67,71,75,79,83,87,91,95,99,103,107,111],{"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","i-solar-library-linear",{"title":117,"path":118,"stem":119},"Chains","\u002Fchains","3.chains",{"id":121,"title":64,"body":122,"description":449,"extension":450,"links":451,"meta":452,"navigation":187,"path":65,"seo":454,"stem":66,"__hash__":455},"docs\u002F2.providers\u002F01.etherscan.md",{"type":123,"value":124,"toc":443},"minimark",[125,129,134,263,275,279,402,406,430,434,439],[126,127],"provider-facts",{"provider":128},"etherscan",[130,131,133],"h2",{"id":132},"address-it","Address it",[135,136,141],"pre",{"className":137,"code":138,"language":139,"meta":140,"style":140},"language-ts shiki shiki-themes github-light github-light poimandres","import { create } from \"@agntn\u002Fexplorers\";\n\nconst etherscan = await create(\"etherscan\"); \u002F\u002F ETHERSCAN_API_KEY from the environment\nawait etherscan.getBalance(\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"base\");\n","ts","",[142,143,144,182,189,226],"code",{"__ignoreMap":140},[145,146,149,153,157,161,164,168,172,176,179],"span",{"class":147,"line":148},"line",1,[145,150,152],{"class":151},"sP0CR","import",[145,154,156],{"class":155},"sKlNE"," {",[145,158,160],{"class":159},"snHMy"," create",[145,162,163],{"class":155}," }",[145,165,167],{"class":166},"stCPd"," from",[145,169,171],{"class":170},"scVjq"," \"",[145,173,175],{"class":174},"sQ7BG","@agntn\u002Fexplorers",[145,177,178],{"class":170},"\"",[145,180,181],{"class":155},";\n",[145,183,185],{"class":147,"line":184},2,[145,186,188],{"emptyLinePlaceholder":187},true,"\n",[145,190,192,196,200,203,207,210,213,215,217,219,222],{"class":147,"line":191},3,[145,193,195],{"class":194},"s1TYA","const",[145,197,199],{"class":198},"saoiD"," etherscan",[145,201,202],{"class":194}," =",[145,204,206],{"class":205},"sZW6a"," await",[145,208,160],{"class":209},"sULi6",[145,211,212],{"class":155},"(",[145,214,178],{"class":170},[145,216,128],{"class":174},[145,218,178],{"class":170},[145,220,221],{"class":155},"); ",[145,223,225],{"class":224},"sjhu3","\u002F\u002F ETHERSCAN_API_KEY from the environment\n",[145,227,229,232,235,238,241,243,245,248,250,253,255,258,260],{"class":147,"line":228},4,[145,230,231],{"class":205},"await",[145,233,199],{"class":234},"spVlQ",[145,236,237],{"class":155},".",[145,239,240],{"class":209},"getBalance",[145,242,212],{"class":155},[145,244,178],{"class":170},[145,246,247],{"class":174},"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",[145,249,178],{"class":170},[145,251,252],{"class":155},", ",[145,254,178],{"class":170},[145,256,257],{"class":174},"base",[145,259,178],{"class":170},[145,261,262],{"class":155},");\n",[264,265,266,267,270,271,274],"p",{},"One key, ten chains. The provider sends the chain id with every request to ",[142,268,269],{},"api.etherscan.io\u002Fv2\u002Fapi",", so Base, Arbitrum, Optimism, Polygon, BSC, Avalanche, Gnosis, Linea and Berachain go through the same endpoint as Ethereum. Without the key the constructor throws ",[142,272,273],{},"AuthError"," before any request goes out.",[130,276,278],{"id":277},"what-it-reads","What it reads",[280,281,282,295],"table",{},[283,284,285],"thead",{},[286,287,288,292],"tr",{},[289,290,291],"th",{},"Operation",[289,293,294],{},"Action",[296,297,298,309,335,346,357,367,381,392],"tbody",{},[286,299,300,304],{},[301,302,303],"td",{},"balance",[301,305,306],{},[142,307,308],{},"account.balance",[286,310,311,314],{},[301,312,313],{},"history",[301,315,316,319,320,252,323,252,326,252,329,252,332],{},[142,317,318],{},"account.txlist",", with ",[142,321,322],{},"startblock",[142,324,325],{},"endblock",[142,327,328],{},"sort",[142,330,331],{},"page",[142,333,334],{},"offset",[286,336,337,340],{},[301,338,339],{},"one transaction",[301,341,342,345],{},[142,343,344],{},"proxy.eth_getTransactionByHash"," plus the receipt for status and fee",[286,347,348,351],{},[301,349,350],{},"contract",[301,352,353,356],{},[142,354,355],{},"contract.getsourcecode",", with proxy and implementation",[286,358,359,362],{},[301,360,361],{},"token holdings",[301,363,364],{},[142,365,366],{},"account.addresstokenbalance",[286,368,369,372],{},[301,370,371],{},"token transfers",[301,373,374,377,378],{},[142,375,376],{},"account.tokentx",", optionally one ",[142,379,380],{},"contractaddress",[286,382,383,386],{},[301,384,385],{},"gas",[301,387,388,391],{},[142,389,390],{},"gastracker.gasoracle",", in gwei",[286,393,394,397],{},[301,395,396],{},"block",[301,398,399],{},[142,400,401],{},"proxy.eth_getBlockByNumber",[130,403,405],{"id":404},"gotchas","Gotchas",[407,408,409,417,424,427],"ul",{},[410,411,412,413,416],"li",{},"The free tier allows five requests a second. Past it the API answers with a rate limit message, which becomes ",[142,414,415],{},"RateLimitError",", and an automatic selection moves the read to Blockscout once.",[410,418,419,420,423],{},"Some chains keep some reads behind a paid plan. The gas oracle on BNB Chain is one; that is a ",[142,421,422],{},"PlanRestrictedError",", and the fallback pass tries Blockscout if it serves the chain.",[410,425,426],{},"\"No transactions found\" is an empty list, not an error. Etherscan phrases an empty page as a failure and the provider knows the phrasing.",[410,428,429],{},"Amounts arrive as decimal strings and stay strings. Token decimals come with each transfer row.",[130,431,433],{"id":432},"where-it-lives","Where it lives",[264,435,436,237],{},[142,437,438],{},"src\u002Fproviders\u002Fetherscan.ts",[440,441,442],"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 .sZW6a, html code.shiki .sZW6a{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7C0}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 .spVlQ, html code.shiki .spVlQ{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E4F0FB}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":140,"searchDepth":184,"depth":184,"links":444},[445,446,447,448],{"id":132,"depth":184,"text":133},{"id":277,"depth":184,"text":278},{"id":404,"depth":184,"text":405},{"id":432,"depth":184,"text":433},"The v2 API with one key for ten EVM chains and every operation. Five requests a second on the free tier, and the first choice whenever ETHERSCAN_API_KEY is set.","md",null,{"icon":453},"i-solar-code-file-linear",{"title":64,"description":449},"mqxTzFBj3j6FX-hhd5H1rpL9baXqS0xdPwOGmTEu-jg",[457,459],{"title":62,"path":58,"stem":59,"description":458,"children":-1},"Thirteen provider classes, one contract. Pick one to see its auth, its endpoints, what it maps and the traps.",{"title":68,"path":69,"stem":70,"description":460,"children":-1},"Keyless and complete on ten EVM chains, one host per chain. The backstop when nothing else serves a chain and the first stop when there are no keys.",1788626961518]