Skip to content

theQRL/qrl-wallet-provider

Repository files navigation

QRL Wallet Provider Preview Cover

QRL Wallet Provider

The Ethereum-style provider object announced by the QRL Web3 Wallet, based on EIP-6963. This facilitates the connection and communication between the QRL wallet extension and dApps.

Important! QRL Wallet Provider is derived from MetaMask repositories (json-rpc-engine, json-rpc-middleware-stream, object-multiplex, post-message-stream, providers, rpc-errors, safe-event-emitter, superstruct, utils). Each sub-module's original license is preserved alongside the code under src/<module>/LICENSE.

⌨️ Usage

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

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

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

// This function announces the QRL wallet provider (EIP-6963) so dApps can detect it.
initializeInPageScript();

License

MIT — see LICENSE. The MetaMask-derived sub-modules retain their original licenses under src/<module>/LICENSE.

Security

See SECURITY.md. Report vulnerabilities to security@theqrl.org.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors