1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1279],{4964:(i,s,e)=>{"use strict";e.d(s,{R:()=>h});var n=e(48447),t=e(1258),a=e.n(t),r=e(21462);let l={img:i=>(0,r.createElement)("object"==typeof i.src?a():"img",i)},h=i=>({...l,...(0,n.R)(i)})},12918:(i,s,e)=>{"use strict";e.r(s),e.d(s,{default:()=>c,useTOC:()=>d});var n=e(23798),t=e(60686),a=e(35999),r=e(4964),l=e(90514),h=e(86534);function d(i){return[{value:"How It Works",id:"how-it-works",depth:2},{value:"Creating a Gas Station",id:"creating-a-gas-station",depth:2},{value:"Integration",id:"integration",depth:2},{value:"Contract Rules",id:"contract-rules",depth:2},{value:"Billing",id:"billing",depth:2},{value:"Security Features",id:"security-features",depth:2},{value:"Limitations",id:"limitations",depth:2}]}let c=(0,t.e)(function(i){let{toc:s=d(i)}=i,e={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...(0,r.R)(),...i.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.h1,{children:"Gas Stations"}),"\n",(0,n.jsx)(e.p,{children:"Gas stations are a powerful resource that allows you to subsidize transaction fees for your users. This means your users can interact with your dApp without needing to hold APT tokens for gas fees, making the user experience much smoother."}),"\n",(0,n.jsx)(e.h2,{id:s[0].id,children:s[0].value}),"\n",(0,n.jsx)(e.p,{children:"A gas station acts as a fee payer for transactions on the Aptos blockchain. When properly configured:"}),"\n",(0,n.jsxs)(e.ol,{children:["\n",(0,n.jsx)(e.li,{children:"Your users submit transactions using your dApp"}),"\n",(0,n.jsx)(e.li,{children:"The gas station automatically pays the gas fees"}),"\n",(0,n.jsx)(e.li,{children:"Your users donât need to hold APT tokens"}),"\n",(0,n.jsx)(e.li,{children:"You maintain control over which transactions can be subsidized"}),"\n"]}),"\n",(0,n.jsx)(e.h2,{id:s[1].id,children:s[1].value}),"\n",(0,n.jsx)(e.p,{children:"To create a gas station:"}),"\n",(0,n.jsxs)(e.ol,{children:["\n",(0,n.jsx)(e.li,{children:"Navigate to your project page"}),"\n",(0,n.jsx)(e.li,{children:"Add a âGas Stationâ resource"}),"\n",(0,n.jsx)(e.li,{children:"Provide a name and select a network"}),"\n",(0,n.jsx)(e.li,{children:"Configure the initial contract rules"}),"\n"]}),"\n",(0,n.jsx)(l.P,{type:"info",children:(0,n.jsx)(e.p,{children:"Each gas station requires an API key for authentication. One will be automatically created for you when you create the gas station."})}),"\n",(0,n.jsx)(e.h2,{id:s[2].id,children:s[2].value}),"\n",(0,n.jsx)(e.p,{children:"This guide explains how to use the Geomi Gas Station in a Typescript based dapp."}),"\n",(0,n.jsx)(e.p,{children:"Install the relevant packages:"}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"plaintext","data-word-wrap":"","data-copy":"",children:(0,n.jsxs)(e.code,{children:[(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{children:"pnpm add \\"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{children:" @aptos-labs/ts-sdk@^5.0.0 \\"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{children:" @aptos-labs/gas-station-client@^2.0.3 \\"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{children:" @aptos-labs/wallet-adapter-react@^7.0.0"})})]})}),"\n",(0,n.jsxs)(e.p,{children:["Build a gas station client and either use it directly, or configure the ",(0,n.jsx)(e.code,{children:"Aptos"})," client to use it to submit transactions:"]}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"typescript","data-word-wrap":"","data-copy":"",children:(0,n.jsxs)(e.code,{children:[(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { GasStationClient, GasStationTransactionSubmitter } "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@aptos-labs/gas-station-client"'}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsx)(e.span,{children:" "}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" network"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Network."}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"MAINNET"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" gasStationClient"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" GasStationClient"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" network,"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" apiKey: "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"aptoslabs_34edbqbxyPrS_6fu9i83mYmjid4MVs3Z3XmCeATQ8tkSda"'}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"});"})}),"\n",(0,n.jsx)(e.span,{children:" "}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Set up Aptos client with gas station"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" transactionSubmitter"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" GasStationTransactionSubmitter"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(gasStationClient);"})]}),"\n",(0,n.jsx)(e.span,{children:" "}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" config"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" AptosConfig"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" network,"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" pluginSettings: {"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" TRANSACTION_SUBMITTER: transactionSubmitter,"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" },"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"});"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" aptos"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Aptos"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(config);"})]})]})}),"\n",(0,n.jsx)(e.p,{children:"If youâre using the wallet adapter, you can configure it to use the gas station client too:"}),"\n",(0,n.jsx)(e.pre,{icon:h.$0,tabIndex:"0","data-language":"tsx","data-word-wrap":"","data-copy":"",children:(0,n.jsxs)(e.code,{children:[(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { AptosWalletAdapterProvider } "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@aptos-labs/wallet-adapter-react"'}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsx)(e.span,{children:" "}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"<"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"AptosWalletAdapterProvider"})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" dappConfig"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"{{"})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" network: state.network,"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" transactionSubmitter: aptos.config."}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"getTransactionSubmitter"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}
1,children:"(),"})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" }}"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" autoConnect"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"{"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"true"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"}"})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:">"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" <"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"MyApp"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" />"})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"</"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"AptosWalletAdapterProvider"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:">"})]})]})}),"\n",(0,n.jsxs)(e.p,{children:["From this point on, any transaction you submit with the TS SDK client or via the wallet adapter (e.g. with ",(0,n.jsx)(e.code,{children:"signAndSubmitTransaction"})," from ",(0,n.jsx)(e.code,{children:"useWallet"}),") will be submitted via the gas station."]}),"\n",(0,n.jsx)(e.p,{children:"If you have configured a reCAPTCHA check, you can provide the token as part of submitting the transaction like this:"}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"typescript","data-word-wrap":"","data-copy":"",children:(0,n.jsxs)(e.code,{children:[(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { useWallet } "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@aptos-labs/wallet-adapter-react"'}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,n.jsx)(e.span,{children:" "}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"signAndSubmitTransaction"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" } "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" useWallet"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"();"})]}),"\n",(0,n.jsx)(e.span,{children:" "}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Make the user do a reCAPTCHA check."})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" recaptchaToken"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" getRecaptchaToken"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}
1,children:"();"})]}),"\n",(0,n.jsx)(e.span,{children:" "}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Build and submit the transaction with the reCAPTCHA token. This will sign locally"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// and then submit to the gas station."})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" response"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" await"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" signAndSubmitTransaction"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" data: {"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" function: "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"0x1::coin::transfer"'}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" typeArguments: ["}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"APTOS_COIN"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"],"})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" functionArguments: ["}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"0x9"'}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"100_000_000"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"],"})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" },"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" withFeePayer: "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"true"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" pluginParams: { recaptchaToken },"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"});"})})]})}),"\n",(0,n.jsx)(l.P,{type:"info",children:(0,n.jsxs)(e.p,{children:["Learn more about API keys and authentication ",(0,n.jsx)(e.a,{href:"/docs/api-keys",children:"here"}),"."]})}),"\n",(0,n.jsx)(e.h2,{id:s[3].id,children:s[3].value}),"\n",(0,n.jsx)(e.p,{children:"Contract rules define which transactions can be subsidized by your gas station. For each contract, you can:"}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Specify which functions can be called"}),"\n",(0,n.jsx)(e.li,{children:"Set spending limits per function"}),"\n",(0,n.jsx)(e.li,{children:"Enable reCAPTCHA protection"}),"\n",(0,n.jsx)(e.li,{children:"Configure rate limits"}),"\n"]}),"\n",(0,n.jsx)(l.P,{type:"warning",children:(0,n.jsx)(e.p,{children:"Always carefully review and test your contract rules before deploying to production. Incorrect rules could lead to unexpected gas costs."})}),"\n",(0,n.jsx)(e.h2,{id:s[4].id,children:s[4].value}),"\n",(0,n.jsx)(e.p,{children:"Gas stations are billed based on the actual gas costs of the transactions they subsidize. You can:"}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Monitor usage in real-time"}),"\n",(0,n.jsx)(e.li,{children:"Set up alerts for high usage"}),"\n",(0,n.jsx)(e.li,{children:"View detailed billing reports"}),"\n",(0,n.jsx)(e.li,{children:"Configure spending limits"}),"\n"]}),"\n",(0,n.jsxs)(e.p,{children:["Learn more about billing and costs ",(0,n.jsx)(e.a,{href:"/docs/admin/billing#cost-dimensions",children:"here"})," (see âGasâ in the Cost Dimensions section)."]}),"\n",(0,n.jsx)(e.h2,{id:s[5].id,children:s[5].value}),"\n",(0,n.jsx)(e.p,{children:"Gas stations include several security features to protect your resources:"}),"\n",(0,n.jsxs)(e.ol,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Function-level Control"}),": Only allow specific functions to be called"]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Spending Limits"}),": Set maximum gas costs per function"]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Rate Limiting"}),": Prevent abuse through request throttling"]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"reCAPTCHA"}),": Optional protection against automated attacks"]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"API Key Authentication"}),": Secure access to your gas station"]}),"\n"]}),"\n",(0,n.jsx)(e.h2,{id:s[6].id,children:s[6].value}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Gas stations can only subsidize transactions on the specified network"}),"\n",(0,n.jsx)(e.li,{children:"Each function call must be explicitly allowed in the contract rules"}),"\n",(0,n.jsx)(e.li,{children:"There are rate limits and spending limits to prevent abuse"}),"\n",(0,n.jsx)(e.li,{children:"Some complex transactions may not be supported"}),"\n"]})]})},"/docs/gas-stations",{filePath:"src/pages/docs/gas-stations.mdx",pageMap:a.O,frontMatter:{},title:"Gas Stations"},"undefined"==typeof RemoteContent?d:RemoteContent.useTOC)},26615:(i,s,e)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/docs/gas-stations",function(){return e(12918)}])},35999:(i,s,e)=>{"use strict";e.d(s,{O:()=>n});let n=[{data:{docs:{type:"page",title:"Documentation"}}},{name:"docs",route:"/docs",children:[{data:{introduction:{title:"Introduction"},start:{title:"Getting Started"},"api-keys":{title:"API Keys"},"api-reference":{title:"API Reference"}
1,"no-code-indexing":{title:"No-Code Indexing"},"gas-stations":{title:"Gas Stations"},"aptos-mcp":{title:"Aptos MCP"},admin:{title:"Admin"},faq:{title:"FAQ"},identity:{title:"Identity",href:"https://aptos.dev/en/build/guides/aptos-keyless"}}},{name:"admin",route:"/docs/admin",children:[{data:{billing:{title:"Billing"},"resource-management":{title:"Resource Management"}}},{name:"billing",route:"/docs/admin/billing",frontMatter:{sidebarTitle:"Billing"}},{name:"resource-management",route:"/docs/admin/resource-management",frontMatter:{title:"Resource Management"}}]},{name:"api-keys",route:"/docs/api-keys",children:[{data:{"frontend-keys":{title:"Frontend Keys"}}},{name:"frontend-keys",route:"/docs/api-keys/frontend-keys",frontMatter:{sidebarTitle:"Frontend Keys"}}]},{name:"api-keys",route:"/docs/api-keys",frontMatter:{sidebarTitle:"API Keys"}},{name:"api-reference",route:"/docs/api-reference",frontMatter:{title:"API Reference"}},{name:"aptos-mcp",route:"/docs/aptos-mcp",frontMatter:{title:"Aptos MCP"}},{name:"faq",route:"/docs/faq",frontMatter:{sidebarTitle:"Faq"}},{name:"gas-stations",route:"/docs/gas-stations",children:[{data:{shelby:{title:"Shelby"}}},{name:"shelby",route:"/docs/gas-stations/shelby",frontMatter:{sidebarTitle:"Shelby"}}]},{name:"gas-stations",route:"/docs/gas-stations",frontMatter:{sidebarTitle:"Gas Stations"}},{name:"introduction",route:"/docs/introduction",frontMatter:{sidebarTitle:"Introduction"}},{name:"no-code-indexing",route:"/docs/no-code-indexing",frontMatter:{sidebarTitle:"No Code Indexing"}},{name:"start",route:"/docs/start",children:[{data:{}}]},{name:"start",route:"/docs/start",frontMatter:{sidebarTitle:"Start"}}]}]},60686:(i,s,e)=>{"use strict";e.d(s,{e:()=>d});var n=e(23798),t=e(56694),a=e(29855);let r=(0,e(21462).createContext)({}),l=r.Provider;r.displayName="SSG";var h=e(4964);function d(i,s,e,n){let a=globalThis[t.VZ];return a.route=s,a.pageMap=e.pageMap,a.context[s]={Content:i,pageOpts:e,useTOC:n},c}function c({__nextra_pageMap:i=[],__nextra_dynamic_opts:s,...e}){let r=globalThis[t.VZ],{Layout:h,themeConfig:d}=r,{route:c,locale:k}=(0,a.r)(),p=r.context[c];if(!p)throw Error(`No content found for the "${c}" route. Please report it as a bug.`);let{pageOpts:x,useTOC:g,Content:j}=p;if(c.startsWith("/["))x.pageMap=i;else for(let{route:s,children:e}of i){let i=s.split("/").slice(k?2:1);(function i(s,[e,...n]){for(let t of s)if("children"in t&&e===t.name)return n.length?i(t.children,n):t})(x.pageMap,i).children=e}if(s){let{title:i,frontMatter:e}=s;x={...x,title:i,frontMatter:e}}return(0,n.jsx)(h,{themeConfig:d,pageOpts:x,pageProps:e,children:(0,n.jsx)(l,{value:e,children:(0,n.jsx)(o,{useTOC:g,children:(0,n.jsx)(j,{...e})})})})}function o({children:i,useTOC:s}){let{wrapper:e}=(0,h.R)();return(0,n.jsx)(k,{useTOC:s,wrapper:e,children:i})}function k({children:i,useTOC:s,wrapper:e,...t}){let a=s(t);return e?(0,n.jsx)(e,{toc:a,children:i}):i}},90514:(i,s,e)=>{"use strict";e.d(s,{P:()=>h});var n=e(23798),t=e(71623),a=e(86534);let r={default:"\uD83D\uDCA1",error:"\uD83D\uDEAB",info:(0,n.jsx)(a.KS,{className:"_mt-1"}),warning:"â ï¸"},l={default:(0,t.A)("_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,t.A)("_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,t.A)("_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,t.A)("_border-yellow-100 _bg-yellow-50 _text-yellow-900 dark:_border-yellow-200/30 dark:_bg-yellow-700/30 dark:_text-yellow-200")};function h({children:i,type:s="default",emoji:e=r[s]}){return(0,n.jsxs)("div",{className:(0,t.A)("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",l[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:e}),(0,n.jsx)("div",{className:"_w-full _min-w-0 _leading-7",children:i})]})}}},i=>{i.O(0,[636,6593,8792],()=>i(i.s=26615)),_N_E=i.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.