near-wallet-validator
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Licence npm version Downloads

near-wallet-validator

Checks if a near wallet exists.

Installation

npm i near-wallet-validator

Live Demo

https://codesandbox.io/s/near-wallet-validator-example-3r2lyo

Example

import "./styles.css";
import { NearRPC, nearWalletExists } from "near-wallet-validator";
import { useEffect, useState } from "react";

export default function App() {
  const [walletExists, setWalletExists] = useState(false);
  const checkWallet = async () => {
    const res = await nearWalletExists("1.testnet", NearRPC.TESTNET);
    setWalletExists(res);
  };

  useEffect(() => {
    checkWallet();
  }, []);

  return (
    <div className="App">
      <h1>near-wallet-validator</h1>
      <p>Does 1.testnet exists in testnet?</p>
      <span>{walletExists ? "Yes" : "No"}</span>
    </div>
  );
}

API

Property Type Description
wallet string Wallet name.
rpc NearRPC TESTNET or MAINNET.

Package Sidebar

Install

npm i near-wallet-validator

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

7.73 kB

Total Files

8

Last publish

Collaborators

  • sainthiago