Contract interaction for creating a Claim (Triple).
createTriple
Creates an onchain Claim. In the context of onchain interactions, a Claim is known as a Triple. You should consider pairing this with Creating a Claim for offchain Claim creation. The Intuition Portal user journey for creating a Claim combines both the offchain and onchain interactions.
If you haven't already worked through the scaffolding in the Getting Started section you'll want to do that before continuing.
If you're looking to generalize this pattern for use with other contracts, you'll want to switch out the ABI and be sure that the functionName matches a function in your contract. In this hook, the functionName: 'createTriple' matches the createTriple function in our contract.
This hook leverages the scaffolding outlined in the Getting Started section. If you're unsure of where any of these values come from consider revisiting that page.
Once this hook pattern is established you can use it in your contract interactions. The following example is a snippet from how we structure our createTriple call for the onchain creation step in the Create Claim Flow in our Portal.
Let's look at a full example that also leverages our transaction reducer for handling the transaction lifecycle state:
This comprehensive example is an example of our full onchain Claim creation. You can remove pieces from this to simplify the interaction as shown in our Remix Starter Template.