{"_id":"@aptos-labs/gas-station-client","_rev":"7-99d958a68f1ac620c45ce9aa283372d1","name":"@aptos-labs/gas-station-client","dist-tags":{"latest":"2.0.3"},"versions":{"1.0.0":{"name":"@aptos-labs/gas-station-client","version":"1.0.0","author":{"name":"Aptos Labs"},"_id":"@aptos-labs/gas-station-client@1.0.0","maintainers":[{"name":"aptos-labs","email":"npmjs@aptoslabs.com"}],"dist":{"shasum":"c5d6b9440b0427390bbc612b28d688c85bec512a","tarball":"https://registry.npmjs.org/@aptos-labs/gas-station-client/-/gas-station-client-1.0.0.tgz","fileCount":51,"integrity":"sha512-8iN+nYIDKLCxshlbisIYuzlffDbx/mjgakyl5W/5XOC0exR74+YI513XHQO7o3VX6ENIEhPzOPcGk21lv4MdFw==","signatures":[{"sig":"MEQCICpLtQjIK/hJBgtPBBhNrStECd5kJuTB8iBXl6kX77iEAiABAUYEPTzGbVmTERQv1UWUoni/a+WchjGQcia7UGnL0Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":129104},"main":"build/index.js","_from":"file:aptos-labs-gas-station-client-1.0.0.tgz","types":"build/types/index.d.ts","scripts":{"build":"tsc"},"_npmUser":{"name":"aptos-labs","email":"npmjs@aptoslabs.com"},"_resolved":"/private/var/folders/n4/74gtnh3d2mn_qb2gddnl8lp80000gn/T/c16dbdbe2bb5a8f985aa81563996d398/aptos-labs-gas-station-client-1.0.0.tgz","_integrity":"sha512-8iN+nYIDKLCxshlbisIYuzlffDbx/mjgakyl5W/5XOC0exR74+YI513XHQO7o3VX6ENIEhPzOPcGk21lv4MdFw==","_npmVersion":"10.8.2","description":"Client for the Aptos Gas Station API","directories":{},"_nodeVersion":"20.18.1","dependencies":{"@aptos-labs/ts-sdk":"^1.37.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.3","@types/node":"^20.14.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-station-client_1.0.0_1743696551256_0.7648575094290591","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@aptos-labs/gas-station-client","version":"1.1.0","author":{"name":"Aptos Labs"},"_id":"@aptos-labs/gas-station-client@1.1.0","maintainers":[{"name":"aptos-labs","email":"npmjs@aptoslabs.com"}],"dist":{"shasum":"6e591600f0dc281c3120de9f608ac339c7e61b64","tarball":"https://registry.npmjs.org/@aptos-labs/gas-station-client/-/gas-station-client-1.1.0.tgz","fileCount":51,"integrity":"sha512-kpGR4LLzGJTF6y9SOqAsI+GuY8tEMfUwXIQqi7+4Vo0Eqb2DAFfUTcfH5IEsO5pN3qPTdcasBoPGKfj/LC3/xA==","signatures":[{"sig":"MEUCIQCctxtPxM4l+YOfq09ylBBfAN0ZigVaW27BfBx3r4mN7AIgEoBN2Hmmh65TICy9vBtWPdEeVwjsEl5zVXvt24rvBag=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":144470},"main":"build/index.js","_from":"file:aptos-labs-gas-station-client-1.1.0.tgz","types":"build/types/index.d.ts","scripts":{"build":"tsc"},"_npmUser":{"name":"aptos-labs","actor":{"name":"aptos-labs","type":"user","email":"npmjs@aptoslabs.com"},"email":"npmjs@aptoslabs.com"},"_resolved":"/private/var/folders/n4/74gtnh3d2mn_qb2gddnl8lp80000gn/T/b3a2d9feb5660aa2b97295d435219200/aptos-labs-gas-station-client-1.1.0.tgz","_integrity":"sha512-kpGR4LLzGJTF6y9SOqAsI+GuY8tEMfUwXIQqi7+4Vo0Eqb2DAFfUTcfH5IEsO5pN3qPTdcasBoPGKfj/LC3/xA==","_npmVersion":"10.9.2","description":"Client for the Aptos Gas Station API","directories":{},"_nodeVersion":"23.11.0","dependencies":{"@aptos-labs/ts-sdk":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.3","@types/node":"^20.14.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-station-client_1.1.0_1750988017290_0.3641589066561415","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@aptos-labs/gas-station-client","version":"1.1.1","author":{"name":"Aptos Labs"},"_id":"@aptos-labs/gas-station-client@1.1.1","maintainers":[{"name":"aptos-labs","email":"npmjs@aptoslabs.com"}],"dist":{"shasum":"251c3439492d06b2f3cf00b8e0755454ffbbbaa0","tarball":"https://registry.npmjs.org/@aptos-labs/gas-station-client/-/gas-station-client-1.1.1.tgz","fileCount":51,"integrity":"sha512-vuXFtGAIfDdl5crR27dT1JUfhKHtad688PL3RD2lHnLd9aIZEJJ0Rtw1UUat4QVxy4N/JcjvR3hFV179DTKMSg==","signatures":[{"sig":"MEQCIBfQBsZOP9d9gV8dMyAmg0PyytJh9ShLnLPGht50QkdFAiA35TDazJ40lqWNW8lhTTMzozREGfnSCDhudDuZQtgNZA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":144470},"main":"build/index.js","_from":"file:aptos-labs-gas-station-client-1.1.1.tgz","types":"build/types/index.d.ts","scripts":{"build":"tsc"},"_npmUser":{"name":"aptos-labs","actor":{"name":"aptos-labs","type":"user","email":"npmjs@aptoslabs.com"},"email":"npmjs@aptoslabs.com"},"_resolved":"/private/var/folders/n4/74gtnh3d2mn_qb2gddnl8lp80000gn/T/f04afc99ca72d48969cd1ba1838ecc4d/aptos-labs-gas-station-client-1.1.1.tgz","_integrity":"sha512-vuXFtGAIfDdl5crR27dT1JUfhKHtad688PL3RD2lHnLd9aIZEJJ0Rtw1UUat4QVxy4N/JcjvR3hFV179DTKMSg==","_npmVersion":"10.9.2","description":"Client for the Aptos Gas Station API","directories":{},"_nodeVersion":"23.11.0","dependencies":{"@aptos-labs/ts-sdk":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.3","@types/node":"^20.14.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-station-client_1.1.1_1751161702134_0.19561948449666522","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@aptos-labs/gas-station-client","version":"2.0.0","author":{"name":"Aptos Labs"},"_id":"@aptos-labs/gas-station-client@2.0.0","maintainers":[{"name":"aptos-labs","email":"npmjs@aptoslabs.com"}],"dist":{"shasum":"396b7bce9b340a0e3f06e61266b8ce9183a31eaa","tarball":"https://registry.npmjs.org/@aptos-labs/gas-station-client/-/gas-station-client-2.0.0.tgz","fileCount":42,"integrity":"sha512-Srby7wvYy3T6qH0vkHNgNwggZ67UakuQ7NE4y2G3p21g9fXEy4KXC6U6DjAqwvu6IiZFQ2k6AXuONn9dqWiLmA==","signatures":[{"sig":"MEYCIQDgm6K3IVl0qfoHTJ97LGH7IzeAVgsqgAV7q4yoAvNaNgIhAN3KREyVmuRgJuLNEr3WiEd0aPrLuX3lHdAMFFvcikiA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":90508},"main":"build/index.js","_from":"file:aptos-labs-gas-station-client-2.0.0.tgz","types":"build/types/index.d.ts","scripts":{"build":"tsc"},"_npmUser":{"name":"aptos-labs","actor":{"name":"aptos-labs","type":"user","email":"npmjs@aptoslabs.com"},"email":"npmjs@aptoslabs.com"},"_resolved":"/private/var/folders/k1/ntvsnj0j4k3_24thh8xbrdxr0000gn/T/5d2232b4b844cfcb36880e24974beeb8/aptos-labs-gas-station-client-2.0.0.tgz","_integrity":"sha512-Srby7wvYy3T6qH0vkHNgNwggZ67UakuQ7NE4y2G3p21g9fXEy4KXC6U6DjAqwvu6IiZFQ2k6AXuONn9dqWiLmA==","_npmVersion":"10.9.2","description":"Client for the Aptos Gas Station API","directories":{},"_nodeVersion":"23.11.1","dependencies":{"@aptos-labs/ts-sdk":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.3","@types/node":"^20.14.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-station-client_2.0.0_1751409821644_0.9823811834917819","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@aptos-labs/gas-station-client","version":"2.0.1","author":{"name":"Aptos Labs"},"_id":"@aptos-labs/gas-station-client@2.0.1","maintainers":[{"name":"aptos-labs","email":"npmjs@aptoslabs.com"}],"dist":{"shasum":"66f6bc32d0ad7d9e9eb8de918b00de5ddb529682","tarball":"https://registry.npmjs.org/@aptos-labs/gas-station-client/-/gas-station-client-2.0.1.tgz","fileCount":47,"integrity":"sha512-yjBYZuZxaAFkvDeNTmcdt4RI7U20iBcyXBFJ89h+QWQLgyJtTbqFF4w2H+mJmWBmA5Qm7Uozh0rnaygLFukbxA==","signatures":[{"sig":"MEUCIBIiCKcggFTBQYQ4uwPZjXC3UIoyjqLQrE7aCOQ9Af/zAiEArILZpsaoa7tLabi5WcmqDp9eojPXltrAo3U6q2Mp3X8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100992},"main":"build/index.js","_from":"file:aptos-labs-gas-station-client-2.0.1.tgz","types":"build/types/index.d.ts","scripts":{"build":"tsc"},"_npmUser":{"name":"aptos-labs","actor":{"name":"aptos-labs","type":"user","email":"npmjs@aptoslabs.com"},"email":"npmjs@aptoslabs.com"},"_resolved":"/private/var/folders/k1/ntvsnj0j4k3_24thh8xbrdxr0000gn/T/c0117ebc55fe883a459cef0361aa7682/aptos-labs-gas-station-client-2.0.1.tgz","_integrity":"sha512-yjBYZuZxaAFkvDeNTmcdt4RI7U20iBcyXBFJ89h+QWQLgyJtTbqFF4w2H+mJmWBmA5Qm7Uozh0rnaygLFukbxA==","_npmVersion":"10.9.2","description":"Client for the Aptos Gas Station API","directories":{},"_nodeVersion":"23.11.1","dependencies":{"@aptos-labs/ts-sdk":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.3","@types/node":"^20.14.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-station-client_2.0.1_1751446295657_0.9283056975406594","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@aptos-labs/gas-station-client","version":"2.0.2","author":{"name":"Aptos Labs"},"_id":"@aptos-labs/gas-station-client@2.0.2","maintainers":[{"name":"aptos-labs","email":"npmjs@aptoslabs.com"}],"dist":{"shasum":"f203f61341388ad11ee358a94af1ba5c0b3db13a","tarball":"https://registry.npmjs.org/@aptos-labs/gas-station-client/-/gas-station-client-2.0.2.tgz","fileCount":47,"integrity":"sha512-kyYt6Ue4qLvt+Yv17MxV3l+M1VCfcc5Sh3uDp3BjdKv1hks2M6RtZAsx5T6qZo5VD+3f5eqYsknzYeRLWDsP2A==","signatures":[{"sig":"MEYCIQD3k9fzXYjzvT2PDjUypkTmTjSXuEUd/8H6w6NH+bA8wAIhAJCSNgiTjXVwR6mdOEkDFPRAvTeoZ4vpdE+DrCZwmkwp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100807},"main":"build/index.js","_from":"file:aptos-labs-gas-station-client-2.0.2.tgz","types":"build/types/index.d.ts","scripts":{"build":"tsc"},"_npmUser":{"name":"aptos-labs","actor":{"name":"aptos-labs","type":"user","email":"npmjs@aptoslabs.com"},"email":"npmjs@aptoslabs.com"},"_resolved":"/private/var/folders/k1/ntvsnj0j4k3_24thh8xbrdxr0000gn/T/059c42d25e9105016033c2f3d5e90181/aptos-labs-gas-station-client-2.0.2.tgz","_integrity":"sha512-kyYt6Ue4qLvt+Yv17MxV3l+M1VCfcc5Sh3uDp3BjdKv1hks2M6RtZAsx5T6qZo5VD+3f5eqYsknzYeRLWDsP2A==","_npmVersion":"10.9.2","description":"Client for the Aptos Gas Station API","directories":{},"_nodeVersion":"23.11.1","dependencies":{"@aptos-labs/ts-sdk":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.3","@types/node":"^20.14.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-station-client_2.0.2_1751575627366_0.267153764020319","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@aptos-labs/gas-station-client","version":"2.0.3","description":"Client for the Aptos Gas Station API","author":{"name":"Aptos Labs"},"main":"build/index.js","types":"build/types/index.d.ts","dependencies":{"@aptos-labs/ts-sdk":"^5.0.0"},"devDependencies":{"@types/node":"^20.14.8","typescript":"^5.4.3"},"scripts":{"build":"tsc"},"_id":"@aptos-labs/gas-station-client@2.0.3","_integrity":"sha512-zKy/gy6rHE9q9+58Oi+AjLukv1rGhVopAlBreil5TDvjVZvpIV4S05cXSRBVgo1UK7c+ClrXgKqCFgGn/q7udg==","_resolved":"/private/var/folders/nz/hxvgq28s7ll4786dpjrp8z680000gn/T/bcf5c0863b5f79f4faf22c8c1c7cff6c/aptos-labs-gas-station-client-2.0.3.tgz","_from":"file:aptos-labs-gas-station-client-2.0.3.tgz","_nodeVersion":"20.14.0","_npmVersion":"10.9.1","dist":{"integrity":"sha512-zKy/gy6rHE9q9+58Oi+AjLukv1rGhVopAlBreil5TDvjVZvpIV4S05cXSRBVgo1UK7c+ClrXgKqCFgGn/q7udg==","shasum":"66793c6df56743a7c57ffbe6258e4c3b4cfec1ef","tarball":"https://registry.npmjs.org/@aptos-labs/gas-station-client/-/gas-station-client-2.0.3.tgz","fileCount":47,"unpackedSize":101250,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEPo/ZpcJ6D/O8f3fgt4xIoV8NdDeV5E2Q+UHuBTrigSAiBXTpSb8oFvSz5kOhPBsuMyvaurHa0/jV6vMU4ztVm0Gw=="}]},"_npmUser":{"name":"aptos-labs","email":"npmjs@aptoslabs.com"},"directories":{},"maintainers":[{"name":"aptos-labs","email":"npmjs@aptoslabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gas-station-client_2.0.3_1758041718119_0.8533004346829995"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-03T16:09:11.155Z","modified":"2025-09-16T16:55:18.496Z","1.0.0":"2025-04-03T16:09:11.414Z","1.1.0":"2025-06-27T01:33:37.476Z","1.1.1":"2025-06-29T01:48:22.306Z","2.0.0":"2025-07-01T22:43:41.818Z","2.0.1":"2025-07-02T08:51:35.830Z","2.0.2":"2025-07-03T20:47:07.542Z","2.0.3":"2025-09-16T16:55:18.343Z"},"author":{"name":"Aptos Labs"},"description":"Client for the Aptos Gas Station API","maintainers":[{"name":"aptos-labs","email":"npmjs@aptoslabs.com"}],"readme":"# Gas Station Client\n\nThe Aptos Build gas station client lets you submit transactions to be sponsored by the gas station.\n\n## Version Management\n\nThis package uses [changesets](https://github.com/changesets/changesets) for version management. To make changes:\n\n1. Make your code changes\n2. Run `pnpm changeset` in the root directory\n3. Follow the prompts to describe your changes\n4. Commit the generated changeset file along with your changes\n5. When ready to release, run `pnpm version-packages` to update versions\n6. Run `pnpm release` to publish the new version\n\n## Installation\n```\npnpm install @aptos-labs/gas-station-client\n```\n\nThis package contains a client for the Gas Station Admin API. It is primarily intended for use by Aptos Build. That's why we publish this to our private registry.\n\n## Usage\n\n### Recommended Usage\nThe easiest way to use the gas station client is with the TS SDK's plugin interface:\n\n```ts\nconst network = Network.MAINNET;\nconst gasStationClient = new GasStationTransactionSubmitter({\n  network,\n  apiKey: \"aptoslabs_21edbqbxyPrS_6fu9i83mYmjid4MVs3Z3XmCeATQ8tkSdd\",\n});\nconst config = new AptosConfig({\n  network,\n  pluginSettings: {\n    TRANSACTION_SUBMITTER: gasStationClient,\n  },\n});\nconst aptos = new Aptos(config);\n```\n\nFrom this point you can use the client like normal and it will submit transactions via the gas station instead of the default submitter:\n\n```ts\nconst transaction = await aptos.transaction.build.simple({\n  sender: senderAccount.accountAddress,\n  // IMPORTANT: Must set withFeePayer: true for gas station transactions.\n  withFeePayer: true,\n  data: {\n    function: \"0x1::aptos_account::transfer\",\n    functionArguments: [receiverAccount.accountAddress.toString(), 100],\n  },\n});\n\nconst response = await aptos.signAndSubmitTransaction({\n  signer: senderAccount,\n  transaction,\n});\n```\n\nTo provide a recaptcha token or other plugin parameters:\n```ts\nconst response = await aptos.signAndSubmitTransaction({\n  signer: senderAccount,\n  transaction,\n  pluginParams: {\n    recaptchaToken: \"your-recaptcha-token\",\n  },\n});\n```\n\n### Ignoring the Plugin\nYou can temporarily bypass the plugin for a single transaction if needed:\n```ts\nconst response = await aptos.signAndSubmitTransaction({\n  signer: senderAccount,\n  transaction,\n  // Set this to null to ignore the plugin.\n  transactionSubmitter: null,\n});\n```\n\nYou can also totally disable / re-enable the plugin like this:\n```ts\naptos.setIgnoreTransactionSubmitter(true);\n// Transactions will now go through normal submission (not gas station)\n\naptos.setIgnoreTransactionSubmitter(false);\n// Re-enable the plugin\n```\n\n### Direct Usage\nIf you wish, you can use the client directly:\n\n```ts\nconst network = Network.MAINNET;\nconst config = new AptosConfig({network});\nconst aptos = new Aptos(config);\n\n// Create the client.\nconst client = new GasStationClient({\n  network,\n  apiKey: \"aptoslabs_21edbqbxyPrS_6fu9i83mYmjid4MVs3Z3XmCeATQ8tkSdd\",\n});\n\n// Build the transaction.\nconst transaction = await aptos.transaction.build.simple({\n  sender: alice.accountAddress,\n  // Make sure that this is set to true.\n  withFeePayer: true,\n  data: {\n    function: \"0x1::aptos_account::transfer\",\n    functionArguments: [bob.accountAddress.toString(), 100],\n  },\n});\n\n// Sign it and get an authenticator.\nconst senderAuthenticator = aptos.transaction.sign({ signer: alice, transaction });\n\n// Submit it to the gas station.\nconst { transactionHash } = await client.signAndSubmitTransaction({\n  transaction,\n  senderAuthenticator,\n});\n\n// Wait for the transaction to be executed.\nconst executedTransaction = await aptos.waitForTransaction({\n  transactionHash,\n  options: { checkSuccess: true },\n});\nconsole.log(\"Transaction executed successfully\", executedTransaction.hash);\n```\n","readmeFilename":"README.md"}