yours-wallet-provider
TypeScript icon, indicating that this package has built-in type declarations

3.2.2 • Public • Published

Yours Wallet Provider 🌱

A React provider to make interactions with Yours Wallet a breeze.

Description

The Yours Wallet Provider simplifies the process of integrating Yours Wallet into your react application by creating a provider that wraps your application.

For detailed instructions on integration and all available methods, be sure to check out the Provider API Docs.

Installation

Install the package using npm:

npm install yours-wallet-provider

Usage

Setup the Provider

First, wrap your application with the YoursProvider.

//... other imports
import { YoursProvider } from "yours-wallet-provider";

const root = ReactDOM.createRoot(
  document.getElementById("root") as HTMLElement
);
root.render(
  <YoursProvider>
    <App />
  </YoursProvider>
);

Use the Wallet Hook

You can now use the useYoursWallet hook to interact with the wallet.

import { useYoursWallet } from 'yours-wallet-provider';

function YourComponent() {
  const wallet = useYoursWallet();
  const isReady = wallet.isReady;
  console.log(isReady);
  // true

  return (
    // Your TSX
  );
}

Use the Yours.org Icon

You can also import the YoursIcon for use in your project.

import { YoursIcon } from "yours-wallet-provider";

function YourComponent() {
  return (
    <div>
      <YoursIcon size="32px" />
    </div>
  );
}

Package Sidebar

Install

npm i yours-wallet-provider

Weekly Downloads

30

Version

3.2.2

License

MIT

Unpacked Size

28.3 kB

Total Files

18

Last publish

Collaborators

  • danwag06