[{"data":1,"prerenderedAt":678},["ShallowReactive",2],{"navigation_docs":3,"-guide-registry":196,"-guide-registry-surround":673},[4,44],{"title":5,"path":6,"stem":7,"children":8,"icon":43},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Registry and aliases","\u002Fguide\u002Fregistry","1.guide\u002F02.registry",{"title":16,"path":17,"stem":18},"Address validation","\u002Fguide\u002Fvalidation","1.guide\u002F03.validation",{"title":20,"path":21,"stem":22},"Identify","\u002Fguide\u002Fidentify","1.guide\u002F04.identify",{"title":24,"path":25,"stem":26},"Metadata","\u002Fguide\u002Fmetadata","1.guide\u002F05.metadata",{"title":28,"path":29,"stem":30},"CLI","\u002Fguide\u002Fcli","1.guide\u002F06.cli",{"title":32,"path":33,"stem":34},"Agents","\u002Fguide\u002Fagents","1.guide\u002F07.agents",{"title":36,"path":37,"stem":38},"Custom chains","\u002Fguide\u002Fcustom","1.guide\u002F08.custom",{"title":40,"path":41,"stem":42},"Playground","\u002Fguide\u002Fplayground","1.guide\u002F09.playground","i-lucide-book-open",{"title":45,"path":46,"stem":47,"children":48,"icon":195},"Chains","\u002Fchains","2.chains\u002F00.index",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Ethereum","\u002Fchains\u002Fethereum","2.chains\u002F01.ethereum",{"title":56,"path":57,"stem":58},"Base","\u002Fchains\u002Fbase","2.chains\u002F02.base",{"title":60,"path":61,"stem":62},"Arbitrum One","\u002Fchains\u002Farbitrum","2.chains\u002F03.arbitrum",{"title":64,"path":65,"stem":66},"Optimism","\u002Fchains\u002Foptimism","2.chains\u002F04.optimism",{"title":68,"path":69,"stem":70},"Polygon PoS","\u002Fchains\u002Fpolygon","2.chains\u002F05.polygon",{"title":72,"path":73,"stem":74},"BNB Chain","\u002Fchains\u002Fbsc","2.chains\u002F06.bsc",{"title":76,"path":77,"stem":78},"Avalanche C-Chain","\u002Fchains\u002Favalanche","2.chains\u002F07.avalanche",{"title":80,"path":81,"stem":82},"Fantom Opera","\u002Fchains\u002Ffantom","2.chains\u002F08.fantom",{"title":84,"path":85,"stem":86},"Gnosis Chain","\u002Fchains\u002Fgnosis","2.chains\u002F09.gnosis",{"title":88,"path":89,"stem":90},"Linea","\u002Fchains\u002Flinea","2.chains\u002F10.linea",{"title":92,"path":93,"stem":94},"zkSync Era","\u002Fchains\u002Fzksync","2.chains\u002F11.zksync",{"title":96,"path":97,"stem":98},"Scroll","\u002Fchains\u002Fscroll","2.chains\u002F12.scroll",{"title":100,"path":101,"stem":102},"Berachain","\u002Fchains\u002Fberachain","2.chains\u002F13.berachain",{"title":104,"path":105,"stem":106},"Bitcoin","\u002Fchains\u002Fbitcoin","2.chains\u002F14.bitcoin",{"title":108,"path":109,"stem":110},"Litecoin","\u002Fchains\u002Flitecoin","2.chains\u002F15.litecoin",{"title":112,"path":113,"stem":114},"Pepecoin","\u002Fchains\u002Fpepecoin","2.chains\u002F16.pepecoin",{"title":116,"path":117,"stem":118},"eCash","\u002Fchains\u002Fecash","2.chains\u002F17.ecash",{"title":120,"path":121,"stem":122},"Cardano","\u002Fchains\u002Fcardano","2.chains\u002F18.cardano",{"title":124,"path":125,"stem":126},"Solana","\u002Fchains\u002Fsolana","2.chains\u002F19.solana",{"title":128,"path":129,"stem":130},"Stellar","\u002Fchains\u002Fstellar","2.chains\u002F20.stellar",{"title":132,"path":133,"stem":134},"XRP Ledger","\u002Fchains\u002Fxrpl","2.chains\u002F21.xrpl",{"title":136,"path":137,"stem":138},"Aptos","\u002Fchains\u002Faptos","2.chains\u002F22.aptos",{"title":140,"path":141,"stem":142},"Sui","\u002Fchains\u002Fsui","2.chains\u002F23.sui",{"title":144,"path":145,"stem":146},"TON (The Open Network)","\u002Fchains\u002Fton","2.chains\u002F24.ton",{"title":148,"path":149,"stem":150},"TRON","\u002Fchains\u002Ftron","2.chains\u002F25.tron",{"title":152,"path":153,"stem":154},"Octra","\u002Fchains\u002Foctra","2.chains\u002F26.octra",{"title":156,"path":157,"stem":158},"Arweave","\u002Fchains\u002Farweave","2.chains\u002F27.arweave",{"title":160,"path":161,"stem":162},"Monero","\u002Fchains\u002Fmonero","2.chains\u002F28.monero",{"title":164,"path":165,"stem":166},"Decred","\u002Fchains\u002Fdecred","2.chains\u002F29.decred",{"title":168,"path":169,"stem":170},"Arc","\u002Fchains\u002Farc","2.chains\u002F30.arc",{"title":172,"path":173,"stem":174},"Dogecoin","\u002Fchains\u002Fdogecoin","2.chains\u002F31.dogecoin",{"title":176,"path":177,"stem":178},"Bitcoin Cash","\u002Fchains\u002Fbitcoincash","2.chains\u002F32.bitcoincash",{"title":180,"path":181,"stem":182},"Bitcoin SV","\u002Fchains\u002Fbitcoinsv","2.chains\u002F33.bitcoinsv",{"title":184,"path":185,"stem":186},"Bitcoin Gold","\u002Fchains\u002Fbitcoingold","2.chains\u002F34.bitcoingold",{"title":188,"path":189,"stem":190},"Dash","\u002Fchains\u002Fdash","2.chains\u002F35.dash",{"title":192,"path":193,"stem":194},"Zcash","\u002Fchains\u002Fzcash","2.chains\u002F36.zcash","i-lucide-link",{"id":197,"title":12,"body":198,"description":666,"extension":667,"links":668,"meta":669,"navigation":244,"path":13,"seo":671,"stem":14,"__hash__":672},"docs\u002F1.guide\u002F02.registry.md",{"type":199,"value":200,"toc":660},"minimark",[201,206,321,334,338,341,481,498,569,579,583,591,601,625,629,656],[202,203,205],"h2",{"id":204},"five-functions","Five functions",[207,208,213],"pre",{"className":209,"code":210,"language":211,"meta":212,"style":212},"language-ts shiki shiki-themes chains chains chains","import { chains, create, getChain, has, register } from \"@agntn\u002Fchains\";\n\nchains(); \u002F\u002F [\"ethereum\", \"base\", \"arbitrum\", ...] in registration order\nhas(\"solana\"); \u002F\u002F true\ncreate(\"solana\"); \u002F\u002F a fresh Solana instance\ngetChain(\"sol\"); \u002F\u002F the same class, by alias\nregister(MyChain); \u002F\u002F a class this package does not ship\n","ts","",[214,215,216,239,246,260,278,293,309],"code",{"__ignoreMap":212},[217,218,221,225,229,232,236],"span",{"class":219,"line":220},"line",1,[217,222,224],{"class":223},"skH_V","import",[217,226,228],{"class":227},"s38Sx"," { chains, create, getChain, has, register } ",[217,230,231],{"class":223},"from",[217,233,235],{"class":234},"shU9J"," \"@agntn\u002Fchains\"",[217,237,238],{"class":227},";\n",[217,240,242],{"class":219,"line":241},2,[217,243,245],{"emptyLinePlaceholder":244},true,"\n",[217,247,249,253,256],{"class":219,"line":248},3,[217,250,252],{"class":251},"sK71F","chains",[217,254,255],{"class":227},"(); ",[217,257,259],{"class":258},"scIB-","\u002F\u002F [\"ethereum\", \"base\", \"arbitrum\", ...] in registration order\n",[217,261,263,266,269,272,275],{"class":219,"line":262},4,[217,264,265],{"class":251},"has",[217,267,268],{"class":227},"(",[217,270,271],{"class":234},"\"solana\"",[217,273,274],{"class":227},"); ",[217,276,277],{"class":258},"\u002F\u002F true\n",[217,279,281,284,286,288,290],{"class":219,"line":280},5,[217,282,283],{"class":251},"create",[217,285,268],{"class":227},[217,287,271],{"class":234},[217,289,274],{"class":227},[217,291,292],{"class":258},"\u002F\u002F a fresh Solana instance\n",[217,294,296,299,301,304,306],{"class":219,"line":295},6,[217,297,298],{"class":251},"getChain",[217,300,268],{"class":227},[217,302,303],{"class":234},"\"sol\"",[217,305,274],{"class":227},[217,307,308],{"class":258},"\u002F\u002F the same class, by alias\n",[217,310,312,315,318],{"class":219,"line":311},7,[217,313,314],{"class":251},"register",[217,316,317],{"class":227},"(MyChain); ",[217,319,320],{"class":258},"\u002F\u002F a class this package does not ship\n",[322,323,324,326,327,330,331,333],"p",{},[214,325,283],{}," takes a canonical key and throws ",[214,328,329],{},"UnknownChainError"," for anything else. ",[214,332,298],{}," is the forgiving one, and the one the CLI and the tools use.",[202,335,337],{"id":336},"what-getchain-accepts","What getChain accepts",[322,339,340],{},"Three spellings, tried in this order:",[342,343,344,373,469],"ol",{},[345,346,347,351,352,355,356,355,359,355,362,365,366,368,369,372],"li",{},[348,349,350],"strong",{},"The canonical key."," ",[214,353,354],{},"ethereum",", ",[214,357,358],{},"bsc",[214,360,361],{},"zksync",[214,363,364],{},"octra",". Lowercase, names the chain rather than its ticker. A short name is still a name, so ",[214,367,358],{}," and ",[214,370,371],{},"arbitrum"," stay keys.",[345,374,375,378,379,355,382,355,385,355,388,355,391,355,394,355,397,355,400,355,403,355,406,355,409,355,412,355,415,355,418,355,421,355,424,355,427,355,430,355,433,355,436,355,439,355,442,355,445,355,448,355,451,355,454,355,457,460,461,464,465,468],{},[348,376,377],{},"An alias."," The ticker spellings and nicknames a caller may already be holding: ",[214,380,381],{},"eth",[214,383,384],{},"matic",[214,386,387],{},"pol",[214,389,390],{},"btc",[214,392,393],{},"arb",[214,395,396],{},"arb1",[214,398,399],{},"op",[214,401,402],{},"bnb",[214,404,405],{},"binance",[214,407,408],{},"avax",[214,410,411],{},"ftm",[214,413,414],{},"xdai",[214,416,417],{},"bera",[214,419,420],{},"ltc",[214,422,423],{},"pep",[214,425,426],{},"xec",[214,428,429],{},"ada",[214,431,432],{},"sol",[214,434,435],{},"xlm",[214,437,438],{},"xrp",[214,440,441],{},"ripple",[214,443,444],{},"apt",[214,446,447],{},"trx",[214,449,450],{},"oct",[214,452,453],{},"ar",[214,455,456],{},"xmr",[214,458,459],{},"dcr",", and a few more like ",[214,462,463],{},"coinbase"," for Base and ",[214,466,467],{},"mainnet"," for Ethereum. Each chain's page lists its own.",[345,470,471,351,474,355,476,355,478,480],{},[348,472,473],{},"The display name.",[214,475,60],{},[214,477,72],{},[214,479,92],{},", read straight off the registered classes. That round trip matters for agents, which get a name out of one call and put it into the next.",[322,482,483,484,368,487,490,491,494,495,497],{},"Input is lowercased and trimmed first, so ",[214,485,486],{},"Matic",[214,488,489],{},"BTC "," work. Symbols aren't in the automatic index on purpose: six chains report ",[214,492,493],{},"ETH",", and matching on it would make the answer depend on registration order. ",[214,496,381],{}," resolves only because it's in the alias table, pointing at Ethereum.",[207,499,501],{"className":209,"code":500,"language":211,"meta":212,"style":212},"getChain(\"matic\").key; \u002F\u002F \"polygon\"\ngetChain(\"BNB Chain\").key; \u002F\u002F \"bsc\"\ngetChain(\"Arbitrum One\").key; \u002F\u002F \"arbitrum\"\ngetChain(); \u002F\u002F Ethereum\ngetChain(\"\"); \u002F\u002F throws UnsupportedChainError\n",[214,502,503,518,532,546,555],{"__ignoreMap":212},[217,504,505,507,509,512,515],{"class":219,"line":220},[217,506,298],{"class":251},[217,508,268],{"class":227},[217,510,511],{"class":234},"\"matic\"",[217,513,514],{"class":227},").key; ",[217,516,517],{"class":258},"\u002F\u002F \"polygon\"\n",[217,519,520,522,524,527,529],{"class":219,"line":241},[217,521,298],{"class":251},[217,523,268],{"class":227},[217,525,526],{"class":234},"\"BNB Chain\"",[217,528,514],{"class":227},[217,530,531],{"class":258},"\u002F\u002F \"bsc\"\n",[217,533,534,536,538,541,543],{"class":219,"line":248},[217,535,298],{"class":251},[217,537,268],{"class":227},[217,539,540],{"class":234},"\"Arbitrum One\"",[217,542,514],{"class":227},[217,544,545],{"class":258},"\u002F\u002F \"arbitrum\"\n",[217,547,548,550,552],{"class":219,"line":262},[217,549,298],{"class":251},[217,551,255],{"class":227},[217,553,554],{"class":258},"\u002F\u002F Ethereum\n",[217,556,557,559,561,564,566],{"class":219,"line":280},[217,558,298],{"class":251},[217,560,268],{"class":227},[217,562,563],{"class":234},"\"\"",[217,565,274],{"class":227},[217,567,568],{"class":258},"\u002F\u002F throws UnsupportedChainError\n",[322,570,571,574,575,578],{},[214,572,573],{},"getChain()"," with no argument still means Ethereum. ",[214,576,577],{},"getChain(\"\")"," or a blank string doesn't, that's a caller mistake, and it throws rather than quietly answering about the wrong chain. The error message quotes the input, so blank and control character input stays visible in a log.",[202,580,582],{"id":581},"where-the-classes-come-from","Where the classes come from",[207,584,589],{"className":585,"code":587,"language":588,"meta":212},[586],"language-text","Chain (abstract)\n├── EVM (abstract)\n│   ├── Ethereum\n│   ├── Base\n│   ├── Arbitrum\n│   └── ...\n├── Move (abstract)\n│   ├── Aptos\n│   └── Sui\n├── Bitcoin\n├── Solana\n├── Stellar\n├── Xrpl\n├── Ton\n├── Tron\n├── Octra\n├── Arweave\n├── Monero\n└── Decred\n","text",[214,590,587],{"__ignoreMap":212},[322,592,593,594,368,597,600],{},"Each chain is its own class holding its own metadata. ",[214,595,596],{},"EVM",[214,598,599],{},"Move"," own the family type and the address format, and everything else is declared per class, down to the coin type all fourteen EVM chains repeat.",[322,602,603,604,607,608,611,612,607,615,618,619,621,622,624],{},"One list puts them in the registry: ",[214,605,606],{},"builtins"," in ",[214,609,610],{},"src\u002Fchains\u002Findex.ts",", read the first time anything asks the registry. No module registers itself or computes anything as it loads, so the CLI is the only entry that runs anything on import, and ",[214,613,614],{},"sideEffects",[214,616,617],{},"package.json"," says so. A bundler keeps only what your project touches: import ",[214,620,104],{}," and you ship Bitcoin, call ",[214,623,298],{}," and you ship every chain, since any name can resolve to any of them. The cost is that a chain file counts for nothing until its class joins that list, and a test compares the two so it can't drift quietly.",[202,626,628],{"id":627},"registering-your-own","Registering your own",[322,630,631,634,635,638,639,355,641,355,643,355,645,368,648,651,652,655],{},[214,632,633],{},"register(ChainClass)"," puts a class under its static ",[214,636,637],{},"key",". From then on ",[214,640,283],{},[214,642,298],{},[214,644,265],{},[214,646,647],{},"chains()",[214,649,650],{},"identify"," see it like any built-in. Registering the same key again replaces the class. The whole recipe, including the two casts the closed key and type unions ask for, is in ",[653,654,36],"a",{"href":37},".",[657,658,659],"style",{},"html pre.shiki code .skH_V, html code.shiki .skH_V{--shiki-light:var(--shiki-token-keyword);--shiki-default:var(--shiki-token-keyword);--shiki-dark:var(--shiki-token-keyword)}html pre.shiki code .s38Sx, html code.shiki .s38Sx{--shiki-light:var(--ui-text-highlighted);--shiki-default:var(--ui-text-highlighted);--shiki-dark:var(--ui-text-highlighted)}html pre.shiki code .shU9J, html code.shiki .shU9J{--shiki-light:var(--shiki-token-string);--shiki-default:var(--shiki-token-string);--shiki-dark:var(--shiki-token-string)}html pre.shiki code .sK71F, html code.shiki .sK71F{--shiki-light:var(--shiki-token-function);--shiki-default:var(--shiki-token-function);--shiki-dark:var(--shiki-token-function)}html pre.shiki code .scIB-, html code.shiki .scIB-{--shiki-light:var(--shiki-token-comment);--shiki-default:var(--shiki-token-comment);--shiki-dark:var(--shiki-token-comment)}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":212,"searchDepth":241,"depth":241,"links":661},[662,663,664,665],{"id":204,"depth":241,"text":205},{"id":336,"depth":241,"text":337},{"id":581,"depth":241,"text":582},{"id":627,"depth":241,"text":628},"Keys and display names plus the aliases people actually type. All land on the same class. How the registry is seeded and why nothing registers itself.","md",null,{"icon":670},"i-lucide-list-tree",{"title":12,"description":666},"Ow6FAZRZtAnP59xi1k5R0nlAgTDywGngns6bYATXk-c",[674,676],{"title":10,"path":6,"stem":7,"description":675,"children":-1},"Install the package. Resolve one chain. Check one address. Every chain is a class and every answer comes from the class that knows the format.",{"title":16,"path":17,"stem":18,"description":677,"children":-1},"assertAddress on every chain, and decodeAddress for what an address pays to. What each family decodes and which checksums are verified and which are left alone. A format check and nothing more.",1791251868133]