2022-02-03 07:26:04 -08:00
<!DOCTYPE html>
< html lang = "en-US" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
< title > ⚓ Anchor< / title >
< meta name = "generator" content = "VuePress 1.8.2" >
< link rel = "icon" href = "data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>⚓ </text></svg>" >
< meta name = "description" content = "" >
< meta name = "theme-color" content = "#3eaf7c" >
< meta name = "apple-mobile-web-app-capable" content = "yes" >
< meta name = "apple-mobile-web-app-status-bar-style" content = "black" >
2022-04-13 16:17:24 -07:00
< link rel = "preload" href = "/anchor/assets/css/0.styles.21b321ec.css" as = "style" > < link rel = "preload" href = "/anchor/assets/js/app.b2f13cd7.js" as = "script" > < link rel = "preload" href = "/anchor/assets/js/2.90291299.js" as = "script" > < link rel = "preload" href = "/anchor/assets/js/16.b6cb9e25.js" as = "script" > < link rel = "prefetch" href = "/anchor/assets/js/10.99d917b5.js" > < link rel = "prefetch" href = "/anchor/assets/js/11.45e25cc5.js" > < link rel = "prefetch" href = "/anchor/assets/js/12.d30544e0.js" > < link rel = "prefetch" href = "/anchor/assets/js/13.7bb3490d.js" > < link rel = "prefetch" href = "/anchor/assets/js/14.258e35e3.js" > < link rel = "prefetch" href = "/anchor/assets/js/15.243176ff.js" > < link rel = "prefetch" href = "/anchor/assets/js/17.29eac49f.js" > < link rel = "prefetch" href = "/anchor/assets/js/18.db5dc2ee.js" > < link rel = "prefetch" href = "/anchor/assets/js/19.b9ce785c.js" > < link rel = "prefetch" href = "/anchor/assets/js/20.50564768.js" > < link rel = "prefetch" href = "/anchor/assets/js/21.b31f2925.js" > < link rel = "prefetch" href = "/anchor/assets/js/3.397fd877.js" > < link rel = "prefetch" href = "/anchor/assets/js/4.f90252b7.js" > < link rel = "prefetch" href = "/anchor/assets/js/5.47891694.js" > < link rel = "prefetch" href = "/anchor/assets/js/6.493f79e9.js" > < link rel = "prefetch" href = "/anchor/assets/js/7.32936426.js" > < link rel = "prefetch" href = "/anchor/assets/js/8.9fc829e7.js" > < link rel = "prefetch" href = "/anchor/assets/js/9.525a5964.js" >
2022-04-12 15:47:53 -07:00
< link rel = "stylesheet" href = "/anchor/assets/css/0.styles.21b321ec.css" >
2022-02-03 07:26:04 -08:00
< / head >
< body >
< div id = "app" data-server-rendered = "true" > < div class = "theme-container no-sidebar" > < header class = "navbar" > < div class = "sidebar-button" > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" role = "img" viewBox = "0 0 448 512" class = "icon" > < path fill = "currentColor" d = "M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z" > < / path > < / svg > < / div > < a href = "/anchor/" aria-current = "page" class = "home-link router-link-exact-active router-link-active" > <!-- --> < span class = "site-name" > ⚓ Anchor< / span > < / a > < div class = "links" > < div class = "search-box" > < input aria-label = "Search" autocomplete = "off" spellcheck = "false" value = "" > <!-- --> < / div > < nav class = "nav-links can-hide" > < div class = "nav-item" > < a href = "https://book.anchor-lang.com" target = "_blank" rel = "noopener noreferrer" class = "nav-link external" >
The Anchor Book
< span > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" focusable = "false" x = "0px" y = "0px" viewBox = "0 0 100 100" width = "15" height = "15" class = "icon outbound" > < path fill = "currentColor" d = "M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z" > < / path > < polygon fill = "currentColor" points = "45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9" > < / polygon > < / svg > < span class = "sr-only" > (opens new window)< / span > < / span > < / a > < / div > < div class = "nav-item" > < a href = "https://docs.rs/anchor-lang/latest/anchor_lang/" target = "_blank" rel = "noopener noreferrer" class = "nav-link external" >
Rust
< span > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" focusable = "false" x = "0px" y = "0px" viewBox = "0 0 100 100" width = "15" height = "15" class = "icon outbound" > < path fill = "currentColor" d = "M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z" > < / path > < polygon fill = "currentColor" points = "45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9" > < / polygon > < / svg > < span class = "sr-only" > (opens new window)< / span > < / span > < / a > < / div > < div class = "nav-item" > < a href = "https://project-serum.github.io/anchor/ts/index.html" target = "_blank" rel = "noopener noreferrer" class = "nav-link external" >
TypeScript
< span > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" focusable = "false" x = "0px" y = "0px" viewBox = "0 0 100 100" width = "15" height = "15" class = "icon outbound" > < path fill = "currentColor" d = "M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z" > < / path > < polygon fill = "currentColor" points = "45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9" > < / polygon > < / svg > < span class = "sr-only" > (opens new window)< / span > < / span > < / a > < / div > < div class = "nav-item" > < a href = "https://github.com/project-serum/anchor" target = "_blank" rel = "noopener noreferrer" class = "nav-link external" >
GitHub
< span > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" focusable = "false" x = "0px" y = "0px" viewBox = "0 0 100 100" width = "15" height = "15" class = "icon outbound" > < path fill = "currentColor" d = "M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z" > < / path > < polygon fill = "currentColor" points = "45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9" > < / polygon > < / svg > < span class = "sr-only" > (opens new window)< / span > < / span > < / a > < / div > <!-- --> < / nav > < / div > < / header > < div class = "sidebar-mask" > < / div > < aside class = "sidebar" > < nav class = "nav-links" > < div class = "nav-item" > < a href = "https://book.anchor-lang.com" target = "_blank" rel = "noopener noreferrer" class = "nav-link external" >
The Anchor Book
< span > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" focusable = "false" x = "0px" y = "0px" viewBox = "0 0 100 100" width = "15" height = "15" class = "icon outbound" > < path fill = "currentColor" d = "M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z" > < / path > < polygon fill = "currentColor" points = "45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9" > < / polygon > < / svg > < span class = "sr-only" > (opens new window)< / span > < / span > < / a > < / div > < div class = "nav-item" > < a href = "https://docs.rs/anchor-lang/latest/anchor_lang/" target = "_blank" rel = "noopener noreferrer" class = "nav-link external" >
Rust
< span > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" focusable = "false" x = "0px" y = "0px" viewBox = "0 0 100 100" width = "15" height = "15" class = "icon outbound" > < path fill = "currentColor" d = "M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z" > < / path > < polygon fill = "currentColor" points = "45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9" > < / polygon > < / svg > < span class = "sr-only" > (opens new window)< / span > < / span > < / a > < / div > < div class = "nav-item" > < a href = "https://project-serum.github.io/anchor/ts/index.html" target = "_blank" rel = "noopener noreferrer" class = "nav-link external" >
TypeScript
< span > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" focusable = "false" x = "0px" y = "0px" viewBox = "0 0 100 100" width = "15" height = "15" class = "icon outbound" > < path fill = "currentColor" d = "M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z" > < / path > < polygon fill = "currentColor" points = "45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9" > < / polygon > < / svg > < span class = "sr-only" > (opens new window)< / span > < / span > < / a > < / div > < div class = "nav-item" > < a href = "https://github.com/project-serum/anchor" target = "_blank" rel = "noopener noreferrer" class = "nav-link external" >
GitHub
< span > < svg xmlns = "http://www.w3.org/2000/svg" aria-hidden = "true" focusable = "false" x = "0px" y = "0px" viewBox = "0 0 100 100" width = "15" height = "15" class = "icon outbound" > < path fill = "currentColor" d = "M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z" > < / path > < polygon fill = "currentColor" points = "45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9" > < / polygon > < / svg > < span class = "sr-only" > (opens new window)< / span > < / span > < / a > < / div > <!-- --> < / nav > < ul class = "sidebar-links" > < li > < section class = "sidebar-group depth-0" > < p class = "sidebar-heading open" > < span > Getting Started< / span > <!-- --> < / p > < ul class = "sidebar-links sidebar-group-items" > < li > < a href = "/anchor/getting-started/introduction.html" class = "sidebar-link" > Introduction< / a > < / li > < li > < a href = "/anchor/getting-started/installation.html" class = "sidebar-link" > Installing Dependencies< / a > < / li > < / ul > < / section > < / li > < li > < section class = "sidebar-group depth-0" > < p class = "sidebar-heading" > < span > Teams< / span > <!-- --> < / p > < ul class = "sidebar-links sidebar-group-items" > < li > < a href = "/anchor/getting-started/projects.html" class = "sidebar-link" > Projects< / a > < / li > < / ul > < / section > < / li > < li > < section class = "sidebar-group depth-0" > < p class = "sidebar-heading" > < span > Tutorials< / span > <!-- --> < / p > < ul class = "sidebar-links sidebar-group-items" > < li > < a href = "/anchor/tutorials/tutorial-0.html" class = "sidebar-link" > A Minimal Example< / a > < / li > < li > < a href = "/anchor/tutorials/tutorial-1.html" class = "sidebar-link" > Arguments and Accounts< / a > < / li > < li > < a href = "/anchor/tutorials/tutorial-2.html" class = "sidebar-link" > Account Constraints and Access Control< / a > < / li > < li > < a href = "/anchor/tutorials/tutorial-3.html" class = "sidebar-link" > Cross Program Invocations (CPI)< / a > < / li > < li > < a href = "/anchor/tutorials/tutorial-4.html" class = "sidebar-link" > Errors< / a > < / li > < / ul > < / section > < / li > < li > < section class = "sidebar-group depth-0" > < p class = "sidebar-heading" > < span > CLI< / span > <!-- --> < / p > < ul class = "sidebar-links sidebar-group-items" > < li > < a href = "/anchor/cli/commands.html" class = "sidebar-link" > Commands< / a > < / li > < / ul > < / section > < / li > < li > < section class = "sidebar-group depth-0" > < p class = "sidebar-heading" > < span > Source Verification< / span > <!-- --> < / p > < ul class = "sidebar-links sidebar-group-items" > < li > < a href = "/anchor/getting-started/verification.html" class = "sidebar-link" > Verifiable Builds< / a > < / li > < li > < a href = "/anchor/getting-started/publishing.html" class = "sidebar-link" > Publishing Source< / a > < / li > < / ul > < / section > < / li > < / ul > < / aside > < main aria-labelledby = "main-title" class = "home" > < header class = "hero" > <!-- --> < h1 id = "main-title" >
Anchor
< / h1 > < p class = "description" >
A framework for building Solana programs
< / p > < p class = "action" > < a href = "/anchor/getting-started/introduction.html" class = "nav-link action-button" >
Get Started →
< / a > < / p > < / header > < div class = "features" > < div class = "feature" > < h2 > Security< / h2 > < p > Anchor eliminates many footguns of raw Solana programs by default and allows you to add more security checks without disrupting your business logic.< / p > < / div > < div class = "feature" > < h2 > Code Generation< / h2 > < p > (De)Serialization, cross-program invocations, account initialization, and more.< / p > < / div > < div class = "feature" > < h2 > IDL & Client Generation< / h2 > < p > Anchor generates an IDL based on your program and automatically creates a typescript client with it.< / p > < / div > < div class = "feature" > < h2 > Verifiability< / h2 > < p > Anchor programs can be built verifiably, so users know that the on-chain program matches the code base.< / p > < / div > < div class = "feature" > < h2 > Workspace Management< / h2 > < p > The CLI helps you manage workspaces with multiple programs, e2e tests, and more.< / p > < / div > < div class = "feature" > < h2 > Compatibility< / h2 > < p > Anchor programs can interact with all non-anchor programs on Solana.< / p > < / div > < / div > < div class = "theme-default-content custom content__default" > < div style = "border:2px solid red;text-align:center;padding:10px 10px 10px 10px;box-sizing:border-box;" > This documentation is being sunset in favor of < a href = "https://book.anchor-lang.com" rel = "noopener noreferrer" target = "_blank" > The Anchor Book< / a > . At this point in time, either documentation may contain information that the other does not.< / div > < / div > < div class = "footer" >
Apache License 2.0
< / div > < / main > < / div > < div class = "global-ui" > < / div > < / div >
2022-04-13 16:17:24 -07:00
< script src = "/anchor/assets/js/app.b2f13cd7.js" defer > < / script > < script src = "/anchor/assets/js/2.90291299.js" defer > < / script > < script src = "/anchor/assets/js/16.b6cb9e25.js" defer > < / script >
2022-02-03 07:26:04 -08:00
< / body >
< / html >