NEAR and NEP141 Balance Widget

A React component to display NEAR native and NEP141 tokens balance. Formatted with their corresponding decimals.

This widget integrates with the original Wallet Selector.

Getting Started

Follow the Project Setup instructions to start the project in your local machine and try the recipes yourself. You can also clone or navigate the repo to get just what you need.

The WalletSelector Component

This React component may be inserted as a child of a NavBar component. You may need only the logic for your project, so follow along to learn how to initialize the NEAR wallet and integrate it with @near-wallet-selector/core

The NearWalletSelectorContextController

This component is designed to be a React context state and action manager. It should initialize the NEAR wallets modules on the first load. It will also set a selector state const so that you can load the wallets modal within UI components.

This context component works together with WalletStateContextController .


This context component is used through the useWalletStateContext hook. It provides the connected wallet address, balance, and actions to sign in and out:


You may also want to look at this component to understand how it fetches the balance of a given NEP141 token. Also displayed in the wallet widget:

Last updated