(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46399],{23490:function(i,s,h){(window.__NEXT_P=window.__NEXT_P||[]).push(["/en/build/sdks/ts-sdk/quickstart",function(){return h(50173)}])},50173:function(i,s,h){"use strict";h.r(s),h.d(s,{useTOC:function(){return c}});var n=h(31549),e=h(82910),l=h(15801),a=h(46977),t=h(92907),r=h(13844),d=h(47023),k=h(83185);function c(i){let s={code:"code",...(0,a.a)()};return[{value:"Initialize A Project",id:"initialize-a-project",depth:3},{value:"Test Initialization",id:"test-initialization",depth:3},{value:"Install the TypeScript SDK using the package manager of your choice:",id:"install-the-typescript-sdk-using-the-package-manager-of-your-choice",depth:3},{value:(0,n.jsxs)(n.Fragment,{children:["Set up the ",(0,n.jsx)(s.code,{children:"Aptos"})," client"]}),id:"set-up-the-aptos-client",depth:3},{value:"Fetch data from on-chain",id:"fetch-data-from-on-chain",depth:3},{value:"Send Transactions",id:"send-transactions",depth:3},{value:"1. Create an Account",id:"1-create-an-account",depth:4},{value:"2. Build the Transaction",id:"2-build-the-transaction",depth:4},{value:"3. Sign and Submit",id:"3-sign-and-submit",depth:4},{value:"4. Wait for completion",id:"4-wait-for-completion",depth:4},{value:"Full Quickstart Code",id:"full-quickstart-code",depth:2},{value:"Run Quickstart",id:"run-quickstart",depth:3},{value:"Summary",id:"summary",depth:2}]}function p(i,s){throw Error("Expected "+(s?"component":"object")+" `"+i+"` to be defined: you likely forgot to import, pass, or provide it.")}s.default=(0,e.c)(function(i){let{toc:s=c(i)}=i,h={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",...(0,a.a)(),...i.components};return t.m||p("$Tabs",!1),t.m.Tab||p("$Tabs.Tab",!0),t.m||p("Tabs",!1),t.m.Tab||p("Tabs.Tab",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.h1,{children:"TypeScript SDK Quickstart"}),"\n",(0,n.jsx)(r.U,{type:"info",children:(0,n.jsxs)(h.p,{children:["The complete example code can be found at ",(0,n.jsx)(h.a,{href:"#full-quickstart-code",children:"Full Quickstart Code"})," at the bottom of the page."]})}),"\n",(0,n.jsxs)(d.R,{children:[(0,n.jsx)(h.h3,{id:s[0].id,children:s[0].value}),(0,n.jsxs)(h.p,{children:["This will initialize a typescript package with ",(0,n.jsx)(h.code,{children:"quickstart.ts"})]}),(0,n.jsxs)(t.m,{items:["npm","pnpm","yarn"],children:[(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npm"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" init"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npm"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -D"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" typescript"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @types/node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npx"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" tsc"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --init"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"mkdir"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"echo"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" 'async function example() { console.log(\"Running example!\")}; example()'"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" >"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" init"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -D"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" typescript"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @types/node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpx"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" tsc"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --init"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"mkdir"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"echo"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" 'async function example() { console.log(\"Running example!\")}; example()'"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" >"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"yarn"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" init"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -y"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"yarn"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -D"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" typescript"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @types/node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npx"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" tsc"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --init"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"mkdir"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" && "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"echo"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" 'async function example() { console.log(\"Running example!\")}; example()'"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" >"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})})]}),(0,n.jsx)(h.h3,{id:s[1].id,children:s[1].value}),(0,n.jsx)(h.p,{children:"To test if you have initialized the package correctly run:"}),(0,n.jsxs)(t.m,{items:["npm","pnpm","yarn"],children:[(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npx"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpx"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"yarn"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})})]}),(0,n.jsx)(h.h3,{id:s[2].id,children:s[2].value}),(0,n.jsxs)(t.m,{items:["npm","pnpm","yarn","bun"],storageKey:"selectedPackageManager",children:[(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npm"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" i"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @aptos-labs/ts-sdk"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @aptos-labs/ts-sdk"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"yarn"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @aptos-labs/ts-sdk"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"bun"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @aptos-labs/ts-sdk"})]})})})})]}),(0,n.jsx)(h.h3,{id:s[3].id,children:s[3].value}),(0,n.jsxs)(h.p,{children:["You can use the ",(0,n.jsx)(h.code,{children:"Aptos"})," object to handle everything that requires a connection to the Aptos network. A connection is established as soon as you create the object."]}),(0,n.jsx)(h.pre,{icon:k.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"quickstart.ts","data-copy":"",children:(0,n.jsxs)(h.code,{children:[(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { Account, Aptos, AptosConfig, Network } "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@aptos-labs/ts-sdk"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Specify which network to connect to via AptosConfig"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"async"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" function"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" example"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"() {"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'    "This example will create two accounts (Alice and Bob), fund them, and transfer between them."'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  );"})}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Setup the client"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" config"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" AptosConfig"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({ network: Network."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"TESTNET"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" });"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" aptos"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Aptos"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(config);"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"}"})}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"example"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"()"})]})]})}),(0,n.jsx)(r.U,{type:"info",children:(0,n.jsxs)(h.p,{children:["(Advanced) If you need to connect to a specific node, you can set that in the ",(0,n.jsx)(h.code,{children:"AptosConfig"})," by specifying the ",(0,n.jsx)(h.code,{children:"fullnode"})," url. Ex. ",(0,n.jsx)(h.code,{children:"fullnode: http://localhost:8080/v1"}),"."]})}),(0,n.jsx)(h.h3,{id:s[4].id,children:s[4].value}),(0,n.jsxs)(h.p,{children:["You can use the ",(0,n.jsx)(h.code,{children:"Aptos"})," client to fetch all sorts of data from on-chain such as information about the network itself or account-specific information."]}),(0,n.jsx)(h.pre,{icon:k.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"quickstart.ts","data-copy":"",children:(0,n.jsxs)(h.code,{children:[(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" ledgerInfo"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"getLedgerInfo"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"();"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" modules"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"getAccountModules"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({ accountAddress: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"0x123"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" });"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" tokens"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"getAccountOwnedTokens"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({ accountAddress: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"0x123"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" });"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})})]})}),(0,n.jsx)(h.h3,{id:s[5].id,children:s[5].value}),(0,n.jsxs)(h.p,{children:["You can send transactions to change the state of the ledger. Transactions let you send tokens like APT, trigger Move modules, trade NFTs, and more. You can find an in-depth tutorial on transactions ",(0,n.jsx)(h.a,{href:"building-transactions",children:"here"}),"."]}),(0,n.jsx)(h.p,{children:"To begin with though, here’s how you can send a basic transaction to transfer APT."}),(0,n.jsx)(h.h4,{id:s[6].id,children:s[6].value}),(0,n.jsx)(h.p,{children:"To create a new account, you first generate new credentials then fund the account. On test networks you can fund an account programmatically by asking a “faucet” which has a lot of test APT to send some to your new account."}),(0,n.jsx)(h.pre,{icon:k.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"quickstart.ts","data-copy":"",children:(0,n.jsxs)(h.code,{children:[(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Generate a new account key pair"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" alice"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Account"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Account."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"generate"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"();"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Fund the account on chain. Funding an account creates it on-chain."})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"fundAccount"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  accountAddress: alice.accountAddress,"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  amount: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"100000000"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"});"})}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Also create a second account to transfer tokens to"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" bob"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Account"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Account."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"generate"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"();"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Fund the account on chain"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"fundAccount"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  accountAddress: bob.accountAddress,"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  amount: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"100000000"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"});"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})})]})}),(0,n.jsx)(h.h4,{id:s[7].id,children:s[7].value}),(0,n.jsxs)(h.p,{children:["You can build transactions with ",(0,n.jsx)(h.code,{children:"aptos.transaction.build.simple({...})"})," by specifying:"]}),(0,n.jsxs)(h.ol,{children:["\n",(0,n.jsxs)(h.li,{children:[(0,n.jsx)(h.code,{children:"sender"})," - The account that’s sending the transaction. This account will pay the gas fees."]}),"\n",(0,n.jsxs)(h.li,{children:[(0,n.jsx)(h.code,{children:"data"})," - The information needed for Aptos to identify what transaction to execute.","\n",(0,n.jsxs)(h.ol,{children:["\n",(0,n.jsxs)(h.li,{children:[(0,n.jsx)(h.code,{children:"function"})," - Which smart contract on chain to call. This has the format ",(0,n.jsx)(h.code,{children:"<account_address>::<move_module>::<function>"}),"."]}),"\n",(0,n.jsxs)(h.li,{children:[(0,n.jsx)(h.code,{children:"functionArguments"})," - These are specific to the function being called. You can look up what parameters a function needs by searching for the account and module on chain with an explorer ",(0,n.jsx)(h.a,{href:"https://explorer.aptoslabs.com/account/0x0000000000000000000000000000000000000000000000000000000000000001/modules/code/aptos_account?network=mainnet",children:"like this"}),"."]}),"\n"]}),"\n"]}),"\n"]}),(0,n.jsx)(h.p,{children:"For example:"}),(0,n.jsx)(h.pre,{icon:k.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"quickstart.ts","data-copy":"",children:(0,n.jsxs)(h.code,{children:[(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" transaction"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos.transaction.build."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"simple"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  sender: alice.accountAddress,"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  data: {"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"	  // The Move entry-function"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    function: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"0x1::aptos_account::transfer"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    functionArguments: [bob.accountAddress, "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"100"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"],"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  },"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"});"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})})]})}),(0,n.jsx)(r.U,{type:"info",children:(0,n.jsxs)(h.p,{children:["For some situations, you can also use simplified functions in the SDK such as ",(0,n.jsx)(h.a,{href:"https://explorer.aptoslabs.com/account/0x0000000000000000000000000000000000000000000000000000000000000001/modules/code/aptos_account?network=mainnet",children:(0,n.jsx)(h.code,{children:"transferCoinTransaction"})}),"."]})}),(0,n.jsx)(h.h4,{id:s[8].id,children:s[8].value}),(0,n.jsx)(h.p,{children:"Signing proves that you own or manage the account that is executing the transaction. This is important since the sender must pay gas fees for the work the network does to execute the transaction."}),(0,n.jsx)(h.p,{children:"Once signed, you can submit to the network for on chain verification and execution."}),(0,n.jsxs)(h.p,{children:["You can use ",(0,n.jsx)(h.code,{children:"aptos.signAndSubmitTransaction"})," which combines those two steps into one:"]}),(0,n.jsx)(h.pre,{icon:k.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"quickstart.ts","data-copy":"",children:(0,n.jsxs)(h.code,{children:[(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Both signs and submits (although these can be done separately too)"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" pendingTransaction"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"signAndSubmitTransaction"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  signer: alice,"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  transaction,"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"});"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})})]})}),(0,n.jsx)(h.h4,{id:s[9].id,children:s[9].value}),(0,n.jsxs)(h.p,{children:["You can run ",(0,n.jsx)(h.code,{children:"aptos.waitForTransaction"})," to guarantee your code executes after the transaction has been processed and applied."]}),(0,n.jsx)(h.p,{children:"This also helps you get any errors that may occur after submitting, such as the transaction being rejected."}),(0,n.jsx)(h.pre,{icon:k.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"quickstart.ts","data-copy":"",children:(0,n.jsxs)(h.code,{children:[(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" executedTransaction"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"waitForTransaction"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({ transactionHash: pendingTransaction.hash });"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"..."})})]})})]}),"\n",(0,n.jsx)(h.h2,{id:s[10].id,children:s[10].value}),"\n",(0,n.jsx)(h.h3,{id:s[11].id,children:s[11].value}),"\n",(0,n.jsxs)(t.m,{items:["npm","pnpm","yarn"],children:[(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npx"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpx"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})}),(0,n.jsx)(t.m.Tab,{children:(0,n.jsx)(h.pre,{icon:k.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(h.code,{children:(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"yarn"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ts-node"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" src/quickstart.ts"})]})})})})]}),"\n",(0,n.jsx)(h.pre,{icon:k.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"quickstart.ts","data-copy":"",children:(0,n.jsxs)(h.code,{children:[(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"/**"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:" * This example shows how to use the Aptos client to create accounts, fund them, and transfer between them."})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:" */"})}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { Account, Aptos, AptosConfig, Network } "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@aptos-labs/ts-sdk"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" APTOS_COIN"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "0x1::aptos_coin::AptosCoin"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" COIN_STORE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" `0x1::coin::CoinStore<${"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"APTOS_COIN"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"}>`"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" ALICE_INITIAL_BALANCE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" 100_000_000"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" BOB_INITIAL_BALANCE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" 100"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" TRANSFER_AMOUNT"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" 100"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"async"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" function"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" example"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"() {"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'    "This example will create two accounts (Alice and Bob), fund them, and transfer between them."'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  );"})}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Setup the client"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" config"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" AptosConfig"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({ network: Network."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"TESTNET"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" });"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" aptos"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Aptos"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(config);"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Generate two account credentials"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Each account has a private key, a public key, and an address"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" alice"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Account."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"generate"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"();"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" bob"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Account."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"generate"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"();"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"=== Addresses ==='}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"`Alice's address is: ${"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"alice"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"accountAddress"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"}`"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"`Bob's address is: ${"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"bob"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"accountAddress"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"}`"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Fund the accounts using a faucet"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"=== Funding accounts ==="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"fundAccount"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    accountAddress: alice.accountAddress,"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    amount: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"ALICE_INITIAL_BALANCE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"fundAccount"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    accountAddress: bob.accountAddress,"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    amount: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"BOB_INITIAL_BALANCE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"Alice and Bob\'s accounts have been funded!"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Look up the newly funded account's balances"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"=== Balances ==="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" aliceAccountBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"getAccountResource"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    accountAddress: alice.accountAddress,"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    resourceType: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"COIN_STORE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" aliceBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Number"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(aliceAccountBalance.coin.value);"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"`Alice's balance is: ${"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"aliceBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"}`"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" bobAccountBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"getAccountResource"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    accountAddress: bob.accountAddress,"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    resourceType: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"COIN_STORE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" bobBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Number"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(bobAccountBalance.coin.value);"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"`Bob's balance is: ${"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"bobBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"}`"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Send a transaction from Alice's account to Bob's account"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" txn"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos.transaction.build."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"simple"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    sender: alice.accountAddress,"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    data: {"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"      // All transactions on Aptos are implemented via smart contracts."})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"      function: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"0x1::aptos_account::transfer"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"      functionArguments: [bob.accountAddress, "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"100"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"],"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    },"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"=== Transfer transaction ==="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Both signs and submits"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" committedTxn"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"signAndSubmitTransaction"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    signer: alice,"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    transaction: txn,"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Waits for Aptos to verify and execute the transaction"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" executedTransaction"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"waitForTransaction"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    transactionHash: committedTxn.hash,"})}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"Transaction hash:"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", executedTransaction.hash);"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"=== Balances after transfer ==="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"\\n"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" newAliceAccountBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"getAccountResource"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    accountAddress: alice.accountAddress,"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    resourceType: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"COIN_STORE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" newAliceBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Number"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(newAliceAccountBalance.coin.value);"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"`Alice's balance is: ${"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"newAliceBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"}`"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" newBobAccountBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" aptos."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"getAccountResource"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    accountAddress: bob.accountAddress,"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    resourceType: "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"COIN_STORE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  });"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  const"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" newBobBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Number"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(newBobAccountBalance.coin.value);"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  console."}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"log"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"`Bob's balance is: ${"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"newBobBalance"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"}`"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Bob should have the transfer amount"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  if"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" (newBobBalance "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"!=="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" TRANSFER_AMOUNT"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" +"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" BOB_INITIAL_BALANCE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:")"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"    throw"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Error"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"Bob\'s balance after transfer is incorrect"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"  // Alice should have the remainder minus gas"})}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  if"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" (newAliceBalance "}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:">="}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" ALICE_INITIAL_BALANCE"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" -"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" TRANSFER_AMOUNT"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:")"})]}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"    throw"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Error"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"Alice\'s balance after transfer is incorrect"'}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(h.span,{children:(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"}"})}),"\n",(0,n.jsx)(h.span,{children:" "}),"\n",(0,n.jsxs)(h.span,{children:[(0,n.jsx)(h.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"example"}),(0,n.jsx)(h.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"();"})]})]})}),"\n",(0,n.jsx)(h.h2,{id:s[12].id,children:s[12].value}),"\n",(0,n.jsx)(h.p,{children:"All told, you just learned how to transfer APT via a transaction by:"}),"\n",(0,n.jsxs)(h.ol,{children:["\n",(0,n.jsxs)(h.li,{children:["Connecting to the network using the ",(0,n.jsx)(h.code,{children:"Aptos"})," client."]}),"\n",(0,n.jsx)(h.li,{children:"Creating an account."}),"\n",(0,n.jsxs)(h.li,{children:["Looking up data from on-chain using client helper functions like ",(0,n.jsx)(h.a,{href:"https://aptos-labs.github.io/aptos-ts-sdk/@aptos-labs/ts-sdk-1.13.1/classes/Aptos.html#getAccountModules",children:(0,n.jsx)(h.code,{children:"aptos.getAccountModules"})}),"."]}),"\n",(0,n.jsx)(h.li,{children:"Signing and submitting a transaction to the network."}),"\n",(0,n.jsx)(h.li,{children:"Waiting for Aptos to execute the transaction."}),"\n"]}),"\n",(0,n.jsx)(h.p,{children:"To see all this in action, you can copy and run the full working code snippet for this quickstart above."}),"\n",(0,n.jsxs)(r.U,{type:"info",children:[(0,n.jsxs)(h.p,{children:["For future development, make sure to bookmark the ",(0,n.jsx)(h.a,{href:"https://aptos-labs.github.io/aptos-ts-sdk/",children:"reference docs"})," to look up specific function signatures."]}),(0,n.jsxs)(h.p,{children:["Note that most helper functions are listed on the ",(0,n.jsxs)(h.a,{href:"https://aptos-labs.github.io/aptos-ts-sdk/@aptos-labs/ts-sdk-1.13.1/classes/Aptos.html",children:[(0,n.jsx)(h.code,{children:"Aptos"})," client object"]}),"."]})]})]})},"/en/build/sdks/ts-sdk/quickstart",{filePath:"pages/en/build/sdks/ts-sdk/quickstart.mdx",timestamp:1728425436e3,pageMap:l.v,frontMatter:{title:"TypeScript SDK Quickstart"},title:"TypeScript SDK Quickstart"},"undefined"==typeof RemoteContent?c:RemoteContent.useTOC)},13844:function(i,s,h){"use strict";h.d(s,{U:function(){return r}});var n=h(31549),e=h(78364),l=h(83185);let a={default:"\uD83D\uDCA1",error:"\uD83D\uDEAB",info:(0,n.jsx)(l.AV,{className:"_mt-1"}),warning:"⚠️"},t={default:(0,e.Z)("_border-orange-100 _bg-orange-50 _text-orange-800 dark:_border-orange-400/30 dark:_bg-orange-400/20 dark:_text-orange-300"),error:(0,e.Z)("_border-red-200 _bg-red-100 _text-red-900 dark:_border-red-200/30 dark:_bg-red-900/30 dark:_text-red-200"),info:(0,e.Z)("_border-blue-200 _bg-blue-100 _text-blue-900 dark:_border-blue-200/30 dark:_bg-blue-900/30 dark:_text-blue-200"),warning:(0,e.Z)("_border-yellow-100 _bg-yellow-50 _text-yellow-900 dark:_border-yellow-200/30 dark:_bg-yellow-700/30 dark:_text-yellow-200")};function r({children:i,type:s="default",emoji:h=a[s]}){return(0,n.jsxs)("div",{className:(0,e.Z)("nextra-callout _overflow-x-auto _mt-6 _flex _rounded-lg _border _py-2 ltr:_pr-4 rtl:_pl-4","contrast-more:_border-current contrast-more:dark:_border-current",t[s]),children:[(0,n.jsx)("div",{className:"_select-none _text-xl ltr:_pl-3 ltr:_pr-2 rtl:_pr-3 rtl:_pl-2",style:{fontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},children:h}),(0,n.jsx)("div",{className:"_w-full _min-w-0 _leading-7",children:i})]})}},47023:function(i,s,h){"use strict";h.d(s,{R:function(){return a}});var n=h(31549),e=h(78364),l=h(44194);function a({children:i,className:s,style:h,...a}){let t=(0,l.useId)().replaceAll(":","");return(0,n.jsx)("div",{className:(0,e.Z)("nextra-steps _ms-4 _mb-12 _border-s _border-gray-200 _ps-6","dark:_border-neutral-800",s),style:{...h,"--counter-id":t},...a,children:i})}}},function(i){i.O(0,[68889,52318,15801,92888,49774,40179],function(){return i(i.s=23490)}),_N_E=i.O()}]);