Configuration
UseInkProvider takes props of type ConfigProps.
import { UseInkProvider } from 'useink';
import { RococoContractsTestnet } from 'useink/chains';
function App({ children }) {
const config = {
chains: [RococoContractsTestnet],
caller: {
// An optional default caller address to be used before a user connects their wallet.
default: "5EyR7vEk7DtvEWeefGcXXMV6hKwB8Ex5uvjHufm466mbjJkR",
}
}
return (
<UseInkProvider config={config}>
<MyRoutes />
</UseInkProvider>
);
}
export default AppConfigProps
Adding a Custom Chain Config
You can add your own chain config by modifying the Custom chain config. e.g.
Using the above config you can call hooks with or without the chainId as an argument.
e.g. useBlockHeaders() (defaults to 'custom') or useBlockHeaders('custom')
Last updated
Was this helpful?