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

@vela-ventures/ao-sync-sdk

v1.1.33

Published

JavaScript SDK for Beacon wallet

Downloads

393

Readme

AO Sync SDK

NPM version npm downloads/month npm downloads

@vela-ventures/ao-sync-sdk

@vela-ventures/ao-sync-sdk is a JavaScript/TypeScript SDK for connecting your application to the Beacon Wallet. This library provides an easy way to interact with Beacon Wallet for Arweave and AO-based applications while delegating signing, encryption, and logic to the wallet itself.

Features

  • Seamless Wallet Connection: Connect to the Beacon Wallet via MQTT.
  • QR Code Authentication: Generate QR codes for easy wallet scanning.
  • Reconnect Support: Automatically reconnect to the wallet using stored session data.

Installation

Install the SDK via npm:

npm install @vela-ventures/ao-sync-sdk

Usage

1. Import the WalletClient Class

import WalletClient from "@vela-ventures/ao-sync-sdk";

2. Initialize the WalletClient

const walletClient = new WalletClient();

3. Connect to the Wallet

To establish a connection with Beacon Wallet, use the connect method:

await walletClient.connect({
  permissions: [
    "ACCESS_ADDRESS",
    "ACCESS_PUBLIC_KEY",
    "SIGN_TRANSACTION"
  ],
  appInfo: {
    name: "MyApp",
    logo: "https://myapp.com/logo.png"
  },
  gateway: {
    host: "arweave.net",
    port: 443,
    protocol: "https"
  },
  brokerUrl: "wss://aosync-broker-eu.beaconwallet.dev:8081",
  options: {
    protocolVersion: 5
  }
});

This will generate a QR code that the user can scan with their Beacon Wallet to establish a connection.

4. Listen for Events

The SDK uses an event-driven architecture. You can listen for connection, disconnection, or custom events:

walletClient.on("connected", (data) => {
  console.log("Wallet connected:", data);
});

walletClient.on("disconnected", (data) => {
  console.log("Wallet disconnected:", data);
});

5. Sign Transactions or Data

Once connected, you can use the wallet to sign transactions or data:

const signedTx = await walletClient.signTransaction(transactionData);
console.log("Signed Transaction:", signedTx);

const signedData = await walletClient.signDataItem(dataItem);
console.log("Signed Data Item:", signedData);

6. Disconnect

To disconnect the wallet:

await walletClient.disconnect();

API Reference

WalletClient

Constructor

new WalletClient(responseTimeoutMs = 30000, txTimeoutMs = 300000)
  • responseTimeoutMs (optional): Timeout duration for responses (default: 30 seconds).
  • txTimeoutMs (optional): Timeout duration for transactions (default: 5 minutes).

Methods

connect(options)

Establish a connection with the Beacon Wallet.

reconnect()

Reconnect to the wallet using session data from sessionStorage.

signTransaction(transaction)

Sign an Arweave transaction.

  • transaction: The transaction object to sign.
signDataItem(dataItem)

Sign a data item.

  • dataItem: The data item to sign.
disconnect()

Disconnect from the Beacon Wallet.

Events

  • connected: Fired when the wallet is successfully connected.
  • disconnected: Fired when the wallet is disconnected.

Dependencies

  • mqtt: MQTT protocol client.
  • qrcode: QR code generation.
  • uuid: Universally unique identifiers.
  • arweave/web: Arweave SDK for transactions and data handling.

Contributing

Feel free to open issues or submit pull requests to enhance this SDK. Contributions are welcome!