[{"data":1,"prerenderedAt":599},["ShallowReactive",2],{"navigation_docs":3,"-providers-horizon":128,"-providers-horizon-surround":594},[4,56,124],{"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":123},"Providers","\u002Fproviders","2.providers\u002F0.index",[61,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119],{"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","i-lucide-library",{"title":125,"path":126,"stem":127},"Chains","\u002Fchains","3.chains",{"id":129,"title":120,"body":130,"description":587,"extension":588,"links":589,"meta":590,"navigation":195,"path":121,"seo":592,"stem":122,"__hash__":593},"docs\u002F2.providers\u002F15.horizon.md",{"type":131,"value":132,"toc":581},"minimark",[133,137,142,285,305,309,412,415,419,568,572,577],[134,135],"provider-facts",{"provider":136},"horizon",[138,139,141],"h2",{"id":140},"address-it","Address it",[143,144,149],"pre",{"className":145,"code":146,"language":147,"meta":148,"style":148},"language-ts shiki shiki-themes github-light github-light poimandres","import { Horizon } from \"@agntn\u002Fexplorers\u002Fproviders\u002Fhorizon\";\n\nconst horizon = new Horizon(); \u002F\u002F or create(\"horizon\"), or { baseUrl: \"https:\u002F\u002Fmy.horizon\" }\nawait horizon.getBalance(\"GAHK7EEG2WWHVKDNT4CEQFZGKF2LGDSW2IVM4S5DP42RBW3K6BTODB4A\", \"stellar\");\nawait horizon.getGasData(\"stellar\");\n","ts","",[150,151,152,190,197,224,263],"code",{"__ignoreMap":148},[153,154,157,161,165,169,172,176,180,184,187],"span",{"class":155,"line":156},"line",1,[153,158,160],{"class":159},"sP0CR","import",[153,162,164],{"class":163},"sKlNE"," {",[153,166,168],{"class":167},"snHMy"," Horizon",[153,170,171],{"class":163}," }",[153,173,175],{"class":174},"stCPd"," from",[153,177,179],{"class":178},"scVjq"," \"",[153,181,183],{"class":182},"sQ7BG","@agntn\u002Fexplorers\u002Fproviders\u002Fhorizon",[153,185,186],{"class":178},"\"",[153,188,189],{"class":163},";\n",[153,191,193],{"class":155,"line":192},2,[153,194,196],{"emptyLinePlaceholder":195},true,"\n",[153,198,200,204,208,211,214,217,220],{"class":155,"line":199},3,[153,201,203],{"class":202},"s1TYA","const",[153,205,207],{"class":206},"saoiD"," horizon",[153,209,210],{"class":202}," =",[153,212,213],{"class":159}," new",[153,215,168],{"class":216},"sULi6",[153,218,219],{"class":163},"(); ",[153,221,223],{"class":222},"sjhu3","\u002F\u002F or create(\"horizon\"), or { baseUrl: \"https:\u002F\u002Fmy.horizon\" }\n",[153,225,227,231,234,237,240,243,245,248,250,253,255,258,260],{"class":155,"line":226},4,[153,228,230],{"class":229},"sZW6a","await",[153,232,207],{"class":233},"spVlQ",[153,235,236],{"class":163},".",[153,238,239],{"class":216},"getBalance",[153,241,242],{"class":163},"(",[153,244,186],{"class":178},[153,246,247],{"class":182},"GAHK7EEG2WWHVKDNT4CEQFZGKF2LGDSW2IVM4S5DP42RBW3K6BTODB4A",[153,249,186],{"class":178},[153,251,252],{"class":163},", ",[153,254,186],{"class":178},[153,256,257],{"class":182},"stellar",[153,259,186],{"class":178},[153,261,262],{"class":163},");\n",[153,264,266,268,270,272,275,277,279,281,283],{"class":155,"line":265},5,[153,267,230],{"class":229},[153,269,207],{"class":233},[153,271,236],{"class":163},[153,273,274],{"class":216},"getGasData",[153,276,242],{"class":163},[153,278,186],{"class":178},[153,280,257],{"class":182},[153,282,186],{"class":178},[153,284,262],{"class":163},[286,287,288,289,292,293,296,297,300,301,304],"p",{},"One chain, no key. ",[150,290,291],{},"baseUrl"," is the Horizon root and defaults to ",[150,294,295],{},"https:\u002F\u002Fhorizon.stellar.org",", the instance the Stellar Development Foundation runs, which keeps one year of history and nothing older. Point it at any other Horizon if you need the rest. Any other chain is an ",[150,298,299],{},"UnsupportedChainError",", and an account id that doesn't pass the Stellar checksum fails before a request goes out. That includes muxed ",[150,302,303],{},"M..."," addresses, which aren't accounts.",[138,306,308],{"id":307},"what-it-reads","What it reads",[310,311,312,325],"table",{},[313,314,315],"thead",{},[316,317,318,322],"tr",{},[319,320,321],"th",{},"Operation",[319,323,324],{},"Route",[326,327,328,340,358,369,377,391,402],"tbody",{},[316,329,330,334],{},[331,332,333],"td",{},"balance",[331,335,336,339],{},[150,337,338],{},"\u002Faccounts\u002F{id}",", the native entry",[316,341,342,345],{},[331,343,344],{},"token holdings",[331,346,347,349,350,353,354,357],{},[150,348,338],{},", every ",[150,351,352],{},"credit_alphanum4"," and ",[150,355,356],{},"credit_alphanum12"," trustline",[316,359,360,363],{},[331,361,362],{},"history",[331,364,365,368],{},[150,366,367],{},"\u002Faccounts\u002F{id}\u002Fpayments?join=transactions",", one row per operation",[316,370,371,374],{},[331,372,373],{},"token transfers",[331,375,376],{},"the same payments, keeping the rows that moved an issued asset",[316,378,379,382],{},[331,380,381],{},"one transaction",[331,383,384,387,388],{},[150,385,386],{},"\u002Ftransactions\u002F{hash}"," plus ",[150,389,390],{},"\u002Ftransactions\u002F{hash}\u002Foperations",[316,392,393,396],{},[331,394,395],{},"gas",[331,397,398,401],{},[150,399,400],{},"\u002Ffee_stats",", in stroops per operation",[316,403,404,407],{},[331,405,406],{},"block",[331,408,409],{},[150,410,411],{},"\u002Fledgers\u002F{sequence}",[286,413,414],{},"No contracts and no unspent outputs. Soroban state lives behind RPC, not Horizon, and Stellar has accounts, not outputs.",[138,416,418],{"id":417},"gotchas","Gotchas",[420,421,422,430,445,464,471,493,511,533,551,560],"ul",{},[423,424,425,426,429],"li",{},"Stroops, seven decimals, for XLM and for every issued asset alike. Horizon prints amounts as decimal strings like ",[150,427,428],{},"12.8193804",", and the provider turns them into stroops without a float in sight.",[423,431,432,433,436,437,440,441,444],{},"An issued asset is ",[150,434,435],{},"CODE:ISSUER",", the SEP-11 spelling, in ",[150,438,439],{},"contract"," on holdings and transfers and as the ",[150,442,443],{},"token"," filter. Liquidity pool shares sit in the same balances array and stay out, because a pool share isn't a token anyone sends.",[423,446,447,448,451,452,455,456,459,460,463],{},"History is Horizon's payments view, not its transactions view, so every row has a sender, a recipient and an amount. That covers payments, path payments, account creations, merges and contract calls that moved an asset. A transaction with a hundred payments in it is a hundred rows sharing one hash, and only a single-operation transaction carries its ",[150,449,450],{},"fee"," on the row; the fee belongs to the transaction, and ",[150,453,454],{},"getTxDetail"," always has it. Failed operations come along with ",[150,457,458],{},"status: \"failed\""," and no token transfers. ",[150,461,462],{},"raw"," keeps the operation record with its joined transaction, memo included.",[423,465,466,467,470],{},"An account merge is a row with ",[150,468,469],{},"value: \"0\"",", honestly. Horizon doesn't put the merged amount on the operation.",[423,472,473,476,477,480,481,484,485,488,489,492],{},[150,474,475],{},"limit"," up to 200 a page, ",[150,478,479],{},"page"," up to 10. Horizon pages with cursors, so page 3 costs three requests, and ",[150,482,483],{},"startBlock"," or ",[150,486,487],{},"endBlock"," throw because there's no ledger filter on an account's payments. Token transfers have no asset filter on Horizon's side either, so ",[150,490,491],{},"getTokenTransfers"," scans up to five pages of 200 payments and keeps what moved an issued asset. On a busy account that's the last thousand payments, not all of them.",[423,494,495,497,498,501,502,505,506,353,509,236],{},[150,496,454],{}," picks the first payment-like operation as the row and lists every issued-asset movement under ",[150,499,500],{},"tokenTransfers",". Soroban operations set ",[150,503,504],{},"isContractInteraction",". A transaction that only manages offers or trustlines has ",[150,507,508],{},"to: null",[150,510,469],{},[423,512,513,514,516,517,520,521,524,525,528,529,532],{},"Gas is ",[150,515,400],{},", and only two of its numbers survive the trip. ",[150,518,519],{},"baseFee"," is the ledger's base fee. ",[150,522,523],{},"safeGasPrice"," is the fee most operations were charged over the last five ledgers, 100 stroops until surge pricing kicks in, then whatever the marginal bid was. ",[150,526,527],{},"fastGasPrice"," is the 95th percentile, and that one is Soroban's: contract calls pay resource fees on top, so it reads as a cap that clears them, not as what a payment costs. There's no ",[150,530,531],{},"proposedGasPrice",", because every percentile in between averages a payment with a contract call and means nothing.",[423,534,535,536,539,540,542,543,546,547,550],{},"A ledger is a block with ",[150,537,538],{},"txCount"," counting successful and failed transactions, ",[150,541,519],{}," in stroops, an empty ",[150,544,545],{},"miner"," and gas fields of ",[150,548,549],{},"\"0\"",", like every other chain without gas.",[423,552,553,555,556,559],{},[150,554,239],{}," returns the whole balance, reserve and liabilities included, and the snapshot fields stay null because the account record doesn't say which ledger answered. An account the ledger never funded is a 404 and a ",[150,557,558],{},"NotFoundError",", not a zero.",[423,561,562,563,567],{},"The ",[564,565,52],"a",{"href":566},"\u002Fexplorer"," has no live feed for Stellar. Search works, the hub says there's no tip.",[138,569,571],{"id":570},"where-it-lives","Where it lives",[286,573,574,236],{},[150,575,576],{},"src\u002Fproviders\u002Fhorizon.ts",[578,579,580],"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 .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":148,"searchDepth":192,"depth":192,"links":582},[583,584,585,586],{"id":140,"depth":192,"text":141},{"id":307,"depth":192,"text":308},{"id":417,"depth":192,"text":418},{"id":570,"depth":192,"text":571},"Stellar through the SDF's public Horizon. Balances and trustlines. Payments as history. Ledgers as blocks and fee stats as gas. Stroops. No key.","md",null,{"icon":591},"i-lucide-sunrise",{"title":120,"description":587},"NMpqz1gX49K1j2d2x0HQqxMmAbakmE6iTC0YKW39jzE",[595,597],{"title":116,"path":117,"stem":118,"description":596,"children":-1},"Decred through the Insight API of explorer.dcrdata.org. Balances with totals and the mempool delta. History and details and blocks. Atoms. No key.",{"title":125,"path":126,"stem":127,"description":598,"children":-1},"The 25 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.",1789756842737]