npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aptos-labs/gas-station-client

v2.0.3

Published

Client for the Aptos Gas Station API

Readme

Gas Station Client

The Aptos Build gas station client lets you submit transactions to be sponsored by the gas station.

Version Management

This package uses changesets for version management. To make changes:

  1. Make your code changes
  2. Run pnpm changeset in the root directory
  3. Follow the prompts to describe your changes
  4. Commit the generated changeset file along with your changes
  5. When ready to release, run pnpm version-packages to update versions
  6. Run pnpm release to publish the new version

Installation

pnpm install @aptos-labs/gas-station-client

This 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.

Usage

Recommended Usage

The easiest way to use the gas station client is with the TS SDK's plugin interface:

const network = Network.MAINNET;
const gasStationClient = new GasStationTransactionSubmitter({
  network,
  apiKey: "aptoslabs_21edbqbxyPrS_6fu9i83mYmjid4MVs3Z3XmCeATQ8tkSdd",
});
const config = new AptosConfig({
  network,
  pluginSettings: {
    TRANSACTION_SUBMITTER: gasStationClient,
  },
});
const aptos = new Aptos(config);

From this point you can use the client like normal and it will submit transactions via the gas station instead of the default submitter:

const transaction = await aptos.transaction.build.simple({
  sender: senderAccount.accountAddress,
  // IMPORTANT: Must set withFeePayer: true for gas station transactions.
  withFeePayer: true,
  data: {
    function: "0x1::aptos_account::transfer",
    functionArguments: [receiverAccount.accountAddress.toString(), 100],
  },
});

const response = await aptos.signAndSubmitTransaction({
  signer: senderAccount,
  transaction,
});

To provide a recaptcha token or other plugin parameters:

const response = await aptos.signAndSubmitTransaction({
  signer: senderAccount,
  transaction,
  pluginParams: {
    recaptchaToken: "your-recaptcha-token",
  },
});

Ignoring the Plugin

You can temporarily bypass the plugin for a single transaction if needed:

const response = await aptos.signAndSubmitTransaction({
  signer: senderAccount,
  transaction,
  // Set this to null to ignore the plugin.
  transactionSubmitter: null,
});

You can also totally disable / re-enable the plugin like this:

aptos.setIgnoreTransactionSubmitter(true);
// Transactions will now go through normal submission (not gas station)

aptos.setIgnoreTransactionSubmitter(false);
// Re-enable the plugin

Direct Usage

If you wish, you can use the client directly:

const network = Network.MAINNET;
const config = new AptosConfig({network});
const aptos = new Aptos(config);

// Create the client.
const client = new GasStationClient({
  network,
  apiKey: "aptoslabs_21edbqbxyPrS_6fu9i83mYmjid4MVs3Z3XmCeATQ8tkSdd",
});

// Build the transaction.
const transaction = await aptos.transaction.build.simple({
  sender: alice.accountAddress,
  // Make sure that this is set to true.
  withFeePayer: true,
  data: {
    function: "0x1::aptos_account::transfer",
    functionArguments: [bob.accountAddress.toString(), 100],
  },
});

// Sign it and get an authenticator.
const senderAuthenticator = aptos.transaction.sign({ signer: alice, transaction });

// Submit it to the gas station.
const { transactionHash } = await client.signAndSubmitTransaction({
  transaction,
  senderAuthenticator,
});

// Wait for the transaction to be executed.
const executedTransaction = await aptos.waitForTransaction({
  transactionHash,
  options: { checkSuccess: true },
});
console.log("Transaction executed successfully", executedTransaction.hash);