New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fedimint/react

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fedimint/react

<!-- Removes the border below the header tag --> <summary> @fedimint/react

  • 0.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-86.67%
Maintainers
0
Weekly downloads
 
Created
Source

Fedimint Logo

    @fedimint/react

    Helpful React hooks for building with the Fedimint Web SDK.

@fedimint/react

Install

pnpm install @fedimint/core-web @fedimint/react

Usage

import { FedimintWalletProvider, setupFedimintWallet } from '@fedimint/react'

setupFedimintWallet({
  lazy: false,
  debug: true,
})

// Wrap your app in the FedimintWalletProvider
<FedimintWalletProvider>
  <App />
</FedimintWalletProvider>


// App.tsx


// Balance

import { useBalance } from '@fedimint/react'

const balance = useBalance()

// Wallet

import { useOpenWallet } from '@fedimint/react'

const {
  walletStatus, // 'open' | 'closed' | 'connecting' | 'failed'
  openWallet, // () => Promise<boolean> - Returns true if wallet was opened successfully.
  joinFederation, // () => Promise<boolean> - Returns true if joined federation successfully.
} = useOpenWallet()

// Receive Lightning

import { useReceiveLightning } from '@fedimint/react'

const {
  generateInvoice, // (amount: number) => Promise<void>
  bolt11, // string
  invoiceStatus, // 'pending' | 'confirmed' | 'failed'
  error, // Error | undefined
} = useReceiveLightning()

// Send Lightning

import { useSendLightning } from '@fedimint/react'

const {
  payInvoice, // (bolt11: string) => Promise<void>
  paymentStatus, // 'pending' | 'confirmed' | 'failed'
  paymentError, // Error | undefined
} = useSendLightning()

FAQs

Package last updated on 10 Nov 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc