Socket
Socket
Sign inDemoInstall

@leapwallet/elements-hooks

Package Overview
Dependencies
12
Maintainers
0
Versions
136
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leapwallet/elements-hooks

React hooks package for Leap Elements SDK. This has hooks used in `@leapwallet/elements` package.


Version published
Maintainers
0
Created

Readme

Source

Leap Elements Hooks

React hooks package for Leap Elements SDK. This has hooks used in @leapwallet/elements package.

How to use

Install

npm install @leapwallet/elements-hooks

Import

import { usePollForTxn } from '@leapwallet/elements-hooks'

const TxnStatusToast = ({ txHash, chainId }) => {
  // get the rest url for the chain
  const restUrl = useChainRestUrl(chainId)

  const { tx, isPolling, error } = usePollForTxn(
    // transaction hash
    txHash,
    // rest url to fetch the transaction status
    restUrl,
    // poll interval in milliseconds
    5 * 1000,
    // polling timeout in milliseconds
    2 * 60 * 100
  )

  // rest of the component
}

Keywords

FAQs

Last updated on 11 Jul 2024

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc