useSplit
Deprecated
This hook is deprecated and will be removed in a future major version. You should use useContract instead.
- const split = useSplit("0x1234...");
+ const split = useContract("0x1234...", "split").contract;
Hook for getting an instance of a Split
contract. This contract supports fund distribution to multiple parties.
function useSplit(
contractAddress: RequiredParam<string>,
): undefined | Split;
Parameters
Returns
type ReturnType = undefined | Split;
Example
import { useContract } from '@thirdweb-dev/react'
export default function Component() {
const { contract } = useContract("<YOUR-CONTRACT-ADDRESS>", "split")
// Now you can use the split contract in the rest of the component
// For example, this function will return all the recipients of the split
async function getRecipients() {
const recipients = await contract.getAllRecipients()
return recipients
}
...
}