1.0.1 • Published 3 months ago
iso-filecoin-react v1.0.1
iso-filecoin-react
React hooks for Filecoin.
Installation
pnpm install iso-filecoin-react
Usage
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.
Docs
Check the docs website
Contributing
Read contributing guidelines here.