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

@azguardwallet/client

v0.7.0

Published

Simple client for interacting with Azguard Wallet via inpage RPC

Readme

@azguardwallet/client

GitHub License NPM Version NPM Downloads

Simple client for interacting with the Azguard Wallet via inpage RPC, simplifying session management routine and events handling.

See Azguard RPC specification and available operation types here: https://github.com/AzguardWallet/azguard-wallet-types/blob/main/src/operation.ts

Install the package:

npm install @azguardwallet/client

How to connect to Azguard wallet:

This example demonstrates a basic connection workflow:

import { AzguardClient } from "@azguardwallet/client";

// check if the Azguard Wallet extension is installed
if (!await AzguardClient.isAzguardInstalled()) {
    // if not, then suggest the user to install it from Chrome Web Store
    // https://chromewebstore.google.com/detail/azguard-wallet/pliilpflcmabdiapdeihifihkbdfnbmn
    return;
}

// create a wallet client
const azguard = await AzguardClient.create();

// handle wallet disconnection, if needed
azguard.onDisconnected.addHandler(() => {
    console.log("Wallet disconnected");
})

// connect to the wallet if it's not connected yet
if (!azguard.connected) {
    await azguard.connect(
        {
            // provide the dapp metadata to be displayed to wallet user
            name: "My Dapp",
        },
        [
            {
                // specify one or more chains you want to connect to:
                // "aztec:1674512022" - devnet,
                // "aztec:0" - local sandbox
                chains: ["aztec:1674512022"],
                // specify a list of operations and actions your dapp is going to use
                methods: ["send_transaction", "add_private_authwit", "call"],
            },
        ],
    );
}

How to send transaction

This is a simple example of how to send a transaction with private authwit:

// send a transaction with private authwit
const [ result ] = await azguard.execute([
    {
        kind: "send_transaction",
        account: azguard.accounts[0],
        actions: [
            {
                kind: "add_private_authwit",
                content: {
                    kind: "call",
                    caller: "0x1111...",
                    contract: "0x2222...",
                    method: "transfer_in_private",
                    args: [
                        "0x3333...",
                        "0x1111...",
                        100n,
                        123,
                    ],
                },
            },
            {
                kind: "call",
                contract: "0x1111...",
                method: "swap",
                args: [
                    "0x2222...",
                    100n,
                ],
            },
        ],
    }
])

// check the result status
if (result.status !== "ok") {
    throw new Error(result.error);
}

// print the tx hash
console.log(result.result);

Simulating view functions

Another example, demonstrating how to read contract's data by simulating its view functions:

const account = azguard.accounts[0];
const address = account.split(":").at(-1);

const [ result ] = await azguard.execute([
    {
        kind: "simulate_views",
        account: account,
        calls: [
            {
                kind: "call",
                contract: "0x2ab7cf582347c8a2834e0faf98339372118275997e14c5a77054bb345362e878",
                method: "balance_of_public",
                args: [ address ],
            },
            {
                kind: "call",
                contract: "0x2ab7cf582347c8a2834e0faf98339372118275997e14c5a77054bb345362e878",
                method: "balance_of_private",
                args: [ address ],
            },
        ],
    },
])

if (result.status !== "ok") {
    throw new Error(result.error);
}

const publicBalance = (result.result as SimulateViewsResult).decoded[0];
const privateBalance = (result.result as SimulateViewsResult).decoded[1];

Contracts registration

In Aztec in order to interact with a contract (simulate or execute its functions, generate proofs, etc.) you have to register it in the wallet beforehand.

So, if the contract you are going to interact with hasn't been registered in the wallet yet, you will need to add the register_contract operation to the beginning of the batch:

const [
    registerContractResult, 
    simulateViewsResult,
    sendTransactionResult
 ] = await azguard.execute([
    {
        kind: "register_contract",
        chain: yourChain,
        address: yourContractAddress,
        instance: yourContractInstance,
        artifact: yourContractArtifact,
    },
    {
        kind: "simulate_views",
        ...
    },
    {
        kind: "send_transaction",
        ...
    },
]);

Note, contract registration is only needed to be done once.

Also, you don't need to register protocol contracts (0x0000..01 - 0x0000..06), because they are registered out of the box.

Disconnect the wallet

Once everything is done, you can disconnect the wallet:

await azguard.disconnect();

That's pretty much it :)

Support channels

If you have any questions, feel free to contact us in:

  • Telegram: https://t.me/azguardwallet
  • Twitter: https://twitter.com/AzguardWallet

Cheers! 🍺