web3-wallet-selector
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Utility Wallet Selector

Utility Wallet Selector makes it easy for users to interact with your dApp by providing an abstraction over various wallets within the Utility ecosystem:

Preview

React / Next.js and Angular variations of the Guest Book dApp can be found in the examples directory. You can use these to gain a concrete understanding of how to integrate Utility Wallet Selector into your own dApp.

Preview

Installation and Usage

The easiest way to use Utility Wallet Selector is to install the core package from the NPM registry, some packages may require web3-api-js v1.0.0 or above check them at packages

# Using Yarn
yarn add web3-api-js

# Using NPM.
npm install web3-api-js
# Using Yarn
yarn add @web3-wallet-selector/core

# Using NPM.
npm install @web3-wallet-selector/core

Next, you'll need to install the wallets you want to support:

# Using Yarn
yarn add \
  @web3-wallet-selector/mywallets \
  @web3-wallet-selector/wallet-connect

# Using NPM.
npm install \
  @web3-wallet-selector/mywallets \
  @web3-wallet-selector/wallet-connect

Optionally, you can install our modal-ui or modal-ui-js package for a pre-built interface that wraps the core API and presents the supported wallets:

# Using Yarn
yarn add @web3-wallet-selector/modal-ui

# Using NPM.
npm install @web3-wallet-selector/modal-ui

Then in your dApp:

import { setupWalletSelector } from "@web3-wallet-selector/core";
import { setupModal } from "@web3-wallet-selector/modal-ui";
import { setupMywallets } from "@web3-wallet-selector/mywallets";
import { setupWalletConnect } from "@web3-wallet-selector/wallet-connect";

const selector = await setupWalletSelector({
  network: "testnet",
  modules: [
    setupMywallets(),
    setupWalletConnect({
      projectId: "c4f79cc...",
      metadata: {
        name: "Utility Wallet Selector",
        description: "Example dApp used by Utility Wallet Selector",
        url: "https://github.com/utnet-org/wallet-selector",
        icons: ["https://avatars.githubusercontent.com/u/37784886"],
      },
    }),
    setupNearMobileWallet(),
    setupMintbaseWallet({
          networkId: "mainnet",
          walletUrl: "https://wallet.mintbase.xyz",
          callbackUrl: "https://www.mywebsite.com",
          deprecated: false,
      }),
  ],
});

const modal = setupModal(selector, {
  contractId: "guest-book.testnet"
});

Wallet Package Documentation

Each wallet package contains its own README document, please refer inside the packages folder for extra information.

Contributing

Contributors may find the examples directory useful as it provides a quick and consistent way to manually test new changes and/or bug fixes.

More details around contributing to this project can be found here.

Editor Setup

This project uses ESLint (with Prettier) to enforce a consistent coding style. It's important that you configure your editor correctly to avoid issues when you're ready to open a Pull Request.

Although this project uses Prettier, it's simply an "internal" dependency to our ESLint configuration. This is because we want Prettier to handle code styling while avoiding conflicts with ESLint which specifically focuses on potentially problematic code. As a result, it's important that you switch off Prettier in your editor and ensure only ESLint is enabled.

License

This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-MIT and LICENSE-APACHE for details.

Package Sidebar

Install

npm i web3-wallet-selector

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

531 MB

Total Files

1602

Last publish

Collaborators

  • alienegra