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

use-cardano

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-cardano

A react context, hook, and set of components that makes interacting with the Cardano blockchain easy

  • 2.0.0-beta.0
  • beta
  • next
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

use-cardano

use-cardano is a react context, hook, and set of components that makes interacting with the Cardano blockchain easy. It allows you to build web3 applications, connect wallets and performing tasks such as signing transactions, and interacting with smart contracts. Visit the official documentation for installation instructions, configuration options, and live examples.

The package leverages lucid for transaction building and off-chain code to interact with smart contracts. For more information on that, visit the lucid documentation.

This package uses blockfrost as the Cardano node provider by default. You can sign up here with a free or paid subscription: blockfrost

Minimal Example

import "use-cardano/styles/use-cardano.css"
import { useCardano, CardanoProvider, CardanoWalletSelector, CardanoToaster } from "use-cardano"

const UseCardanoNodeOptions = {
  provider: 'blockfrost',
  // this exposes your API key to the client, consider using blockfrost-proxy instead
  projectId: process.env.REACT_APP_BLOCKFROST_PROJECT_ID_MAINNET
}

const UseCardanoOptions = {
  testnetNetwork: 'Preview',
  node: UseCardanoNodeOptions
}

const Content = () => {
  const { account } = useCardano()

  return (
    <>
      <CardanoWalletSelector />

      <div>Connected Address: {account.address || 'No wallet connected.'}</div>
    </>
  )
}

const App = () => (
  <CardanoProvider options={UseCardanoOptions}>
    <Content />

    <CardanoToaster />
  </CardanoProvider>
)

Contributing / Development

See the contributing doc for instructions on how to contribute to the development of the library.

LICENSE

MIT, see LICENSE for more information.

Keywords

FAQs

Package last updated on 09 Feb 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