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

@multiversx/sdk-js-web-wallet-io

v3.3.0

Published

A library to hold the Web Wallet communication

Readme

mx-sdk-js-web-wallet-io

Web-wallet input/output mechanism.

@multiversx/sdk-js-web-wallet-io is the I/O layer of the MultiversX Web Wallet. It parses the inbound "hook" URLs that dApps send to the wallet, validates them, and replies back to the dApp over the right transport.

It contains no UI and no signing logic — it is the boundary between an untrusted dApp request and the wallet acting on it.

Installation

npm install @multiversx/sdk-js-web-wallet-io
# or
pnpm add @multiversx/sdk-js-web-wallet-io

The MultiversX SDK packages are peer dependencies, so install them alongside:

| Peer | Range | | --- | --- | | @multiversx/sdk-core | ^14 \|\| ^15 \|\| ^16 | | @multiversx/sdk-dapp | ^5 | | @multiversx/sdk-dapp-utils | ^3 | | @multiversx/sdk-web-wallet-cross-window-provider | ^3 | | @multiversx/sdk-web-wallet-provider | ^5 | | axios | ^1.18.1 | | bignumber.js | ^9 |

Only qs and yup are pulled in as runtime dependencies.

How it works

dApp ──hook URL──▶ parse ──▶ validate (yup) ──▶ sanitize callbackUrl ──▶ wallet acts
                                                                              │
dApp ◀── redirect / postMessage ◀────────────── replyToDapp ◀─────────────────┘

Every parser follows the same contract: it returns null on any validation failure rather than throwing. Callers branch on the result. A malformed or disallowed hook is simply not actionable.

Usage

Reading a hook

Each hook type has a parser that takes the URL query string:

import {
  getLoginHookData,
  getLogoutHookData,
  getSignMessageHookData
} from '@multiversx/sdk-js-web-wallet-io';

const login = getLoginHookData(window.location.search);
// -> { hookUrl, callbackUrl, token?, method? } | null

const logout = getLogoutHookData();          // defaults to window.location.search
// -> { hookUrl, callbackUrl } | null

const signMessage = getSignMessageHookData(window.location.search);
// -> { hookUrl, callbackUrl } | null

if (login === null) {
  // invalid or disallowed hook — do not proceed
}

Reading a sign hook

The sign hook is network-aware, so you build a transaction schema first:

import { signTxSchema } from '@multiversx/sdk-js-web-wallet-io/out/hooks/helpers/sign';
import { getSignHookData } from '@multiversx/sdk-js-web-wallet-io/out/hooks/signHook';

const schema = signTxSchema({
  isMainnet: true,
  hookWhitelist: [],   // receivers allowed on mainnet
  chainId: '1',
  isSignHook: true
});

const data = getSignHookData(schema)(window.location.search);
// -> { hookUrl, callbackUrl } | null

The receiver allow-list applies only when isMainnet is true and isSignHook is false — that is, to transaction hooks on mainnet, where the receiver must be a smart contract or appear in hookWhitelist. Sign hooks (isSignHook: true) bypass that restriction.

Replying to the dApp

replyToDapp picks the transport automatically based on how the wallet was opened — popup (window.opener), iframe, browser extension, webview, or plain redirect:

import { replyToDapp } from '@multiversx/sdk-js-web-wallet-io/out/replyToDapp';

replyToDapp({
  callbackUrl,
  postMessageData,   // omit to force a URL redirect
  transactionData,
  webwiewApp         // optional iframe target
});

Public API surface

getLoginHookData, getLogoutHookData, getSignMessageHookData, and the SignBaseHookType type are exported from the package root. getSignHookData, replyToDapp, and the schema helpers are reached through deep out/... paths as shown above.

Requirements

Node >= 24 for local development. The published build targets es2021 and runs in browsers. pnpm compile emits CommonJS (the published out/index.js); pnpm compile-next emits an ESM/ESNext build to the same directory — they are alternative build modes, not a dual-format package.

Note: this package targets browser environments and expects to be bundled. It cannot be loaded by Node's CommonJS resolver directly, because @multiversx/sdk-dapp publishes .cjs/.mjs files without a plain .js, which the extensionless deep imports in this package rely on. Bundlers resolve them correctly.

Contributing

See AGENTS.md for setup, commands, architecture, the invariants that must not be broken, and the verification checklist. It is written for coding agents but is the fastest orientation for humans too.

Two things to know up front:

  • Every PR needs a CHANGELOG.md entry — this is enforced by CI.
  • Merging to main publishes to npm automatically, so the version bump gates the release.

Changelog

See CHANGELOG.md.

License

MIT