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

cardano-dapp-js

v1.0.11

Published

A library that enables websites to quickly become dApps using Javascript code

Downloads

93

Readme

Quickstart

Recommend prerequisites for running a local NPM webapp:

Basic usage

See cardano-nft-js-toolkit for full dApp examples.

First, you need to create a simple div to contain the wallet picker:

<div id="wallet-container"></div>

Then, in a script block use JavaScript to initialize the wallet container and wire up the wallet picker users will use in your dApp.

var cardanoDApp = new CardanoDApp('wallet-container');

The wallet returned from calls to this class conforms to CIP-0030. In addition, we optionally support the WalletConnect protocol for Cardano wallets. To enable WalletConnect support in your dApp you need to include additional information:

var cardanoDApp = new CardanoDApp('wallet-container', {
  projectId: '0123456789abcdeffedcba9876543210',
  relayerRegion: 'wss://relay.walletconnect.com',
  metadata: {
    description: 'Your dApp description goes here',
    name: 'Your dApp',
    icons: ['https://www.yourdapp.com/favicon.ico'],
    url: 'https://yourdapp.com/'
  },
  autoconnect: false
});

Sample usage could be:

if (!cardanoDApp.isWalletConnected()) {
  alert('Please connect a wallet to access this dApp!');
  return;
}

cardanoDApp.getConnectedWallet().then(wallet => {
  var Blockfrost = new Blockfrost(BLOCKFROST_BASE, BLOCKFROST_KEY);
  Lucid.new(Blockfrost, NETWORK).then(lucid => {
    lucid.selectWallet(wallet);
    lucid.newTx().payToAddress(paymentAddr, { lovelace: paymentAmount }).complete();
    // ...
  });
});

After a successful connection is made by the user a message of type CARDANO_DAPP_JS_CONNECT is posted to the window object. For third-party integrations, simply receive this message into your JavaScript code and make use of the wallet object that is passed in:

window.addEventListener("message", async event => {
  // We only accept messages from ourselves
  if (event.source != window || !event.data.type) {
    return;
  }

  try {
    switch (event.data.type) {
      case "CARDANO_DAPP_JS_CONNECT":
        await doSomethingWith(event.data.wallet);
        ...

Styling

The dropdown menu created by the initialization of the CardanoDApp facilitates unique styling through HTML/CSS identifiers. A simple CSS stylesheet for testing can be found at cardano-wallet-picker.css and can be included as:

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/cardano-wallet-picker.css" rel="stylesheet" integrity="<COMPUTED_INTEGRITY>" crossorigin="anonymous" type="text/css">

Examples

Please see the examples provide in the src/examples/ directory.

Installation

While this code can be built directly into Javascript (using a tool like Webpack), we recommend building your HTML5 webapp using npm. Then, you can install this package using:

npm install cardano-dapp-js

From Source

First, clone this repository and install all dependencies:

npm install

Then, create the ability for npm to link on your local system:

npm link

Finally, go to your project directory and use npm link to create a symlink:

cd $PROJECT_DIR/node_modules
npm link cardano-dapp-js

When you build your web application, you will be using a locally symlinked version of this library.

Static Javascript Linkage

A compiled version of this library is generated with each release using webpack. To link it directly from your HTML code, please use (and optionally include the integrity attribute):

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cardano-dapp-js.js" crossorigin="anonymous" type="text/javascript"></script>

Compatibility

This library is built to be compatible with any wallet that is aligned to CIP-0030 (the full list can be found at cardano-caniuse.io).

While not required, we highly recommend integrating this library with Lucid by Berry-Pool for creating and submitting transactions on Cardano.

Testing

TBA

Documentation

All documentation relevant to this project is contained in this README. For community support, please visit the WildTangz Discord.