[{"data":1,"prerenderedAt":538},["ShallowReactive",2],{"navigation_docs":3,"-guide-balances":120,"-guide-balances-surround":533},[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":20,"body":122,"description":525,"extension":526,"links":527,"meta":528,"navigation":530,"path":21,"seo":531,"stem":22,"__hash__":532},"docs\u002F1.guide\u002F04.balances.md",{"type":123,"value":124,"toc":518},"minimark",[125,130,194,209,213,397,411,436,445,449,477,487,491,502,506,514],[126,127,129],"h2",{"id":128},"the-call","The call",[131,132,137],"pre",{"className":133,"code":134,"language":135,"meta":136,"style":136},"language-ts shiki shiki-themes github-light github-light poimandres","const balance = await provider.getBalance(address, \"ethereum\");\n","ts","",[138,139,140],"code",{"__ignoreMap":136},[141,142,145,149,153,156,160,164,168,172,175,178,181,185,189,191],"span",{"class":143,"line":144},"line",1,[141,146,148],{"class":147},"s1TYA","const",[141,150,152],{"class":151},"saoiD"," balance",[141,154,155],{"class":147}," =",[141,157,159],{"class":158},"sZW6a"," await",[141,161,163],{"class":162},"spVlQ"," provider",[141,165,167],{"class":166},"sKlNE",".",[141,169,171],{"class":170},"sULi6","getBalance",[141,173,174],{"class":166},"(",[141,176,177],{"class":162},"address",[141,179,180],{"class":166},", ",[141,182,184],{"class":183},"scVjq","\"",[141,186,188],{"class":187},"sQ7BG","ethereum",[141,190,184],{"class":183},[141,192,193],{"class":166},");\n",[195,196,197,198,201,202,205,206,167],"p",{},"Every provider except Helius and Aptos implements it. Helius has no REST balance endpoint and Aptos has no explorer API at all, so both throw ",[138,199,200],{},"UnsupportedOperationError"," and their ",[138,203,204],{},"capabilities.balances"," is ",[138,207,208],{},"false",[126,210,212],{"id":211},"the-shape","The shape",[131,214,216],{"className":133,"code":215,"language":135,"meta":136,"style":136},"interface Balance {\n  address: string;\n  chain: ChainKey;\n  fetchedAt: string; \u002F\u002F ISO, when the provider finished the read\n  blockNumber: number | null; \u002F\u002F the height the answer describes, when the explorer says\n  blockHash: string | null;\n  balance: string; \u002F\u002F smallest unit, exact\n  balanceFormatted: string; \u002F\u002F decimal, exact\n  funded?: string; \u002F\u002F UTXO explorers only: cumulative received\n  spent?: string; \u002F\u002F UTXO explorers only: cumulative spent\n  symbol: string; \u002F\u002F ETH, BTC, AR…\n}\n",[138,217,218,230,247,260,277,299,315,330,345,361,376,391],{"__ignoreMap":136},[141,219,220,223,227],{"class":143,"line":144},[141,221,222],{"class":147},"interface",[141,224,226],{"class":225},"sCrqT"," Balance",[141,228,229],{"class":166}," {\n",[141,231,233,237,240,244],{"class":143,"line":232},2,[141,234,236],{"class":235},"s0VbO","  address",[141,238,239],{"class":147},":",[141,241,243],{"class":242},"s8yaW"," string",[141,245,246],{"class":166},";\n",[141,248,250,253,255,258],{"class":143,"line":249},3,[141,251,252],{"class":235},"  chain",[141,254,239],{"class":147},[141,256,257],{"class":225}," ChainKey",[141,259,246],{"class":166},[141,261,263,266,268,270,273],{"class":143,"line":262},4,[141,264,265],{"class":235},"  fetchedAt",[141,267,239],{"class":147},[141,269,243],{"class":242},[141,271,272],{"class":166},"; ",[141,274,276],{"class":275},"sjhu3","\u002F\u002F ISO, when the provider finished the read\n",[141,278,280,283,285,288,291,294,296],{"class":143,"line":279},5,[141,281,282],{"class":235},"  blockNumber",[141,284,239],{"class":147},[141,286,287],{"class":242}," number",[141,289,290],{"class":147}," |",[141,292,293],{"class":242}," null",[141,295,272],{"class":166},[141,297,298],{"class":275},"\u002F\u002F the height the answer describes, when the explorer says\n",[141,300,302,305,307,309,311,313],{"class":143,"line":301},6,[141,303,304],{"class":235},"  blockHash",[141,306,239],{"class":147},[141,308,243],{"class":242},[141,310,290],{"class":147},[141,312,293],{"class":242},[141,314,246],{"class":166},[141,316,318,321,323,325,327],{"class":143,"line":317},7,[141,319,320],{"class":235},"  balance",[141,322,239],{"class":147},[141,324,243],{"class":242},[141,326,272],{"class":166},[141,328,329],{"class":275},"\u002F\u002F smallest unit, exact\n",[141,331,333,336,338,340,342],{"class":143,"line":332},8,[141,334,335],{"class":235},"  balanceFormatted",[141,337,239],{"class":147},[141,339,243],{"class":242},[141,341,272],{"class":166},[141,343,344],{"class":275},"\u002F\u002F decimal, exact\n",[141,346,348,351,354,356,358],{"class":143,"line":347},9,[141,349,350],{"class":235},"  funded",[141,352,353],{"class":147},"?:",[141,355,243],{"class":242},[141,357,272],{"class":166},[141,359,360],{"class":275},"\u002F\u002F UTXO explorers only: cumulative received\n",[141,362,364,367,369,371,373],{"class":143,"line":363},10,[141,365,366],{"class":235},"  spent",[141,368,353],{"class":147},[141,370,243],{"class":242},[141,372,272],{"class":166},[141,374,375],{"class":275},"\u002F\u002F UTXO explorers only: cumulative spent\n",[141,377,379,382,384,386,388],{"class":143,"line":378},11,[141,380,381],{"class":235},"  symbol",[141,383,239],{"class":147},[141,385,243],{"class":242},[141,387,272],{"class":166},[141,389,390],{"class":275},"\u002F\u002F ETH, BTC, AR…\n",[141,392,394],{"class":143,"line":393},12,[141,395,396],{"class":166},"}\n",[195,398,399,402,403,406,407,410],{},[138,400,401],{},"balance"," is a string because a JavaScript number cannot hold 6.712150161831460931 ETH in wei without losing the tail. ",[138,404,405],{},"balanceFormatted"," is the same value with the decimal point in place, computed with ",[138,408,409],{},"formatWei(value, decimals)"," and nothing else. Neither is rounded.",[195,412,413,416,417,420,421,424,425,428,429,432,433,435],{},[138,414,415],{},"fetchedAt"," is always there. ",[138,418,419],{},"blockNumber"," and ",[138,422,423],{},"blockHash"," are there when the explorer's answer names a block and ",[138,426,427],{},"null"," when it does not, so an unknown chain position is explicit instead of a zero that looks like genesis. Today only Blockchair passes a height through, from the ",[138,430,431],{},"context.state"," of its dashboard answer; every other provider's balance endpoint says nothing about a block, so both fields stay ",[138,434,427],{}," there.",[195,437,438,420,441,444],{},[138,439,440],{},"funded",[138,442,443],{},"spent"," come from explorers that keep cumulative totals: Mempool, Blockstream and Blockchair on the Bitcoin family, and Koios on Cardano. They are absent everywhere else rather than set to zero.",[126,446,448],{"id":447},"ens","ENS",[195,450,451,454,455,457,458,461,462,465,466,469,470,420,473,476],{},[138,452,453],{},"resolveEns(\"vitalik.eth\")"," goes through public HTTP resolvers, no key and no keccak, and returns the address or ",[138,456,427],{},". ",[138,459,460],{},"resolveAddresses(input, chain)"," does the classification for you: an address or a hash passes through, a ",[138,463,464],{},".eth"," name is resolved, and a name that does not resolve is a ",[138,467,468],{},"NotFoundError",". The CLI, the tools and the docs worker all go through it, so ",[138,471,472],{},"explorers vitalik.eth",[138,474,475],{},"explorers 0xd8dA…6045"," are the same read.",[195,478,479,482,483,486],{},[138,480,481],{},"resolveAddresses"," also takes a list, up to twenty entries, which is what ",[138,484,485],{},"explorers_balance"," uses when an agent hands it several addresses at once.",[126,488,490],{"id":489},"decimals","Decimals",[195,492,493,495,496,498,499,501],{},[138,494,409],{}," defaults to 18. Bitcoin, Litecoin, Pepecoin and Blockstream amounts are 8, Solana 9, Arweave 12, Cardano 6, TON 9, TRON 6, Sui 9, eCash 2. The providers apply the right one, so ",[138,497,405],{}," is always correct; the default matters only when you format ",[138,500,401],{}," yourself.",[126,503,505],{"id":504},"reading-ahead","Reading ahead",[195,507,508,509,513],{},"The ",[510,511,52],"a",{"href":512},"\u002Fexplorer"," shows the full shape for any address. The landing walks through three addresses on three chains, recorded through the library and swapped for live answers as the worker replies.",[515,516,517],"style",{},"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 .spVlQ, html code.shiki .spVlQ{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E4F0FB}html pre.shiki code .sKlNE, html code.shiki .sKlNE{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#A6ACCD}html pre.shiki code .sULi6, html code.shiki .sULi6{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#E4F0FBD0}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 .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);}html pre.shiki code .sCrqT, html code.shiki .sCrqT{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#A6ACCDC0}html pre.shiki code .s0VbO, html code.shiki .s0VbO{--shiki-light:#E36209;--shiki-default:#E36209;--shiki-dark:#A6ACCD}html pre.shiki code .s8yaW, html code.shiki .s8yaW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#A6ACCDC0}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}",{"title":136,"searchDepth":232,"depth":232,"links":519},[520,521,522,523,524],{"id":128,"depth":232,"text":129},{"id":211,"depth":232,"text":212},{"id":447,"depth":232,"text":448},{"id":489,"depth":232,"text":490},{"id":504,"depth":232,"text":505},"getBalance on every chain, the Balance shape, ENS resolution, UTXO totals, and why blockNumber is sometimes null.","md",null,{"icon":529},"i-solar-wallet-linear",true,{"title":20,"description":525},"pGK-lxCSskDpY6eynk3Wi-R7QOQ9ewb3c3ds1F-U6TA",[534,536],{"title":16,"path":17,"stem":18,"description":535,"children":-1},"How resolveProvider ranks candidates, when withProvider retries, and why an explicit provider is never second guessed.",{"title":24,"path":25,"stem":26,"description":537,"children":-1},"getTxHistory and getTxDetail, the Transaction shape, paging options, OP_RETURN payloads, and what raw is for.",1788626962638]