[{"data":1,"prerenderedAt":562},["ShallowReactive",2],{"navigation_docs":3,"-guide-tokens":120,"-guide-tokens-surround":557},[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":28,"body":122,"description":549,"extension":550,"links":551,"meta":552,"navigation":554,"path":29,"seo":555,"stem":30,"__hash__":556},"docs\u002F1.guide\u002F06.tokens.md",{"type":123,"value":124,"toc":543},"minimark",[125,130,208,220,353,363,367,440,472,483,486,527,531,539],[126,127,129],"h2",{"id":128},"holdings","Holdings",[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 tokens = await provider.getTokenBalances?.(address, \"ethereum\", { nonZeroOnly: true });\n","ts","",[138,139,140],"code",{"__ignoreMap":136},[141,142,145,149,153,156,160,164,168,172,175,178,181,185,189,191,194,198,201,205],"span",{"class":143,"line":144},"line",1,[141,146,148],{"class":147},"s1TYA","const",[141,150,152],{"class":151},"saoiD"," tokens",[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","getTokenBalances",[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},", {",[141,195,197],{"class":196},"snHMy"," nonZeroOnly",[141,199,200],{"class":166},":",[141,202,204],{"class":203},"siHFe"," true",[141,206,207],{"class":166}," });\n",[209,210,211,212,215,216,219],"p",{},"Etherscan and Blockscout serve it on EVM chains, Helius on Solana through DAS ",[138,213,214],{},"searchAssets",", Koios on Cardano for native assets. Everyone else leaves the method absent and ",[138,217,218],{},"capabilities.tokenBalances"," false.",[131,221,223],{"className":133,"code":222,"language":135,"meta":136,"style":136},"interface TokenBalance {\n  contract: string;\n  symbol: string;\n  name?: string;\n  decimals: number;\n  balance: string; \u002F\u002F raw, exact\n  balanceFormatted: string;\n  priceUsd?: number; \u002F\u002F when the explorer quotes one\n  valueUsd?: number;\n}\n",[138,224,225,237,253,265,278,291,308,320,335,347],{"__ignoreMap":136},[141,226,227,230,234],{"class":143,"line":144},[141,228,229],{"class":147},"interface",[141,231,233],{"class":232},"sCrqT"," TokenBalance",[141,235,236],{"class":166}," {\n",[141,238,240,244,246,250],{"class":143,"line":239},2,[141,241,243],{"class":242},"s0VbO","  contract",[141,245,200],{"class":147},[141,247,249],{"class":248},"s8yaW"," string",[141,251,252],{"class":166},";\n",[141,254,256,259,261,263],{"class":143,"line":255},3,[141,257,258],{"class":242},"  symbol",[141,260,200],{"class":147},[141,262,249],{"class":248},[141,264,252],{"class":166},[141,266,268,271,274,276],{"class":143,"line":267},4,[141,269,270],{"class":242},"  name",[141,272,273],{"class":147},"?:",[141,275,249],{"class":248},[141,277,252],{"class":166},[141,279,281,284,286,289],{"class":143,"line":280},5,[141,282,283],{"class":242},"  decimals",[141,285,200],{"class":147},[141,287,288],{"class":248}," number",[141,290,252],{"class":166},[141,292,294,297,299,301,304],{"class":143,"line":293},6,[141,295,296],{"class":242},"  balance",[141,298,200],{"class":147},[141,300,249],{"class":248},[141,302,303],{"class":166},"; ",[141,305,307],{"class":306},"sjhu3","\u002F\u002F raw, exact\n",[141,309,311,314,316,318],{"class":143,"line":310},7,[141,312,313],{"class":242},"  balanceFormatted",[141,315,200],{"class":147},[141,317,249],{"class":248},[141,319,252],{"class":166},[141,321,323,326,328,330,332],{"class":143,"line":322},8,[141,324,325],{"class":242},"  priceUsd",[141,327,273],{"class":147},[141,329,288],{"class":248},[141,331,303],{"class":166},[141,333,334],{"class":306},"\u002F\u002F when the explorer quotes one\n",[141,336,338,341,343,345],{"class":143,"line":337},9,[141,339,340],{"class":242},"  valueUsd",[141,342,273],{"class":147},[141,344,288],{"class":248},[141,346,252],{"class":166},[141,348,350],{"class":143,"line":349},10,[141,351,352],{"class":166},"}\n",[209,354,355,358,359,362],{},[138,356,357],{},"nonZeroOnly"," drops holdings with a zero balance, which is most of them on a wallet that has been airdropped at. Two sizes to know: Blockscout returns the complete holding array in one answer, and a busy wallet makes that a response of several megabytes, so that read gets sixty seconds unless ",[138,360,361],{},"ProviderConfig.timeout"," says otherwise. Helius pages a thousand assets at a time and stops after twenty pages.",[126,364,366],{"id":365},"transfers","Transfers",[131,368,370],{"className":133,"code":369,"language":135,"meta":136,"style":136},"const transfers = await provider.getTokenTransfers?.(address, \"ethereum\", {\n  token: \"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984\",\n  limit: 20,\n});\n",[138,371,372,405,423,435],{"__ignoreMap":136},[141,373,374,376,379,381,383,385,387,390,392,394,396,398,400,402],{"class":143,"line":144},[141,375,148],{"class":147},[141,377,378],{"class":151}," transfers",[141,380,155],{"class":147},[141,382,159],{"class":158},[141,384,163],{"class":162},[141,386,167],{"class":166},[141,388,389],{"class":170},"getTokenTransfers",[141,391,174],{"class":166},[141,393,177],{"class":162},[141,395,180],{"class":166},[141,397,184],{"class":183},[141,399,188],{"class":187},[141,401,184],{"class":183},[141,403,404],{"class":166},", {\n",[141,406,407,410,412,415,418,420],{"class":143,"line":239},[141,408,409],{"class":196},"  token",[141,411,200],{"class":166},[141,413,414],{"class":183}," \"",[141,416,417],{"class":187},"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",[141,419,184],{"class":183},[141,421,422],{"class":166},",\n",[141,424,425,428,430,433],{"class":143,"line":255},[141,426,427],{"class":196},"  limit",[141,429,200],{"class":166},[141,431,432],{"class":203}," 20",[141,434,422],{"class":166},[141,436,437],{"class":143,"line":267},[141,438,439],{"class":166},"});\n",[209,441,442,443,446,447,450,451,454,455,180,458,180,461,180,464,467,468,471],{},"Etherscan and Blockscout only. The options are ",[138,444,445],{},"TxHistoryOptions"," plus ",[138,448,449],{},"token",", which narrows the list to one contract. Each row is a ",[138,452,453],{},"TokenTransfer"," with the contract, symbol, decimals, exact ",[138,456,457],{},"value",[138,459,460],{},"valueFormatted",[138,462,463],{},"from",[138,465,466],{},"to",", the ",[138,469,470],{},"txHash"," it happened in, the block and the timestamp.",[209,473,474,475,478,479,482],{},"The reason this read exists next to ",[138,476,477],{},"getTxHistory",": an ERC-20 transfer sent to you by somebody else is their transaction, not yours. It never appears in your native history. ",[138,480,481],{},"explorers_token_transfers"," says as much in its description, so an agent asked \"what did this wallet receive\" reaches for the right tool.",[126,484,12],{"id":485},"cli",[131,487,491],{"className":488,"code":489,"language":490,"meta":136,"style":136},"language-bash shiki shiki-themes github-light github-light poimandres","explorers tokens vitalik.eth\nexplorers transfers vitalik.eth -t 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 -n 20\n","bash",[138,492,493,505],{"__ignoreMap":136},[141,494,495,499,502],{"class":143,"line":144},[141,496,498],{"class":497},"sseY5","explorers",[141,500,152],{"class":501},"sX7Zv",[141,503,504],{"class":501}," vitalik.eth\n",[141,506,507,509,511,514,518,521,524],{"class":143,"line":239},[141,508,498],{"class":497},[141,510,378],{"class":501},[141,512,513],{"class":501}," vitalik.eth",[141,515,517],{"class":516},"sqT1Y"," -t",[141,519,520],{"class":203}," 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",[141,522,523],{"class":516}," -n",[141,525,526],{"class":203}," 20\n",[126,528,530],{"id":529},"in-the-explorer","In the explorer",[209,532,533,534,538],{},"The ",[535,536,52],"a",{"href":537},"\u002Fexplorer"," caps holdings at fifty rows and transfers at ten, and says how many there were. Read the rest with the library.",[540,541,542],"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 pre.shiki code .snHMy, html code.shiki .snHMy{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#ADD7FF}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);}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}html pre.shiki code .sseY5, html code.shiki .sseY5{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#91B4D5}html pre.shiki code .sX7Zv, html code.shiki .sX7Zv{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#ADD7FF}html pre.shiki code .sqT1Y, html code.shiki .sqT1Y{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#ADD7FF}",{"title":136,"searchDepth":239,"depth":239,"links":544},[545,546,547,548],{"id":128,"depth":239,"text":129},{"id":365,"depth":239,"text":366},{"id":485,"depth":239,"text":12},{"id":529,"depth":239,"text":530},"getTokenBalances and getTokenTransfers, where they exist, the nonZeroOnly flag, and the transfers that never show up in native history.","md",null,{"icon":553},"i-solar-square-transfer-horizontal-linear",true,{"title":28,"description":549},"Yh2500-_dc_t7q2PAWUMTuqUawmWefhsHS-WkfS5ixY",[558,560],{"title":24,"path":25,"stem":26,"description":559,"children":-1},"getTxHistory and getTxDetail, the Transaction shape, paging options, OP_RETURN payloads, and what raw is for.",{"title":32,"path":33,"stem":34,"description":561,"children":-1},"getContractInfo on Etherscan and Blockscout, the ContractInfo shape, proxies, and what verified actually means.",1788626962638]