With Tooblox API users can automate smart-contract generation. In summary this is the general workflow:
- Use API to create new smart-contract workflows or to update existing workflows (SLA 99.9%)
- The API will
- Use AI to create a workflow
- Construct the workflow, store it and provide a URL in return
- If id is given, update an existing workflow
- The URL can be used to open the workflow and deploy it onto a selected blockchain
- The URL can be shared with customers to initiate a transfer of ownership. The idea is that while a solution provider can help businesses build blockchain solutions it is up to to the customers to deploy the smart-contracts in the end to ensure proper custody.
- Credits to use the AI generator (credits are included in each plan)
There are two ways to use the API.
- Using Toolblox plugin for ChatGPT
- Using API endpoint: https://toolbloxfunctions-api.azure-api.net/api/Generate
Toolblox plugin for ChatGPT
Using Toolblox plugin for ChatGPT is the easiest way to create smart contracts. Just converse with ChatGPT, describe what process you wish to digitize as a smart contract and the plugin takes care of calling Toolblox.
A well formulated input to ChatGPT describes the asset, its properties that need to be stored on blockchain and the lifecycle especially the parties or roles that handle the asset at each stage of its lifecycle.
Specifying the API key
Optional: To get access to more AI credits provided by Toolblox subscription you need to specify the API key to the chatbot.
The example shows a minimal input, and how to specify the API key while using Toolblox plugin for ChatGPT:
|apiKey||Yes||Generated in Toolblox profile page|
|text||Yes||Contains freetext description of the desired workflow. It should describe the object type stored in the smart contract, its properties, and user roles who can perform actions throughout its lifecycle. Recommended at least 3 sentences for a good outcome but more is better. |
Any language can be used although English gets the best results. Workflow will be created in English.
POST requests can omit the text parameter and replace it with request content instead. For GET requests text parameter is mandatory.
|id||No||Contains the workflow id - if given will perform an update of existing smart contract workflow instead of creating a new workflow.|
Example to create workflow
Creation of an apartment rental service using blockchain, built with API builder.
|apiKey||active API key|
|text||create a workflow for managing appartment rent. add also way to pay rent each month|
This is the smart contract workflow that got generated and opens using the received link.
Example to update workflow
|apiKey||active API key|
|text||Add a way to make apartments unavailable for rent|
|id||id returned from first request|
When refreshing the UI for the smart contract we see that an 'Unavailable' state has been added: