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

@adena-wallet/sdk

v0.0.13

Published

Adena Wallet SDK

Readme

Adena Wallet SDK

The Adena Wallet SDK is a TypeScript-based library designed to interact with the Adena Wallet and TM2 Wallet.

This SDK provides various functionalities, including wallet connection, network switching, transaction signing, and more.

Adena Wallet

Installation

Install the SDK via npm:

npm install @adena-wallet/sdk

Or via yarn:

yarn add @adena-wallet/sdk

Basic Usage

Here is a basic example of how to use the SDK:

import { AdenaSDK, WalletProvider } from '@adena-wallet/sdk';

const walletProvider = new WalletProvider();
const adenaSDK = new AdenaSDK(walletProvider);

// Connect to the wallet
adenaSDK.connectWallet().then(() => {
  console.log('Wallet connected');
});

// Retrieves account information
adenaSDK.getAccount().then((account) => {
  console.log('Account:', account);
});

SDK Functions

connectWallet

Connects the SDK to the wallet.

Example:

adenaSDK.connectWallet().then(() => {
  console.log('Wallet connected');
});

disconnectWallet

Disconnects the SDK from the wallet.

Example:

adenaSDK.disconnectWallet();

getConnectionState

Retrieves the current connection state of the wallet.

Example:

const state = adenaSDK.getConnectionState();
console.log('Connection state:', state);

onConnectionChange

Sets up a listener for connection state changes.

Example:

adenaSDK.onConnectionChange({
  callback: (event) => {
    console.log('Connection event:', event);
  },
});

offConnectionChange

Removes a previously set connection state change listener.

Example:

const listener = (event) => {
  console.log('Connection event:', event);
};

adenaSDK.onConnectionChange({ callback: listener });

// Later, remove the listener
adenaSDK.offConnectionChange({ callback: listener });

isConnected

Checks if the wallet is currently connected.

Example:

adenaSDK.isConnected().then((response) => {
  console.log('Is connected:', response.status);
});

getAccount

Retrieves account information from the connected wallet.

Example:

adenaSDK.getAccount().then((account) => {
  console.log('Account:', account);
});

switchNetwork

Switches the wallet to a different network.

Example:

adenaSDK.switchNetwork({ chainId: 'new-chain-id' }).then(() => {
  console.log('Network switched');
});

addNetwork

Adds a new network to the wallet.

Example:

adenaSDK.addNetwork({
  chainId: 'new-chain-id',
  chainName: 'New Network',
  rpcUrl: 'New Chain RPC URL',
}).then(() => {
  console.log('Network added');
});

signTransaction

Signs a transaction with the connected wallet.

Example:

const tx = {
    /** specific message types */
    messages: Any[];
    /** transaction costs (fee) */
    fee?: TxFee;
    /** the signatures for the transaction */
    signatures: TxSignature[];
    /** memo attached to the transaction */
    memo: string;
};

adenaSDK.signTransaction({ tx }).then((response) => {
  console.log('Signed transaction:', response.encodedTransaction);
});

broadcastTransaction

Broadcasts a signed transaction to the network.

Example:

const tx = {
    /** specific message types */
    messages: Any[];
    /** transaction costs (fee) */
    fee?: TxFee;
    /** the signatures for the transaction */
    signatures: TxSignature[];
    /** memo attached to the transaction */
    memo: string;
};

adenaSDK.broadcastTransaction({ tx }).then((response) => {
  console.log('Broadcast response:', response);
});

onChangeAccount

Sets up a listener for account changes.

Example:

adenaSDK.onChangeAccount({
  callback: (account) => {
    console.log('Account changed:', account);
  },
});

onChangeNetwork

Sets up a listener for network changes.

Example:

adenaSDK.onChangeNetwork({
  callback: (network) => {
    console.log('Network changed:', network);
  },
});

Development Setup

The Node.js version is 18.14.2.
We recommend using nvm.

# If you don't have that version installed,
# $ nvm install

$ nvm use

License

This project is licensed under the MIT License.