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

@oasisprotocol/sapphire-paratime

v2.3.0

Published

The Sapphire ParaTime Web3 integration library.

Readme

Sapphire ParaTime Compat Lib

@oasisprotocol/sapphire-paratime makes it easy to port your dapp to the Sapphire ParaTime by wrapping your existing EIP-1193 compatible provider (e.g. window.ethereum). Once you wrap your provider, you can use Sapphire just like you would use Ethereum, however to get full support for encrypted transactions, queries and gas estimates it may be necessary to use a framework-specific package such as with Ethers, Hardhat, Viem or Wagmi.

The Sapphire wrapper with automatically encrypt the eth_call, eth_estimateGas and eth_signTransaction JSON-RPC calls

If your dapp doesn't port in under 10 minutes, it's a bug! If you have more than a little trouble, please file an issue. There should be no reason not to use the Sapphire ParaTime!

Usage

After installing this library, find your Ethereum provider and wrap it using wrapEthereumProvider. Below are some examples for the most kinds of providers.

EIP-1193

import { wrapEthereumProvider } from '@oasisprotocol/sapphire-paratime';

const provider = wrapEthereumProvider(window.ethereum);
window.ethereum = wrapEthereumProvider(window.ethereum); // If you're feeling bold.

Hardhat

Try the @oasisprotocol/sapphire-hardhat Hardhat plugin for extra convenience. Place this line at the top of your hardhat.config.ts.

import '@oasisprotocol/sapphire-hardhat';
// All other Hardhat plugins must come below.

Troubleshooting

Error: missing provider (operation="getChainId", code=UNSUPPORTED_OPERATION, ...)

Explanation: When you first make a transaction or call using a wrapped signer or provider, this library will automatically fetch the runtime public key from the Web3 gateway using your connected provider. If you've wrapped just a signer (e.g., ethers.Wallet), then you'll see this error.

Fix: The simplest thing to do is connect a provider. Alternatively, you can pass in a pre-initialized Cipher object as the second argument to wrap; and then also generate signed queries manually using the overrides parameter to SignedCallDataPack.make.

See Also