useSplit() function
Hook for getting an instance of a Split contract. This contract supports fund distribution to multiple parties.
Example
import { useSplit } from '@thirdweb-dev/react'
export default function Component() {
const split = useSplit("<YOUR-CONTRACT-ADDRESS>")
// Now you can use the split contract in the rest of the component
// For example, this function will retrun all the receipients of the split
async function getRecipients() {
const recipients = await split.getAllRecipients()
return recipients
}
...
}
Signature:
export declare function useSplit(contractAddress?: string): Split | undefined;
Parameters
| Parameter | Type | Description |
|---|---|---|
| contractAddress | string | (Optional) the address of the Split contract, found in your thirdweb dashboard |
Returns:
Split | undefined