Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mojito-inc/connect-wallet

Package Overview
Dependencies
Maintainers
3
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mojito-inc/connect-wallet

Connecting wallet via metamask, wallet connect, email

  • 1.0.1-beta.15
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
181
decreased by-33.21%
Maintainers
3
Weekly downloads
 
Created
Source

☁️ Mojito Modules - Connect Wallet



👨‍💻 React components for the Mojito Platform, Reference App and third-party projects, including Connect Wallet.

Version: 1.0.1


Using this library in your project

You can install this project with one of these commands:

npm install @mojito-inc/connect-wallet

yarn add @mojito-inc/connect-wallet


  import { ConnectWalletProvider } from '@mojitoinc/mojito-connect-wallet';

  const WalletProvider = ({ children }: WalletProviderProps) => {

    const [token, setToken] = useState<string>();

    const client = useMemo(
      () => ({
        uri: Configuration.API_HOSTNAME,
        token: token ? `Bearer ${ token }` : undefined,
      }),
      [token],
    );

    return (
      <ConnectWalletProvider
        theme={ theme }
        onAuthenticated={ setToken }
        clientOptions={ client }>
        { children }
      </ConnectWalletProvider>
    );
  };

  export default WalletProvider;

After setup ConnectWallet Provider

Following step:

  1. Connect Wallet Container

ConnectWalletContainer

  import { ConnectWalletContainer } from '@mojitoinc/mojito-connect-wallet';

  const ConnectWalletPage = () => {

    const config = {
      ORG_ID: Configuration.ORG_ID ?? '',
      paperClientId: Configuration.PAPER_CLIENT_ID ?? '',
      paperNetworkName: Configuration.PAPER_NETWORK_NAME ?? '',
      projectId: Configuration.PROJECT_ID ?? '',
    }

    const walletOptions = {
      enableMetamask: true,
      enableWalletConnect: true,
      enableEmail: true,
    }

    const image = {
      logo: 'https://res.cloudinary.com/duwztsuxj/image/upload/v1683870261/Frame_238173_cpwne5.png',
      metamask: Images.METAMASK.src,
      walletConnect: Images.WALLET_CONNECT.src,
      error: 'https://res.cloudinary.com/duwztsuxj/image/upload/v1683870261/Frame_238173_cpwne5.png',
    }

    return (
        <ConnectWalletContainer
          open={ openModal }
          config={ config }
          walletOptions={ walletOptions }
          image={ image }
          isDisConnect={ disconnect }
          walletAddress={ walletDetails.walletAddress }
          onChangeWalletAddress={ onChangeWalletAddress }
          onCloseModal={ onClickCloseModal } />
    );
  };

  export default ConnectWalletPage;

ParamtypeRequiredDescription
openboolean
walletAddressstring
isDisConnectboolean
configObjectconfig
walletOptionsObjectwalletOptions
imageObjectimage
contentObjectContentData
isRefetchBalanceboolean
onCloseModalfunctionTo close the Modal

interface

config
ParamtypeRequiredDescription
ORG_IDstring
paperClientIdstring
projectIdstring
paperNetworkNameany
walletOptions
ParamtypeRequiredDescription
enableMetamaskboolean
enableWalletConnectboolean
enableEmailboolean
image
ParamtypeRequiredDescription
logostring
metamaskstring
walletConnectstring
errorstring
ContentData
ParamtypeRequiredDescription
titlestring
descriptionstring

Keywords

FAQs

Package last updated on 24 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc