[{"data":1,"prerenderedAt":746},["ShallowReactive",2],{"navigation_docs":3,"-guide-registry":196,"-guide-registry-surround":741},[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":734,"extension":735,"links":736,"meta":737,"navigation":280,"path":13,"seo":739,"stem":14,"__hash__":740},"docs\u002F1.guide\u002F02.registry.md",{"type":199,"value":200,"toc":728},"minimark",[201,206,374,387,391,394,533,550,644,654,658,666,676,694,698,724],[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 github-light github-light poimandres","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,275,282,296,318,337,357],"code",{"__ignoreMap":212},[217,218,221,225,229,233,236,239,241,244,246,249,251,254,257,261,265,269,272],"span",{"class":219,"line":220},"line",1,[217,222,224],{"class":223},"sP0CR","import",[217,226,228],{"class":227},"sKlNE"," {",[217,230,232],{"class":231},"snHMy"," chains",[217,234,235],{"class":227},",",[217,237,238],{"class":231}," create",[217,240,235],{"class":227},[217,242,243],{"class":231}," getChain",[217,245,235],{"class":227},[217,247,248],{"class":231}," has",[217,250,235],{"class":227},[217,252,253],{"class":231}," register",[217,255,256],{"class":227}," }",[217,258,260],{"class":259},"stCPd"," from",[217,262,264],{"class":263},"scVjq"," \"",[217,266,268],{"class":267},"sQ7BG","@agntn\u002Fchains",[217,270,271],{"class":263},"\"",[217,273,274],{"class":227},";\n",[217,276,278],{"class":219,"line":277},2,[217,279,281],{"emptyLinePlaceholder":280},true,"\n",[217,283,285,289,292],{"class":219,"line":284},3,[217,286,288],{"class":287},"sULi6","chains",[217,290,291],{"class":227},"(); ",[217,293,295],{"class":294},"sjhu3","\u002F\u002F [\"ethereum\", \"base\", \"arbitrum\", ...] in registration order\n",[217,297,299,302,305,307,310,312,315],{"class":219,"line":298},4,[217,300,301],{"class":287},"has",[217,303,304],{"class":227},"(",[217,306,271],{"class":263},[217,308,309],{"class":267},"solana",[217,311,271],{"class":263},[217,313,314],{"class":227},"); ",[217,316,317],{"class":294},"\u002F\u002F true\n",[217,319,321,324,326,328,330,332,334],{"class":219,"line":320},5,[217,322,323],{"class":287},"create",[217,325,304],{"class":227},[217,327,271],{"class":263},[217,329,309],{"class":267},[217,331,271],{"class":263},[217,333,314],{"class":227},[217,335,336],{"class":294},"\u002F\u002F a fresh Solana instance\n",[217,338,340,343,345,347,350,352,354],{"class":219,"line":339},6,[217,341,342],{"class":287},"getChain",[217,344,304],{"class":227},[217,346,271],{"class":263},[217,348,349],{"class":267},"sol",[217,351,271],{"class":263},[217,353,314],{"class":227},[217,355,356],{"class":294},"\u002F\u002F the same class, by alias\n",[217,358,360,363,365,369,371],{"class":219,"line":359},7,[217,361,362],{"class":287},"register",[217,364,304],{"class":227},[217,366,368],{"class":367},"spVlQ","MyChain",[217,370,314],{"class":227},[217,372,373],{"class":294},"\u002F\u002F a class this package does not ship\n",[375,376,377,379,380,383,384,386],"p",{},[214,378,323],{}," takes a canonical key and throws ",[214,381,382],{},"UnknownChainError"," for anything else. ",[214,385,342],{}," is the forgiving one, and the one the CLI and the tools use.",[202,388,390],{"id":389},"what-getchain-accepts","What getChain accepts",[375,392,393],{},"Three spellings, tried in this order:",[395,396,397,426,521],"ol",{},[398,399,400,404,405,408,409,408,412,408,415,418,419,421,422,425],"li",{},[401,402,403],"strong",{},"The canonical key."," ",[214,406,407],{},"ethereum",", ",[214,410,411],{},"bsc",[214,413,414],{},"zksync",[214,416,417],{},"octra",". Lowercase, names the chain rather than its ticker. A short name is still a name, so ",[214,420,411],{}," and ",[214,423,424],{},"arbitrum"," stay keys.",[398,427,428,431,432,408,435,408,438,408,441,408,444,408,447,408,450,408,453,408,456,408,459,408,462,408,465,408,468,408,471,408,474,408,477,408,480,408,483,408,485,408,488,408,491,408,494,408,497,408,500,408,503,408,506,408,509,512,513,516,517,520],{},[401,429,430],{},"An alias."," The ticker spellings and nicknames a caller may already be holding: ",[214,433,434],{},"eth",[214,436,437],{},"matic",[214,439,440],{},"pol",[214,442,443],{},"btc",[214,445,446],{},"arb",[214,448,449],{},"arb1",[214,451,452],{},"op",[214,454,455],{},"bnb",[214,457,458],{},"binance",[214,460,461],{},"avax",[214,463,464],{},"ftm",[214,466,467],{},"xdai",[214,469,470],{},"bera",[214,472,473],{},"ltc",[214,475,476],{},"pep",[214,478,479],{},"xec",[214,481,482],{},"ada",[214,484,349],{},[214,486,487],{},"xlm",[214,489,490],{},"xrp",[214,492,493],{},"ripple",[214,495,496],{},"apt",[214,498,499],{},"trx",[214,501,502],{},"oct",[214,504,505],{},"ar",[214,507,508],{},"xmr",[214,510,511],{},"dcr",", and a few more like ",[214,514,515],{},"coinbase"," for Base and ",[214,518,519],{},"mainnet"," for Ethereum. Each chain's page lists its own.",[398,522,523,404,526,408,528,408,530,532],{},[401,524,525],{},"The display name.",[214,527,60],{},[214,529,72],{},[214,531,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.",[375,534,535,536,421,539,542,543,546,547,549],{},"Input is lowercased and trimmed first, so ",[214,537,538],{},"Matic",[214,540,541],{},"BTC "," work. Symbols aren't in the automatic index on purpose: six chains report ",[214,544,545],{},"ETH",", and matching on it would make the answer depend on registration order. ",[214,548,434],{}," resolves only because it's in the alias table, pointing at Ethereum.",[207,551,553],{"className":209,"code":552,"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,554,555,579,600,621,630],{"__ignoreMap":212},[217,556,557,559,561,563,565,567,570,573,576],{"class":219,"line":220},[217,558,342],{"class":287},[217,560,304],{"class":227},[217,562,271],{"class":263},[217,564,437],{"class":267},[217,566,271],{"class":263},[217,568,569],{"class":227},").",[217,571,572],{"class":367},"key",[217,574,575],{"class":227},"; ",[217,577,578],{"class":294},"\u002F\u002F \"polygon\"\n",[217,580,581,583,585,587,589,591,593,595,597],{"class":219,"line":277},[217,582,342],{"class":287},[217,584,304],{"class":227},[217,586,271],{"class":263},[217,588,72],{"class":267},[217,590,271],{"class":263},[217,592,569],{"class":227},[217,594,572],{"class":367},[217,596,575],{"class":227},[217,598,599],{"class":294},"\u002F\u002F \"bsc\"\n",[217,601,602,604,606,608,610,612,614,616,618],{"class":219,"line":284},[217,603,342],{"class":287},[217,605,304],{"class":227},[217,607,271],{"class":263},[217,609,60],{"class":267},[217,611,271],{"class":263},[217,613,569],{"class":227},[217,615,572],{"class":367},[217,617,575],{"class":227},[217,619,620],{"class":294},"\u002F\u002F \"arbitrum\"\n",[217,622,623,625,627],{"class":219,"line":298},[217,624,342],{"class":287},[217,626,291],{"class":227},[217,628,629],{"class":294},"\u002F\u002F Ethereum\n",[217,631,632,634,636,639,641],{"class":219,"line":320},[217,633,342],{"class":287},[217,635,304],{"class":227},[217,637,638],{"class":263},"\"\"",[217,640,314],{"class":227},[217,642,643],{"class":294},"\u002F\u002F throws UnsupportedChainError\n",[375,645,646,649,650,653],{},[214,647,648],{},"getChain()"," with no argument still means Ethereum. ",[214,651,652],{},"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,655,657],{"id":656},"where-the-classes-come-from","Where the classes come from",[207,659,664],{"className":660,"code":662,"language":663,"meta":212},[661],"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,665,662],{"__ignoreMap":212},[375,667,668,669,421,672,675],{},"Each chain is its own class holding its own metadata. ",[214,670,671],{},"EVM",[214,673,674],{},"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.",[375,677,678,679,682,683,686,687,682,690,693],{},"One list puts them in the registry: ",[214,680,681],{},"builtins"," in ",[214,684,685],{},"src\u002Fchains\u002Findex.ts",". No module registers itself as it loads, so the CLI is the only entry that runs anything on import, and ",[214,688,689],{},"sideEffects",[214,691,692],{},"package.json"," says so, which lets a bundler drop whatever your project never touches. 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,695,697],{"id":696},"registering-your-own","Registering your own",[375,699,700,703,704,706,707,408,709,408,711,408,713,421,716,719,720,723],{},[214,701,702],{},"register(ChainClass)"," puts a class under its static ",[214,705,572],{},". From then on ",[214,708,323],{},[214,710,342],{},[214,712,301],{},[214,714,715],{},"chains()",[214,717,718],{},"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 ",[721,722,36],"a",{"href":37},".",[725,726,727],"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 .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":212,"searchDepth":277,"depth":277,"links":729},[730,731,732,733],{"id":204,"depth":277,"text":205},{"id":389,"depth":277,"text":390},{"id":656,"depth":277,"text":657},{"id":696,"depth":277,"text":697},"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":738},"i-lucide-list-tree",{"title":12,"description":734},"vKv2DeEBGvQCYWCmWjFFYfV9WZv4JWOZYkj1Dz92cHU",[742,744],{"title":10,"path":6,"stem":7,"description":743,"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":745,"children":-1},"assertAddress on every chain. What each family decodes and which checksums are verified and which are left alone. A format check and nothing more.",1790447828961]