@theqrl/zond-wallet-provider
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Zond Wallet Provider Preview Cover

Zond Wallet Provider

The Ethereum provider object announced by the Zond Wallet, based on EIP-6963. This facilitates the connection and communication between Zond Wallet and dApps.

Important! Zond Wallet Provider is based on few MetaMask repositories(json-rpc-engine, json-rpc-middleware-stream, object-multiplex,post-message-stream,providers,rpc-errors,safe-event-emitter,superstruct,utils). For each of the codebase used, their respective license is kept alongside the code. Please go through the subdirectories of this repository to view those licenses.

⌨️ Usage

  • Run npm i -D @theqrl/zond-wallet-provider in your project to install the zond-wallet-provider package.
  • Import the required functions to the files, and invoke it.
import { initializeProvider, WindowPostMessageStream } from "@theqrl/zond-wallet-provider";

const initializeInPageScript = () => {
  try {
    const zondStream = new WindowPostMessageStream({
      name: ZOND_POST_MESSAGE_STREAM.INPAGE,
      target: ZOND_POST_MESSAGE_STREAM.CONTENT_SCRIPT,
    });

    initializeProvider({
      connectionStream: zondStream,
      logger: log,
      providerInfo: {
        uuid: uuid(),
        name: ZOND_WALLET_PROVIDER_INFO.NAME,
        icon: ZOND_WALLET_PROVIDER_INFO.ICON,
        rdns: ZOND_WALLET_PROVIDER_INFO.RDNS,
      },
    });
  } catch (error) {
    console.warn("Zond Wallet: Failed to initialize the zond wallet provider", error);
  }
};

// This function accounces the zond wallet provider(based on EIP-6963), to be detected by the dApps.
initializeInPageScript();

Package Sidebar

Install

npm i @theqrl/zond-wallet-provider

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

818 kB

Total Files

355

Last publish

Collaborators

  • jplomas