Module iso-filecoin-react - v1.0.0

iso-filecoin-react

NPM Version License: MIT License Adapter

React hooks for Filecoin.

pnpm install iso-filecoin-react
import { WalletProvider } from 'iso-filecoin-react'

const wallets = []

function Main() {
return (
<WalletProvider wallets={wallets}>
<App />
</WalletProvider>
)
}
import { useFilsnap } from 'filsnap-adapter-react'

function App() {
const { isLoading, hasSnaps, isConnected, connect, account, error } =
useFilsnap()

if (isLoading) {
return <div>Loading...</div>
}

if (!isConnected) {
return <button onClick={() => connect()}>Connect to Filecoin Snap</button>
}

return <div>Connected to {account.address}</div>
}

Check out the demo for a working example and the API for more details.

Check https://hugomrdias.github.io/filecoin

Read contributing guidelines here.

Open in GitHub Codespaces

MIT © Hugo Dias

Modules

<internal>

Interfaces

Chain

Variables

mainnet
testnet

Functions

useAddresses
useBalance
useWallet
WalletProvider