periphery-artifacts-viem-types
v1.0.8
Published
Flare Network periphery artifacts viem types
Downloads
10
Maintainers
Readme
Flare Periphery Wagmi Viem Types
This package provides TypeScript types and React hooks for Flare Network periphery contracts, generated using Wagmi CLI.
Installation
npm install periphery-artifacts-viem-typesUsage
Import types for specific networks
// Import types for Coston network
import { useContractRead } from 'periphery-artifacts-viem-types/coston'
// Import types for Coston2 network
import { useContractRead } from 'periphery-artifacts-viem-types/coston2'
// Import types for Songbird network
import { useContractRead } from 'periphery-artifacts-viem-types/songbird'
// Import types for Flare network
import { useContractRead } from 'periphery-artifacts-viem-types/flare'Using the generated hooks
import { useContractRead } from 'periphery-artifacts-viem-types/flare'
function MyComponent() {
const { data } = useContractRead({
address: '0x...',
abi: SomeContractAbi,
functionName: 'someFunction',
})
return <div>{data}</div>
}Networks
This package provides types for the following Flare networks:
- coston - Flare Coston testnet
- coston2 - Flare Coston2 testnet
- songbird - Flare Songbird canary network
- flare - Flare mainnet
Generated Files
Each network directory contains:
generated.ts- Generated TypeScript types and React hookswagmi.config.ts- Wagmi configuration for that network
Development
Types are automatically generated during the build process using the Wagmi CLI.
To regenerate types for a specific network:
npm run wagmi:generate -- --config {network}/wagmi.config.ts