(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[82237],{58579:function(i,s,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/en/build/sdks/rust-sdk",function(){return e(95073)}])},95073:function(i,s,e){"use strict";e.r(s),e.d(s,{useTOC:function(){return r}});var t=e(31549),n=e(82910),h=e(1117),l=e(46977);function r(i){return[{value:"Installation",id:"installation",depth:2},{value:"Using Rust SDK",id:"using-rust-sdk",depth:2}]}s.default=(0,n.c)(function(i){let{toc:s=r(i)}=i,e={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",span:"span",...(0,l.a)(),...i.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.h1,{children:"Rust SDK"}),"\n",(0,t.jsx)(e.h2,{id:s[0].id,children:s[0].value}),"\n",(0,t.jsxs)(e.p,{children:["Aptos provides an official lightly supported Rust SDK in the\n",(0,t.jsx)(e.a,{href:"https://github.com/aptos-labs/aptos-core/tree/main/sdk",children:"Aptos-core GitHub"}),"\nrepository. To use the Rust SDK, add the following dependency and patches on the\ngit repo directly in your ",(0,t.jsx)(e.code,{children:"Cargo.toml"}),", like this:"]}),"\n",(0,t.jsx)(e.pre,{tabIndex:"0","data-language":"toml","data-word-wrap":"","data-filename":"Cargo.toml","data-copy":"",children:(0,t.jsxs)(e.code,{children:[(0,t.jsxs)(e.span,{children:[(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"["}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"dependencies"}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"]"})]}),"\n",(0,t.jsxs)(e.span,{children:[(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"aptos-sdk = { git = "}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"https://github.com/aptos-labs/aptos-core"'}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", branch = "}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"devnet"'}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" }"})]}),"\n",(0,t.jsx)(e.span,{children:" "}),"\n",(0,t.jsxs)(e.span,{children:[(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"["}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"patch"}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"."}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"crates-io"}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"]"})]}),"\n",(0,t.jsxs)(e.span,{children:[(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"merlin = { git = "}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"https://github.com/aptos-labs/merlin"'}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" }"})]}),"\n",(0,t.jsxs)(e.span,{children:[(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"x25519-dalek = { git = "}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"https://github.com/aptos-labs/x25519-dalek"'}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", branch = "}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"zeroize_v1"'}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" }"})]})]})}),"\n",(0,t.jsxs)(e.p,{children:["You must also create a ",(0,t.jsx)(e.code,{children:".cargo/config.toml"})," file with this content:"]}),"\n",(0,t.jsx)(e.pre,{tabIndex:"0","data-language":"toml","data-word-wrap":"","data-filename":".cargo/config.toml","data-copy":"",children:(0,t.jsxs)(e.code,{children:[(0,t.jsxs)(e.span,{children:[(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"["}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"build"}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"]"})]}),"\n",(0,t.jsxs)(e.span,{children:[(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"rustflags = ["}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"--cfg"'}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"tokio_unstable"'}),(0,t.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"]"})]})]})}),"\n",(0,t.jsxs)(e.p,{children:["The source code for the official Rust SDK is available in the\n",(0,t.jsx)(e.a,{href:"https://github.com/aptos-labs/aptos-core/tree/main/sdk",children:"aptos-core GitHub repository"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:s[1].id,children:s[1].value}),"\n",(0,t.jsxs)(e.p,{children:["See the ",(0,t.jsx)(e.a,{href:"../guides",children:"Developer Tutorials"})," for code examples showing how to\nuse the Rust SDK."]})]})},"/en/build/sdks/rust-sdk",{filePath:"pages/en/build/sdks/rust-sdk.mdx",timestamp:1728425436e3,pageMap:h.v,frontMatter:{title:"Rust SDK"},title:"Rust SDK"},"undefined"==typeof RemoteContent?r:RemoteContent.useTOC)},82910:function(i,s,e){"use strict";e.d(s,{c:function(){return a}});var t=e(31549),n=e(74271),h=e(14553),l=e(55754),r=e(46977);function a(i,s,e,t){let h=globalThis[n.ud];return h.route=s,h.pageMap=e.pageMap,h.context[s]={Content:i,pageOpts:e,useTOC:t},d}function d({__nextra_pageMap:i=[],__nextra_dynamic_opts:s,...e}){let r=globalThis[n.ud],{Layout:a,themeConfig:d}=r,{route:o,locale:p}=(0,h.t)(),k=r.context[o];if(!k)throw Error(`No content found for the "${o}" route. Please report it as a bug.`);let{pageOpts:u,useTOC:E,Content:g}=k;if(o.startsWith("/["))u.pageMap=i;else for(let{route:s,children:e}of i){let i=s.split("/").slice(p?2:1);(function i(s,[e,...t]){for(let n of s)if("children"in n&&e===n.name)return t.length?i(n.children,t):n})(u.pageMap,i).children=e}if(s){let{title:i,frontMatter:e}=s;u={...u,title:i,frontMatter:e}}return(0,t.jsx)(a,{themeConfig:d,pageOpts:u,pageProps:e,children:(0,t.jsx)(l.F,{value:e,children:(0,t.jsx)(c,{useTOC:E,children:(0,t.jsx)(g,{...e})})})})}function c({children:i,useTOC:s}){let{wrapper:e}=(0,r.a)();return(0,t.jsx)(o,{useTOC:s,wrapper:e,children:i})}function o({children:i,useTOC:s,wrapper:e,...n}){let h=s(n);return e?(0,t.jsx)(e,{toc:h,children:i}):i}}},function(i){i.O(0,[68889,1117,92888,49774,40179],function(){return i(i.s=58579)}),_N_E=i.O()}]);