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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aptos-labs/wallet-standard

v2.0.0

Published

Aptos wallet standard

Readme

Aptos Wallet Standard

npm version npm downloads CI codecov License

The Aptos Wallet Standard defines TypeScript interfaces and utilities for wallet and dapp interactions in the Aptos ecosystem. It implements AIP-62, providing a consistent way for wallets to integrate with applications.

Built on top of the chain-agnostic Wallet Standard, this library extends it with Aptos-specific features like transaction signing, network management, and account handling.

Installation

# npm
npm install @aptos-labs/wallet-standard

# pnpm
pnpm add @aptos-labs/wallet-standard

Peer Dependencies

This package requires the following peer dependencies:

For Dapp Developers

Detecting Wallets

Use getAptosWallets() to discover all registered Aptos-compatible wallets. This function filters for wallets that implement the required feature set.

import { getAptosWallets } from "@aptos-labs/wallet-standard";

const { aptosWallets, on } = getAptosWallets();

// Use currently registered wallets
console.log("Available wallets:", aptosWallets);

// Listen for new wallets that register after page load
const removeListener = on("register", (wallet) => {
  console.log("New wallet registered:", wallet);
});

Checking for Optional Features

Use isWalletWithRequiredFeatureSet() to check if a wallet supports additional features beyond the required set:

import { isWalletWithRequiredFeatureSet } from "@aptos-labs/wallet-standard";
import type { AptosSignAndSubmitTransactionFeature } from "@aptos-labs/wallet-standard";

if (
  isWalletWithRequiredFeatureSet<AptosSignAndSubmitTransactionFeature>(wallet, [
    "aptos:signAndSubmitTransaction",
  ])
) {
  // Wallet supports sign-and-submit
}

For Wallet Developers

To make your wallet compatible with the Aptos Wallet Standard, implement the AptosWallet interface and register it using registerWallet from @wallet-standard/core.

1. Implement the Wallet Interface

import { APTOS_CHAINS } from "@aptos-labs/wallet-standard";
import type { AptosWallet, AptosFeatures } from "@aptos-labs/wallet-standard";

class MyWallet implements AptosWallet {
  readonly name = "My Wallet";
  readonly url = "https://mywallet.com";
  readonly version = "1.0.0";
  readonly icon = "data:image/png;base64,...";
  readonly chains = APTOS_CHAINS;
  accounts = [];

  get features(): AptosFeatures {
    return {
      "aptos:connect": { version: "1.0.0", connect: this.connect },
      "aptos:disconnect": { version: "1.0.0", disconnect: this.disconnect },
      "aptos:account": { version: "1.0.0", account: this.account },
      "aptos:network": { version: "1.0.0", network: this.network },
      "aptos:signTransaction": {
        version: "1.0.0",
        signTransaction: this.signTransaction,
      },
      "aptos:signMessage": {
        version: "1.0.0",
        signMessage: this.signMessage,
      },
      "aptos:onAccountChange": {
        version: "1.0.0",
        onAccountChange: this.onAccountChange,
      },
      "aptos:onNetworkChange": {
        version: "1.0.0",
        onNetworkChange: this.onNetworkChange,
      },
    };
  }

  // ... implement each feature method
}

2. Register the Wallet

For browser extension wallets, call registerWallet when the page loads:

import { registerWallet } from "@aptos-labs/wallet-standard";

const myWallet = new MyWallet();
registerWallet(myWallet);

See the full example wallet implementation for a complete template with detailed guidance.

API Reference

Interfaces

| Interface | Description | | --- | --- | | AptosWallet | Main wallet interface extending WalletWithAptosFeatures with a url property | | AptosWalletAccount | Account interface extending WalletAccount with a signingScheme field | | AccountInfo | Serializable account info class with address, publicKey, and optional ansName | | NetworkInfo | Network details including name, chainId, and optional url |

Required Features

All Aptos wallets must implement these features:

| Feature | Description | | --- | --- | | aptos:connect | Connect a user's account to the dapp | | aptos:disconnect | Disconnect the account from the dapp | | aptos:account | Get the currently connected account info | | aptos:network | Get the current network the wallet is connected to | | aptos:signTransaction | Sign a transaction without submitting | | aptos:signMessage | Sign an arbitrary message | | aptos:onAccountChange | Listen for account change events | | aptos:onNetworkChange | Listen for network change events |

Optional Features

| Feature | Description | | --- | --- | | aptos:signAndSubmitTransaction | Sign and submit a transaction in one step | | aptos:changeNetwork | Request the wallet to switch networks | | aptos:openInMobileApp | Open the wallet's mobile app | | aptos:signIn | Sign in with the wallet |

Chains

Pre-defined chain identifiers:

import {
  APTOS_MAINNET_CHAIN, // "aptos:mainnet"
  APTOS_TESTNET_CHAIN, // "aptos:testnet"
  APTOS_DEVNET_CHAIN, // "aptos:devnet"
  APTOS_LOCALNET_CHAIN, // "aptos:localnet"
  APTOS_CHAINS, // All of the above
} from "@aptos-labs/wallet-standard";

Error Handling

The library provides structured errors via AptosWalletError:

import {
  AptosWalletError,
  AptosWalletErrorCode,
} from "@aptos-labs/wallet-standard";

// Error codes:
// 4100 - Unauthorized: method/account not authorized by the user
// 4200 - Unsupported: requested feature is not supported
// -30001 - InternalError: something went wrong within the wallet

User Responses

Methods that prompt the user for approval return a UserResponse<T>, a discriminated union that lets the wallet signal either approval (with a result) or rejection. The following features use this shape:

  • aptos:connect
  • aptos:signTransaction
  • aptos:signAndSubmitTransaction
  • aptos:signMessage
  • aptos:signIn
  • aptos:changeNetwork

Other required features return their value directly (still asynchronously): aptos:account returns Promise<AccountInfo>, aptos:network returns Promise<NetworkInfo>, aptos:disconnect returns Promise<void>, and the onAccountChange / onNetworkChange features register subscriptions.

import { UserResponseStatus } from "@aptos-labs/wallet-standard";

const response = await wallet.features["aptos:connect"].connect();

if (response.status === UserResponseStatus.APPROVED) {
  console.log("Connected:", response.args); // AccountInfo
} else {
  console.log("User rejected the connection");
}

Development

# Install dependencies
pnpm install

# Build
pnpm build

# Lint
pnpm lint

# Format
pnpm format

License

Apache-2.0