Subbi Provider

The SubbiProvider wraps your app at the root level and uses the React Context APIarrow-up-right to provide information to the hooks that Subbi components use. It has the following optional props:

network (optional):Defaults to 'polygon', currently the only options are 'polygon' or 'mumbai'

signer (optional): If you don't want Subbi to handle it's own connection to sign requests, then you can pass a signer in directly if you prefer.

Usage

An example of using both optional props might look like:

import { ethers } from "ethers";

const provider = window.ethereum; // Injected into the browser by Metamask or similar
const signer = new ethers.providers.Web3Provider(provider).getSigner();

<SubbiProvider
    network="poylgon"
    signer={signer}
>
    {children}
</SubbiProvider>

Last updated