Starknet React
Starknet React is a collection of React hooks for Starknet. It is inspired by
wagmi, powered by starknet.js.
Documentation
Documentation, including a small demo, is available online.
Getting Started
- Add
@starknet-react/coreto your dependencies.
pnpm add @starknet-react/coreYou also need to add get-starknet-core and starknet to your dependencies.
pnpm add get-starknet-core starknet- Wrap your app with
StarknetConfig
import { StarknetConfig } from '@starknet-react/core'
function App() {
return (
<StarknetConfig>
<YourApp />
</StarknetConfig>
)
}- Access the hooks from your components.
import { useAccount } from '@starknet-react/core'
function YourComponent() {
const { address } = useAccount()
return <div>gm {address}</div>
}License
This library is licensed under the MIT license.