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

@blockshake/defly-connect

v1.2.1

Published

JavaScript SDK for integrating Defly Wallet to web applications.

Readme

@blockshake/defly-connect

JavaScript SDK for integrating Defly Wallet to web applications. For more detailed information, please check our Defly Manual.

This is a fork of the Pera connect JavaScript SDK, for more details visit Pera connect on GitHub.

Quick Start

Let's start with installing @blockshake/defly-connect

npm install --save @blockshake/defly-connect
// Connect handler
deflyWallet
  .connect()
  .then((newAccounts) => {
    // Setup the disconnect event listener
    deflyWallet.connector?.on("disconnect", handleDisconnectWalletClick);

    setAccountAddress(newAccounts[0]);
  })
  .reject((error) => {
    // You MUST handle the reject because once the user closes the modal, deflyWallet.connect() promise will be rejected.
    // For the async/await syntax you MUST use try/catch
    if (error?.data?.type !== "CONNECT_MODAL_CLOSED") {
      // log the necessary errors
    }
  });

If you don't want the user's account information to be lost by the dApp when the user closes the browser with user’s wallet connected to the dApp, you need to handle the reconnect session status. You can do this in the following way.

// On the every page refresh
deflyWallet.reconnectSession().then((accounts) => {
  // Setup the disconnect event listener
  deflyWallet.connector?.on("disconnect", handleDisconnectWalletClick);

  if (accounts.length) {
    setAccountAddress(accounts[0]);
  }
});

After that you can sign transaction with this way

// Single Transaction
try {
  const signedTxn = await deflyWallet.signTransaction([singleTxnGroups]);
} catch (error) {
  console.log("Couldn't sign Opt-in txns", error);
}

Options

| option | default | value | | | ------------------------ | ------- | ------------------------------------- | -------- | | chainId | 4160 | 416001, 416002, 416003 , 4160 | optional | | shouldShowSignTxnToast | true | boolean | optional |

chainId

Determines which Algorand network your dApp uses.

MainNet: 416001

TestNet: 416002

BetaNet: 416003

All Networks: 4160

shouldShowSignTxnToast

It's enabled by default but in some cases, you may not need the toast message (e.g. you already have signing guidance for users). To disable it, use the shouldShowSignTxnToast option:

Methods

DeflyWalletConnect.connect(): Promise<string[]>

Starts the initial connection flow and returns the array of account addresses.

DeflyWalletConnect.reconnectSession(): Promise<string[]>

Reconnects to the wallet if there is any active connection and returns the array of account addresses.

DeflyWalletConnect.disconnect(): Promise<void | undefined>

Disconnects from the wallet and resets the related storage items.

DeflyWalletConnect.platform: DeflyWalletPlatformType

Returns the platform of the active session. Possible responses: mobile | null

DeflyWalletConnect.isConnected: boolean

Checks if there's any active session regardless of platform. Possible responses: true | false

DeflyWalletConnect.signTransaction(txGroups: SignerTransaction[][], signerAddress?: string): Promise<Uint8Array[]>

Starts the sign process and returns the signed transaction in Uint8Array

Customizing Style

You can override the z-index using the .defly-wallet-connect-modal class so that the modal does not conflict with another component on your application.

.defly-wallet-connect-modal {
  // The default value of z-index is 10. You can lower and raise it as much as you want.
  z-index: 11;
}

Your app name on Defly Wallet

By default, the connect wallet drawer on Defly Wallet gets the app name from document.title.

In some cases, you may want to customize it. You can achieve this by adding a meta tag to your HTML between the head tag.

<meta name="name" content="My dApp" />

Contributing

All contributions are welcomed! To get more information about the details, please read the contribution guide first.