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 undersrc/<module>/LICENSE.
- Run
npm i -D @theqrl/qrl-wallet-providerin 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();MIT — see LICENSE. The MetaMask-derived sub-modules retain their original licenses under src/<module>/LICENSE.
See SECURITY.md. Report vulnerabilities to security@theqrl.org.
